Created
March 3, 2015 14:36
-
-
Save thurloat/be869e4aafb741499007 to your computer and use it in GitHub Desktop.
demo manual offline snapshot in openstack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ./test_off.sh <uuid> <snap_name> | |
uuid=$1 | |
snapname=$2 | |
nova stop $uuid | |
while true; do | |
status=$(nova show $uuid | grep vm_state | awk '{ print $4 }') | |
echo $status | |
if [ "$status" == "stopped" ]; then | |
break; | |
fi | |
sleep 1 | |
done | |
echo "Off" | |
sleep 3 | |
nova image-create $uuid $snapname | |
while true; do | |
status=$(nova show $uuid | grep task_state | awk '{ print $4 }') | |
echo $status | |
if [ "$status" == "-" ]; then | |
break; | |
fi | |
sleep 2 | |
done | |
nova start $uuid | |
( ( sleep 2 && nova show $uuid ) & ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment