Skip to content
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

nfs sr-probe fails with QNAP NFS devices #511

Open
olivierlambert opened this issue Aug 27, 2020 · 2 comments
Open

nfs sr-probe fails with QNAP NFS devices #511

olivierlambert opened this issue Aug 27, 2020 · 2 comments

Comments

@olivierlambert
Copy link

olivierlambert commented Aug 27, 2020

Hi!

We had numerous reports of users having issues to create an NFS SR when using QNAP devices.

So it seems the problem is because the probe request (even on xe) doesn't return anything, eg:

xe sr-probe type=nfs device-config:server=192.168.0.15
Error code: SR_BACKEND_FAILURE_101
Error parameters: , The request is missing the serverpath parameter,

It should be:

xe sr-probe type=nfs device-config:server=192.168.0.15
Error code: SR_BACKEND_FAILURE_101
Error parameters: , The request is missing the serverpath parameter,
<nfs-exports>
	<Export>
		<Target>192.168.0.15</Target>
		<Path>/foo/bar</Path>
		<Accesslist>(everyone)</Accesslist>
	</Export>
</nfs-exports>

After some investigation, the common point was using a QNAP device, and having showmount to return share lists without any "permissions". Eg, an expected showmount would be:

# showmount -e 10.0.1.197
Export list for 10.0.1.197:
/mnt/tank/backups/Xen 10.0.1.0
/mnt/tank/ISO         10.0.1.1
/mnt/tank/home/kevdog 10.0.1.1

But with QNAP devices, for example:

# showmount -e 172.18.9.34
Export list for 172.18.9.34:
/vm      
/Public  
/Web     

I suppose this is the reason of the issue: in NFS probe function, it expects to have another row with the permission (IP or "everyone"). QNAP told us there's no possibility to modify permission for the NFS, so we can't test on that side.

Problem might be around here:

sm/drivers/nfs.py

Lines 187 to 216 in 46a8c7a

def scan_exports(target):
"""Scan target and return an XML DOM with target, path and accesslist."""
util.SMlog("scanning")
cmd = [SHOWMOUNT_BIN, "--no-headers", "-e", target]
dom = xml.dom.minidom.Document()
element = dom.createElement("nfs-exports")
dom.appendChild(element)
for val in util.pread2(cmd).split('\n'):
if not len(val):
continue
entry = dom.createElement('Export')
element.appendChild(entry)
subentry = dom.createElement("Target")
entry.appendChild(subentry)
textnode = dom.createTextNode(target)
subentry.appendChild(textnode)
(path, access) = val.split()
subentry = dom.createElement("Path")
entry.appendChild(subentry)
textnode = dom.createTextNode(path)
subentry.appendChild(textnode)
subentry = dom.createElement("Accesslist")
entry.appendChild(subentry)
textnode = dom.createTextNode(access)
subentry.appendChild(textnode)
return dom

It might be doable to manage this case when there's no ACLs visible for a share. At least, that's my theory, your input is welcome 👍

@edwintorok
Copy link
Contributor

Which QNAP device model? IIRC we do have some QNAP devices internally that do work, and there is a list of tested QNAP devices here: http://hcl.xensource.com/storage/?vendor=65
Or is this due to a non-default configuration?

@olivierlambert
Copy link
Author

Reports are coming (cf issues pointing to here) from QNAP TS-873U-RP (4.3.5.0760), and various QNAP OS version (QTS 4.4.1, and upper).

There's not a lot of NFS settings on their side, so there's nothing fancy in their config. Just seeing no ACLs whatsoever on the showmount command. Could it be the root cause of the issue? (parsing failing without this row)

benjamreis added a commit to xcp-ng/sm that referenced this issue Feb 25, 2021
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
stormi pushed a commit to xcp-ng/sm that referenced this issue Feb 25, 2021
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Apr 28, 2021
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Apr 29, 2021
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
xandrus pushed a commit to xandrus/sm that referenced this issue May 4, 2021
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue May 27, 2021
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue May 27, 2021
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Jun 22, 2021
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Jan 4, 2022
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Jun 14, 2022
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
andrey-podko pushed a commit to andrey-podko/sm that referenced this issue Aug 16, 2022
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Apr 17, 2023
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Apr 25, 2023
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Oct 13, 2023
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Dec 11, 2023
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Wescoeur pushed a commit to xcp-ng/sm that referenced this issue Feb 6, 2024
Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".

This commit fixes the crash when attempting to access the non existing ACL.
Relevant issues:
- xapi-project#511
- xcp-ng/xcp#113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants