diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index 3c21c29d5..7dcb20838 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -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) diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index ccd6158ec..6a6460268 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -790,6 +790,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 @@ -800,6 +802,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,