Merge "VNX: delete the LUN from VNX backend" into stable/rocky

This commit is contained in:
Zuul 2020-08-03 13:05:55 +00:00 committed by Gerrit Code Review
commit 44b64b1ba2
6 changed files with 59 additions and 3 deletions

View File

@ -127,6 +127,12 @@ test_delete_async_volume:
test_delete_async_volume_migrating: test_delete_async_volume_migrating:
volume: *volume_base volume: *volume_base
test_delete_async_volume_not_from_snapshot:
volume: *volume_base
test_delete_async_volume_from_snapshot:
volume: *volume_base
test_retype_need_migration_when_host_changed: test_retype_need_migration_when_host_changed:
volume: *volume_base volume: *volume_base
host: host:

View File

@ -1480,6 +1480,20 @@ test_delete_async_volume_migrating:
get_lun: *lun_used_by_feature get_lun: *lun_used_by_feature
get_snap: *snap_test_delete_async_volume get_snap: *snap_test_delete_async_volume
test_delete_async_volume_not_from_snapshot:
vnx:
_methods:
get_lun: *lun_test_delete_lun
test_delete_async_volume_from_snapshot:
snap: &snap_test_delete_async_volume_from_snapshot
_methods:
delete:
vnx:
_methods:
get_lun: *lun_test_delete_lun
get_snap: *snap_test_delete_async_volume_from_snapshot
test_enable_compression: test_enable_compression:
lun: lun:
_properties: _properties:

View File

@ -450,6 +450,31 @@ class TestCommonAdapter(test.TestCase):
lun = vnx_common.client.vnx.get_lun() lun = vnx_common.client.vnx.get_lun()
lun.delete.assert_called_with(force_detach=True, detach_from_sg=True) lun.delete.assert_called_with(force_detach=True, detach_from_sg=True)
@res_mock.mock_driver_input
@res_mock.patch_common_adapter
def test_delete_async_volume_not_from_snapshot(self, vnx_common, mocked,
mocked_input):
volume = mocked_input['volume']
volume.metadata = {'async_migrate': 'True'}
vnx_common.force_delete_lun_in_sg = True
vnx_common.delete_volume(volume)
lun = vnx_common.client.vnx.get_lun()
lun.delete.assert_called_with(force_detach=True, detach_from_sg=True)
@res_mock.mock_driver_input
@res_mock.patch_common_adapter
def test_delete_async_volume_from_snapshot(self, vnx_common, mocked,
mocked_input):
volume = mocked_input['volume']
volume.metadata = {'async_migrate': 'True'}
volume.snapshot_id = 'snap'
vnx_common.force_delete_lun_in_sg = True
vnx_common.delete_volume(volume)
lun = vnx_common.client.vnx.get_lun()
lun.delete.assert_called_with(force_detach=True, detach_from_sg=True)
snap = vnx_common.client.vnx.get_snap()
snap.delete.assert_called_with()
@utils.patch_extra_specs_validate(side_effect=exception.InvalidVolumeType( @utils.patch_extra_specs_validate(side_effect=exception.InvalidVolumeType(
reason='fake_reason')) reason='fake_reason'))
@res_mock.patch_common_adapter @res_mock.patch_common_adapter

View File

@ -801,8 +801,8 @@ class CommonAdapter(replication.ReplicationAdapter):
# for later deletion # for later deletion
self.client.delay_delete_lun(volume.name) self.client.delay_delete_lun(volume.name)
# Case 2. Migration already finished, try to delete the temp snap # Case 2. Migration already finished, try to delete the temp snap
# only when it's a cloned volume. # when it's a cloned volume or created from snapshot.
if async_migrate and volume.source_volid: if async_migrate and (volume.source_volid or volume.snapshot_id):
self.client.delete_snapshot(utils.construct_snap_name(volume)) self.client.delete_snapshot(utils.construct_snap_name(volume))
def extend_volume(self, volume, new_size): def extend_volume(self, volume, new_size):

View File

@ -84,9 +84,11 @@ class VNXDriver(driver.ManageableVD,
12.1.2 - Fix bug https://bugs.launchpad.net/cinder/+bug/1817385 to 12.1.2 - Fix bug https://bugs.launchpad.net/cinder/+bug/1817385 to
make sure sg can be created again after it was destroyed make sure sg can be created again after it was destroyed
under `destroy_empty_stroage_group` setting to `True` under `destroy_empty_stroage_group` setting to `True`
12.1.3 - Fix bug 1794646: failed to delete LUNs from backend due to
the temporary snapshots on them wasn't deleted.
""" """
VERSION = '12.01.02' VERSION = '12.01.03'
VENDOR = 'Dell EMC' VENDOR = 'Dell EMC'
# ThirdPartySystems wiki page # ThirdPartySystems wiki page
CI_WIKI_NAME = "EMC_VNX_CI" CI_WIKI_NAME = "EMC_VNX_CI"

View File

@ -0,0 +1,9 @@
---
fixes:
- |
Dell EMC VNX Cinder Driver: Fixes `bug 1794646
<https://bugs.launchpad.net/cinder/+bug/1794646>`__ to delete the LUN from
the VNX storage. Because a temporary snapshot is created from the LUN
during creating a volume from a snapshot and isn't deleted, the LUN cannot
be deleted before its snapshot is deleted. The fix makes sure the temp
snapshot is deleted.