Rename BASE_IMAGE_COPY to VM_IMAGE

This commit is contained in:
Dean Troyer 2011-10-21 14:58:44 -05:00
parent ad57a3a8e8
commit d03329106f

View file

@ -52,7 +52,7 @@ CONTAINER_NAME=${CONTAINER_NAME:-kvmstack}
BASE_IMAGE=$KVMSTACK_DIR/images/$DIST_NAME.raw BASE_IMAGE=$KVMSTACK_DIR/images/$DIST_NAME.raw
# Copy of base image, which we pre-install with tasty treats # Copy of base image, which we pre-install with tasty treats
BASE_IMAGE_COPY=$IMAGES_DIR/$DIST_NAME.$CONTAINER_NAME.raw.copy VM_IMAGE=$IMAGES_DIR/$DIST_NAME.$CONTAINER_NAME.raw
# Mop up after previous runs # Mop up after previous runs
virsh destroy $CONTAINER_NAME virsh destroy $CONTAINER_NAME
@ -76,8 +76,8 @@ if [ ! -e $IMAGES_DIR/$IMAGE_FNAME ]; then
fi fi
# Create a copy of the base image # Create a copy of the base image
if [ ! -e $BASE_IMAGE_COPY ]; then if [ ! -e $VM_IMAGE ]; then
cp -p $BASE_IMAGE $BASE_IMAGE_COPY cp -p $BASE_IMAGE $VM_IMAGE
fi fi
# Unmount the copied base image # Unmount the copied base image
@ -108,7 +108,7 @@ trap kill_unmount SIGINT
DEST=${DEST:-/opt/stack} DEST=${DEST:-/opt/stack}
# Mount the file system # Mount the file system
mount -o loop,offset=32256 $BASE_IMAGE_COPY $COPY_DIR mount -o loop,offset=32256 $VM_IMAGE $COPY_DIR
# git clone only if directory doesn't exist already. Since ``DEST`` might not # git clone only if directory doesn't exist already. Since ``DEST`` might not
# be owned by the installation user, we create the directory and change the # be owned by the installation user, we create the directory and change the
@ -231,7 +231,7 @@ cd $VM_DIR
rm -f $VM_DIR/disk rm -f $VM_DIR/disk
# Create our instance fs # Create our instance fs
qemu-img create -f qcow2 -b $BASE_IMAGE_COPY disk qemu-img create -f qcow2 -b $VM_IMAGE disk
sleep 5 sleep 5