[FFWD] Propose a fix for node_upgrade_pre.sh.j2
If overcloud already exist and migration needed before compute upgrade Which means workload_launch=false and compute_present=true compute_upgrade_pre.sh is not created. This fix allows the above parameter mix to create and run compute_upgrade_pre.sh Adding condition check in compute_upgrade_pre.sh 1) If no active computes on host, live migration will not occur 2) Adding --all param to see tenant vms on compute Change-Id: I3cd33592a625cb8d8dabd0ad09e5f95e1e3be556
This commit is contained in:
parent
f3278cb056
commit
b8d3218d1e
@ -4,9 +4,7 @@
|
||||
when: pcs_present
|
||||
|
||||
- name: create compute pre upgrade script for {{ item }}
|
||||
when:
|
||||
- compute_present|bool
|
||||
- workload_launch|bool
|
||||
when: (compute_present | bool) or (workload_launch | bool)
|
||||
vars:
|
||||
node_name: "{{ item | reject('none') | join(',') }}"
|
||||
template:
|
||||
|
@ -12,9 +12,7 @@
|
||||
tags: ffu_overcloud_system_upgrade
|
||||
|
||||
- name: run the pre upgrade script for the host {{ host }}
|
||||
when:
|
||||
- compute_present|bool
|
||||
- workload_launch|bool
|
||||
when: (compute_present | bool) or (workload_launch | bool)
|
||||
shell: |
|
||||
set -o pipefail
|
||||
./{{ host }}_upgrade_pre.sh 2>&1 {{ timestamper_cmd }} >> {{ host }}_upgrade_pre.log
|
||||
|
@ -2,13 +2,19 @@
|
||||
source {{ overcloud_rc }}
|
||||
## Get exact hostname
|
||||
HOST=$(openstack compute service list -f value -c Host | grep {{ node_name }} )
|
||||
nova host-evacuate-live ${HOST}
|
||||
INSTANCE_COUNT=$(openstack server list --all --host ${HOST} -f json | jq -r -c '[.[] | select(.Status | contains("ACTIVE"))] | length')
|
||||
|
||||
if [ $INSTANCE_COUNT != 0 ]; then
|
||||
nova host-evacuate-live ${HOST}
|
||||
else
|
||||
echo "No vms in active state on ${HOST}"
|
||||
fi
|
||||
|
||||
timeout_seconds=120
|
||||
elapsed_seconds=0
|
||||
while true; do
|
||||
while [ $INSTANCE_COUNT != 0 ]; do
|
||||
echo "Waiting for ${HOST} to get quiesced ..."
|
||||
INSTANCE_COUNT=$(openstack server list --host ${HOST} -f json | jq -r -c '[.[] | select(.Status | contains("ACTIVE") or contains("PAUSED") or contains("MIGRATING"))] | length')
|
||||
INSTANCE_COUNT=$(openstack server list --all --host ${HOST} -f json | jq -r -c '[.[] | select(.Status | contains("ACTIVE") or contains("PAUSED") or contains("MIGRATING"))] | length')
|
||||
if [ $INSTANCE_COUNT == 0 ]; then
|
||||
break
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user