From 797bbe29abd9095b752fb2bb31cb76454b02ff97 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Fri, 13 Dec 2013 11:18:56 -0500 Subject: [PATCH] LVM: Activate source snap LV when cloning from volume Similar to the change made in: 01a2199 LVM: Activate source LV before cloning from it Previous change only fixed this issue for clone-from-snapshot. This activates the source snapshot LV when cloning from volume as well, fixing the problem where cloning fails due to inability to open the source LV device. Related-Bug: 1252423 Closes-Bug: 1260786 (cherry picked from commit 673057320929d33095c998d477c2537567ccf74b) Change-Id: If48be8516fd71738cb83a91683c33d02f227b9d6 --- cinder/tests/brick/fake_lvm.py | 3 +++ cinder/volume/drivers/lvm.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/cinder/tests/brick/fake_lvm.py b/cinder/tests/brick/fake_lvm.py index a6f76ab9b52..d6eec28f55c 100644 --- a/cinder/tests/brick/fake_lvm.py +++ b/cinder/tests/brick/fake_lvm.py @@ -67,3 +67,6 @@ class FakeBrickLVM(object): def lv_has_snapshot(self, name): return False + + def activate_lv(self, lv, is_snapshot=False): + pass diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 8c477c605e9..44f0410bdaf 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -314,6 +314,8 @@ class LVMVolumeDriver(driver.VolumeDriver): self.configuration.lvm_type, mirror_count) + self.vg.activate_lv(temp_snapshot['name'], is_snapshot=True) + try: volutils.copy_volume(self.local_path(temp_snapshot), self.local_path(volume),