TrueNAS NFS and VMware vSphere

Overview

I am not going to mention versions as as soon as I publish, I know they will be out of date. Either way, I was struggling to get TrueNAS NFS attached to my vSphere lab over the weekend and thought I would capture the details here for future reference. For personal reasons, I do not use NFS with my lab, but it was a requirement for a project I was working on and had to figure it out quickly.

TrueNAS Configuration

I already have a Pool configured, called vm-pool. I used all of the available disks for it. I carved out space for a ZFS Volume (ZVOL) for iSCSI and two datasets for NFS.

For the backups dataset, I also have a system user created.

Under the Sharing menu, I selected Unix Shares (NFS) and added two NFS paths.

The first one is for my virtual infrastructure backups, but I configured the paths the same. A few things I wanted to highlight that needed to be configured.

  • All dirs selected
  • Maproot User set to root
  • Maproot Group set to wheel

Under the Services menu, I started the NFS service. There are no configured options. I did experiment with the Bind IP Addresses option, but decided to leave it open.

The vSphere VMkernel port is configured on the same subnet as one of the TrueNAS VLAN interfaces.

When actually trying to connect to the TrueNAS NFS storage, it depended on the interface of the software I was making the connection from.

The first thing is to ensure that the firewall ports are open to the TrueNAS server. By default, TrueNAS uses TCP/UDP 111 and 2049 for NFS v3.

When asked for the server, use one of the configured Bind IP Addresses. If no Bind IP Addresses are configured, use one of the IP addresses from the TrueNAS Interfaces menu. Be sure that the subnet is the same so that you are not routing storage traffic. I use only layer 2 networks for storage.


vSphere Configuration

Configuring the Network

Added a distributed port group and then added a VMkernel Adapter to the connected hosts.

Configuring the Datastore

When trying to create the NFS datastore, the path tripped me up a few times. Turns out I needed to use the Path from TrueNAS for the Folder on vSphere and the Description from TrueNAS for the datastore name. The server address can be a fully qualified domain name or an IP address. Ensure the TrueNAS server is accessible from the VMkernel that is bound.


Leave a Reply

Your email address will not be published. Required fields are marked *