Discussion:
[lxc-devel] [lxd/master] Fix LVM on 18.04
stgraber on Github
2018-12-05 06:30:06 UTC
Permalink
From 5aed995ab2cb6c37ae85cd889db3bf0719cd16b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <***@ubuntu.com>
Date: Wed, 5 Dec 2018 00:35:51 -0500
Subject: [PATCH 1/2] lxd/storage/lvm: Run pvremove on VG deletion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <***@ubuntu.com>
---
lxd/storage_lvm.go | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/lxd/storage_lvm.go b/lxd/storage_lvm.go
index 5fa3ada8ed..d8022512f4 100644
--- a/lxd/storage_lvm.go
+++ b/lxd/storage_lvm.go
@@ -389,6 +389,11 @@ func (s *storageLvm) StoragePoolDelete() error {
if err != nil {
logger.Warnf("Failed to set LO_FLAGS_AUTOCLEAR on loop device: %s, manual cleanup needed", err)
}
+
+ output, err := shared.TryRunCommand("pvremove", "-f", s.loopInfo.Name())
+ if err != nil {
+ logger.Warnf("Failed to destroy the physical volume for the lvm storage pool: %s", output)
+ }
}

if filepath.IsAbs(source) {

From e553ecf4b76118d45d5f49ea6574c2d7a0e7fac3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <***@ubuntu.com>
Date: Wed, 5 Dec 2018 00:57:20 -0500
Subject: [PATCH 2/2] tests: Bump size to 120MB for btrfs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <***@ubuntu.com>
---
test/suites/storage.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/suites/storage.sh b/test/suites/storage.sh
index 4860a9157e..c96fdc815b 100644
--- a/test/suites/storage.sh
+++ b/test/suites/storage.sh
@@ -428,7 +428,7 @@ test_storage() {
lxc storage set "lxdtest-$(basename "${LXD_DIR}")-pool6" volume.block.filesystem xfs
lxc init testimage c1pool6 -s "lxdtest-$(basename "${LXD_DIR}")-pool6"
lxc storage set "lxdtest-$(basename "${LXD_DIR}")-pool6" volume.block.filesystem btrfs
- lxc storage set "lxdtest-$(basename "${LXD_DIR}")-pool6" volume.size 100MB
+ lxc storage set "lxdtest-$(basename "${LXD_DIR}")-pool6" volume.size 120MB
lxc init testimage c2pool6 -s "lxdtest-$(basename "${LXD_DIR}")-pool6"

lxc storage volume create "lxdtest-$(basename "${LXD_DIR}")-pool6" c10pool6
Loading...