'isV3': True,
'portgroupname': u'OS-portgroup-PG'}
remainingSLOCapacity = '123456789'
+ SYNCHRONIZED = 4
+ UNSYNCHRONIZED = 3
class FakeLookupService(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):
svInstance['SystemElement'] = sourceInstanceName
svInstance['CreationClassName'] = 'SE_StorageSynchronized_SV_SV'
svInstance['PercentSynced'] = 100
+ svInstance['CopyState'] = self.data.UNSYNCHRONIZED
svInstances.append(svInstance)
return svInstances
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(
RETRIES = 'storagetype:retries'
CIM_ERR_NOT_FOUND = 6
VOLUME_ELEMENT_NAME_PREFIX = 'OS-'
+SYNCHRONIZED = 4
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.