-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support NFSv4 only environment #617
Conversation
What can be done next: Attempt a mount on / with nfs4 and:
What do you think @MarkSymsCtx? EDIT: Done. |
b7cc0d2
to
f093ab0
Compare
It's all generally horrible with NFSv4 but the above may help in a significant set of sub-cases. |
Okay, i'll try that then, it's still better than nothing. |
I don't know exactly how this works, but the current version of This means that the version we can extract from Another approach would be, after a first successful mount of Yet another approach would be always listing all version of NFSv4, and let it fail at |
I don't like this option, it can be deceptive to show supported versions and then fail when trying to use them. IMHO only displaying 4 is enough and let the mount decide on the version? |
ccf8420
to
58fba7c
Compare
Successfull tests on NFS3 & 4. |
Hey :) Any news on this? Is there anything left to do or simply getting validated? |
|
||
|
||
def scan_srlist(path, dconf): | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't particularly like how long this method has now become, it makes it quite cognitively hard to follow. Would be good to pull some of these long open coded blocks out into well named methods which describe what they're doing and then each one can be reviewed and understood in isolation (or ignored if not of interest to the current needs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, to a lesser extent, get_supported_nfs_versions
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can split in methods for NFS3 and NFS4Only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
2e00158
to
ae867b0
Compare
NFSv4 only environments don't support `rpcinfo` and `showmount` calls as they're missing NFSv3 services. When `rpcinfo` or `showmount` fails, try to mount NFSv4 pseudo FS '/' to add '4' to supported NFS versions and run `ls` on the mounted pseudo FS to offer the first folder level of exports. See: xapi-project#551 And: xcp-ng/xcp#135 Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
ae867b0
to
332cc68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor nit on method names.
Is there anything "useful" to see in the logging for this that will show it working?
drivers/nfs.py
Outdated
return dom | ||
|
||
|
||
def _scan_exports_nfs4_only(target, transport, dom, element): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that we have _scan_exports_nfs3
this should probably just be _scan_exports_nfs4
for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hesitated to add the _only
or not, both are okay for me so I can remove it if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done :)
In a NFS3/NFS3-4 env you should see the same logs as before since NFS4 only is a fallback in case of failure. I also added logs in case both methods failed before throwing an exception. |
Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
|
||
class NfsException(Exception): | ||
|
||
def __init__(self, errstr): | ||
self.errstr = errstr | ||
|
||
|
||
def check_server_tcp(server, nfsversion=DEFAULT_NFSVERSION): | ||
def check_server_tcp(server, transport, nfsversion=DEFAULT_NFSVERSION): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method is explicit (or is expected to be) in using TCP, so it should not have the transport argument. If get_suppoted_nfs_versions
needs a transport it should be passed as a literal from this method without changing the signature of the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed but transport can be tcp
or tcp6
in the case of IPv6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer an IPv6 boolean and the the transport given to get_supported_nfs_versions
would be 'tcp6' if ipv6 else 'tcp'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, that was not clear. Might have been better for the IPv6 bits to be at least a commit on their own right to make it clear. But would be difficult to split now so leave it as it is.
I think we need another validated reviewer to be able to merge this. Anyone in mind @MarkSymsCtx ? |
@olivierlambert I'd already added the extra reviewer |
Can you merge? Thanks! |
Mark is on vacation I will see if I can find somebody else who has permission to merge it. |
See: xapi-project#617 Signed-off-by: Benjamin Reis <benjamin.reis@vates.tech>
See: xapi-project#617 Signed-off-by: Benjamin Reis <benjamin.reis@vates.tech>
See: xapi-project#617 Signed-off-by: Benjamin Reis <benjamin.reis@vates.tech>
See: xapi-project#617 Signed-off-by: Benjamin Reis <benjamin.reis@vates.tech>
See: xapi-project#617 Signed-off-by: Benjamin Reis <benjamin.reis@vates.tech>
See: xapi-project#617 Signed-off-by: Benjamin Reis <benjamin.reis@vates.tech>
NFSv4 only environments don't support
rpcinfo
and
showmount
calls as they're missing NFSv3services.
When
rpcinfo
orshowmount
fails, try to mountNFSv4 pseudo FS '/' to add '4' to supported NFS versions
and run
ls
on the mounted pseudo FS to offer the firstfolder level of exports.
See: #551
And: xcp-ng/xcp#135