From b0d8a8288be6ad23114563c4bf62338c79766501 Mon Sep 17 00:00:00 2001 From: Armando Migliaccio Date: Thu, 13 Dec 2012 16:08:48 +0000 Subject: [PATCH] make volume size parametric in boot_from_volume Fixes bug #1090007 Change-Id: Ifa13b0b7b62be75805db2730cb7154406f0c1b94 --- exerciserc | 4 ++++ exercises/boot_from_volume.sh | 2 +- exercises/volumes.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/exerciserc b/exerciserc index 82c74b7fe4..c26ec2ce95 100644 --- a/exerciserc +++ b/exerciserc @@ -26,3 +26,7 @@ export VOLUME_TIMEOUT=${VOLUME_TIMEOUT:-30} # Max time to wait for a euca-delete command to propogate export VOLUME_DELETE_TIMEOUT=${SNAPSHOT_DELETE_TIMEOUT:-60} + +# The size of the volume we want to boot from; some storage back-ends +# do not allow a disk resize, so it's important that this can be tuned +export DEFAULT_VOLUME_SIZE=${DEFAULT_VOLUME_SIZE:-1} diff --git a/exercises/boot_from_volume.sh b/exercises/boot_from_volume.sh index 5ebdecc755..5ada2370b8 100755 --- a/exercises/boot_from_volume.sh +++ b/exercises/boot_from_volume.sh @@ -117,7 +117,7 @@ if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! nova floating-ip-list | grep -q $ fi # Create the bootable volume -cinder create --display_name=$VOL_NAME --image-id $IMAGE 1 +cinder create --display_name=$VOL_NAME --image-id $IMAGE $DEFAULT_VOLUME_SIZE # Wait for volume to activate if ! timeout $ACTIVE_TIMEOUT sh -c "while ! cinder list | grep $VOL_NAME | grep available; do sleep 1; done"; then diff --git a/exercises/volumes.sh b/exercises/volumes.sh index 42f9cb4e72..48a976ed3d 100755 --- a/exercises/volumes.sh +++ b/exercises/volumes.sh @@ -142,7 +142,7 @@ if [[ -n "`cinder list | grep $VOL_NAME | head -1 | get_field 2`" ]]; then fi # Create a new volume -cinder create --display_name $VOL_NAME --display_description "test volume: $VOL_NAME" 1 +cinder create --display_name $VOL_NAME --display_description "test volume: $VOL_NAME" $DEFAULT_VOLUME_SIZE if [[ $? != 0 ]]; then echo "Failure creating volume $VOL_NAME" exit 1