Created
November 8, 2014 00:18
-
-
Save noelbk/f6147e195ac62c735ee6 to your computer and use it in GitHub Desktop.
cobalt live-image test script
This file contains 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
tenant_id=$(keystone tenant-get admin | awk '$2 == "id" { print $4 }') | |
nova quota-show --tenant $tenant_id | |
nova quota-update --instances 100 --force $tenant_id | |
nova quota-update --cores 400 --force $tenant_id | |
nova quota-update --ram 102400 --force $tenant_id | |
glance image-create --name=ubuntu --disk-format qcow2 --copy-from http://smurf.i.pistoncloud.com/vm-images/Demo-Image-Ubuntu-12.04.img | |
# test #1 | |
image="Demo Image CirrOS 0.3.1 9" | |
flavor=m1.medium | |
# test #2 | |
#image="ubuntu" | |
#flavor=m1.large | |
net_id=$(neutron net-list | awk '$4=="internal" { print $2 }') | |
t0=$SECONDS | |
nova boot --image "$image" --flavor $flavor --nic net-id=$net_id vm1 | |
while ! nova list | grep -q " vm1 .* ACTIVE\|ERROR .*"; do sleep .5; done | |
echo "time_boot: $((SECONDS-t0))" | |
nova live-image-delete vm1-l1 | |
( | |
t0=$SECONDS | |
nova live-image-create vm1 vm1-l1 && | |
while ! nova list | grep -q ' vm1-l1 .* BLESSED\|ERROR .*'; do sleep .5; done | |
echo "time_live-image-create: $((SECONDS-t0))" | |
) & | |
for i in $(seq 1 20); do | |
( | |
t0=$SECONDS | |
nova live-image-start --live-image vm1-l1 vm1-l1-i$i; | |
while ! nova list | grep -q " vm1-l1-i$i .* ACTIVE\|ERROR .*"; do sleep .5; done | |
echo "time_live-image-start($i): $((SECONDS-t0))" | |
) & | |
done | |
while true; do nova list --fields name,Networks,OS-EXT-SRV-ATTR:host,status; sleep 2; done | |
nova list | grep vm1-l1- | awk '{ print $2 }' | xargs -i nova delete {} | |
nova live-image-delete vm1-l1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment