Introduction to NFS
Network File System (NFS) is a distributed file system protocol that allows remote applications on other computers to access files over a network similar to how local storage is accessed. With NFS, you can bring the resources of the ES NAS to client platforms, providing the advantages of system-managed and high-performance storage, file access security, and centralized data access with the option of data encryption.
NFS uses the communication services provided by TCP/IP, a suite of protocols that includes the remote procedure call (RPC) and External Data Representation (XDR) protocols. RPC allows a program on one machine to start a procedure on another machine whereas XDR resolves the differences in data representation of different machines. NFS can then be used for file serving and sharing between workstations, personal computers, and other systems that run client software for NFS v2, v3 and v4 protocols.
The following figure illustrates the client-server relationship in an NFS environment. Using NFS, the client can mount all or part of the remote file system and make it appear as part of the local file system. From there the client user can create, delete, read, write, and treat the NFS server-located files as part of the workstation's own file system. On NFS Client 1, /home/data/NfsShared is the directory in the local client file system where the shared folder: /Share/ is to be mounted.
Use NFS Datastore in a vSphere environment
Since NFS is file-level storage, an NFS Datastore is ideal storage for file-level resource sharing. Using a QNAP ES NAS as an NFS server will be safe, efficient, and you will be able to use additional features that help utilize storage resources. For example, the online storage pool expansion and thin provisioning of the ES NAS allow you to extend datastores online without downtime. To use NFS as a shared repository, create a directory on the NFS server (i.e. the ES NAS) and then mount it as a datastore on all hosts.
Preparation for installation
We have learned that each of VMware hosts is able to connect to the ES NAS via NFS. And it allows you to mount an NFS volume and use it as if it were a Virtual Machine File System (VMFS) datastore, a special high-performance file system format that is optimized for storing virtual machines. We will demonstrate this implementation.
In our demonstration, the following configuration is used:
Storage device: QNAP ES NAS series with QES 1.1.1 (NAS operating system) or later.
vSphere ESXi hosts: VMware ESXi 6.0
IP addressing: Static IP addresses are recommended for both ESXi hosts and the ES NAS.
|vSphere ESXi hosts Network Settings|
|ESXi host A||192.168.217.1||VMware ESXi host|
|Data Network||10.10.10.1||10G Data port in ESXi host|
|Storage Network Settings|
|SCA Management IP||192.168.217.61||Management IP of Storage Controller A (SCA)|
|SCA Ethernet1 IP||10.10.10.61||Data port 1's IP address (SCA)|
|SCA Ethernet2 IP||10.10.20.61||Data port 2's IP address (SCA)|
|SCB Management IP||192.168.217.62||Management IP of Storage Controller B (SCB)|
|SCB Ethernet1 IP||10.10.10.62||Data port 1's IP address (SCB)|
|SCB Ethernet2 IP||10.10.20.62||Data port 2's IP address (SCB)|
|Storage Pool owned by SCA||Pool1||A storage pool with RAID6 configuration owned by Storage Controller A (SCA)|
Configure the ES NAS
Use the following procedures to configure the NAS for NFS share.
Enable the NFS service
1. Log into the NAS as an administrator (with the management IP address of the ES NAS: 192.168.217.61 or 62), go to "Control Panel" > "Network Services" > "WIN/NFS", and then select "Enable NFS Service".
Create a storage pool
Follow these steps to create a new storage pool:
- Go to "Storage Manager" > "STORAGE" > "Storage Space".
- Click "Create" > "New Storage Pool".
- Specify the pool name, choose the controller that the pool belongs to and select the enclosure unit, hard disk drive(s), RAID type, and then click "Next".
- Review the pool creation summary and click “Create”.
Please note that all data on the selected hard disk drive(s) will be erased. Click "OK" if you are certain about this.
A new storage pool will be created.
Add ESXi hosts to the trusted host list
1. Go to "Storage Manager" > "Hosts" to add a host.
2. To add a host, click "Create Host" and complete the alias name, description, IPv4 address, IPv6 address, network name, iSCSI IQN, and operating system fields for the host. Then click "Apply". For the IPv4, IPv6 address, network name, and iSCSI IQN fields, use "+" or "-" to add or remove an entry.
3. The added host will be shown on the trusted host list. You can edit or remove any host on the list.
Create a shared folder
Please follow this procedure to create a share folder:
1. Before creating a shared folder, please create a storage pool first. For instructions, please refer to the "Create a storage pool" section.
2. Go to "Storage Manager" > "STORAGE" > "Storage Space" and select "New Shared Folder" from the "Create" menu.
3. Enter the basic folder settings for the shared folder.
- Folder name: Enter the share name. The share name cannot contain " / \ [ ] : ; | = , + * ? < > ` '
- Description: Enter an optional description of the shared folder.
- Storage Pool: Select the storage pool where you would like to create the share folder.
4. Configure storage settings and services: Storage settings:
- Thin provision: This option will allow the storage capacity of the iSCSI Target to be dynamic and allocated on-demand. With thin provisioning, the system can allocate initialized space and increments this quantity when the used storage reaches the threshold. It allows the system to over-allocate the storage capacity regardless of the physical storage limit, and the physical disk space is used only when files are written into the share folder.
- Folder quota: Set the quote of the shared folder. If the quota is not specified, the size of the shared folder will be equal to that of the pool.
- Compression: The ES NAS utilizes ZFS’s inline data reduction, offering compression and deduplication options. When this option is enabled, more CPU resources of the NAS will be used but the size of the shared folder can be reduced.
- Deduplication: ZFS deduplication is the other data reduction method available on the ES NAS. This option allows the system to reduce the amount of storage needed by eliminating duplicate copies of data. However, it must be used with caution as it can become very computationally intensive in some workloads (e.g. streaming workloads). If enabling this option, it is recommended only to use this shared folder for workloads for which it works well and put other workloads on other shared folders that use compression instead.
- SSD cache: Enable SSD cache on this share folder. An SSD cache can be used to accelerate the performance of the NAS. Please note that at least one SSD needs to be installed to enable this function.
- Storage services: Set the sharing protocol for this shared folder from CIFS/SMB (Windows share), NFS (Linux share) or FTP/FTPS.
5. Access privileges for users: Select the way you want to specify access rights to the folder. If you select to specify the access rights by user or user group, you can select to grant read only, read/write, or deny access to the users or user groups.
6. Advanced settings
- Hidden Folder: Select to hide the shared folder or not in Microsoft Networking. When a shared folder is hidden, you have to enter the complete directory \\NAS_IP\share_name to access the share.
- Lock File (Oplocks): Opportunistic locking is a Windows mechanism for the client to place an opportunistic lock (oplock) on a file residing on a server in order to cache the data locally for improved performance. Oplocks is enabled by default for everyday usage and should be disabled on networks that require multiple users concurrently accessing the same files.
- Synchronous I/O: Select “Always” to always use synchronous file I/O or “Standard” for the system to deploy the file I/O approach (synchronous file I/O or asynchronous file I/O) based on applications. Use the default option if you are not sure which one to choose.
- Recycle Bin: Enable the Network Recycle Bin for created shared folders. "Restrict the access of Recycle Bin to administrators only for now" will ensure that files deleted and moved to the Network Recycle Bin can only be recovered by administrators. Please note that the Recycle Bin option is only available after you enable Network Recycle Bin in "Control Panel" > "Network Services" > "Network Recycle Bin".
7. WORM (Write once read many): If a shared folder is set as WORM, data cannot be modified once it is written into that shared folder. This assures that the data cannot be tampered with. There are two choices available for WORM: Enterprise and Compliance. With "Enterprise", users can delete the shared folder and for "Compliance", users need to remove the entire storage pool if they want to remove the WORM shared folder. The retention period can be used to specify the period before files in the folder can be deleted. Choose to enable WORM and the retention period based on your needs. Note that you cannot modify the WORM setting of a shared folder after creating it.
8. Folder Encryption: Select to enable folder encryption (with 256-bit AES encryption) using a password or a key. The encryption feature protects the confidential data of the folder from unauthorized access even if the hard drives or the entire NAS were stolen.
9. Save the encryption key: Save the encryption key on the NAS to automatically unlock and mount the encrypted disk volume after the NAS restarts.
- The password must be 8-16 characters long. Symbols (! @ # $ % ^ & * ( )_+ = ? ") are supported.
- You can only encrypt a shared folder when creating it. If a shared folder is created unencrypted, you cannot encrypt it afterward.
10. Click "create" to complete the setup.
Note: You will need the NFS Path for the Folder name when creating a datastore for ESXi hosts. To obtain NFS path information, please click next to NFS Path.
Configure NFS host access permissions
Please follow this procedure to configure the shared folder permissions for NFS host access:
1. Go to "Storage Manager" > "Storage Space", select the owning controller and the storage pool on which the shared folder was created, and then select the shared folder under "Shared Folder of Storage Pool Pool_name".
2. Select "Permissions". The Share Folder permission configuration window appears.
3. Select "NFS host access" in the "Select permission type" drop-down list to configure the NFS access rights for a network share.
This field allows you to assign users and groups that the users of NFS client should be mapped to on your system.
None for Map_Root
None for Map_ALL
4. Check "All hosts can access the shared folder" to apply the selected access right to all of hosts in the list. Or select specific hosts that this access right should be applied to.
5. Click "Apply" to save your changes.
Add a NFS datastore in a vSphere environment
After you have set up an NFS network share on the ES NAS, you can now use this share in your vSphere environment.
1. Log into vCenter, select the ESXi host on which you want to add the datastore. Then go to "Configuration" > "Storage", and select "Add Storage".
2. Select "Network File System" and click "Next".
3. Server: Enter the data port’s IP address of the Storage Controller on the ES NAS.
Folder: Enter the shared folder’s path. For more information, please refer to the “Create a shared folder” section.
Datastore Name: Give a name for this NFS share.
4. Confirm your settings and click "Finish".
5. You should see the added NFS datastore on the list.