Managing NFS/NAS Datastores
ESXi hosts can access a designated NFS volume located on a NAS (Network Attached Storage) server, can mount the volume, and can use it for its storage needs. You can use NFS volumes to store and boot virtual machines in the same way that you use VMFS datastores.
Capabilities Supported by NFS/NAS
ESXi hosts support the following shared storage capabilities on NFS volumes:
NAS stores virtual machine files on remote file servers that are accessed over a standard TCP/IP network. The NFS client built into the ESXi system uses NFS version 3 to communicate with NAS/NFS servers. For network connectivity, the host requires a standard network adapter.
In addition to storing virtual disks on NFS datastores, you can also use NFS as a central repository for ISO images, virtual machine templates, and so on.
To use NFS as a shared repository, you create a directory on the NFS server and then mount the directory as a datastore on all hosts. If you use the datastore for ISO images, you can connect the virtual machine's CD-ROM device to an ISO file on the datastore and install a guest operating system from the ISO file.
Adding and Deleting NAS File Systems
You can list, add, and delete a NAS file system with ESXCLI or with vicfg-nas.
Managing NAS File Systems with ESXCLI
You can use ESXCLI as a vCLI command with connection options (see Connection Options) or in the ESXi shell.
To manage a NAS file system
1
esxcli <conn_options> storage nfs list
For each NAS file system, the command lists the mount name, share name, and host name and whether the file system is mounted.
If no NAS file systems are available, the system does not return a NAS filesystem and returns to the command prompt.
2
Add a new NAS file system to the ESXi host. Specify the NAS server with --host, the volume to use for the mount with --volume-name, and the share name on the remote system to use for this NAS mount point with --share.
esxcli <conn_options> storage nfs add --host=dir42.eng.vmware.com --share=/<mount_dir> --volume-name=nfsstore-dir42
This command adds an entry to the known NAS file system list and supplies the share name of the new NAS file system. You must supply the host name, share name, and volume name for the new NAS file system.
3
esxcli <conn_options> storage nfs add --host=dir42.eng.vmware.com --share=/home --volume-name=FileServerHome2 --readonly
4
esxcli <conn_options> storage nfs remove --volume-name=FileServerHome2
This command unmounts the NAS file system and removes it from the list of known file systems.
Managing NAS File Systems with vicfg-nas
You can use vicfg-nas as a vCLI command with connection options. See Connection Options.
To manage a NAS file system
1
vicfg-nas <conn_options> -l
For each NAS file system, the command lists the mount name, share name, and host name and whether the file system is mounted. If no NAS file systems are available, the system returns the following message:
No NAS datastore found
2
vicfg-nas <conn_options --add --nasserver dir42.eng.vmware.com -s /<mount_dir> nfsstore-dir42
This command adds an entry to the known NAS file system list and supplies the share name of the new NAS file system. You must supply the host name and the share name for the new NAS file system.
3
vicfg-nas <conn_options> -a -y --n esx42nas2 -s /home FileServerHome2
4
vicfg-nas <conn_options> -d FileServerHome1
This command unmounts the NAS file system and removes it from the list of known file systems.