make volume size parametric in boot_from_volume

Fixes bug #1090007

Change-Id: Ifa13b0b7b62be75805db2730cb7154406f0c1b94
This commit is contained in:
Armando Migliaccio 2012-12-13 16:08:48 +00:00
parent 1bd2a1b186
commit b0d8a8288b
3 changed files with 6 additions and 2 deletions

View File

@ -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}

View File

@ -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

View File

@ -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