From: Vojtech Trefny vtrefny@redhat.com
Running pvmove on empty pv results in non-zero exit code (causing libblockdev to think pvmove failed).
Signed-off-by: Vojtech Trefny vtrefny@redhat.com --- blivet/devices/lvm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py index 39d245c..d283b7d 100644 --- a/blivet/devices/lvm.py +++ b/blivet/devices/lvm.py @@ -265,7 +265,9 @@ def _remove(self, member): if lv.exists: lv.setup()
- blockdev.lvm.pvmove(member.path) + # do not run pvmove on empty pvs + if (member.size - member.format.peStart - member.format.pvFree) >= self.peSize: + blockdev.lvm.pvmove(member.path) blockdev.lvm.vgreduce(self.name, member.path)
for (lv, status) in zip(self.lvs, status):