Adds LIBVIRT_VOL_POOL_TARGET to tripleo create-nodes
During dev setup in a vm environment, the default OS partitioning may result in insufficient space for the libvirt default storage pool which defaults (and we also hard-code) to /var/lib/libvirt/images This change means you can export LIBVIRT_VOL_POOL_TARGET before instack-virt-setup to get the libvirt default storage pool created there (and the directory is created if necessary). Change-Id: I85d51457fbd8b747f55091f3ecdc6ca921b70b84
This commit is contained in:
parent
7461b01e39
commit
d2f9efeeda
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user