Skip to content

Instantly share code, notes, and snippets.

@rushikeshjadhav
Created February 23, 2019 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rushikeshjadhav/af53bb5747365875f0ab21bd3a64c6fe to your computer and use it in GitHub Desktop.
Save rushikeshjadhav/af53bb5747365875f0ab21bd3a64c6fe to your computer and use it in GitHub Desktop.
--- /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