From babb2e075adbba7402d0914ad81eb01d5fe5c17e Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Thu, 20 Oct 2011 12:32:58 -0700 Subject: [PATCH] re-order cleanup calls --- tools/build_kvm.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/build_kvm.sh b/tools/build_kvm.sh index 95aff7b..d30250d 100755 --- a/tools/build_kvm.sh +++ b/tools/build_kvm.sh @@ -148,18 +148,11 @@ git_clone $OPENSTACKX_REPO $COPY_DIR/$DEST/openstackx $OPENSTACKX_BRANCH git_clone $KEYSTONE_REPO $COPY_DIR/$DEST/keystone $KEYSTONE_BRANCH git_clone $NOVNC_REPO $COPY_DIR/$DEST/noVNC $NOVNC_BRANCH -# Back to devstack -cd $TOP_DIR - # Unmount the filesystems unmount_images -# Clean up old runs -cd $VM_DIR -rm -f $VM_DIR/disk - -# Clean up old instance data -qemu-img create -f qcow2 -b $BASE_IMAGE_COPY disk +# Back to devstack +cd $TOP_DIR # Network configuration variables BRIDGE=${BRIDGE:-br0} @@ -231,6 +224,14 @@ NBD=${NBD:-/dev/nbd5} umount $ROOTFS || echo 'ok' qemu-nbd -d $NBD || echo 'ok' +# Clean up old runs +cd $VM_DIR +rm -f $VM_DIR/disk + +# Create our instance fs +qemu-img create -f qcow2 -b $BASE_IMAGE_COPY disk + + # Mount the instance qemu-nbd -c $NBD disk mount $NBD $ROOTFS -o offset=32256 -t ext4