Darshan N has uploaded a new change for review.

Change subject: gluster: Added an optional argument to mountBrokerSetup verb.
......................................................................

gluster: Added an optional argument to mountBrokerSetup verb.

Added an optional argument called "partial" to mountBrokerSetup
verb. This argument takes boolean value. If true only mount broker
root creation is done as part of mountBrokerSetup, else along with
root creation user addition and few mount broker options are also
set.
This is introduced because in only one of the slave node's all the
operations mentioned above has to be done, this is synced to all
the remaining nodes automatically. Only mount broker root creation
has to be performed on all the slave nodes. Engine can call this
verb with partial as false on one of the nodes and on all the other
nodes verb can be called with partial set to true.

Change-Id: I732675c611221cf10f191f69990f78bd713da245
Signed-off-by: Darshan N <[email protected]>
---
M client/vdsClientGluster.py
M vdsm/gluster/api.py
M vdsm/gluster/apiwrapper.py
M vdsm/rpc/vdsmapi-gluster-schema.json
4 files changed, 20 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/41600/1

diff --git a/client/vdsClientGluster.py b/client/vdsClientGluster.py
index fa8a725..668babe 100644
--- a/client/vdsClientGluster.py
+++ b/client/vdsClientGluster.py
@@ -671,10 +671,12 @@
         remoteUserName = params.get('remoteUserName', '')
         remoteVolumeName = params.get('remoteVolumeName', '')
         remoteGroupName = params.get('remoteGroupName', '')
+        partial = (params.get('partial', 'no').upper() == 'YES')
 
         status = self.s.glusterGeoRepMountBrokerSetup(remoteUserName,
                                                       remoteGroupName,
-                                                      remoteVolumeName)
+                                                      remoteVolumeName,
+                                                      partial)
         pp.pprint(status)
         return status['status']['code'], status['status']['message']
 
@@ -1193,6 +1195,7 @@
              ('remoteUserName=remote_user_name'
               'remoteVolumeName=remote_volume_name'
               'remoteGroupName=remote_group_name',
+              '[partial={yes|no}]'
               'setup mount broker for geo replication'
               )),
          'glusterVolumeGeoRepSessionCreate': (
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 6aca2e7..7f7f85c 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -644,16 +644,17 @@
 
     @exportAsVerb
     def geoRepMountBrokerSetup(self, remoteUserName, remoteGroupName,
-                               remoteVolumeName, options=None):
+                               remoteVolumeName, partial=False, options=None):
         self.svdsmProxy.glusterCreateMountBrokerRoot(remoteUserName)
-        mountBrokerOptions = {'mountbroker-root': MOUNT_BROKER_ROOT,
-                              'geo-replication-log-group': remoteGroupName,
-                              'rpc-auth-allow-insecure': 'on'}
-        for optionName, optionValue in mountBrokerOptions.iteritems():
-            self.svdsmProxy.glusterExecuteMountBrokerOpt(optionName,
-                                                         optionValue)
-        self.svdsmProxy.glusterExecuteMountBrokerUserAdd(remoteUserName,
-                                                         remoteVolumeName)
+        if not partial:
+            mountBrokerOptions = {'mountbroker-root': MOUNT_BROKER_ROOT,
+                                  'geo-replication-log-group': remoteGroupName,
+                                  'rpc-auth-allow-insecure': 'on'}
+            for optionName, optionValue in mountBrokerOptions.iteritems():
+                self.svdsmProxy.glusterExecuteMountBrokerOpt(optionName,
+                                                             optionValue)
+            self.svdsmProxy.glusterExecuteMountBrokerUserAdd(remoteUserName,
+                                                             remoteVolumeName)
 
     @exportAsVerb
     def volumeGeoRepSessionCreate(self, volumeName, remoteHost,
diff --git a/vdsm/gluster/apiwrapper.py b/vdsm/gluster/apiwrapper.py
index 2298ebb..26eba7a 100644
--- a/vdsm/gluster/apiwrapper.py
+++ b/vdsm/gluster/apiwrapper.py
@@ -282,10 +282,11 @@
         return self._gluster.geoRepKeysUpdate(userName, geoRepPubKeys)
 
     def geoRepMountBrokerSetup(self, remoteUserName, remoteGroupName,
-                               remoteVolumeName):
+                               remoteVolumeName, partial=False):
         return self._gluster.geoRepMountBrokerSetup(remoteUserName,
                                                     remoteGroupName,
-                                                    remoteVolumeName)
+                                                    remoteVolumeName,
+                                                    partial)
 
     def geoRepSessionCreate(self, volumeName, remoteHost, remotVolumeName,
                             remoteUserName=None, force=False):
diff --git a/vdsm/rpc/vdsmapi-gluster-schema.json 
b/vdsm/rpc/vdsmapi-gluster-schema.json
index 6e7a629..74d68fb 100644
--- a/vdsm/rpc/vdsmapi-gluster-schema.json
+++ b/vdsm/rpc/vdsmapi-gluster-schema.json
@@ -2116,11 +2116,13 @@
 #
 # @remoteVolumeName:       Name of the remote volume
 #
+# @partial:                #optional if partial mount broker setup
+#
 # Since: 4.17.0
 ##
 {'command': {'class': 'GlusterVolume', 'name': 'geoRepMountBrokerSetup'},
  'data': {'remoteUserName': 'str', 'remoteGroupName': 'str',
-          'remoteVolumeName': 'str'}}
+          'remoteVolumeName': 'str', '*partial': 'bool'}}
 
 ##
 # @VolumeEmptyCheck:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I732675c611221cf10f191f69990f78bd713da245
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to