Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
--- /opt/xensource/sm/nfs.py 2019-02-24 02:25:32.303331185 +0530
+++ /opt/xensource/sm/nfs.py 2019-02-24 02:53:26.651909645 +0530
@@ -136,7 +136,8 @@
raise util.CommandException(code=errno.EOPNOTSUPP,
reason="No NFS service on host")
except util.CommandException, inst:
- raise NfsException("Failed to detect NFS service on server %s"
+ if useroptions.find("ceph") < 0:
+ raise NfsException("Failed to detect NFS service on server %s"
% remoteserver)
mountcommand = 'mount.nfs'
@@ -155,6 +156,10 @@
if useroptions != '':
options += ",%s" % useroptions
+ if useroptions.find("ceph") >= 0:
+ options = useroptions
+ mountcommand = 'mount.ceph'
+
try:
util.ioretry(lambda:
util.pread([mountcommand, "%s:%s"
@@ -291,3 +296,4 @@
nfs_retrans = val
return nfs_retrans
+
--- /opt/xensource/sm/NFSSR.py 2019-02-24 01:59:02.478251742 +0530
+++ /opt/xensource/sm/NFSSR.py 2019-02-24 02:54:05.322534575 +0530
@@ -137,7 +137,8 @@
def attach(self, sr_uuid):
if not self._checkmount():
self.validate_remotepath(False)
- util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget')
+ if self.dconf['options'].find("ceph") < 0:
+ util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget')
#Extract timeout and retrans values, if any
io_timeout = nfs.get_nfs_timeout(self.other_config)
io_retrans = nfs.get_nfs_retrans(self.other_config)
@@ -159,7 +160,8 @@
def probe(self):
# Verify NFS target and port
- util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget')
+ if self.dconf['options'].find("ceph") < 0:
+ util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget')
self.validate_remotepath(True)
self.check_server()
@@ -195,7 +197,8 @@
def create(self, sr_uuid, size):
- util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget')
+ if self.dconf['options'].find("ceph") < 0:
+ util._testHost(self.dconf['server'], NFSPORT, 'NFSTarget')
self.validate_remotepath(True)
if self._checkmount():
raise xs_errors.XenError('NFSAttached')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.