Merge "Remove the obsolete --block-migrate parameter"

This commit is contained in:
Zuul 2020-09-14 16:05:45 +00:00 committed by Gerrit Code Review
commit 5a5ffcf560
2 changed files with 6 additions and 23 deletions

View File

@ -68,26 +68,15 @@ fi
{% if compute_evacuate %}
{% if 'compute' in node_name %}
source {{ overcloud_rc }}
## Detect if ceph shared storage was used
STORAGE_BACKEND=$(openstack volume service list -f json | jq -r -c '.[] | select(.Binary | contains("cinder-volume")) | .Host' | sed s/hostgroup@tripleo_//)
{% for instance in node_instances.stdout_lines %}
if [ $STORAGE_BACKEND == 'ceph' ]; then
nova live-migration {{ instance }} {{ node_name }}
else
nova live-migration --block-migrate {{ instance }} {{ node_name }}
fi
nova live-migration {{ instance }} {{ node_name }}
timeout_seconds=120
elapsed_seconds=0
while true; do
if [ $STORAGE_BACKEND == 'ceph' ]; then
echo "Shared storage live migrating {{ instance }} back to {{ node_name }} ..."
## Live migration might not complete on the first run so we run it multiple times
## until the instance ends back on the originating host
nova live-migration {{ instance }} {{ node_name }}
else
echo "Block migrating {{ instance }} back to {{ node_name }} ..."
nova live-migration --block-migrate {{ instance }} {{ node_name }}
fi
echo "Live migrating {{ instance }} back to {{ node_name }} ..."
## Live migration might not complete on the first run so we run it multiple times
## until the instance ends back on the originating host
nova live-migration {{ instance }} {{ node_name }}
INSTANCE_HOST=$(openstack server show {{ instance }} -f value -c OS-EXT-SRV-ATTR:host)
if [ $INSTANCE_HOST == '{{ node_name }}' ]; then
break

View File

@ -1,14 +1,8 @@
{% if compute_evacuate %}
source {{ overcloud_rc }}
## Detect if ceph shared storage was used
STORAGE_BACKEND=$(openstack volume service list -f json | jq -r -c '.[] | select(.Binary | contains("cinder-volume")) | .Host' | sed s/hostgroup@tripleo_//)
## Get exact hostname
HOST=$(openstack compute service list -f value -c Host | grep {{ node_name }} )
if [ $STORAGE_BACKEND == 'ceph' ]; then
nova host-evacuate-live ${HOST}
else
nova host-evacuate-live --block-migrate ${HOST}
fi
nova host-evacuate-live ${HOST}
timeout_seconds=120
elapsed_seconds=0