Merge "Adds LIBVIRT_VOL_POOL_TARGET to tripleo create-nodes"

This commit is contained in:
Jenkins 2015-11-03 11:01:21 +00:00 committed by Gerrit Code Review
commit dec6215b86
1 changed files with 8 additions and 4 deletions

View File

@ -24,12 +24,16 @@ BRIDGE_NAMES=${9:-""}
LIBVIRT_NIC_DRIVER=${LIBVIRT_NIC_DRIVER:-"virtio"}
LIBVIRT_VOL_POOL=${LIBVIRT_VOL_POOL:-"default"}
LIBVIRT_VOL_POOL_TARGET=${LIBVIRT_VOL_POOL_TARGET:-"/var/lib/libvirt/images"}
# define the default storage pool if its not there yet
(virsh pool-list --all --persistent | grep -q $LIBVIRT_VOL_POOL) || \
(virsh pool-define-as --name $LIBVIRT_VOL_POOL dir --target /var/lib/libvirt/images; \
# define the $LIBVIRT_VOL_POOL storage pool if its not there yet
if ! $(virsh pool-list --all --persistent | grep -q $LIBVIRT_VOL_POOL) ; then
if [ ! -d $LIBVIRT_VOL_POOL_TARGET ]; then
sudo mkdir -p $LIBVIRT_VOL_POOL_TARGET ;
fi
(virsh pool-define-as --name $LIBVIRT_VOL_POOL dir --target $LIBVIRT_VOL_POOL_TARGET ; \
virsh pool-autostart $LIBVIRT_VOL_POOL; virsh pool-start $LIBVIRT_VOL_POOL) >&2
fi
PREALLOC=
if [ "${TRIPLEO_OS_FAMILY:-}" = "debian" ]; then
PREALLOC="--prealloc-metadata"