Tuesday, 6 March 2012

Using NFS for ESX/ESXi

Last week I attended a VMware training course and this week I was trying to set up a nfs datastore but I was making no headway, it always failed to mount from vSphere:
Create NFSTest datastore 172.10.121.213
Error during the configuration of the host : NFS Error: Unable to Mount filesystem: Unable to connect to
NFS server
I then remembered the training course. ESX only supports NFS 3, so I mounted the NFS share from a linux box using nfs 3:
mount <host>:/shareddir /localdir -o nfsvers=3
This worked fine from linux but not from ESX.

Network connectivity existed, i.e. I could ping and telnet on port 2049 to the NFS server, yet ESX stubbornly refused to mount the NFS share.

After doing a little bit of reading, I learnt that I was using the wrong ping command, I should have used vmkping instead, which dutifully failed to reach the NFS server.

It turns out that VMKernel needs to be able to connect to the NFS server and due to network segmentation (VLANs) the ESX hosts could not reach the NFS server from the existing VMKernel connections. So I added another VMKernel connection and I was able to mount the share with this following command:
esxcfg-nas -a nfstest -o nfsserver -s /shareddir
Although this was on a ESX 4 host, this command exists on ESXi 5.0 too.

2 comments:

  1. The functionality may exist in esxi5 but something significant has changed since 4.0 (beyond the UDP and NFS3). All my NFS shares that connected just fine in 4.1 get an "access denied" when mounting with ESXi5.01. I'm 6 hours into troubleshooting with no traction on the resolution.

    ReplyDelete