Wire in load-images

Updates devtest_overcloud.sh so that it makes use of load-images
to load images in a more flexible format via the load-images utility.
Images created with devtest_overcloud_images.sh will be loaded via
the static overcloud_disk_images.yaml file. If a custom YAML
script is provided to build images that will also be used to
load images as well.

This patch also removes the hard coded OVERCLOUD_CONTROL_ID,
OVERCLOUD_COMPUTE_ID, and OVERCLOUD_BLOCKSTORAGE_ID variables
from devtest that were used to map Glance image IDs into
heat parameters. This has been replaces by a more
flexible heat environment file which is generated
via the load-images tool.

Change-Id: I78c4c532169721674b2ea58ef37d2a4b23693fae
This commit is contained in:
Dan Prince 2015-04-20 14:18:02 -04:00
parent cb09424c57
commit 6eca9fe19a
2 changed files with 28 additions and 26 deletions

View File

@ -109,6 +109,8 @@ if [ -n "$DISK_IMAGES_CONFIG" ]; then
USE_CACHE=$USE_CACHE build-images -d -c $DISK_IMAGES_CONFIG
else
USE_CACHE=$USE_CACHE devtest_overcloud_images.sh
# use a default disk images YAML file to load images
DISK_IMAGES_CONFIG="$TRIPLEO_ROOT/tripleo-incubator/scripts/overcloud_disk_images.yaml"
fi
if [ -n "$BUILD_ONLY" ]; then
echo "--build-only is deprecated. Please use devtest_overcloud_images.sh instead."
@ -154,26 +156,15 @@ NODE_ARCH=$(os-apply-config -m $TE_DATAFILE --key arch --type raw)
### --include
## #. Load the controller image into Glance (if present).
## #. Load all images into Glance (based on the provided disk images config).
## This captures all the Glance IDs into a Heat env file which maps
## them to the appropriate parameter names. This allows us some
## amount of flexability how many images to use for the overcloud
## deployment.
## ::
if [ -f "$TRIPLEO_ROOT/overcloud-control.qcow2" ]; then #nodocs
OVERCLOUD_CONTROL_ID=$(load-image -d $TRIPLEO_ROOT/overcloud-control.qcow2)
fi #nodocs
## #. Load the block storage image into Glance (if present).
## ::
if [ -f "$TRIPLEO_ROOT/overcloud-cinder-volume.qcow2" ]; then #nodocs
OVERCLOUD_BLOCKSTORAGE_ID=$(load-image -d $TRIPLEO_ROOT/overcloud-cinder-volume.qcow2)
fi #nodocs
## #. Load the compute image into Glance. (if present)
## ::
if [ -f "$TRIPLEO_ROOT/overcloud-compute.qcow2" ]; then #nodocs
OVERCLOUD_COMPUTE_ID=$(load-image -d $TRIPLEO_ROOT/overcloud-compute.qcow2)
fi #nodocs
OVERCLOUD_IMAGE_IDS_ENV=${OVERCLOUD_IMAGE_IDS_ENV:-"${TRIPLEO_ROOT}/overcloud-images-env.yaml"}
load-images -d --remove -c $DISK_IMAGES_CONFIG -o $OVERCLOUD_IMAGE_IDS_ENV
## #. For running an overcloud in VM's. For Physical machines, set to kvm:
## ::
@ -322,7 +313,6 @@ ENV_JSON=$(jq '.parameters = {
"CeilometerMeteringSecret": "'"${OVERCLOUD_CEILOMETER_SECRET}"'",
"CinderPassword": "'"${OVERCLOUD_CINDER_PASSWORD}"'",
"CloudName": "'"${OVERCLOUD_NAME}"'",
"controllerImage": "'"${OVERCLOUD_CONTROL_ID}"'",
"GlancePassword": "'"${OVERCLOUD_GLANCE_PASSWORD}"'",
"HeatPassword": "'"${OVERCLOUD_HEAT_PASSWORD}"'",
"HeatStackDomainAdminPassword": "'"${OVERCLOUD_HEAT_STACK_DOMAIN_PASSWORD}"'",
@ -339,7 +329,6 @@ ENV_JSON=$(jq '.parameters = {
"NtpServer": "'"${OVERCLOUD_NTP_SERVER}"'",
"SwiftHashSuffix": "'"${OVERCLOUD_SWIFT_HASH}"'",
"SwiftPassword": "'"${OVERCLOUD_SWIFT_PASSWORD}"'",
"NovaImage": "'"${OVERCLOUD_COMPUTE_ID}"'",
"SSLCertificate": "'"${OVERCLOUD_SSL_CERT}"'",
"SSLKey": "'"${OVERCLOUD_SSL_KEY}"'",
"OvercloudComputeFlavor": "'"${COMPUTE_FLAVOR}"'",
@ -356,12 +345,6 @@ if [ "$DEBUG_LOGGING" = "1" ]; then
fi
### --include
if [ $OVERCLOUD_BLOCKSTORAGESCALE -gt 0 ]; then
ENV_JSON=$(jq '.parameters = {} + .parameters + {
"BlockStorageImage": "'"${OVERCLOUD_BLOCKSTORAGE_ID}"'",
}' <<< $ENV_JSON)
fi
## #. We enable the automatic relocation of L3 routers in Neutron by default,
## alternatively you can use the L3 agents high availability mechanism
@ -460,6 +443,7 @@ fi
# create stack with a 6 hour timeout, and allow wait_for_stack_ready
# to impose a realistic timeout.
heat $HEAT_OP -e "$HEAT_ENV" \
-e $OVERCLOUD_IMAGE_IDS_ENV \
$RESOURCE_REGISTRY \
$CUSTOM_HEAT_ENVIRONMENT \
-t 360 \

View File

@ -0,0 +1,18 @@
# A default disk images YAML file that will load images
# created with devtest_overcloud_images.sh. The
# heat_parameters sections are used to output a heat
# environment file that maps heat parameter
# names to the Glance image IDs from each upload.
disk_images:
-
imagename: overcloud-control
heat_parameters:
- controllerImage
-
imagename: overcloud-compute
heat_parameters:
- NovaImage
-
imagename: overcloud-cinder-volume
heat_parameters:
- BlockStorageImage