Merge "ovn migration: Support stack name"

This commit is contained in:
Zuul 2020-07-24 09:44:21 +00:00 committed by Gerrit Code Review
commit 1075e79be5
2 changed files with 18 additions and 1 deletions

View File

@ -107,6 +107,11 @@ Perform the following steps in the undercloud
step 1.
Default: ~/overcloud-deploy-ovn.sh
* STACK_NAME - Name or ID of the heat stack
Default: 'overcloud'
If the stack that is migrated differs from the default, please set this
environment variable to the stack name or ID.
* PUBLIC_NETWORK_NAME - Name of your public network.
Default: 'public'.
To support migration validation, this network must have available

View File

@ -30,6 +30,7 @@ LANG=C
: ${OVERCLOUD_OVN_DEPLOY_SCRIPT:=~/overcloud-deploy-ovn.sh}
: ${OPT_WORKDIR:=$PWD}
: ${STACK_NAME:=overcloud}
: ${PUBLIC_NETWORK_NAME:=public}
: ${IMAGE_NAME:=cirros}
: ${SERVER_USER_NAME:=cirros}
@ -127,7 +128,7 @@ generate_ansible_inventory_file() {
echo "[ovn-dbs]" > hosts_for_migration
ovn_central=True
inventory_file=$(mktemp --tmpdir ansible-inventory-XXXXXXXX.yaml)
/usr/bin/tripleo-ansible-inventory --static-yaml-inventory "$inventory_file"
/usr/bin/tripleo-ansible-inventory --stack $STACK_NAME --static-yaml-inventory "$inventory_file"
# We want to run ovn_dbs where neutron_api is running
OVN_DBS=$(get_group_hosts "$inventory_file" neutron_api)
for node_name in $OVN_DBS; do
@ -190,6 +191,16 @@ EOF
echo "Please review the file before running the next command - setup-mtu-t1"
}
# Check if the stack exists
function check_stack {
source $STACKRC_FILE
openstack stack show $STACK_NAME 1> /dev/null || {
echo "ERROR: STACK_NAME=${STACK_NAME} does not exist. Please provide the stack name or its ID "
echo " via STACK_NAME environment variable."
exit 1
}
}
# Check if the public network exists, and if it has floating ips available
oc_check_public_network() {
@ -307,6 +318,7 @@ command=$1
ret_val=0
case $command in
generate-inventory)
check_stack
oc_check_public_network
generate_ansible_inventory_file
generate_ansible_config_file