Merge "[devstack] don't try to configure ZFS backend if already present"

This commit is contained in:
Zuul 2019-01-24 00:57:05 +00:00 committed by Gerrit Code Review
commit 58974a6a6b
1 changed files with 19 additions and 14 deletions

View File

@ -109,6 +109,8 @@ function configure_lxd_block() {
if [ "$LXD_BACKEND_DRIVER" == "default" ]; then
echo "Nothing to be done"
elif [ "$LXD_BACKEND_DRIVER" == "zfs" ]; then
pool=`lxc profile device get default root pool 2>> /dev/null || :`
if [ "$pool" != "$LXD_ZFS_ZPOOL" ]; then
echo "Configuring ZFS backend"
truncate -s $LXD_LOOPBACK_DISK_SIZE $LXD_DISK_IMAGE
# TODO(sahid): switch to use snap
@ -116,6 +118,9 @@ function configure_lxd_block() {
lxd_dev=`sudo losetup --show -f ${LXD_DISK_IMAGE}`
sudo lxd init --auto --storage-backend zfs --storage-pool $LXD_ZFS_ZPOOL \
--storage-create-device $lxd_dev
else
echo "ZFS backend already configured"
fi
fi
fi
}