Discussion:
[Libstoragemgmt-devel] [PATCH 0/2] Bug fix for VOLUME_REPLICATE capability on EMC VNX.
Gris Ge
2014-12-09 07:42:06 UTC
Permalink
* EMC VNX might mark VOLUME_REPLICATE as supported with no actual support
of any volume replication type.

* This patch set ensure VOLUME_REPLICATE be set only after found at least
one supported volume replicate type in SMI-S plugin.

* A test case of plugin_test.py is also introduced to enforce this
rule.

Gris Ge (2):
SMI-S Plugin: Fix incorrect Capabilities report about VOLUME_REPLICATE
Plugin Test: Test for VOLUME_REPLICATE capability.

plugin/smispy/smis_cap.py | 8 +++++---
test/plugin_test.py | 10 ++++++++++
2 files changed, 15 insertions(+), 3 deletions(-)
--
1.8.3.1
Gris Ge
2014-12-09 07:42:07 UTC
Permalink
* When running capabilities() against EMC VNX array with not SnapView
license, we will get these capabilities report:
VOLUME_REPLICATE | SUPPORTED
VOLUME_REPLICATE_CLONE | UNSUPPORTED
VOLUME_REPLICATE_COPY | UNSUPPORTED
VOLUME_REPLICATE_MIRROR_ASYNC | UNSUPPORTED
VOLUME_REPLICATE_MIRROR_SYNC | UNSUPPORTED

* This patch changes the capabilities() of SMI-S plugin to only set
VOLUME_REPLICATE when support at lease on replication type.

* I got no access to any SnapView licensed EMC VNX array, this patch only
tested on arrays without SnapView license.

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/smispy/smis_cap.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/plugin/smispy/smis_cap.py b/plugin/smispy/smis_cap.py
index e027a22..e94146f 100644
--- a/plugin/smispy/smis_cap.py
+++ b/plugin/smispy/smis_cap.py
@@ -43,16 +43,18 @@ def _rs_supported_capabilities(smis_common, system_id, cap):

if dmtf.REPLICA_CAP_ACTION_CREATE_ELEMENT in async_actions or \
dmtf.REPLICA_CAP_ACTION_CREATE_ELEMENT in sync_actions:
- cap.set(Capabilities.VOLUME_REPLICATE)
+ pass
else:
return

if dmtf.REPLICA_CAP_TYPE_SYNC_SNAPSHOT_LOCAL in s_rt or \
dmtf.REPLICA_CAP_TYPE_ASYNC_SNAPSHOT_LOCAL in s_rt:
+ cap.set(Capabilities.VOLUME_REPLICATE)
cap.set(Capabilities.VOLUME_REPLICATE_CLONE)

if dmtf.REPLICA_CAP_TYPE_SYNC_CLONE_LOCAL in s_rt or \
dmtf.REPLICA_CAP_TYPE_ASYNC_CLONE_LOCAL in s_rt:
+ cap.set(Capabilities.VOLUME_REPLICATE)
cap.set(Capabilities.VOLUME_REPLICATE_COPY)
else:
# Try older storage configuration service
@@ -70,12 +72,12 @@ def _rs_supported_capabilities(smis_common, system_id, cap):
sct = cim_sc_cap['SupportedCopyTypes']

if sct and len(sct):
- cap.set(Capabilities.VOLUME_REPLICATE)
-
if dmtf.ST_CONF_CAP_COPY_TYPE_UNSYNC_ASSOC in sct:
+ cap.set(Capabilities.VOLUME_REPLICATE)
cap.set(Capabilities.VOLUME_REPLICATE_CLONE)

if dmtf.ST_CONF_CAP_COPY_TYPE_UNSYNC_UNASSOC in sct:
+ cap.set(Capabilities.VOLUME_REPLICATE)
cap.set(Capabilities.VOLUME_REPLICATE_COPY)
--
1.8.3.1
MaShimiao
2014-12-09 08:59:27 UTC
Permalink
Hi Gris,
Post by Gris Ge
* When running capabilities() against EMC VNX array with not SnapView
VOLUME_REPLICATE | SUPPORTED
VOLUME_REPLICATE_CLONE | UNSUPPORTED
VOLUME_REPLICATE_COPY | UNSUPPORTED
VOLUME_REPLICATE_MIRROR_ASYNC | UNSUPPORTED
VOLUME_REPLICATE_MIRROR_SYNC | UNSUPPORTED
IMO, the problem we need to solve is why VOLUME_REPLICATE is printed as SUPPORTED,
but none of the above volume_replicate_type is printed as SUPPORTED.
I'm not familiar with EMC VNX, but I think the old code seems more logical.
I'm afraid of if there are enough options as volume_replicate_type.

How do you think about that?
Did I miss something?


