You can use the esxcli command or the vSphere Client to configure the NFS datastore depending on the NFS version and the configuration you want to set.
Understand the esxcli Command Parameters for NFS Datastores
Use the esxcli command to configure specific settings on NFS.
Command | Description |
---|---|
NFS 4.1: esxcli storage nfs41 add NFS 3: esxcli storage nfs add |
Adds a new NFS or NAS volume and mounts it with the given volume name on the ESXi host . |
NFS 4.1: esxcli storage nfs41 param set NFS 3: esxcli storage nfs param set |
Sets the NFS volume parameters. |
Option | Description |
---|---|
-H|--hosts=<str> |
NFS 4.1: The hostname or IP address of the server for the NFS 4.1 volume you want to add. You can add multiple NFS volumes separated with a comma. NFS 3: The hostname or IP address of the NAS volume you want to add and mount on the system. |
-I|--host-vmknic=<str> |
NFS 4.1: The hostname or IP address of the server for the NFS 4.1 volume you want to add followed by a colon(:) and the VMknic name. You can specify multiple names. Example: NFS 3: The hostname or IP address of the NAS volume you want to add. You can specify only one name. Example: |
-p|--ispe |
If set, this flag will set PE as the mount point. |
-r|--readonly |
If set, this flag will make the mount point be read-only. |
-a|--sec=<str> |
Security setting. Acceptable values are: AUTH_SYS, SEC_KRB5, and SEC_KRB5I. This option is applicable only for NFS 4.1 and later. |
-s|--share=<str> |
The share name to use for the NFS or NAS mount point on the remote system. This option is required. |
-v|--volume-name=<str> |
The volume name to use for the NFS or NAS mount. The volume name must be unique and should not conflict with existing NAS, NFS, VMFS, or other volume names. This option is required. |
-c|--connections=<long> |
The number of RPC connections to be established for the NFS datastore. A higher number of connections results in better performance on datastores with higher I/O load. |
-q|--maxqueuedepth=<long> |
The maximum queue depth for the NFS volume. This option can be used only with the param set command. |
Configure Multiple TCP Connections for NFS
You can configure NFS storage with multiple connections by using the nconnect option. For NFS 4.1, you can create multiple connections per session. For NFS 3, you can mount the datastore with multiple connections. Use the esxcli storage nfs41 command to configure multiple connections.
For NFS 4.1, setting up multiple connections does not impact multipathing. Multiple connections and multiple paths can co-exist.
Prerequisites
Set up the NFS storage environment.
Procedure
Configure VMkernel Binding for NFS Datastore
VMkernel port binding for the NFS datastore on an ESXi host allows you to bind an NFS volume to a specific VMkernel adapter to connect to an NFS server. With NFS datastores, you can isolate NFS traffic to a specific VMkernel adapter. To route the traffic to this adapter, connect the datastore to the adapter.
Configure VMkernel Binding for NFS 4.1 Datastores
To connect an NFS 4.1 datastore to a specific VMkernel adapter, use the esxcli storage nfs41 command. You can specify the VMkernel adapters either while mounting the NFS 4.1 datastore or, if the NFS datastore is already mounted with a specific VMkernel adapter, you can modify the existing NFS volume configuration to specify the desired VMkernel adapters.
Prerequisites
- Set up the NFS storage environment.
- Create and configure a VMkernel adapter on default TCP/IP stack.
Procedure
Configure VMkernel Binding for NFS 3 Datastores
For NFS 3 datastores, you can use the vSphere Client to connect the datastore to the desired VMkernel adapters.
Prerequisites
- Set up the NFS storage environment.
- Create and configure a VMkernel adapter on default TCP/IP stack.