VMware vSphere

 View Only
Expand all | Collapse all

unable to copy files to nfs datastore : result empty file

  • 1.  unable to copy files to nfs datastore : result empty file

    Posted Apr 03, 2020 12:31 PM

    Hello,

    esx 5 on a server with storage disk.

    I added two external nas via nfs.

    On the one of two nas i can do everything but it's very small.

    On the other nas i have these important problems (named nasdico02pu)

    I can't copy from disk to nas a file, for example using ssh.

    # cp myfile.txt /vmfs/volumes/nasdico02pu

    # cp: can't open '/vmfs/volumes/nasdico02pu/myfile.txt': File exists

    Obviusly before copy there wasn't any file.

    The result is that in nasdico02pu i have the myfile.txt but it's empty (0KB)

    Using vsphere client i have the same result browsing datastore and trying to copy or move a file to nasdico02pu.

    On the other hand, always using vsphere client, browsing nasdico02pu datastore, i can upload files (with the button, i mean).

    Unfortunately i have to use the nas to make snapshots

    Please help, because i need it for backup.

    Andrea



  • 2.  RE: unable to copy files to nfs datastore : result empty file

    Broadcom Employee
    Posted Apr 03, 2020 01:23 PM

    It sounds like your second NAS doesn't have the no_root_squash option set

    https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/vmware-nfs-bestpractices-white-paper-en.pdf

    see page 11

    Kind regards,

    Fouad



  • 3.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 03, 2020 01:43 PM

    Thanks,

    but both nas are qnap and it's possible to set, as i have done, no_root_squash option (for qnap it's default option)



  • 4.  RE: unable to copy files to nfs datastore : result empty file

    Broadcom Employee
    Posted Apr 03, 2020 01:55 PM

    Is the permission type on the share set to NFS Host access?

    Are the Access rights set to no limit?

    Set up a VMware ESXi Datastore via NFS in QNAP Enterprise Storage | QNAP

    There was also some issue with an old firmware where NFS failed in strange ways...

    And also just to check the share isn't hosted on a USB drive attached to the back of the qnap?

    Kind regards,

    Fouad



  • 5.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 03, 2020 02:23 PM

    The share is exactly the same of the document. "No limit" / in my qnap version is the "read/write/.

    The qnap arrived yesterday to substitute the other one (that's works).

    Last firmware.

    No usb driver attached.



  • 6.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 03, 2020 01:33 PM

    try to copy files in vCenter GUI >> Under Datastore >>Browse file....



  • 7.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 03, 2020 01:50 PM

    i have not a vcenter connected to host but i tried browsing via host (vsphere client) and i have the same result that i have using console.

    It seems that when the copy process starts it creates an empty file called myfile.txt and then the process tries to create another file with the same name and hangs. As result i have an empty file.



  • 8.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 03, 2020 04:04 PM

    did you checked if you have sufficient space in that datastore and check if any other task already running for the same activity if yes then cancel all previous task and then try.



  • 9.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 03, 2020 04:04 PM

    I have new information about this scenario, if someone could help me.

    1. I can connect via nfs to the new nas, using an esx 6; and I can move file in it without any problem.
    2. I can connect via nfs to the new nas, using an esx 5 but when I try to move file i produce only an empty file (this post)
    3. I can't connect via nfs to new nas using an esx 4.

    All 3 hosts can connect and operate on the previus nas.

    The two nas are of the same firm, but differnt years an obviusly  the last one is bigger.



  • 10.  RE: unable to copy files to nfs datastore : result empty file

    Broadcom Employee
    Posted Apr 03, 2020 04:07 PM

    This is a useful data point!

    Check that the NAS is set for NFS version 3.1 only it sounds like there may be a 4.0 endpoint confusing the connection.



  • 11.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 03, 2020 04:32 PM

    I disabled nfs 4 option and restarted the nas.

    Same result, only esx 6 can operate with success on it.



  • 12.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 06, 2020 02:11 PM

    Hello,

    an adjournment

    Now I can connect to the nas using esx 4. It was a simple mistake in the nas's configuration. From this machine i can do everything on the nas. (as using the host with esx 6).

    Unfortunately i have the problem on esx 5 that it's the machine more important for this project.

    From this host i can connect to the nas (i can create nfs storage)  but i can not write on it: copying create an empty file.

    Could be a problem of routing ?

    We have two lan in esx, one for managment and vm (192.168.1) and one dedicated to nas link (10.10.20). The networks are separated.

    #esxcfg-vmknic -l

    Interface  Port Group/DVPort   IP Family IP Address                              Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled Type

    vmk0       Management Network  IPv4      192.168.1.65                            255.255.255.0   192.168.1.255   98:4b:e1:0c:6d:0c 1500    65535     true    STATIC

    vmk1       VMkernel                      IPv4      10.10.20.3                                255.255.255.0   10.10.20.255     00:50:56:66:79:63 9000    65535     true    STATIC

    esxcfg-route -l

    VMkernel Routes:

    Network          Netmask          Gateway          Interface

    10.10.20.0        255.255.255.0    Local Subnet     vmk1

    192.168.0.0      255.255.255.0    Local Subnet     vmk0

    default              0.0.0.0                 192.168.1.103   vmk0

    From result of the command of routing i see that i have two vmkernel routes.

    maybe I have to cancel the route 192.168.1? I'm afraid I can no longer manage the host by making a mistake.

    Thanks

    Andrea



  • 13.  RE: unable to copy files to nfs datastore : result empty file

    Posted Apr 06, 2020 02:22 PM

    i made a mistake copying data for the post.

    Obviusly the routing is

    10.10.20.0        255.255.255.0    Local Subnet     vmk1

    192.168.1.0      255.255.255.0    Local Subnet     vmk0

    default              0.0.0.0                 192.168.1.103   vmk0



  • 14.  RE: unable to copy files to nfs datastore : result empty file
    Best Answer

    Posted Apr 07, 2020 12:02 PM