diff --git a/projects/15_placement/settings b/projects/15_placement/settings new file mode 100644 index 00000000..5ba0821e --- /dev/null +++ b/projects/15_placement/settings @@ -0,0 +1,4 @@ +if is_service_enabled placement-api; then + register_project_for_upgrade placement + register_db_to_save placement +fi diff --git a/projects/15_placement/upgrade.sh b/projects/15_placement/upgrade.sh new file mode 100755 index 00000000..f87926c2 --- /dev/null +++ b/projects/15_placement/upgrade.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +# ``upgrade-placement`` + +echo "*********************************************************************" +echo "Begin $0" +echo "*********************************************************************" + +# Clean up any resources that may be in use +cleanup() { + set +o errexit + + echo "*********************************************************************" + echo "ERROR: Abort $0" + echo "*********************************************************************" + + # Kill ourselves to signal any calling process + trap 2; kill -2 $$ +} + +trap cleanup SIGHUP SIGINT SIGTERM + +# Keep track of the grenade directory +RUN_DIR=$(cd $(dirname "$0") && pwd) + +# Source params +source $GRENADE_DIR/grenaderc + +# Import common functions +source $GRENADE_DIR/functions + +# This script exits on an error so that errors don't compound and you see +# only the first error that occurred. +set -o errexit + +source $TARGET_DEVSTACK_DIR/stackrc +source $TARGET_DEVSTACK_DIR/lib/apache +source $TARGET_DEVSTACK_DIR/lib/tls +source $TARGET_DEVSTACK_DIR/lib/placement + +# Print the commands being run so that we can see the command that triggers +# an error. It is also useful for following along as the install occurs. +set -o xtrace + +# Temporary setting until venv change is in DevStack +if [[ -z $PLACEMENT_BIN_DIR ]]; then + PLACEMENT_BIN_DIR=$(dirname $(which placement-manage)) +fi + +# Save current config files for posterity +[[ -d $SAVE_DIR/etc.placement ]] || cp -pr $PLACEMENT_CONF_DIR $SAVE_DIR/etc.placement + +# install_placement() +stack_install_service placement + +# calls upgrade-placement for specific release +upgrade_project placement $RUN_DIR $BASE_DEVSTACK_BRANCH + +# Simulate init_placement() +# Migrate the database +$PLACEMENT_BIN_DIR/placement-manage db sync || die $LINENO "DB sync error" + +# Start Placement: +start_placement + +# ensure the service has started +ensure_services_started placement + +set +o xtrace +echo "*********************************************************************" +echo "SUCCESS: End $0" +echo "*********************************************************************" diff --git a/projects/60_nova/upgrade.sh b/projects/60_nova/upgrade.sh index ffb3de7a..80299cc6 100755 --- a/projects/60_nova/upgrade.sh +++ b/projects/60_nova/upgrade.sh @@ -48,7 +48,6 @@ source $TARGET_DEVSTACK_DIR/lib/apache source $TARGET_DEVSTACK_DIR/lib/nova source $TARGET_DEVSTACK_DIR/lib/database source $TARGET_DEVSTACK_DIR/lib/rpc_backend -source $TARGET_DEVSTACK_DIR/lib/placement # Print the commands being run so that we can see the command that triggers # an error. It is also useful for following allowing as the install occurs. @@ -60,9 +59,8 @@ set -o xtrace # calls pre-upgrade hooks for within-$base before we upgrade upgrade_project nova $RUN_DIR $BASE_DEVSTACK_BRANCH $BASE_DEVSTACK_BRANCH -# install_nova() and placement +# install_nova() stack_install_service nova -stack_install_service placement # calls upgrade-nova for specific release upgrade_project nova $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH @@ -85,10 +83,9 @@ fi $NOVA_BIN_DIR/nova-manage cell_v2 map_cell0 --database_connection $(database_connection_url nova_cell0) $NOVA_BIN_DIR/nova-manage cell_v2 simple_cell_setup --transport-url $(get_transport_url) -# Start the Placement service - this needs to be running before the nova-status +# Ensure the Placement service - this needs to be running before the nova-status # upgrade check command is run since that validates that we can connect to # the placement endpoint. -start_placement ensure_services_started placement-api # Run the nova-status upgrade check, which was only available starting in Ocata