VMAX driver - snapshot creation and immediate deletion fix

Creating and immediately deleting a snapshot greater than 50GB
fails. This patch rectifies the issue by passing the
WaitForCopyState parameter into the CreateElementReplica SMI-S
function when creating the snapshot.

Change-Id: I5aa4a77cb8208bb805551074a28d8b722d6eb22c
Closes-Bug: #1662950
This commit is contained in:
Helen Walsh 2017-02-08 17:00:59 +00:00
parent 898c4a768c
commit 3cdbcba1e2
3 changed files with 35 additions and 3 deletions

View File

@ -9322,6 +9322,38 @@ class VMAXCommonTest(test.TestCase):
common.failover_host('context', volumes, 'default'))
self.assertEqual(verify_update_fo, volume_update_2)
# create snapshot and immediately delete it fails when snapshot > 50GB
@mock.patch.object(
utils.VMAXUtils,
'get_v3_default_sg_instance_name',
return_value=(None, None, VMAXCommonData.default_sg_instance_name))
@mock.patch.object(
utils.VMAXUtils,
'is_clone_licensed',
return_value=True)
@mock.patch.object(
common.VMAXCommon,
'_get_pool_and_storage_system',
return_value=(None, VMAXCommonData.storage_system))
@mock.patch.object(
volume_types,
'get_volume_type_extra_specs',
return_value={'volume_backend_name': 'V3_BE'})
@mock.patch.object(
common.VMAXCommon,
'_get_ecom_connection',
return_value=FakeEcomConnection())
def test_create_and_delete_snapshot_100GB(
self, mock_conn, mock_extraspecs, mock_pool, mock_licence,
mock_sg):
common = self.driver.common
snapshot = self.data.test_snapshot_v3.copy()
snapshot['size'] = '100'
with mock.patch.object(common, '_initial_setup',
return_value=self.data.extra_specs):
self.driver.create_snapshot(snapshot)
self.driver.delete_snapshot(snapshot)
class VMAXProvisionTest(test.TestCase):
def setUp(self):

View File

@ -4270,7 +4270,7 @@ class VMAXCommon(object):
operation = self.utils.get_num(DISSOLVE_SNAPVX, '16')
rsdInstance = None
targetInstance = None
copyState = None
copyState = self.utils.get_num(4, '16')
if isSnapshot:
rsdInstance = self.utils.set_target_element_supplier_in_rsd(
self.conn, repServiceInstanceName, SNAPVX_REPLICATION_TYPE,
@ -4278,7 +4278,6 @@ class VMAXCommon(object):
else:
targetInstance = self._create_duplicate_volume(
sourceInstance, cloneName, extraSpecs)
copyState = self.utils.get_num(4, '16')
try:
rc, job = (

View File

@ -421,7 +421,8 @@ class VMAXProvisionV3(object):
SyncType=syncType,
SourceElement=sourceInstance.path,
ReplicationSettingData=rsdInstance,
Collections=[sgInstanceName])
Collections=[sgInstanceName],
WaitForCopyState=copyState)
elif targetInstance and copyState:
rc, job = conn.InvokeMethod(
'CreateElementReplica', repServiceInstanceName,