Get rid of sourcing stackrc in grenade settings

Instead, use the common_settings file to source all the variables
we need at the early stages of devstack setup and during the upgrade
itself. This also fixes an issue with the networking-generic-switch
upgrade script, which is run from the old release instead of the new
one.

It depends on a patch from an older release, as grenade is setup
using settings from an older release, we need common_setting to be
populated there.

Change-Id: I34fb68c150b753824bd2687a1f522ac87771a5e3
Depends-On: If63779ced5e99461782c65188f4776045df85125
This commit is contained in:
Vladyslav Drok 2017-06-30 18:28:15 +03:00 committed by Julia Kreger
parent 879febe702
commit fbf2cab100
4 changed files with 70 additions and 71 deletions

63
devstack/common_settings Normal file
View File

@ -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

View File

@ -204,14 +204,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 / -)
@ -445,13 +437,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
@ -594,13 +579,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
@ -610,43 +588,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

View File

@ -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

View File

@ -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