VMware – Add an NFS share to all hosts

Send Us a Sign! (Contact Us!)

You can use the Add Storage wizard to mount an NFS volume and use it as if it were a VMFS datastore. Adding an NFS datastore was easy with 5.0 (and prior) but with 5.1 it is even easier. Just a couple of steps to add an NFS datastore to your cluster:

Prerequisites

Because NFS requires network connectivity to access data stored on remote servers, before configuring NFS, you must first configure VMkernel networking.

Procedure (vSphere Desktop Client)

  • Log in to the vSphere Client and select the host from the Inventory panel.
  • Click the Configuration tab and click Storage in the Hardware panel.
  • Click Datastores and click Add Storage.
  • Select Network File System as the storage type and click Next.
  • Enter the server name, the mount point folder name, and the datastore name.
  • For the server name, you can enter an IP address, a DNS name, or an NFS UUID.
  • (Optional) Select Mount NFS read only if the volume is exported as read only by the NFS server.
  • Click Next.
  • In the Network File System Summary page, review the configuration options and click Finish.

Note: when you mount the same NFS volume on different hosts, make sure that the server and folder names are identical across the hosts. If the names do not match exactly, the hosts see the same NFS volume as two different datastores. This might result in a failure of such features as vMotion. An example of such discrepancy could be if you enter filer as the server name on one host and filer.domain.com on the other.

When an NFS share is mounted a unique identifier is created to ensure that this volume can be correctly identified. Now here comes the part where you need to pay attention, the UUID is created by calculating a hash and this calculation uses the “server name” and the folder name you specify in the “Add NFS Datastore” workflow.

VMware - Add an NFS share to all hosts

Precedure (vSphere Web Client)

  • Open the Web Client.
  • Go to your host under “vCenter” —> “Hosts and Clusters”.
  • Click “New Datastore”.
  • Provide a name for the datastore and click “Next”.
  • Select “NFS” and click “Next”. Fill out the NFS “Server” and “Folder” details and click “Next”.

VMware - Add an NFS share to all hosts

  • On “Host Accessibility” select all the hosts that need to connect to this NFS datastore and click “Next”.
  • Click “Finish”.
  • Note that a task is created for each of the hosts, you can see this in the “Recent Tasks” pane.

VMware - Add an NFS share to all hosts

If for whatever reason you added the NFS datastore to just one host and want to add it to another, just right click the host and click “Add Datastore”. If you provide the same name vCenter will recognize that it already exists and ask you if you want to use the details of the other NFS datastore with that name as shown in the screenshot below.

VMware - Add an NFS share to all hosts