The first thing I set up in the server closet was a TrueNAS Core server. If you are looking for a guide on installing TrueNAS core, a good one can be found here. With it already in place, it can be used to create an NFS share.
One of the major benefits of NFS is being able to easily migrate a container from one environment to another. By using the NFS, the container or VM is pulled over the network which allows any host to host ad hoc. When every Proxmox host mounts the same NFS backend, migrating VMs or containers between them takes seconds; migrations across unrelated storage take far longer.
TrueNAS NFS support
Creating a Network File System (NFS) share on TrueNAS gives the benefit of making lots of data easily available for anyone with share access. Depending how the share is configured, users accessing the share can be restricted to read or write privileges. To create a new share, make sure a dataset is available with all the data for sharing.
Creating an NFS Share
Go to Sharing > Unix Shares (NFS) and click ADD.
Use the file browser to select the dataset to be shared. An optional Description can be entered to help identify the share. Clicking SUBMIT creates the share. At the time of creation, you can select ENABLE SERVICE for the service to start and to automatically start after any reboots. If you wish to create the share but not immediately enable it, select CANCEL.
NFS Share Settings
| Setting | Value | Description |
|---|---|---|
| Path | file browser | Type or browse to the full path to the pool or dataset to share. Click ADD to configure multiple paths. |
| Description | string | Enter any notes or reminders about the share. |
| All dirs | checkbox | Set to allow the client to mount any subdirectory within the Path. Leaving disabled only allows clients to mount the Path endpoint. |
| Quiet | checkbox | Enabling inhibits some syslog diagnostics to avoid error messages. See exports(5) for examples. Disabling allows all syslog diagnostics, which can lead to additional cosmetic error messages. |
| Enabled | checkbox | Enable this NFS share. Unset to disable this NFS share without deleting the configuration. |
To edit an existing NFS share, go to Sharing > Unix Shares (NFS) and click more_vert > Edit. The options available are identical to the share creation options.
Configure the NFS Service
To begin sharing the data, go to Services and click the NFS toggle. If you want NFS sharing to activate immediately after TrueNAS boots, set Start Automatically.
NFS service settings can be configured from the Services page.
| Setting | Value | Description |
|---|---|---|
| Number of servers | integer | Specify how many servers to create. Increase if NFS client responses are slow. Keep this less than or equal to the number of CPUs reported by sysctl -n kern.smp.cpus to limit CPU context switching. |
| Bind IP Addresses | drop down | Select IP addresses to listen to for NFS requests. Leave empty for NFS to listen to all available addresses. |
| Enable NFSv4 | checkbox | Set to switch from NFSv3 to NFSv4. |
| NFSv3 ownership model for NFSv4 | checkbox | Set when NFSv4 ACL support is needed without requiring the client and the server to sync users and groups. |
| Require Kerberos for NFSv4 | checkbox | Set to force NFS shares to fail if the Kerberos ticket is unavailable. |
| Serve UDP NFS clients | checkbox | Set if NFS clients need to use the User Datagram Protocol (UDP). |
| Allow non-root mount | checkbox | Set only if required by the NFS client. Set to allow serving non-root mount requests. |
| Support >16 groups | checkbox | Set when a user is a member of more than 16 groups. This assumes group membership is configured correctly on the NFS server. |
| Log mountd(8) requests | checkbox | Set to log mountd syslog requests. |
| Log rpc.statd(8) and rpc.lockd(8) | checkbox | Set to log rpc.statd and rpc.lockd syslog requests. |
| mountd(8) bind port | integer | Enter a number to bind mountd only to that port. |
| rpc.statd(8) bind port | integer | Enter a number to bind rpc.statd only to that port. |
| rpc.lockd(8) bind port | integer | Enter a number to bind rpc.lockd only to that port. |
Unless a specific setting is needed, it is recommended to use the default settings for the NFS service. When TrueNAS is already connected to Active Directory, setting NFSv4 and Require Kerberos for NFSv4 also requires a Kerberos Keytab.
Proxmox NFS storage pool
On the Proxmox side, the NFS share gets added as a storage pool. In the Proxmox web UI, go to Datacenter > Storage > Add > NFS. Proxmox mounts the share for you, so there is nothing to add to /etc/fstab, and it can probe whether the server is online and list the exports it offers.
The fields that matter:
- ID - the name Proxmox will use for this storage.
- Server - the TrueNAS IP or DNS name. Prefer an IP address unless you have reliable DNS, to avoid mount-time lookup delays.
- Export - the NFS export path (you can list what the server offers with
pvesm nfsscan). - Content - pick what this storage holds; VM disks and containers are the usual choices for a shared backend.
- Nodes - leave as all nodes if every host should mount the same share.
Because the share is mounted by every host in the cluster, a VM or container living on this storage can be migrated between hosts without copying its disk. That is the payoff from the first half of this post.