diff --git a/doc/source/admin/migration.rst b/doc/source/admin/migration.rst index 3020825e894b..6eebab1ad4cf 100644 --- a/doc/source/admin/migration.rst +++ b/doc/source/admin/migration.rst @@ -35,31 +35,30 @@ nodes. For more information, see :ref:`cli-os-migrate-cfg-ssh`. # Provide usage usage() { - echo "Usage: $0 VM_ID" - exit 1 + echo "Usage: $0 VM_ID" + exit 1 } [[ $# -eq 0 ]] && usage - - # Migrate the VM to an alternate hypervisor - echo -n "Migrating instance to alternate host" VM_ID=$1 - openstack server migrate $VM_ID - VM_OUTPUT=$(openstack server show $VM_ID) - VM_STATUS=$(echo "$VM_OUTPUT" | grep status | awk '{print $4}') - while [[ "$VM_STATUS" != "VERIFY_RESIZE" ]]; do - echo -n "." - sleep 2 - VM_OUTPUT=$(openstack server show $VM_ID) - VM_STATUS=$(echo "$VM_OUTPUT" | grep status | awk '{print $4}') - done - openstack server resize --confirm $VM_ID - echo " instance migrated and resized." - echo; # Show the details for the VM - echo "Updated instance details:" - openstack server show $VM_ID + echo "Instance details:" + openstack server show ${VM_ID} + + # Migrate the VM to an alternate hypervisor + echo -n "Migrating instance to alternate host " + openstack server migrate ${VM_ID} + while [[ "$(openstack server show ${VM_ID} -f value -c status)" != "VERIFY_RESIZE" ]]; do + echo -n "." + sleep 2 + done + openstack server resize --confirm ${VM_ID} + echo " instance migrated and resized." + + # Show the details for the migrated VM + echo "Migrated instance details:" + openstack server show ${VM_ID} # Pause to allow users to examine VM details read -p "Pausing, press to exit."