Change in vdsm[master]: Add feature to create dispersed volume
tjeyasin at redhat.com
tjeyasin at redhat.com
Tue Feb 3 10:43:03 UTC 2015
Timothy Asir has uploaded a new change for review.
Change subject: Add feature to create dispersed volume
......................................................................
Add feature to create dispersed volume
Added disperse count and redundancy count params into
create volume function which provides options to create
a dispersed volume.
Change-Id: I50f6dbae8d179c09480634c64d7d439ae82d72a2
Signed-off-by: Timothy Asir <tjeyasin at redhat.com>
---
M client/vdsClientGluster.py
M vdsm/gluster/api.py
M vdsm/gluster/apiwrapper.py
M vdsm/gluster/cli.py
M vdsm/rpc/vdsmapi-gluster-schema.json
5 files changed, 28 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/37474/1
diff --git a/client/vdsClientGluster.py b/client/vdsClientGluster.py
index a5065f3..1139222 100644
--- a/client/vdsClientGluster.py
+++ b/client/vdsClientGluster.py
@@ -32,6 +32,8 @@
params = self._eqSplit(args)
brickList = params.get('bricks', '').split(',')
volumeName = params.get('volumeName', '')
+ disperseCount = params.get('disperse', '')
+ redundancyCount = params.get('redundancy', '')
replicaCount = params.get('replica', '')
stripeCount = params.get('stripe', '')
transport = params.get('transport', '')
@@ -39,6 +41,7 @@
force = (params.get('force', 'no').upper() == 'YES')
status = self.s.glusterVolumeCreate(volumeName, brickList,
+ disperseCount, redundancyCount,
replicaCount, stripeCount,
transportList, force)
pp.pprint(status)
@@ -522,6 +525,7 @@
{'glusterVolumeCreate': (
serv.do_glusterVolumeCreate,
('volumeName=<volume_name> bricks=<brick[,brick, ...]> '
+ '[disperse=<count>] [redundancy=<count>] '
'[replica=<count>] [stripe=<count>] [transport={tcp|rdma}] '
'[force={yes|no}]\n\t'
'<volume_name> is name of new volume',
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 04e0f33..33f1724 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -79,10 +79,12 @@
remoteServer)}
@exportAsVerb
- def volumeCreate(self, volumeName, brickList, replicaCount=0,
+ def volumeCreate(self, volumeName, brickList, disperseCount=0,
+ redundancyCount=0, replicaCount=0,
stripeCount=0, transportList=[],
force=False, options=None):
return self.svdsmProxy.glusterVolumeCreate(volumeName, brickList,
+ disperseCount, redundancyCount,
replicaCount, stripeCount,
transportList, force)
diff --git a/vdsm/gluster/apiwrapper.py b/vdsm/gluster/apiwrapper.py
index d42f8ba..4f0689b 100644
--- a/vdsm/gluster/apiwrapper.py
+++ b/vdsm/gluster/apiwrapper.py
@@ -111,9 +111,10 @@
def list(self, volumeName=None, remoteServer=None):
return self._gluster.volumesList(volumeName, remoteServer)
- def create(self, volumeName, brickList, replicaCount=0, stripeCount=0,
- transportList=[], force=False):
- return self._gluster.volumeCreate(volumeName, brickList, replicaCount,
+ def create(self, volumeName, brickList, disperseCount=0, redundancyCount=0,
+ replicaCount=0, stripeCount=0, transportList=[], force=False):
+ return self._gluster.volumeCreate(volumeName, brickList, disperseCount,
+ redundancyCount, replicaCount,
stripeCount, transportList, force)
def start(self, volumeName, force=False):
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index d9ecd66..d161801 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -475,9 +475,13 @@
@makePublic
-def volumeCreate(volumeName, brickList, replicaCount=0, stripeCount=0,
- transportList=[], force=False):
+def volumeCreate(volumeName, brickList, disperseCount=0, redundancyCount=0,
+ replicaCount=0, stripeCount=0, transportList=[], force=False):
command = _getGlusterVolCmd() + ["create", volumeName]
+ if disperseCount:
+ command += ["disperse", "%s" % disperseCount]
+ if redundancyCount:
+ command += ["redundancy", "%s" % redundancyCount]
if stripeCount:
command += ["stripe", "%s" % stripeCount]
if replicaCount:
diff --git a/vdsm/rpc/vdsmapi-gluster-schema.json b/vdsm/rpc/vdsmapi-gluster-schema.json
index 5924fd9..bba7126 100644
--- a/vdsm/rpc/vdsmapi-gluster-schema.json
+++ b/vdsm/rpc/vdsmapi-gluster-schema.json
@@ -660,17 +660,21 @@
#
# Create a Gluster volume
#
-# @volumeName: Gluster volume name
+# @volumeName: Gluster volume name
#
-# @bricklist: List of bricks
+# @bricklist: List of bricks
#
-# @replicaCount: #optional Replica count for volume
+# @disperseCount: #optional Disperse count for volume
#
-# @stripeCount: #optional Stripe count for volume
+# @redundancyCount: #optional Redundancy count for volume
#
-# @transportList: #optional Transport type
+# @replicaCount: #optional Replica count for volume
#
-# @force: #optional Force create Volume (new in version 4.14.0)
+# @stripeCount: #optional Stripe count for volume
+#
+# @transportList: #optional Transport type
+#
+# @force: #optional Force create Volume (new in version 4.14.0)
#
# Returns:
# uuid of the volume
@@ -679,6 +683,7 @@
##
{'command': {'class': 'GlusterVolume', 'name': 'create'},
'data': {'volumeName': 'str', 'bricklist': ['str'],
+ '*disperseCount': 'int', '*redundancyCount': 'int',
'*replicaCount': 'int', '*stripeCount': 'int',
'*transportList': ['transType'], '*force': 'bool'},
'returns': 'UUID'}
--
To view, visit http://gerrit.ovirt.org/37474
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I50f6dbae8d179c09480634c64d7d439ae82d72a2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin at redhat.com>
More information about the vdsm-patches
mailing list