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

@ -104,20 +104,25 @@ function test_config_nova-lxd() {
} }
function configure_lxd_block() { function configure_lxd_block() {
echo_summary "Configure LXD storage backend" echo_summary "Configure LXD storage backend"
if is_ubuntu; then if is_ubuntu; then
if [ "$LXD_BACKEND_DRIVER" == "default" ]; then if [ "$LXD_BACKEND_DRIVER" == "default" ]; then
echo "Nothing to be done" echo "Nothing to be done"
elif [ "$LXD_BACKEND_DRIVER" == "zfs" ]; then elif [ "$LXD_BACKEND_DRIVER" == "zfs" ]; then
echo "Configuring ZFS backend" pool=`lxc profile device get default root pool 2>> /dev/null || :`
truncate -s $LXD_LOOPBACK_DISK_SIZE $LXD_DISK_IMAGE if [ "$pool" != "$LXD_ZFS_ZPOOL" ]; then
# TODO(sahid): switch to use snap echo "Configuring ZFS backend"
sudo apt-get install -y zfsutils-linux truncate -s $LXD_LOOPBACK_DISK_SIZE $LXD_DISK_IMAGE
lxd_dev=`sudo losetup --show -f ${LXD_DISK_IMAGE}` # TODO(sahid): switch to use snap
sudo lxd init --auto --storage-backend zfs --storage-pool $LXD_ZFS_ZPOOL \ sudo apt-get install -y zfsutils-linux
--storage-create-device $lxd_dev lxd_dev=`sudo losetup --show -f ${LXD_DISK_IMAGE}`
fi sudo lxd init --auto --storage-backend zfs --storage-pool $LXD_ZFS_ZPOOL \
fi --storage-create-device $lxd_dev
else
echo "ZFS backend already configured"
fi
fi
fi
} }
function shutdown_nova-lxd() { function shutdown_nova-lxd() {