improve migration script
Change-Id: I7bacbdd9a0a0914be507758436f7b9ceb465654c
This commit is contained in:
parent
b2ff372535
commit
dacf857145
@ -40,26 +40,25 @@ nodes. For more information, see :ref:`cli-os-migrate-cfg-ssh`.
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[ $# -eq 0 ]] && usage
|
[[ $# -eq 0 ]] && usage
|
||||||
|
|
||||||
# Migrate the VM to an alternate hypervisor
|
|
||||||
echo -n "Migrating instance to alternate host"
|
|
||||||
VM_ID=$1
|
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
|
# Show the details for the VM
|
||||||
echo "Updated instance details:"
|
echo "Instance details:"
|
||||||
openstack server show $VM_ID
|
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
|
# Pause to allow users to examine VM details
|
||||||
read -p "Pausing, press <enter> to exit."
|
read -p "Pausing, press <enter> to exit."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user