PowerMax Driver - Unmanage Snapshot Improvements

This change removes an expensive and unnecessary call in the
unmanage snapshot operation.  An additional log warning has
also been added to notify users of the inability to delete
volumes where a linked snapshot has been unmanaged but still
existsX on the back end storage array.

Change-Id: I77720dc8e3b3c79e60d0ea16939a80480067215e
This commit is contained in:
michael-mcaleer 2019-02-13 14:36:55 +00:00 committed by Helen Walsh
parent 8d972bec8a
commit 49ba8943e5
2 changed files with 13 additions and 4 deletions

View File

@ -2301,12 +2301,18 @@ class PowerMaxCommonTest(test.TestCase):
self.common.manage_existing_snapshot, self.common.manage_existing_snapshot,
snapshot, existing_ref) snapshot, existing_ref)
@mock.patch.object(common.PowerMaxCommon, '_sync_check')
@mock.patch.object(rest.PowerMaxRest, 'modify_volume_snap') @mock.patch.object(rest.PowerMaxRest, 'modify_volume_snap')
def test_unmanage_snapshot_success(self, mock_mod, mock_sync): def test_unmanage_snapshot_success(self, mock_mod, ):
self.common.unmanage_snapshot(self.data.test_snapshot_manage) self.common.unmanage_snapshot(self.data.test_snapshot_manage)
mock_mod.assert_called_once() mock_mod.assert_called_once()
@mock.patch.object(common.PowerMaxCommon, '_sync_check')
@mock.patch.object(rest.PowerMaxRest, 'modify_volume_snap')
def test_unmanage_snapshot_no_sync_check(self, mock_mod, mock_sync):
self.common.unmanage_snapshot(self.data.test_snapshot_manage)
mock_mod.assert_called_once()
mock_sync.assert_not_called()
@mock.patch.object(utils.PowerMaxUtils, 'is_volume_failed_over', @mock.patch.object(utils.PowerMaxUtils, 'is_volume_failed_over',
return_value=True) return_value=True)
def test_unmanage_snapshot_fail_failover(self, mock_failed): def test_unmanage_snapshot_fail_failover(self, mock_failed):

View File

@ -2602,12 +2602,15 @@ class PowerMaxCommon(object):
raise exception.VolumeBackendAPIException( raise exception.VolumeBackendAPIException(
message=exception_message) message=exception_message)
self._sync_check(array, device_id, extra_specs)
LOG.info("Snapshot %(snap_name)s is no longer managed in " LOG.info("Snapshot %(snap_name)s is no longer managed in "
"OpenStack but still remains on PowerMax/VMAX source " "OpenStack but still remains on PowerMax/VMAX source "
"%(array_id)s", {'snap_name': snap_name, 'array_id': array}) "%(array_id)s", {'snap_name': snap_name, 'array_id': array})
LOG.warning("In order to remove the snapshot source volume from "
"OpenStack you will need to either delete the linked "
"SnapVX snapshot on the array or un-manage the volume "
"from Cinder.")
def get_manageable_volumes(self, marker, limit, offset, sort_keys, def get_manageable_volumes(self, marker, limit, offset, sort_keys,
sort_dirs): sort_dirs):
"""Lists all manageable volumes. """Lists all manageable volumes.