Best regards
Post by Gris Ge
* This patch changes the capabilities() of SMI-S plugin to only set
VOLUME_REPLICATE when support at lease on replication type.
* I got no access to any SnapView licensed EMC VNX array, this patch only
tested on arrays without SnapView license.
---
plugin/smispy/smis_cap.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/plugin/smispy/smis_cap.py b/plugin/smispy/smis_cap.py
index e027a22..e94146f 100644
--- a/plugin/smispy/smis_cap.py
+++ b/plugin/smispy/smis_cap.py
if dmtf.REPLICA_CAP_ACTION_CREATE_ELEMENT in async_actions or \
- cap.set(Capabilities.VOLUME_REPLICATE)
+ pass
return
if dmtf.REPLICA_CAP_TYPE_SYNC_SNAPSHOT_LOCAL in s_rt or \
+ cap.set(Capabilities.VOLUME_REPLICATE)
cap.set(Capabilities.VOLUME_REPLICATE_CLONE)
if dmtf.REPLICA_CAP_TYPE_SYNC_CLONE_LOCAL in s_rt or \
+ cap.set(Capabilities.VOLUME_REPLICATE)
cap.set(Capabilities.VOLUME_REPLICATE_COPY)
# Try older storage configuration service
sct = cim_sc_cap['SupportedCopyTypes']
- cap.set(Capabilities.VOLUME_REPLICATE)
-
+ cap.set(Capabilities.VOLUME_REPLICATE)
cap.set(Capabilities.VOLUME_REPLICATE_CLONE)
+ cap.set(Capabilities.VOLUME_REPLICATE)
cap.set(Capabilities.VOLUME_REPLICATE_COPY)
--
Ma Shimiao
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
Gris Ge
2014-12-09 07:42:08 UTC
Permalink
* Expected behaviour of Capabilities.VOLUME_REPLICATE:
Capabilities.VOLUME_REPLICATE should be only used with at least one of
these capabilities:
Cap.VOLUME_REPLICATE_CLONE
Cap.VOLUME_REPLICATE_COPY
Cap.VOLUME_REPLICATE_MIRROR_ASYNC
Cap.VOLUME_REPLICATE_MIRROR_SYNC

Signed-off-by: Gris Ge <***@redhat.com>
---
test/plugin_test.py | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/test/plugin_test.py b/test/plugin_test.py
index e92497c..e3d5d39 100755
--- a/test/plugin_test.py
+++ b/test/plugin_test.py
@@ -1267,6 +1267,16 @@ def test_create_delete_exports(self):
self.c.export_remove(exp)
self._fs_delete(fs)

+ def test_volume_rep_cap(self):
+ for s in self.systems:
+ cap = self.c.capabilities(s)
+ if supported(cap, [Cap.VOLUME_REPLICATE]):
+ self.assertTrue(
+ supported(cap, [Cap.VOLUME_REPLICATE_CLONE]) or
+ supported(cap, [Cap.VOLUME_REPLICATE_COPY]) or
+ supported(cap, [Cap.VOLUME_REPLICATE_MIRROR_ASYNC]) or
+ supported(cap, [Cap.VOLUME_REPLICATE_MIRROR_SYNC]))
+

def dump_results():
"""
--
1.8.3.1
Tony Asleson
2014-12-09 15:00:00 UTC
Permalink
Post by Gris Ge
* EMC VNX might mark VOLUME_REPLICATE as supported with no actual support
of any volume replication type.
Is this because the array doesn't have the required license?

Thanks,
Tony
Post by Gris Ge
* This patch set ensure VOLUME_REPLICATE be set only after found at least
one supported volume replicate type in SMI-S plugin.
* A test case of plugin_test.py is also introduced to enforce this
rule.
SMI-S Plugin: Fix incorrect Capabilities report about VOLUME_REPLICATE
Plugin Test: Test for VOLUME_REPLICATE capability.
plugin/smispy/smis_cap.py | 8 +++++---
test/plugin_test.py | 10 ++++++++++
2 files changed, 15 insertions(+), 3 deletions(-)
Gris Ge
2014-12-09 15:18:18 UTC
Permalink
Post by Tony Asleson
Post by Gris Ge
* EMC VNX might mark VOLUME_REPLICATE as supported with no actual support
of any volume replication type.
Is this because the array doesn't have the required license?
I haven't check with EMC yet. Will investigate more.

So the topics are:

1. SUPPORT + LsmError NOT_LICENSED
vs
UNSUPPORT
2. What's the use of capability VOLUME_REPLICATE when we have
VOLUME_REPLICATE_CLONE and etc?
I intend to mark VOLUME_REPLICATE as backward compatible
existence and suggest user to use VOLUME_REPLICATE_CLONE and
etc.
Post by Tony Asleson
Thanks,
Tony
--
Gris Ge
Loading...