Table of Contents | ||
---|---|---|
|
Mounting the NFS Share from VMware vSphere
- Mount and use the NFS-shared volume as a VMware vSphere datastore.
- 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.
Note If the SoftNAS® IP has been added to DNS, use the SoftNAS® DNS name itself. - 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.
Note Repeat the above process for each VMware vSphere host that needs to access the datastore. In an HA configuration, Make sure that all VMware vSphere hosts have this NFS datastore configured.
- Once done, click the Next button.
Note |
---|
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:
Code Block language powershell theme Eclipse title NFS Client - Server OS Install-WindowsFeature NFS-Client
For a Windows Desktop instance, run the following in an Administrative PowerShell:
Code Block language powershell theme Eclipse title NFS Client - Desktop OS Enable-WindowsOptionalFeature -FeatureName ServicesforNFS-ClientOnly, ClientForNFS-Infrastructure -Online -NoRestart
Mount the share using the following command:
Code Block language powershell theme Eclipse title Mount Share mount -o anon nfs.share.server.name:/share-name X:
Note title Mount Share - Replace nfs.share.server.name with the name of SoftNAS NFS server.
- Replace share-name with the name of the NFS share.
- Replace X: with the desired drive letter.
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
Note |
---|
To mount the NFS volume from Linux, Unix or Mac OS, use the mount command as the root user: |
Code Block | ||||
---|---|---|---|---|
| ||||
mount -o rsize=32768,wsize=32768,noatime,intr <ip-address>:<export-path> <mnt-point>* |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
mkdir /myvol* mount 172.16.1.100:/naspool1/myvol01 /myvol* |
- The above command creates a new directory to be used as the mount point, then mounts a storage pool naspool1 with volume myvol01 at export path /naspool1/myvol01 to /myvol, on the SoftNAS® server at 172.16.1.100.
- For better performance, use the following command variation, which sets the read/write size to 32K and disables setting last access time and intr options
Code Block | ||||
---|---|---|---|---|
| ||||
mount -o rsize=32768,wsize=32768,noatime,intr <ip-address>:<export-path> <mount-point> |
- To unmount the filesystem, issue the following command:
Code Block | ||||
---|---|---|---|---|
| ||||
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
- The most common issue encountered when mounting and using an NFS volume are Access Denied and read-only types of problems.
- 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.