Gris Ge
2014-10-14 10:08:20 UTC
* Some (EMC VMAX, Dot hill) SMI-S Providers allow duplicated
ElementName when creating replication, we have to do a pre-check by
enumerating all CIM_StroageVolume with 'ElementName' property only.
* EMC VMAX passed the 'TestPlugin.test_volume_replication' test of
plugin_test.py.
Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/smispy/smis.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/plugin/smispy/smis.py b/plugin/smispy/smis.py
index e57cb19..88d8e4b 100644
--- a/plugin/smispy/smis.py
+++ b/plugin/smispy/smis.py
@@ -1160,6 +1160,17 @@ class Smis(IStorageAreaNetwork):
rs = self._c.get_class_instance("CIM_ReplicationService", 'SystemName',
volume_src.system_id,
raise_error=False)
+
+ # Some (EMC VMAX, Dot hill) SMI-S Provider allow duplicated
+ # ElementName, we have to do pre-check here.
+ all_cim_vols = self._c.EnumerateInstances(
+ 'CIM_StorageVolume', PropertyList=['ElementName'])
+ for exist_cim_vol in all_cim_vols:
+ if name == exist_cim_vol['ElementName']:
+ raise LsmError(
+ ErrorNumber.NAME_CONFLICT,
+ "Volume with name '%s' already exists!" % name)
+
cim_pool_path = None
if pool is not None:
cim_pool_path = smis_pool.lsm_pool_to_cim_pool_path(self._c, pool)
ElementName when creating replication, we have to do a pre-check by
enumerating all CIM_StroageVolume with 'ElementName' property only.
* EMC VMAX passed the 'TestPlugin.test_volume_replication' test of
plugin_test.py.
Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/smispy/smis.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/plugin/smispy/smis.py b/plugin/smispy/smis.py
index e57cb19..88d8e4b 100644
--- a/plugin/smispy/smis.py
+++ b/plugin/smispy/smis.py
@@ -1160,6 +1160,17 @@ class Smis(IStorageAreaNetwork):
rs = self._c.get_class_instance("CIM_ReplicationService", 'SystemName',
volume_src.system_id,
raise_error=False)
+
+ # Some (EMC VMAX, Dot hill) SMI-S Provider allow duplicated
+ # ElementName, we have to do pre-check here.
+ all_cim_vols = self._c.EnumerateInstances(
+ 'CIM_StorageVolume', PropertyList=['ElementName'])
+ for exist_cim_vol in all_cim_vols:
+ if name == exist_cim_vol['ElementName']:
+ raise LsmError(
+ ErrorNumber.NAME_CONFLICT,
+ "Volume with name '%s' already exists!" % name)
+
cim_pool_path = None
if pool is not None:
cim_pool_path = smis_pool.lsm_pool_to_cim_pool_path(self._c, pool)
--
1.8.3.1
1.8.3.1