VMware Cloud Community
cicco171
Enthusiast
Enthusiast
Jump to solution

unable to copy files to nfs datastore : result empty file

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

Reply
0 Kudos
1 Solution

Accepted Solutions
cicco171
Enthusiast
Enthusiast
Jump to solution

Reply
0 Kudos
13 Replies
vFouad
Leadership
Leadership
Jump to solution

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...

see page 11

Kind regards,

Fouad

sarikrizvi
Enthusiast
Enthusiast
Jump to solution

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

Regards,
SARIK (Infrastructure Architect)
vExpert 2018-2020 | vExpert - Pro | NSX | Security
vCAP-DCD 6.5 | vCP-DCV 5.0 | 5.5 | 6.0 | vCA-DCV 5 | vCA-Cloud 5 | RHCSA & RHCE 6 | A+ (HW & NW)
__________________
Please Mark "Helpful" or "Correct" if It'll help you
_____________________________________
@Follow:
Blog# https://vmwarevtech.com
vExpert# https://vexpert.vmware.com/directory/1997
Badge# https://www.youracclaim.com/users/sarik
Reply
0 Kudos
cicco171
Enthusiast
Enthusiast
Jump to solution

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)

cicco171
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
vFouad
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
cicco171
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
cicco171
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
sarikrizvi
Enthusiast
Enthusiast
Jump to solution

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.

Regards,
SARIK (Infrastructure Architect)
vExpert 2018-2020 | vExpert - Pro | NSX | Security
vCAP-DCD 6.5 | vCP-DCV 5.0 | 5.5 | 6.0 | vCA-DCV 5 | vCA-Cloud 5 | RHCSA & RHCE 6 | A+ (HW & NW)
__________________
Please Mark "Helpful" or "Correct" if It'll help you
_____________________________________
@Follow:
Blog# https://vmwarevtech.com
vExpert# https://vexpert.vmware.com/directory/1997
Badge# https://www.youracclaim.com/users/sarik
Reply
0 Kudos
vFouad
Leadership
Leadership
Jump to solution

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.

Reply
0 Kudos
cicco171
Enthusiast
Enthusiast
Jump to solution

I disabled nfs 4 option and restarted the nas.

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

Reply
0 Kudos
cicco171
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
cicco171
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
cicco171
Enthusiast
Enthusiast
Jump to solution

Finally i found the solution. I downgraded the nas to the same firmware that i have in the oldest.

All works like a charm.

I have found, over the net, only two posts about my same problem : everyone without a solution.

https://unix.stackexchange.com/questions/195414/mv-to-nfs-cannot-create-regular-file-file-exists-but...


https://www.ixsystems.com/community/threads/cp-to-nfs-operation-not-permitted-empty-file-created-and... https://www.ixsystems.com/community/threads/cp-to-nfs-operation-not-permitted-empty-file-created-and...

Reply
0 Kudos