Merge "VMAX driver - snapshot creation and immediate deletion fix"

This commit is contained in:
Jenkins
2017-02-14 01:09:25 +00:00
committed by Gerrit Code Review
3 changed files with 35 additions and 3 deletions

View File

@@ -9433,6 +9433,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

@@ -4293,7 +4293,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,
@@ -4301,7 +4301,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

@@ -420,7 +420,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,