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

Can't create ISO NFS SR via XOA #1845

Closed
hoerup opened this issue Dec 22, 2016 · 38 comments
Closed

Can't create ISO NFS SR via XOA #1845

hoerup opened this issue Dec 22, 2016 · 38 comments

Comments

@hoerup
Copy link

hoerup commented Dec 22, 2016

When Using XenCenter I have no problem creating a NFS SR pointing to this NFSv3 export 192.168.12.4:/Public

When I try to do the same thing in Xen Orchestra I just get an error:
"Server Detection

unknown error from the peer"

@julien-f
Copy link
Member

Which version are you using?

@olivierlambert
Copy link
Member

@hoerup please just enter the host address first (not the path), then click on the "search" icon.

@hoerup
Copy link
Author

hoerup commented Dec 22, 2016

Without path I get this in log:

Dec 22 11:11:14 xotest xo-server[1228]: Thu, 22 Dec 2016 11:11:14 GMT xen-api [email protected]: SR.probe(...) [173ms] =!> XapiError: SR_BACKEND_FAILURE_101(, The request is missing the serverpath parameter, )
Dec 22 11:11:14 xotest xo-server[1228]: Thu, 22 Dec 2016 11:11:14 GMT xo:api [email protected] | sr.probeNfs(...) [177ms] =!> TypeError: Cannot read property 'nfs-exports' of null

But with the path I get this:

Dec 22 11:11:59 xotest xo-server[1228]: Thu, 22 Dec 2016 11:11:59 GMT xen-api [email protected]: SR.probe(...) [151ms] =!> XapiError: SR_BACKEND_FAILURE_140(, Incorrect DNS name, unable to resolve., )
Dec 22 11:11:59 xotest xo-server[1228]: Thu, 22 Dec 2016 11:11:59 GMT xo:api [email protected] | sr.probeNfs(...) [155ms] =!> XapiError: SR_BACKEND_FAILURE_140(, Incorrect DNS name, unable to resolve., )

I'm using
XenServer 7
XOweb 5.5.0, XOserver 5.5.1 from source
nfs host is nfsv3 only

@julien-f
Copy link
Member

@hoerup you have to enter both the host and the path but in the two different inputs.

@hoerup
Copy link
Author

hoerup commented Dec 22, 2016

Well, there's the problem - I never get more than one input field
https://i.imgur.com/soVgebj.png

@julien-f
Copy link
Member

My bad, it's normal to have a single input.

The error with the path is normal: you should not put the path in the server input.

We cannot reproduce the other error.

@olivierlambert
Copy link
Member

@hoerup normally, XenServer should return:

XapiError: SR_BACKEND_FAILURE_101(, The request is missing the serverpath parameter, <?xml version="1.0" ?>
<nfs-exports>
	<Export>
		<Target>192.168.100.42</Target>
		<Path>/srv/nfs</Path>
		<Accesslist>*</Accesslist>
	</Export>
</nfs-exports>

)

In your case, it's like XAPI didn't return a XML with the list of exports.

@hoerup
Copy link
Author

hoerup commented Dec 22, 2016

The target is a Qnap nas running latest QTS(4.2).
Just for fun i tried install nfs server on a debian VM - and here works the XO nfs SR creation as expected

@olivierlambert
Copy link
Member

An interesting result would be to use xe sr-probe CLI to see the difference about the XML returned between QNAP and Debian.

@olivierlambert
Copy link
Member

Any news @hoerup ?

I tried to reproduce here, without success :(

@olivierlambert
Copy link
Member

Closing until we have news on this.

@snickson
Copy link

snickson commented Apr 8, 2018

Here are the xe CLI outputs:

# xe sr-probe type=nfs device-config:server=192.168.0.15 device-config:serverpath=/ISO
<?xml version="1.0" ?>
<SRlist/>
# rpcinfo -t 192.168.0.15 nfs
program 100003 version 2 ready and waiting
program 100003 version 3 ready and waiting
program 100003 version 4 ready and waiting
# showmount -e 192.168.0.15
Export list for 192.168.0.15:
/Web
/Public
/ISO
/Download
/Documents
/Development
/Backup

When trying to input the details for an NFS-ISO SR in XOA, I get this:
image

With the following in the logs: Cannot read property 'nfs-exports' of null | April 8, 2018, 7:21:28 PM

I've just had a thought though, does XO expect the be on the same network? My XO instance is in a cloud VM, and communicating with the XCP-ng server through a firewall (only port 443 and 5900 open).

@olivierlambert
Copy link
Member

Reopening to see if I can reproduce

@olivierlambert olivierlambert reopened this Apr 8, 2018
@olivierlambert olivierlambert changed the title Can't create NFS SR via XOA Can't create ISO NFS SR via XOA Apr 9, 2018
@olivierlambert olivierlambert self-assigned this Apr 9, 2018
@olivierlambert olivierlambert added this to the 5.19 milestone Apr 9, 2018
@olivierlambert
Copy link
Member

I can't reproduce here. Can you open a support tunnel that I test it myself in your XOA?

@snickson
Copy link

snickson commented Apr 11, 2018

I'm using XOA from source, but can deploy the turnkey appliance unless there is a way to open a support tunnel from the source build? I have re-deployed XOA to the same host where I am trying to set up the NFS mount, and getting the same symptoms.

Also found this in the SMLog when trying to search the NFS through the UI:

Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] lock: opening lock file /var/lock/sm/sr
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] lock: acquired /var/lock/sm/sr
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] sr_probe {'subtask_of': 'DummyRef:|46ff88fd-3f51-4fe2-a0c7-35a6641da7e0|SR.probe', 'sr_sm_config': {}, 'args': [], 'host_ref': 'OpaqueRef:b96b28fe-2ac7-4f47-aef5-25701a107508', 'session_ref': 'OpaqueRef:759a3696-fff3-404e-a4fb-7c022cfef939', 'device_config': {'SRmaster': 'true', 'server': '192.168.0.15'}, 'command': 'sr_probe'}
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] _testHost: Testing host/port: 192.168.0.15,2049
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] scanning2 (target=192.168.0.15)
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] scanning
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] ['/usr/sbin/showmount', '--no-headers', '-e', '192.168.0.15']
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   pread SUCCESS
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] Raising exception [101, The request is missing the serverpath parameter]
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] lock: released /var/lock/sm/sr
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] ***** generic exception: sr_probe: EXCEPTION <class 'SR.SROSError'>, The request is missing the serverpath parameter
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/SRCommand.py", line 110, in run
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     return self._run_locked(sr)
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/SRCommand.py", line 159, in _run_locked
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     rv = self._run(sr, target)
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/SRCommand.py", line 332, in _run
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     txt = sr.probe()
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/NFSSR", line 164, in probe
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     self.validate_remotepath(True)
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/NFSSR", line 109, in validate_remotepath
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     raise xs_errors.XenError('ConfigServerPathMissing')
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] ***** NFS VHD: EXCEPTION <class 'SR.SROSError'>, The request is missing the serverpath parameter
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/SRCommand.py", line 372, in run
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     ret = cmd.run(sr)
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/SRCommand.py", line 110, in run
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     return self._run_locked(sr)
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/SRCommand.py", line 159, in _run_locked
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     rv = self._run(sr, target)
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/SRCommand.py", line 332, in _run
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     txt = sr.probe()
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/NFSSR", line 164, in probe
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     self.validate_remotepath(True)
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]   File "/opt/xensource/sm/NFSSR", line 109, in validate_remotepath
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]     raise xs_errors.XenError('ConfigServerPathMissing')
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954]
Apr 11 13:36:21 nxnxcp-ng1 SM: [24954] lock: closed /var/lock/sm/sr

@olivierlambert
Copy link
Member

olivierlambert commented Apr 11, 2018

Please just type the server IP address in the server field, NOT the full path.

edit: hmm it seems you just entered the server address, correct?

@snickson
Copy link

That error is with just the IP, as per the XOA screenshot above.

@olivierlambert
Copy link
Member

Please import a XOA, create a support tunnel and then I'll try myself ASAP

@snickson
Copy link

I'm just importing and upgrading, then I will open a tunnel.

@olivierlambert
Copy link
Member

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>

@olivierlambert
Copy link
Member

So not XO related. Closing but still eager to know what could be the root cause :)

@olivierlambert olivierlambert removed this from the 5.19 milestone Apr 11, 2018
@aidanwardman
Copy link

I also have this issue: "Cannot read property 'nfs-exports' of null" using XO

Yet I can mount the NFS to the same host manually.

Tried both VDI SR NFS and ISO SR NFS ISO

image

@olivierlambert
Copy link
Member

This will be fixed in the today's release.

@olivierlambert olivierlambert added this to the 5.19 milestone May 5, 2018
@nilsan
Copy link

nilsan commented Dec 13, 2018

I have this problem running XCP-ng 7.6 with the latest patches, XOA 5.29.1, and a QNAP (TS-873U-RP) with the latest firmware 4.3.5.0760

Log message from Xen Orchestra

sr.probeNfs
{
  "host": "281bbf63-56c4-405e-b3fb-b48f8fc492b7",
  "server": "172.18.9.34"
}
{
  "message": "Cannot read property 'nfs-exports' of null",
  "stack": "TypeError: Cannot read property 'nfs-exports' of null
    at Xo.<anonymous> (/usr/local/lib/node_modules/xo-server/src/api/sr.js:389:26)
    at throw (native)
    at asyncGeneratorStep (/usr/local/lib/node_modules/xo-server/dist/api/sr.js:40:103)
    at _throw (/usr/local/lib/node_modules/xo-server/dist/api/sr.js:42:291)
    at run (/usr/local/lib/node_modules/xo-server-xoa/node_modules/core-js/modules/es6.promise.js:75:22)
    at /usr/local/lib/node_modules/xo-server-xoa/node_modules/core-js/modules/es6.promise.js:92:30
    at flush (/usr/local/lib/node_modules/xo-server-xoa/node_modules/core-js/modules/_microtask.js:18:9)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)"
}

xe sr-probe

[root@vm02 ~]# xe sr-probe type=nfs device-config:server=172.18.9.34
Error code: SR_BACKEND_FAILURE_101
Error parameters: , The request is missing the serverpath parameter,

showmount

[root@vm02 ~]# showmount -e 172.18.9.34
Export list for 172.18.9.34:
/vm      
/Public  
/Web     

rpcinfo

[root@vm02 ~]# rpcinfo -t 172.18.9.34 nfs
program 100003 version 4 ready and waiting

manual mount

[root@vm02 ~]# mount -v -t nfs 172.18.9.34:/vm /mnt
mount.nfs: timeout set for Thu Dec 13 12:08:33 2018
mount.nfs: trying text-based options 'vers=4,addr=172.18.9.34,clientaddr=10.187.2.8'
[root@vm02 ~]# df -h /mnt/
Filesystem       Size  Used Avail Use% Mounted on
172.18.9.34:/vm  5.5T   17G  5.5T   1% /mnt
[root@vm02 ~]# mount |grep mnt
172.18.9.34:/vm on /mnt type nfs4 (rw,relatime,vers=4.0,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.187.2.8,local_lock=none,addr=172.18.9.34)

@olivierlambert
Copy link
Member

@nilsan as discussed, it's a XCP-ng/XenServer issue, due to NFS v4 only on the server. Please create the issue here on XCP-ng side: https://github.com/xcp-ng/xcp/issues

@nilsan
Copy link

nilsan commented Dec 21, 2018

I'll create the issue, but the problem is identical on both NFSv3 and NFSv4.

@olivierlambert
Copy link
Member

I can't reproduce your issue if I have v3 enabled, so let's report what we can reproduce first ;)

@kevdogg
Copy link

kevdogg commented Mar 7, 2019

Not to piggyback on the same issue:

xe sr-probe

> # xe sr-probe type=nfs device-config:server=10.0.1.197
> Error code: SR_BACKEND_FAILURE_101
> Error parameters: , The request is missing the serverpath parameter, <?xml version="1.0" ?>
> <nfs-exports>
> 	<Export>
> 		<Target>10.0.1.197</Target>
> 		<Path>/mnt/tank/backups/Xen</Path>
> 		<Accesslist>10.0.1.0</Accesslist>
> 	</Export>
> 	<Export>
> 		<Target>10.0.1.197</Target>
> 		<Path>/mnt/tank/ISO</Path>
> 		<Accesslist>10.0.1.1</Accesslist>
> 	</Export>
> </nfs-exports>

mounts:

# 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

nfs info

# rpcinfo -t 10.0.1.197 nfs program 100003 version 2 ready and waiting program 100003 version 3 ready and waiting

@olivierlambert
Copy link
Member

My theory about this: xapi-project/sm#511

@Mohitsharma44
Copy link

Mohitsharma44 commented Sep 5, 2020

Another quick way that I was able to reproduce this on a fresh install of xcp-ng 8.1.0 and xen-orchestra (xo-server 5.64.1 and xo-web 5.67.0) is:

Start a simple NFS (v4 +) docker container on a linux host:

modprobe nfs nfsd
mkdir /nfsdata
docker run -d --name nfs --privileged -v /nfsdata:/nfsdata -e SHARED_DIRECTORY=/nfsdata -p 2049:2049 itsthenetwork/nfs-server-alpine:latest

# creating an empty file
touch /nfsdata/foo

exports file in the above container looks like:
/nfsdata *(rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash)

output of netstat -ntulp | 2049
tcp6 0 0 :::2049 :::* LISTEN 4972/docker-proxy

Xen-orchestra log when trying to add NFS ISO server:

sr.probeNfs
{
  "host": "e7add5b5-daef-4887-90a6-11ee9449fded",
  "server": "192.168.40.60"
}
{
  "message": "Cannot read property 'nfs-exports' of null",
  "name": "TypeError",
  "stack": "TypeError: Cannot read property 'nfs-exports' of null
    at Object.probeNfs (/home/node/xen-orchestra/packages/xo-server/src/api/sr.js:472:26)
    at runNextTicks (internal/process/task_queues.js:58:5)
    at processImmediate (internal/timers.js:431:9)
    at Api.callApiMethod (/home/node/xen-orchestra/packages/xo-server/src/xo-mixins/api.js:301:20)"
} 

