From 2b761537334f56608db4a1ebc1d8abb0553cdbb2 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Thu, 28 Jan 2016 15:03:51 -0500 Subject: Various fixes and improvements Changes Include: - New Interactive mode. Allows you to pause deployments in order to make changes before continuing (or exit and deploy manually). Useful when needing to modify NIC order for baremetal deployments. - deploy_settings -d is now required. - ha_enabled no longer defaults to true. It can be specified in deploy_settings or overridden with via command line. - compute nodes now scale correctly with what is defined by inventory JIRA: APEX-70 APEX-71 APEX-72 Change-Id: Id45808f4d0435d66f12c020bd4455faaa43da191 Signed-off-by: Tim Rozet --- ci/deploy.sh | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) (limited to 'ci') diff --git a/ci/deploy.sh b/ci/deploy.sh index d0b8338b..a2c9c434 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -30,7 +30,8 @@ else fi vm_index=4 -ha_enabled="TRUE" +#ha_enabled="TRUE" +interactive="FALSE" ping_site="8.8.8.8" ntp_server="pool.ntp.org" net_isolation_enabled="TRUE" @@ -811,10 +812,24 @@ function undercloud_prep_overcloud_deploy { # make sure ceph is installed DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" + # scale compute nodes according to inventory + total_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "cat /home/stack/instackenv.json | grep -c memory") + # check if HA is enabled if [[ "$ha_enabled" == "TRUE" ]]; then - DEPLOY_OPTIONS+=" --control-scale 3 --compute-scale 2" + DEPLOY_OPTIONS+=" --control-scale 3" + compute_nodes=$((total_nodes - 3)) DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml" + else + compute_nodes=$((total_nodes - 1)) + fi + + if [ "$compute_nodes" -le 0 ]; then + echo -e "${red}ERROR: Invalid number of compute nodes: ${compute_nodes}. Check your inventory file.${reset}" + exit 1 + else + echo -e "${blue}INFO: Number of compute nodes set for deployment: ${compute_nodes}${reset}" + DEPLOY_OPTIONS+=" --compute-scale ${compute_nodes}" fi if [[ "$net_isolation_enabled" == "TRUE" ]]; then @@ -865,6 +880,18 @@ sleep 60 #wait for Hypervisor stats to check-in to nova cat > deploy_command << EOF openstack overcloud deploy --templates $DEPLOY_OPTIONS --timeout 90 EOF +EOI + + if [ "$interactive" == "TRUE" ]; then + if ! prompt_user "Overcloud Deployment"; then + echo -e "${blue}INFO: User requests exit${reset}" + exit 0 + fi + fi + + ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <