diff --git a/tools/build_kvm.sh b/tools/build_kvm.sh index 32c7bf6..ea135f6 100755 --- a/tools/build_kvm.sh +++ b/tools/build_kvm.sh @@ -19,9 +19,6 @@ set -o xtrace TOOLS_DIR=$(cd $(dirname "$0") && pwd) TOP_DIR=$TOOLS_DIR/.. -# Configure the root password of the vm -ROOT_PASSWORD=${ROOT_PASSWORD:-password} - # Where to store files and instances KVMSTACK_DIR=${KVMSTACK_DIR:-/opt/kvmstack} @@ -44,6 +41,10 @@ fi # Source params source ./stackrc +# Configure the root password of the vm to be the same as ``ADMIN_PASSWORD`` +ROOT_PASSWORD=${ADMIN_PASSWORD:-password} + + # Base image (natty by default) DIST_NAME=${DIST_NAME:-natty} IMAGE_FNAME=$DIST_NAME.raw @@ -260,7 +261,7 @@ iface eth0 inet static EOF # User configuration for the instance -chroot $ROOTFS groupadd libvirtd +chroot $ROOTFS groupadd libvirtd || true chroot $ROOTFS useradd stack -s /bin/bash -d $DEST -G libvirtd cp -pr $TOOLS_DIR/.. $ROOTFS/$DEST/devstack echo "root:$ROOT_PASSWORD" | chroot $ROOTFS chpasswd