From xcp-ng host:

xe sr-probe type=nfs device-config:server=192.168.40.60
Error code: SR_BACKEND_FAILURE_101

rpcinfo -T 192.168.40.60
   program version netid     address                service    owner
    100000    4    tcp6      ::.0.111               portmapper superuser
    100000    3    tcp6      ::.0.111               portmapper superuser
    100000    4    udp6      ::.0.111               portmapper superuser
    100000    3    udp6      ::.0.111               portmapper superuser
    100000    4    tcp       0.0.0.0.0.111          portmapper superuser
    100000    3    tcp       0.0.0.0.0.111          portmapper superuser
    100000    2    tcp       0.0.0.0.0.111          portmapper superuser
    100000    4    udp       0.0.0.0.0.111          portmapper superuser
    100000    3    udp       0.0.0.0.0.111          portmapper superuser
    100000    2    udp       0.0.0.0.0.111          portmapper superuser
    100000    4    local     /var/run/rpcbind.sock  portmapper superuser
    100000    3    local     /var/run/rpcbind.sock  portmapper superuser

# Manually mounting nfsshare works fine.
mkdir /mnt/testnfs
mount -t nfs 192.168.40.60:/ /mnt/testnfs

df -h
Filesystem                                                                                                 Size  Used Avail Use% Mounted on
devtmpfs                                                                                                   805M     0  805M   0% /dev
tmpfs                                                                                                      817M   48K  817M   1% /dev/shm
tmpfs                                                                                                      817M  8.9M  808M   2% /run
tmpfs                                                                                                      817M     0  817M   0% /sys/fs/cgroup
/dev/sda1                                                                                                   18G  1.7G   16G  10% /
xenstore                                                                                                   817M     0  817M   0% /var/lib/xenstored
/dev/sda5                                                                                                  3.9G   29M  3.6G   1% /var/log
/dev/mapper/XSLocalEXT--e890aea2--ff74--921a--a687--8f5e1a2aa04b-e890aea2--ff74--921a--a687--8f5e1a2aa04b   58G   53M   55G   1% /run/sr-mount/e890aea2-ff74-921a-a687-8f5e1a2aa04b
tmpfs                                                                                                      164M     0  164M   0% /run/user/0
192.168.40.60:/                                                                                            7.4G  4.6G  2.4G  66% /mnt/testnfs

# Verify we can see the empty file that was created on nfs server
ls /mnt/testnfs/
foo

@olivierlambert
Copy link
Member

Can you show the result of xe sr-probe please?

@Mohitsharma44
Copy link

Sure, looks like I had partially pasted the output in my previous comment.

xe sr-probe type=nfs device-config:server=192.168.40.60

Error code: SR_BACKEND_FAILURE_101
Error parameters: , The request is missing the serverpath parameter,

@olivierlambert
Copy link
Member

What about showmount -e 192.168.40.60?

@Mohitsharma44
Copy link

showmount -e 192.168.40.60
clnt_create: RPC: Port mapper failure - Unable to receive: errno 111 (Connection refused)

@olivierlambert
Copy link
Member

olivierlambert commented Sep 5, 2020

So this is not exactly the same issue than the previous one. You should at least got a share list available.

Fix that and then, we'll see the problem with XCP-ng/XO

edit: Google says "Firewall issues", eg https://www.linuxhelp.com/questions/showmount-command-failure

@Mohitsharma44
Copy link

Well.. Im using NFS v4 (4, 4.1, 4.2 only) so to secure things a bit more (and since technically I dont need rpcbind and its friends), I didnt have portmapper service running.
Let me have that listening and try again.
Will post an update here..
Thanks!

@Mohitsharma44
Copy link

Okay.. looks like if I have rpcbind process running on port 111, XO is able to look up the NFS server.

showmount -e 192.168.40.60
Export list for 192.168.40.60:
/nfsdata *

Above, I was not running rpcbind (since its no longer a requirement for NFSv4) and was using fsid=0 so my only share was "mountable" at the root i.e. at 192.168.40.60:/

I'm not sure (and maybe this is a "feature request") but maybe we should let users specify the path, if they know, instead of defaulting on probing?
My guess is some changes around

const paths = await probeSrNfs(host.id, server.value)
(but I could be wrong)

Thanks again!
Cheers!

@olivierlambert
Copy link
Member

Okay so it works and the original issue with QNAP (not reporting the * you have in showmount) isn't the same.

Regarding your feature request, yes, you can create a new issue for adding a SR with a path directly without doing a probe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants