Merge "EMC VMAX - Changing PercentSynced to CopyState in isSynched"

This commit is contained in:
Jenkins 2016-02-27 03:10:40 +00:00 committed by Gerrit Code Review
commit d3fd2828f6
4 changed files with 24 additions and 8 deletions

View File

@ -494,6 +494,8 @@ class EMCVMAXCommonData(object):
'isV3': True,
'portgroupname': u'OS-portgroup-PG'}
remainingSLOCapacity = '123456789'
SYNCHRONIZED = 4
UNSYNCHRONIZED = 3
class FakeLookupService(object):
@ -1174,6 +1176,12 @@ class FakeEcomConnection(object):
svInstance['SyncedElement'] = 'SyncedElement'
svInstance['SystemElement'] = 'SystemElement'
svInstance['PercentSynced'] = 100
if 'PercentSynced' in objectpath and objectpath['PercentSynced'] < 100:
svInstance['PercentSynced'] = 50
svInstance['CopyState'] = self.data.SYNCHRONIZED
if 'CopyState' in objectpath and (
objectpath['CopyState'] != self.data.SYNCHRONIZED):
svInstance['CopyState'] = self.data.UNSYNCHRONIZED
return svInstance
def _getinstance_replicationServCapabilities(self, objectpath):
@ -1623,6 +1631,7 @@ class FakeEcomConnection(object):
svInstance['SystemElement'] = sourceInstanceName
svInstance['CreationClassName'] = 'SE_StorageSynchronized_SV_SV'
svInstance['PercentSynced'] = 100
svInstance['CopyState'] = self.data.UNSYNCHRONIZED
svInstances.append(svInstance)
return svInstances
@ -2036,6 +2045,14 @@ class EMCVMAXISCSIDriverNoFastTestCase(test.TestCase):
storageGroupName, volumeInstance, volumeName,
storageSystemInstanceName, False, extraSpecs)
def test_is_sync_complete(self):
conn = self.fake_ecom_connection()
syncname = SE_ConcreteJob()
syncname.classname = 'SE_StorageSynchronized_SV_SV'
syncname['CopyState'] = self.data.UNSYNCHRONIZED
issynched = self.driver.common.utils._is_sync_complete(conn, syncname)
self.assertFalse(issynched)
def test_generate_unique_trunc_pool(self):
pool_under_16_chars = 'pool_under_16'
pool1 = self.driver.utils.generate_unique_trunc_pool(

View File

@ -57,6 +57,7 @@ class EMCVMAXFCDriver(driver.FibreChannelDriver):
- _remove_last_vol_and_delete_sg is not being called
for VMAX3 (bug #1520549)
- necessary updates for CG changes (#1534616)
- Changing PercentSynced to CopyState (bug #1517103)
"""
VERSION = "2.3.0"

View File

@ -63,6 +63,7 @@ class EMCVMAXISCSIDriver(driver.ISCSIDriver):
- _remove_last_vol_and_delete_sg is not being called
for VMAX3 (bug #1520549)
- necessary updates for CG changes (#1534616)
- Changing PercentSynced to CopyState (bug #1517103)
"""
VERSION = "2.3.0"

View File

@ -53,6 +53,7 @@ INTERVAL = 'storagetype:interval'
RETRIES = 'storagetype:retries'
CIM_ERR_NOT_FOUND = 6
VOLUME_ELEMENT_NAME_PREFIX = 'OS-'
SYNCHRONIZED = 4
class EMCVMAXUtils(object):
@ -439,15 +440,11 @@ class EMCVMAXUtils(object):
"""
syncInstance = conn.GetInstance(syncName,
LocalOnly=False)
percentSynced = syncInstance['PercentSynced']
copyState = syncInstance['CopyState']
LOG.debug("CopyState is %(copyState)lu.",
{'copyState': copyState})
LOG.debug("Percent synced is %(percentSynced)lu.",
{'percentSynced': percentSynced})
if percentSynced < 100:
return False
else:
return True
return copyState == SYNCHRONIZED
def get_num(self, numStr, datatype):
"""Get the ecom int from the number.