Deepak C Shetty has uploaded a new change for review.
Change subject: glusterSD: BZ 988299: Deduce gluster volume name from domain metadata
......................................................................
glusterSD: BZ 988299: Deduce gluster volume name from domain metadata
Gluster volume name thats present as part of mount point path is
mangled, hence gluster volume lookup fails if volume has '_' or '/' in
it.
Use the pristine value of server:volname stored in domain metadata
to deduce the gluster volume name.
Change-Id: Ibfc8af4aa7ab028a7a6f0e691eae1c89f5148ee9
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=988299
Signed-off-by: Deepak C Shetty <deepakcs(a)linux.vnet.ibm.com>
---
M vdsm/storage/glusterVolume.py
1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/19219/1
diff --git a/vdsm/storage/glusterVolume.py b/vdsm/storage/glusterVolume.py
index 3368de3..1a1b40e 100644
--- a/vdsm/storage/glusterVolume.py
+++ b/vdsm/storage/glusterVolume.py
@@ -3,6 +3,7 @@
from sdc import sdCache
import supervdsm as svdsm
from gluster.exception import GlusterException
+from fileSD import REMOTE_PATH
class GlusterVolume(fileVolume.FileVolume):
@@ -15,10 +16,18 @@
"""
Send info to represent Gluster volume as a network block device
"""
- rpath = sdCache.produce(self.sdUUID).getRemotePath()
+
+ # Get the pristine remote path (hostname:volname) from MD,
+ # so that we don't end up using the mangled volume and/or hostnames.
+ rpath = sdCache.produce(self.sdUUID).getMetaParam(REMOTE_PATH)
rpath_list = rpath.rsplit(":", 1)
volfileServer = rpath_list[0]
- volname = rpath_list[1]
+ # Check for leading '/', since its perfectly valid to say
+ # hostname:/volname for gluster mounts.
+ if rpath_list[1][0] == '/':
+ volname = rpath_list[1][1:]
+ else:
+ volname = rpath_list[1]
# Volume transport to Libvirt transport mapping
VOLUME_TRANS_MAP = {'TCP': 'tcp', 'RDMA':
'rdma'}
--
To view, visit
http://gerrit.ovirt.org/19219
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfc8af4aa7ab028a7a6f0e691eae1c89f5148ee9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Deepak C Shetty <deepakcs(a)linux.vnet.ibm.com>