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.

Change-Id: If48be8516fd71738cb83a91683c33d02f227b9d6
Related-Bug: 1252423
Closes-Bug: 1260786
This commit is contained in:
Eric Harney 2013-12-13 11:18:56 -05:00
parent e3ce1ca32c
commit 6730573209
2 changed files with 5 additions and 0 deletions

View File

@ -67,3 +67,6 @@ class FakeBrickLVM(object):
def lv_has_snapshot(self, name):
return False
def activate_lv(self, lv, is_snapshot=False):
pass

View File

@ -309,6 +309,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),