Mounting NFS Exports/Shares
Mounting the NFS Share from VMware vSphere
Log into vCenter (or VMware vSphere if managing VM hosts directly)
For each VMware vSphere host that needs shared access to the NFS-shared datastore, select the Configuration tab in VMware vSphere client.
Select the Storage option from left-side menu. The datastore list will be displayed.
Select the Add Storage option from upper-right menu. The Add Storage wizard will be displayed.
Select the Network File System option in the Storage Type section.
Click Next to continue. The Locate Network File System section of the wizard will be displayed.
In the Properties section, enter the IP address of the SoftNAS VM in the Server text entry box.
Enter the path of the folder for NFS export in the Folder text entry box.
Enter the name of the datastore in the Datastore Name text entry box.
The most common issue at this point is an Access Denied error when trying to mount the NFS export. This typically denotes that the Nobody option under Trust remove users was not chosen, or another security configuration setting may have a problem. Go back to the NFS export configuration panel, click on the NFS export and resolve the security issue. The settings shown above are known to work correctly with VMware vSphere (there may be other security settings preferred depending on environment.)
Mounting from Windows NFS Clients
Make sure that the NFS Client is installed on your Windows instance.
For a Windows Server instance, run the following in an Administrative PowerShell:
NFS Client - Server OS
Install-WindowsFeature NFS-ClientFor a Windows Desktop instance, run the following in an Administrative PowerShell:
NFS Client - Desktop OS
Enable-WindowsOptionalFeature -FeatureName ServicesforNFS-ClientOnly, ClientForNFS-Infrastructure -Online -NoRestart
Mount the share using the following command:
Mount Share
mount -o anon nfs.share.server.name:/share-name X:
NFS and Firewall Settings
Using NFS may involve opening additional ports in any firewalls that sit between SoftNAS® VMs and workload VMs, which will otherwise block traffic (esp. if traversing to an external IP in cloud-based situations).
The ports required for NFS client mounts, according to the settings located in /etc/sysconfig/nfs are displayed here on the right.
The ports were determined by logging into SoftNAS® and running an rpcinfo -p command, which displays the ports being used for RPC.
Be sure to should lock the address range down to only the subnet where allowed EC2 instances reside (or the particular IP range that's appropriate).
TCP Port | UDP Port | Source | Service |
|---|---|---|---|
111 | 111 | x.x.x.x/24 | portmapper |
2010 | 2010 | x.x.x.x/24 | rquotad |
2011 | 2011 | x.x.x.x/24 | nlockmgr |
2013 | 2013 | x.x.x.x/24 | mountd |
2014 | 2014 | x.x.x.x/24 | status |
2049 | 2049 | x.x.x.x/24 | nfs |
NFS Client Mount from Linux
To mount the NFS volume from Linux, Unix or Mac OS, use the mount command as the root user:
mount -o rsize=32768,wsize=32768,noatime,intr <ip-address>:<export-path> <mnt-point>*EXAMPLE: Where <ip-address> is the IP address (or DNS name) of the SoftNAS® server, <export-path> is the path chosen when exporting the filesystem via NFS and <mnt-point> is the mount point in the local filesystem.
mkdir /myvol*
mount 172.16.1.100:/naspool1/myvol01 /myvol*
mount -o rsize=32768,wsize=32768,noatime,intr <ip-address>:<export-path> <mount-point>
umount <name_of_pool>/<name_of_volume>NFS v4 and Authentication Considerations
NFS v4 provides for separation of filesystem metadata and file data I/O, improving performance and throughput. It is also possible to configure NFS v4 to operate in conjunction with Kerberos and LDAP for user authentication. Use of an authentication server allows each user who mounts and accesses NFS exports to have their unique user ID (uid) and group ID (gid) maintained on the NFS server.
More details on configuring NFS v4 and use of NFS in conjunction with kerberos and LDAP.
Common NFS Issues
Access Denied - This typically happens when trying to mount an NFS export that has been restricted by IP address range, user ID or other permission restrictions. Try opening up the NFS export for access by any IP address and Everyone; i.e., loosen the security up during initial testing, then lock it back down one step at a time.
Read-Only Access - When this happens, it is possible to mount the filesystem, but not possible to write to the mounted filesystem. This is a security permissions issue. Try opening up the permissions on the NFS export to Everyone as a starting point, then with a working NFS mount, choose to lock the security down incrementally.
NFS ID Mapping Disabled - When this happens, check the "/sys/module/nfsd/parameters/nfs4_disable_idmapping" and change the default value, "N", to "Y" and restart the NFS service.