Change in vdsm[master]: gluster: Adds a new flag 'gluster3_7Support' to getVdsCaps.

dnarayan at redhat.com dnarayan at redhat.com
Mon Mar 30 06:12:25 UTC 2015


Darshan N has uploaded a new change for review.

Change subject: gluster: Adds a new flag 'gluster3_7Support' to getVdsCaps.
......................................................................

gluster: Adds a new flag 'gluster3_7Support' to getVdsCaps.

This patch adds a new flag 'gluster3_7Support' to getVdsCaps.
This flag specifies if the host has support for gluster-3.7
features like Geo-replication, Snapshot and Brick provisoning.
This is an optional flag, this flag is returned only if
gluster is enabled.

Change-Id: Ic203fa0565914d528ae457427f6f1ff7708017d2
Signed-off-by: Darshan N <dnarayan at redhat.com>
---
M vdsm/caps.py
M vdsm/rpc/vdsmapi-schema.json
2 files changed, 27 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/39324/1

diff --git a/vdsm/caps.py b/vdsm/caps.py
index 57c5b7e..f9b0193 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -57,6 +57,7 @@
 try:
     from gluster.api import GLUSTER_RPM_PACKAGES
     from gluster.api import GLUSTER_DEB_PACKAGES
+    from gluster.api import GlusterApi
     _glusterEnabled = True
 except ImportError:
     _glusterEnabled = False
@@ -599,6 +600,23 @@
         return False
 
 
+def _getGluster3_7FeatureSupport():
+    # Check if gluster 3.7 features are supported by this Vdsm.
+    # This Check is done by seeing if sample verbs for supporting
+    # gluster 3.7 features are available in gluster api.
+    if _glusterEnabled:
+        gluster3_7featureSampleVerbs = ('volumeSnapshotCreate',
+                                        'volumeGeoRepSessionCreate',
+                                        'storageDevicesList')
+        for feature in gluster3_7featureSampleVerbs:
+            if feature not in dir(GlusterApi):
+                return False
+        else:
+            return True
+    else:
+        return None
+
+
 def get():
     targetArch = getTargetArch()
 
@@ -693,6 +711,10 @@
 
     caps['hostdevPassthrough'] = str(_getHostdevPassthorughSupport()).lower()
 
+    gluster3_7FeatureSupport = _getGluster3_7FeatureSupport()
+    if gluster3_7FeatureSupport is not None:
+        caps['gluster3_7Support'] = str(gluster3_7FeatureSupport).lower()
+
     return caps
 
 
diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index 477f712..0cf2702 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -1269,6 +1269,10 @@
 # @directedPassthrough: Indicates status of Intel VT-d or AMD-vi
 #                       (new in version 4.17.0)
 #
+# @gluster3_7Support:   #optional Indicates if glusterfs-3.7 features are
+#                       supported in this host.
+#                       (new in version 4.17.0)
+#
 # Since: 4.15.0
 #
 # Notes: Since ovirt-engine cannot parse software versions in 'x.y.z' format,
@@ -1295,7 +1299,7 @@
           'autoNumaBalancing': 'AutoNumaBalancingStatus',
           'selinux': 'SELinuxStatus', '*liveSnapshot': 'bool',
           'kdumpStatus': 'int', '*liveMerge': 'bool',
-          'directedPassthrough': 'bool'}}
+          'directedPassthrough': 'bool', '*gluster3_7Support': 'bool'}}
 
 ##
 # @Host.getCapabilities:


-- 
To view, visit https://gerrit.ovirt.org/39324
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic203fa0565914d528ae457427f6f1ff7708017d2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N <dnarayan at redhat.com>


More information about the vdsm-patches mailing list