Adding Windows Server NFS Shares to VMware ESX

KB ID 0000319

Problem

You have a Windows 2019/2016, 2012, or 2008 server with plenty of storage space, and you would like to present that to an ESX/ESXi server as a datastore. You can configure a folder (or drive) as an NFS share and present it to VMware vSphere, so that it can be used as a datastore.

Note: For Server 2008 and vSphere 4/5 Scroll down.

Create NFS Shares on Windows Server 2019, 2016, and 2012

Essentially you need to add the ‘Server for NFS’ role, (Below “File and Storage Services“).

Create a folder to share, on its properties > NFS Sharing > Manage NFS Sharing.

Tick to share > Permissions.

You can add each host individually here, but I’m just changing the default rule to allow Read/Write to ALL MACHINES > Tick ‘Allow root access’ > OK.

VMWare vSphere 6 Connecting to Windows NFS Shares

Make Sure you have a VMKernel port on the same network as your NFS share.

DataStore View > Right click the ‘Cluster‘ > Storage > New Datastore > NFS > Next > NFS 3 > Next.

Give the datastore a name > Select the share name (prefix it with a forward slash, and remember they are case sensitive!) > Enter the IP or FQDN of the NFS server > Next > Next > Finish.

Create NFS Shares on Windows Server 2008

Gotchas

1. The system will not work if you do not have a vmkernel port, if you already have iSCSI or vmotion working then this will already be in place.

If not you will see an error like this,

Call “HostDatastoreSystem.CreateNasDatastore” for object “ha-datastoresystem” on ESX “{name or IP of ESX server}” failed.

2. Make sure TCP port 2049 is open between the NFS share and the ESX box. On an ESX 3.x servers you may need to run ” esxcfg-firewall -e nfsClient “.

Other Points

1. You CAN boot a windows VM from any NFS store (just because Windows cannot boot from NFS – does not mean a VM can’t).

2. NFS Datastores are limited to 16TB.

3. vSphere supports up to 64 NFS Datastores (ESX supports up to 32).

4. Thin provisioned disks will “re-expand” when moved/cloned to another NFS Datastore (THOUGH NOT in a vSphere environment).

5. On Server 2008 R2 NFS can only support 16 TCP connections, to raise the limit see here.

Related Articles, References, Credits, or External Links

NA

VMware vSphere: Adding NFS Storage

KB ID 0001408

Problem

If you have some NFS storage, and you want to use it as a Datastore in your VMware environment, this is the procedure to follow.

Pre-Requisites

I’m assuming you already have a network connection between your ESX servers and the NAS box, (i.e you have a VM Kernel NIC) on the same network. I’m also assuming you have the NFS setup correctly, in this example I’m using  a Buffalo NAS box.

But you can also use a Windows NFS Share, see the follow article;

Solution

In Datastore View > Datastore > Add Datastore.

Next > NFS v3 > Next.

Enter your NFS mount details and IP address > Next > Select the Host(s) that will use the NFS storage > Next.

Finish

Related Articles, References, Credits, or External Links

VMware – Datastore Browser shows “Searching Datastore….”

KB ID 0000401 

Problem

I did a VMware VI3 to vSphere (4.1 U1) upgrade today. While bringing all the guest machines across, suddenly I could no longer browse the datastore, I only had one more guest to “Add to the inventory”, and all the mission critical machines were already migrated. I tried rebooting the virtual center, I tried restarting the ESXi host machines, still it sat saying “Searching Datastore……”.

Solution

1. I found the solution by accident. I was adding virtual machines to the new VSphere inventory, so I went in search of a method of doing it from the console, I was just about to:

Command to add a VMware guest to the inventory

[box]vmware-cmd -s register {full path to virtual machine}MACHINE_NAME.vmx[/box]

But, while looking in the folder with the guest files, I saw thousands of log files, I guess the VI client is struggling to parse them all, and display them. A quick internet search and I found out I can safely delete the log files.

2. Log into the ESX/ESXi servers console, for ESXi servers (version 4.0 and below) see here, for newer versions you can simply enable SSH access from Troubleshooting Mode Options > Enable Remote Tech support (SSH).

3. Log on as root and issue the following command to find the symlink path to your shared storage:

[box]ls -l /vmfs/volumes/[/box]

4. Now you know your symlink, you can change to the folder that contains the affected guest OS.

[box]cd /vmfs/volumes/{your symlink}/{your vm folder}[/box]

5. To get rid of all the log files, simply issue the following command.

[box]rm -f vmware-*.log[/box]

6. Now retry and you should see the folder contents when you “Browse Datastore”.

Related Articles, References, Credits, or External Links

NA