Merge "LVM: Activate LV before creating exports"

This commit is contained in:
Jenkins 2017-07-25 12:03:18 +00:00 committed by Gerrit Code Review
commit 8c134a2e2a
2 changed files with 6 additions and 1 deletions

View File

@ -676,11 +676,12 @@ class LVM(executor.Executor):
cmd = ['lvchange', '-a', 'y', '--yes']
if self.supports_lvchange_ignoreskipactivation:
cmd.append('-K')
# If permanent=True is specified, drop the skipactivation flag in
# order to make this LV automatically activated after next reboot.
if permanent:
cmd += ['-k', 'n']
else:
cmd.append('-K')
cmd.append(lv_path)

View File

@ -797,6 +797,8 @@ class LVMVolumeDriver(driver.VolumeDriver):
volume_path = "/dev/%s/%s" % (self.configuration.volume_group,
volume['name'])
self.vg.activate_lv(volume['name'])
model_update = \
self.target_driver.ensure_export(context, volume, volume_path)
return model_update
@ -807,6 +809,8 @@ class LVMVolumeDriver(driver.VolumeDriver):
volume_path = "/dev/%s/%s" % (vg, volume['name'])
self.vg.activate_lv(volume['name'])
export_info = self.target_driver.create_export(
context,
volume,