Skip to content

Instantly share code, notes, and snippets.

@rushikeshjadhav
Last active September 30, 2019 12:36
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/3042c9e54d7d58c1bdebda3408598567 to your computer and use it in GitHub Desktop.
Save rushikeshjadhav/3042c9e54d7d58c1bdebda3408598567 to your computer and use it in GitHub Desktop.
--- a/opt/xensource/sm/nfs.py 2019-09-27 16:45:11.918853933 +0530
+++ b/opt/xensource/sm/nfs.py 2019-09-30 17:48:33.010514755 +0530
@@ -66,6 +66,8 @@
False otherwise.
"""
try:
+ if useroptions.find("ceph") < 0:
+ return True
sv = get_supported_nfs_versions(server)
return (True if nfsversion in sv else False)
except util.CommandException, inst:
@@ -137,7 +139,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'
@@ -158,6 +161,9 @@
options += ",retrans=%s" % retrans
if useroptions != '':
options += ",%s" % useroptions
+ if useroptions.find("ceph") >= 0:
+ options = useroptions
+ mountcommand = 'mount.ceph'
try:
util.ioretry(lambda:
--- a/opt/xensource/sm/NFSSR.py 2019-09-27 16:44:56.437557255 +0530
+++ b/opt/xensource/sm/NFSSR.py 2019-09-27 17:41:30.584197599 +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