[devstack] properly clean ZFS backend

Change-Id: Iedf157a2f156565ca7798cfd62954f4807922eae
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
This commit is contained in:
Sahid Orentino Ferdjaoui 2018-12-12 09:52:37 -05:00 committed by Alex Kavanagh (tinwood)
parent 58974a6a6b
commit cbb3d64b5f
1 changed files with 5 additions and 1 deletions

View File

@ -133,7 +133,11 @@ function shutdown_nova-lxd() {
function cleanup_nova-lxd() {
# Cleanup the service.
if [ "$LXD_BACKEND_DRIVER" == "zfs" ]; then
sudo zpool destroy ${LXD_ZFS_ZPOOL}
pool=`lxc profile device get default root pool 2>> /dev/null || :`
if [ "$pool" == "$LXD_ZFS_ZPOOL" ]; then
sudo lxc profile device remove default root
sudo lxc storage delete $LXD_ZFS_ZPOOL
fi
fi
}