diff --git a/devstack/common_settings b/devstack/common_settings new file mode 100644 index 0000000000..bb3d6fe312 --- /dev/null +++ b/devstack/common_settings @@ -0,0 +1,63 @@ +if [[ -f $TOP_DIR/../../old/devstack/.localrc.auto ]]; then + source <(cat $TOP_DIR/../../old/devstack/.localrc.auto | grep -v 'enable_plugin') +fi + +CIRROS_VERSION=0.3.5 + +# Whether configure the nodes to boot in Legacy BIOS or UEFI mode. Accepted +# values are: "bios" or "uefi", defaults to "bios". +# +# WARNING: UEFI is EXPERIMENTAL. The CirrOS images uploaded by DevStack by +# default WILL NOT WORK with UEFI. +IRONIC_BOOT_MODE=${IRONIC_BOOT_MODE:-bios} + +IRONIC_DEFAULT_IMAGE_NAME=cirros-${CIRROS_VERSION}-x86_64-uec +if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then + IRONIC_DEFAULT_IMAGE_NAME=cirros-d160722-x86_64-uec +fi + +IRONIC_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-$IRONIC_DEFAULT_IMAGE_NAME} + +# Add link to download queue, ignore if already exist. +# TODO(vsaienko) Move to devstack https://review.openstack.org/420656 +function add_image_link { + local i_link="$1" + if ! [[ "$IMAGE_URLS" =~ "$i_link" ]]; then + if [[ -z "$IMAGE_URLS" || "${IMAGE_URLS: -1}" == "," ]]; then + IMAGE_URLS+="$i_link" + else + IMAGE_URLS+=",$i_link" + fi + fi +} + +if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then + add_image_link http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-uec.tar.gz + add_image_link http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-disk.img +else + # NOTE (vsaienko) We are going to test mixed drivers/partitions in single setup. + # Do not restrict downloading image only for specific case. Download both disk and uec images. + add_image_link http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-uec.tar.gz + add_image_link http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-disk.img +fi + +export IRONIC_WHOLEDISK_IMAGE_NAME=${IRONIC_WHOLEDISK_IMAGE_NAME:-${IRONIC_IMAGE_NAME/-uec/-disk}} +export IRONIC_PARTITIONED_IMAGE_NAME=${IRONIC_PARTITIONED_IMAGE_NAME:-${IRONIC_IMAGE_NAME/-disk/-uec}} + +# These parameters describe which image will be used to provision a node in +# tempest tests +if [[ -z "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" && "$IRONIC_VM_EPHEMERAL_DISK" == 0 ]]; then + IRONIC_TEMPEST_WHOLE_DISK_IMAGE=True +fi + +IRONIC_TEMPEST_WHOLE_DISK_IMAGE=$(trueorfalse False IRONIC_TEMPEST_WHOLE_DISK_IMAGE) + +if [[ "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" == "True" ]]; then + export IRONIC_IMAGE_NAME=$IRONIC_WHOLEDISK_IMAGE_NAME +else + export IRONIC_IMAGE_NAME=$IRONIC_PARTITIONED_IMAGE_NAME +fi + +# NOTE(vsaienko) set DEFAULT_IMAGE_NAME here, as it is still used by grenade +# https://github.com/openstack-dev/grenade/blob/90c4ead2f2a7ed48c873c51cef415b83d655752e/projects/60_nova/resources.sh#L31 +export DEFAULT_IMAGE_NAME=$IRONIC_IMAGE_NAME diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 16c0527f2f..28c374c346 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -200,14 +200,6 @@ IRONIC_DEPLOY_RAMDISK=${IRONIC_DEPLOY_RAMDISK:-$TOP_DIR/files/ir-deploy-$IRONIC_ IRONIC_DEPLOY_KERNEL=${IRONIC_DEPLOY_KERNEL:-$TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER.kernel} IRONIC_DEPLOY_ISO=${IRONIC_DEPLOY_ISO:-$TOP_DIR/files/ir-deploy-$IRONIC_DEPLOY_DRIVER.iso} -# These parameters describe which image will be used to provision a node in -# tempest tests -if [[ -z "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" && "$IRONIC_VM_EPHEMERAL_DISK" == 0 ]]; then - IRONIC_TEMPEST_WHOLE_DISK_IMAGE=True -fi - -IRONIC_TEMPEST_WHOLE_DISK_IMAGE=$(trueorfalse False IRONIC_TEMPEST_WHOLE_DISK_IMAGE) - # NOTE(jroll) this needs to be updated when stable branches are cut IPA_DOWNLOAD_BRANCH=${IPA_DOWNLOAD_BRANCH:-master} IPA_DOWNLOAD_BRANCH=$(echo $IPA_DOWNLOAD_BRANCH | tr / -) @@ -441,13 +433,6 @@ IRONIC_PXE_BOOT_IMAGE=${IRONIC_PXE_BOOT_IMAGE:-$(get_pxe_boot_file)} IRONIC_AUTOMATED_CLEAN_ENABLED=$(trueorfalse True IRONIC_AUTOMATED_CLEAN_ENABLED) -# Whether configure the nodes to boot in Legacy BIOS or UEFI mode. Accepted -# values are: "bios" or "uefi", defaults to "bios". -# -# WARNING: UEFI is EXPERIMENTAL. The CirrOS images uploaded by DevStack by -# default WILL NOT WORK with UEFI. You will need to download the UEFI capable -# images manually from [0] and upload it to Glance before deploying. -IRONIC_BOOT_MODE=${IRONIC_BOOT_MODE:-bios} IRONIC_UEFI_FILES_DIR=${IRONIC_UEFI_FILES_DIR:-/var/lib/libvirt/images} UEFI_LOADER_PATH=$IRONIC_UEFI_FILES_DIR/OVMF_CODE.fd UEFI_NVRAM_PATH=$IRONIC_UEFI_FILES_DIR/OVMF_VARS.fd @@ -581,13 +566,6 @@ function configure_enabled_interfaces { fi } -IRONIC_DEFAULT_IMAGE_NAME=cirros-${CIRROS_VERSION}-x86_64-uec -if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - IRONIC_DEFAULT_IMAGE_NAME=cirros-d160722-x86_64-uec -fi - -IRONIC_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-$IRONIC_DEFAULT_IMAGE_NAME} - # Assert that the redfish hardware type is enabled in case we are using # the redfish driver if is_deployed_by_redfish && [[ "$IRONIC_ENABLED_HARDWARE_TYPES" != *"redfish"* ]]; then @@ -597,43 +575,6 @@ if is_deployed_by_redfish && [[ "$IRONIC_ENABLED_HARDWARE_TYPES" != *"redfish"* "for DevStack" fi -# Add link to download queue, ignore if already exist. -# TODO(vsaienko) Move to devstack https://review.openstack.org/420656 -function add_image_link { - local i_link="$1" - if ! [[ "$IMAGE_URLS" =~ "$i_link" ]]; then - if [[ -z "$IMAGE_URLS" || "${IMAGE_URLS: -1}" == "," ]]; then - IMAGE_URLS+="$i_link" - else - IMAGE_URLS+=",$i_link" - fi - fi -} - -if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - add_image_link http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-uec.tar.gz - add_image_link http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-disk.img -else - # NOTE (vsaienko) We are going to test mixed drivers/partitions in single setup. - # Do not restrict downloading image only for specific case. Download both disk and uec images. - add_image_link http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-uec.tar.gz - add_image_link http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-disk.img -fi - - -IRONIC_WHOLEDISK_IMAGE_NAME=${IRONIC_WHOLEDISK_IMAGE_NAME:-${IRONIC_IMAGE_NAME/-uec/-disk}} -IRONIC_PARTITIONED_IMAGE_NAME=${IRONIC_PARTITIONED_IMAGE_NAME:-${IRONIC_IMAGE_NAME/-disk/-uec}} - -if [[ "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" == "True" ]]; then - IRONIC_IMAGE_NAME=$IRONIC_WHOLEDISK_IMAGE_NAME -else - IRONIC_IMAGE_NAME=$IRONIC_PARTITIONED_IMAGE_NAME -fi - -# NOTE(vsaienko) set DEFAULT_IMAGE_NAME here, as it is still used by grenade -# https://github.com/openstack-dev/grenade/blob/90c4ead2f2a7ed48c873c51cef415b83d655752e/projects/60_nova/resources.sh#L31 -export DEFAULT_IMAGE_NAME=$IRONIC_IMAGE_NAME - # Syslinux >= 5.00 pxelinux.0 binary is not "stand-alone" anymore, # it depends on some c32 modules to work correctly. # More info: http://www.syslinux.org/wiki/index.php/Library_modules diff --git a/devstack/settings b/devstack/settings index 4391b56e96..857535a477 100644 --- a/devstack/settings +++ b/devstack/settings @@ -1,5 +1,7 @@ enable_service ironic ir-api ir-cond +source $DEST/ironic/devstack/common_settings + # NOTE(vsaienko) mtu calculation has been changed recently to 1450 # https://github.com/openstack/neutron/commit/51a697 # and caused https://bugs.launchpad.net/ironic/+bug/1631875 diff --git a/devstack/upgrade/settings b/devstack/upgrade/settings index 7569c26f8f..f91da06a83 100644 --- a/devstack/upgrade/settings +++ b/devstack/upgrade/settings @@ -10,24 +10,17 @@ register_project_for_upgrade ironic register_db_to_save ironic -# Duplicate some setup bits from target DevStack. Use old devstack as we install base environment from it. -BASE_TOP_DIR=$TOP_DIR/../../old/devstack/ -source $BASE_TOP_DIR/stackrc -source $BASE_TOP_DIR/lib/tls -source $BASE_TOP_DIR/lib/nova -source $BASE_TOP_DIR/lib/neutron-legacy -source $BASE_TOP_DIR/lib/apache -source $BASE_TOP_DIR/lib/keystone +# Duplicate some settings from devstack. Use old devstack as we install base +# environment from it. In common_settings we also source the old localrc +# variables, so we need to do this before checking the HOST_TOPOLOGY value +IRONIC_BASE_DEVSTACK_DIR=$TOP_DIR/../../old/ironic/devstack +source $IRONIC_BASE_DEVSTACK_DIR/common_settings if [[ "${HOST_TOPOLOGY}" != "multinode" ]]; then # Disable automated cleaning on single node grenade to save a time and resources. export IRONIC_AUTOMATED_CLEAN_ENABLED=False fi -# Update global variables like DEFAULT_IMAGE_NAME that are set in ironic devstack plugin -IRONIC_BASE_DEVSTACK_DIR=$BASE_TOP_DIR/../ironic/devstack -source $IRONIC_BASE_DEVSTACK_DIR/lib/ironic - # NOTE(jlvillal): For multi-node grenade jobs we do not want to upgrade Nova if [[ "${HOST_TOPOLOGY}" == "multinode" ]]; then # Remove 'nova' from the list of projects to upgrade