This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Integrations

Articles about using TrueNAS with various 3rd party applications.

Integrations discusses how TrueNAS can work with different third-party applications to create unique or efficient storage management environments.

AWS Images (Obsolete)

Obsolete Content

This content is obsolete and is not functional for Amazon AMI creation. See Amazon’s Knowledge Center for guidance on creating custom Amazon Machine Images (AMIs) .

Obsolete TrueNAS 13.0 AMI Creation Steps

Process Summary

  • Requirements
    • FreeBSD system
    • AWS Account
    • S3 Bucket
    • User with permissions for EC2
      • Download the user key to the local working directory and modify
    • Install bhyve and bsdec2-image-upload
    • Patch bsdec2-image-upload if needed
  • Create TrueNAS image file
    • Download TrueNAS .iso
    • Create blank image file
    • Load virtualization module
    • Create tap and bridge interface
    • Load image and iso into bhyve
    • Install TrueNAS
  • Upload image to EC2
    • Description and region name are required
  • Launch EC2 instance
    • Select name created with image
    • t2.large is the recommended instance type
    • Add HDD/SSD volumes as needed
    • Step 6: add new rule
      • Type: http
    • Launch the instance
  • Wait for AWS to finish status checks
  • Paste Public DNS or Public IP link in browser to access TrueNAS web interface

Using Virtualized TrueNAS 13.0 with Amazon Web Services (AWS)

These instructions demonstrate how to create a virtualized TrueNAS image on FreeBSD, configure it with Amazon Elastic Compute Cloud (EC2), and access the TrueNAS web interface. There are a few things that must be prepared before building the image.

The FreeBSD system needs two applications to create, configure, and upload the virtual machine image: bhyve and bsdec2-image-upload . The most recent version (>=1.3.1) of bsdec2-image-upload is required, otherwise an SSL error occurs when attempting to upload the image. If not available on the ports tree, the utility is available from the GitHub repository .

Currently, bsdec2-image-upload fails on images that aren’t 10GB. An issue has been created, but in the meantime a workaround is to edit main.c and replace:

"BlockDeviceMapping.1.Ebs.VolumeSize=10&"

with

"BlockDeviceMapping.1.Ebs.VolumeSize=16&"

To build, use a FreeBSD system with either libressl-devel or openssl-devel, as well as ca_root_nss, and run make install.

Create an AWS account with an S3 bucket . Record the region associated with the S3 bucket. Set the bucket lifetime policy to delete data after 1 day, as bsdec2-image-upload does not delete files from S3 and the files are no longer needed after the AMI is registered. A user with permissions to EC2 and S3 is must have these permissions:

s3:PutObject
s3:GetObject
ec2:RegisterImage
ec2:DescribeImages
s3:DeleteObject
ec2:ImportVolume
ec2:DescribeConverstionTasks
ec2:CreateSnapshot
ec2:DescribeSnapshots
ec2:DeleteVolume
ec2:DescribeRegions
ec2:CopyImage
ec2:ModifyImageAttribute

Alternatively, give full access to S3 and EC2.

After creating the IAM user, download an Access Key to the working directory on the FreeBSD system. The file has these lines:

Access key ID,Secret access key
{ACCESS_KEY},{SECRET}

Open a new file called KEY.pem and copy the information contained in the csv file:

ACCESS_KEY_ID={ACCESS_KEY}
ACCESS_KEY_SECRET={SECRET}

Create TrueNAS Image

When all the prerequisites are ready, download a TrueNAS 11.2 or later .iso file . Open a shell and go to your local working directory. Create an empty raw image file with truncate -s 16G {TRUENAS}.img. Replace {TRUENAS} with a image file name. This empty image is the installation target for the TrueNAS .iso.

Next, load the virtualization module and create a tap and bridge interface:

kldload -n vmm
ifconfig tap0 create
sysctl net.link.tap.up_on_open=1
ifconfig bridge0 create
ifconfig bridge0 addm re0 addm tap0
ifconfig bridge0 up

Use bhyveload -m 4GB -d truenas.img vm0 to load the image into the hypervisor and create virtual machine vm0 with four gigabytes of memory.

To install TrueNAS into the image, load both the image and TrueNAS .iso file into bhyve: bhyve -c 2 -m 4G -H -A -P -g 0 -s 0,hostbridge -s 1,lpc -s 2,virtio-net,tap0 -s 3,virtio-blk,{TRUENAS}.img -s 31,ahci-cd,{TRUENAS-VERSION}.iso -l com1,stdio vm0. Replace {TRUENAS} with the name of the image file and {TRUENAS-VERSION} with the TrueNAS .iso file name.

The commands failed?

If these commands fail, for instance an error concerning boot.lua, then try this command which uses a combines the two previous commands in a shell script included in the bhyve installation.

sh /usr/share/examples/bhyve/vmrun.sh -c 2 -m 4GB -t tap0 -d {TRUENAS}.img -i -I {TRUENAS-VERSION}.iso vm0

When the TrueNAS installer opens, make sure boot with BIOS is chosen and start the installation. Power off the device when the installation is done.

Why can't I just restart? Do not load the completed image into bhyve and boot after installation as TrueNAS creates invalid network settings. If network issues occur, boot the image and create a DHCP interface manually named xn0.

Upload TrueNAS Image to EC2

Now that the image is created and configured, upload it to EC2. Use bsdec2-image-upload with the image file: bsdec2-image-upload --public {TRUENAS}.img TrueNAS {description} {region} {S3 bucket} KEY.pem. Replace {TRUENAS} with the image file name, {description} with a unique identifier for the Amazon Machine Image (AMI), {region} with your Amazon region , and {S3 bucket} with your AWS image storage location. KEY.pem is the IAM user access key that was downloaded earlier. These elements are required for the upload to start.

bsdec2-image-upload sends the image to the AWS bucket in 10 MiB segments. The upload can take several hours, depending on connection speeds and other factors.

When the S3 bucket upload completes, the script creates a snapshot, registers the AMI, and copies the AMI to all regions for mirrors.

The upload command failed? The upload command can fail for various reasons. For example, entering a description that already exists. If this happens, fix the error and rerun the command. When successful, the upload simply finishes.

Accessing TrueNAS with the AMI

With the Amazon Machine Image (AMI) created and uploaded to AWS, an EC2 instance needs to be activated before the TrueNAS interface is accessible. Log in to your Amazon Web Services account and click the EC2 Compute service.

Find the Launch instance section, open the Launch instance drop down, and click Launch instance.

The instance launcher follows several steps:

  1. Click My AMIs and select the name that was uploaded by bsdec2-image-upload.
  2. Any instance will work, but t2.large is recommended for TrueNAS given an 8GB memory recommendation.
  3. Skip this step.
  4. Add EBS volumes according to your TrueNAS use case. At minimum, add a couple of cold HDD volumes for a storage pool. General purpose SSD volumes can be used as L2ARC or SLOG devices.
  5. Skip this step.
  6. Add a rule with http. This allows you to connect to the TrueNAS web interface.
  7. Review your settings and press Launch.

The running instance is added to the EC2 dashboard or can be seen in the Instances menu. When the image has fully started, AWS performs two status checks. The first checks for AWS uptime, and the second verifies the instance is functional. After both checks pass, paste either the Public IP or Public DNS link in a new browser window to connect to the TrueNAS web interface.

Asigra Plugin

Asigra provides a TrueNAS plugin to simplify cloud storage backups with their service. The Asigra plugin connects TrueNAS to a third-party service and is subject to licensing. TrueNAS must have a public static IP address for Asigra services to function. Please read the Asigra Software License Agreement before using this plugin.

Asigra also provides this installation guide for the Asigra Backup Plugin for TrueNAS .

To begin using Asigra services after installing the plugin, expand the plugin options and click Register. A new browser tab opens to register a user with Asigra .

Refer to the Asigra documentation for details about using the Asigra platform:

  • DS-Operator Management Guide : Using the DS-Operator interface to manage the plugin DS-System service. Click Management in the plugin options to open the DS-Operator interface.
  • DS-Client Installation Guide : How to install the DS-Client system. DS-Client aggregates backup content from endpoints and transmits it to the DS-System service.
  • DS-Client Management Guide : Managing the DS-Client system after it has been successfully installed at one or more locations.

Containers

TrueNAS can be used as backing storage for container workloads.

The democratic-csi driver (available at https://github.com/democratic-csi/democratic-csi ) allows users to integrate popular container solutions like Kubernetes, Nomad, Cloud Foundry, or Mesos into the TrueNAS CLI. The driver is sponsored by and officially supported by TrueNAS for TrueNAS Enterprise Customers.

A CSI (Container Storage Interface) is an interface between container workloads and third-party storage that supports creating and configuring persistent storage external to the orchestrator, its input/output (I/O), and its advanced functionality such as snapshots and cloning.

The democratic-csi focuses on providing storage using iSCSI, NFS, and SMB protocols, and includes several ZFS features like snapshots, cloning, and resizing.

Features

  • dynamically provisions/de-provision storage and shares it as appropriate for cluster usage
  • online resize operations to dynamically expand volumes as needed
  • cross-architecture (amd64, armv7, arm64)

Installation

There are 3 steps to integrating a container solution in TrueNAS:

  1. Prepare TrueNAS.
  2. Prepare the nodes (ie: your Kubernetes cluster nodes).
  3. Deploy your container orchestrator.

Prepare TrueNAS for a Container Solution

We recommend using TrueNAS 12.0-U2.1+. However, the driver typically works with previous versions too, but is unsupported. Before you start, log in to TrueNAS, go to Services, and make sure iSCSI, NFS, and SSH are enabled.

Create Pools

Go to Storage > Pools and create the pools to include in your container.

Set up SSH

Now you need to ensure that a supported shell is used by the user account that your container solution can use to SSH to TrueNAS. Go to Accounts > Users and set the desired user’s Shell to either bash or sh, then click SAVE.

Set up NFS

  1. Go to Services and click the next to NFS to edit its properties.
  2. Make sure Enable NFSv4, NFSv3 ownership model for NFSv4, and Allow non-root mount are checked, then click SAVE.

Set up iSCSI

  1. Go to Sharing > Block Shares (iSCSI).
  2. Use the default settings in the Target Global Configuration tab.
  3. In the Portals tab, click ADD, then create a *Description. Set the IP Address to 0.0.0.0 and the Port to 3260, then click SUBMIT.
  4. In the Initiators Groups tab, click ADD. For ease of use, check the Allow ALL Initiators, then click SAVE. You can make restrictions later using the Allowed Initiators (IQN) function.
  5. Kubernetes will create Targets and Extents automatically.

Prepare the Nodes

Install and configure the requirements for both NFS and iSCSI.

iSCSI

<div class="admonition note">
  <div class="admonition-header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 125.7-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"/></svg>
    <span>Note</span>
  </div>
  <div class="admonition-content">
    <p>Multipath is supported for the <code>iscsi</code>-based drivers. Configure multipath with multiple portals in the configuration as needed.</p>

If you are running Kubernetes with rancher/rke, please see https://github.com/rancher/rke/issues/1846 .

SMB

When using Windows based machines, you might need to enable guest access, even if you are connecting with credentials.

Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters AllowInsecureGuestAuth -Value 1
Restart-Service LanmanWorkstation -Force

Deploy Your Orchestrator Into the Cluster

Kubernetes

Kubernetes is “an open-source system for automating deployment, scaling, and management of containerized applications.”

Deploy the Driver (Helm Installation)

helm repo add democratic-csi https://democratic-csi.github.io/charts/
helm repo update

# helm v2
helm search democratic-csi/

# helm v3
helm search repo democratic-csi/

# copy proper values file from https://github.com/democratic-csi/charts/tree/master/stable/democratic-csi/examples
# edit as appropriate
# examples are from helm v2, alter as appropriate for v3

# add --create-namespace for helm v3
helm upgrade \
--install \
--values freenas-iscsi.yaml \
--namespace democratic-csi \
zfs-iscsi democratic-csi/democratic-csi
helm upgrade \
--install \
--values freenas-nfs.yaml \
--namespace democratic-csi \
zfs-nfs democratic-csi/democratic-csi

Non-standard Kubelet Paths

When using a distribution with a non-standard kubelet path (such as minikube and microk8s), a new kubelet host path is required. Example:

microk8s helm upgrade \
  --install \
  --values freenas-nfs.yaml \
  --set node.kubeletHostPath="/var/snap/microk8s/common/var/lib/kubelet"  \
  --namespace democratic-csi \
  zfs-nfs democratic-csi/democratic-csi

Multiple Deployments

You can install multiple deployments of each or any driver. You will need:

  • a new helm release name for each deployment
  • a unique csiDriver.name in the values file
  • a unique name for each storage class (per cluster)
  • a unique parent dataset (don’t try to use the same parent across deployments or clusters)

Snapshot Support

Install beta (v1.17+) CRDs (once per cluster):

kubectl apply -f snapshot.storage.k8s.io_volumesnapshotclasses.yaml
kubectl apply -f snapshot.storage.k8s.io_volumesnapshotcontents.yaml
kubectl apply -f snapshot.storage.k8s.io_volumesnapshots.yaml

Install snapshot controller (once per cluster):

# replace namespace references to your liking
kubectl apply -f rbac-snapshot-controller.yaml
kubectl apply -f setup-snapshot-controller.yaml

Install democratic-csi as usual with volumeSnapshotClasses defined as appropriate.

Openshift

Openshift is another addon to Kubernetes and generally works fine with the democratic-csi. You will need to set special parameters with helm (support added in chart version 0.6.1):

# for sure required
--set node.rbac.openshift.privileged=true
--set node.driver.localtimeHostPath=false
# unlikely, but in special circumstances may be required
--set controller.rbac.openshift.privileged=true

Nomad

Nomad is a “simple and flexible workload orchestrator to deploy and manage containers and non-containerized applications across on-prem and clouds at scale.”

The democratic-csi works in Nomad with limited functionality and has to be deployed as a set of jobs. The controller job runs as a single instance, and the node job runs on every node and manages mounting the volume.

Read the Nomad Support page in the democratic-csi GitHub for detailed setup instructions. Visit the Nomad Storage Plugins page to learn how Nomad manages dynamic storage plugins.

Mesos

Mesos is an open source cluster manager that abstracts CPU, memory, storage, and other compute resources away from machines (physical or virtual), enabling fault-tolerant and elastic distributed systems to easily be built and run effectively.

Cloud Foundry

Cloud Foundry is an open source cloud platform as a service (PaaS) on which developers can build, deploy, run and scale applications.

As always, we welcome and encourage contributions from the community!

Additional Resources

CSI Driver

CSI Driver Overview

The TrueNAS CSI (Container Storage Interface) Driver is an official TrueNAS product that enables Kubernetes clusters to dynamically provision, manage, and consume storage from TrueNAS storage systems. The driver automatically creates storage volumes on-demand from Kubernetes, and leverages ZFS capabilities such as snapshots, clones, and compression in Kubernetes. The driver provides native Kubernetes integration via industry-standard CSI specifications.

The CSI driver supports snapshots, clones, ZFS compression (with no extra setup), and supports both file (NFS) and block (iSCSI) storage protocols. Standard Kubernetes uses K8s APIs and works with all K8s tooling. The CSI driver integration leverages TrueNAS investment in Kubernetes environments.

Storage administrators set up TrueNAS and the storage guardrails (StorageClasses), and thereafter developers can create the storage volumes they need through YAML files, bypassing the need to submit IT requests for the storage they need.

The CSI driver is ideal for:

  • Stateful applications in Kubernetes, like databases (PostgreSQL, MySQL, MongoDB), content management systems, CI/CD build caches, and application persistence.
  • DevOps and development, like development environments with persistent data, shared build artifacts, and testing environments
  • Data-intensive workloads, like big data processing (Spark, Hadoop), ML/AI training data storage, media processing and transcoding
  • Enterprise Kubernetes deployments, like multi-tenant Kubernetes clusters needing reliable storage, hybrid cloud deployments with on-premises storage, and edge computing with local TrueNAS systems.

The CSI driver is simple to use. Developer/users only need to create PVCs using the StorageClass cluster administrators setup, and the driver handles everything else.

Additional CSI Driver Articles

  • CSI Driver Administrators Guide
  • Provides Kubernetes cluster administrators with the information needed to deploy the TrueNAS CSI Driver integration with Kubernetes, including information on setting up StorageClasses.

    • CSI Driver User Guide
    • Provides information for Kubernetes developer/users of the TrueNAS CSI Driver.

      • CSI Driver Reference
      • Provides information on best practices, example StorageClasses, glossary of terms, troubleshooting and diagnostic commands, and API commands related to the TrueNAS CSI Driver integration with Kubernetes.

        CSI Driver Administrators Guide

        Configuration Overview

        This article is for Kubernetes cluster administrators who perform the one-time configuration of Kubernetes that consists of:

        • Setting up each worker node that can use the CSI driver
        • Deploying the TrueNAS CSI driver in Kubernetes

        After receiving the authentication credentials from the TrueNAS administrator, they then establish communication with TrueNAS using the API authentication key provided by TrueNAS and the TrueNAS system IP address.

        The TrueNAS administrator does the one-time setup that consists of:

        • Creating an API key for Kubernetes authentication
        • Setting up a pool to use for storage
        • Turning on the appropriate service (nfs for file or iscsi for block storage requests)
        • Supplying the Kubernetes administrator with the API and IP address of the TrueNAS system

        Each Kubernetes cluster user (developer) creates a YAML file that specifies the volume size, access mode, StorageClass, etc., then submits this PVC request in Kubernetes using a kubectl command. TrueNAS receives the request, adds the requested volumes based on the StorageClass information received in the yaml file.

        The CSI driver does the work of communicating what is received from Kubernetes, passes it to TrueNAS, and then sends information from TrueNAS back to Kubernetes where users can mount the storage volume(s) requested.

        Prerequisites

        • Kubernetes Cluster Requirements

          • Kubernetes Version 1.20 or higher
          • Node OS Linux (Ubuntu, RHEL, Debian, etc.)
        • Required packages on Kubernetes nodes:

          • For NFS: nfs-common (Debian/Ubuntu) or nfs-utils (RHEL/CentOS)
          • For iSCSI: open-iscsi (Debian/Ubuntu) or iscsi-initiator-utils (RHEL/CentOS)
        • Privileges: Cluster admin access for installation

        TrueNAS Requirements

        • TrueNAS SCALE 25.10.0 or later

        • Services enabled:

          • NFS service (for NFS volumes)
          • iSCSI service (for iSCSI volumes)
        • Network connectivity - Kubernetes nodes must reach TrueNAS IP

        • Storage pool - provide at least one ZFS pool with space available to meet user needs

        • API key with administrative privileges to authenticate Kubernetes connections

        • TrueNAS network requirements:

          • TrueNAS WebSocket API Port 443 (HTTPS/WSS)
          • NFS Port 2049 (TCP/UDP)
          • iSCSI Port 3260 (TCP)
          • Firewall that allows Kubernetes pod network CIDR to reach TrueNAS

        Configuring TrueNAS

        Share Creation

        The CSI driver automatically creates datasets and NFS shares or iSCSI targets with UUID-based names, which are not human-readable. For example, a path like /mnt/Tank1/pvc-538b3b31-2619-4cda-837a-57a47c40e8df. Do not modify or delete these auto-created shares or targets.

        Log in to TrueNAS:

        1. Generate an API key for Kubernetes.

          a. Click Settings on the top toolbar, then click My API Keys to open the User API Keys screen. b. Click Add, enter a name for the key, for example, Kubernetes or CSI driver. c. Click Save. d. Copy the key to a txt file or a document you keep secured, and backed up regularly.

          Provide this to the Kubernetes cluster administrator, who should enter this key in Kubernetes along with the TrueNAS IP address to establish authenticated communication with TrueNAS.

          For more information on TrueNAS API keys, see Managing API Keys .

          To locate the IP address for TrueNAS, go to System > Network. The primary network interface is listed in the Interfaces card.

        2. Enable the NFS service if using NFS, or enable the iSCSI service if using iSCSI.

          a. Go to System > Services. b. Edit the service settings to provide the required port access. For the NFS service, set TCP port 2049, and set UDP port 2049. For iSCSI, set TCP port 3260. c. Click Save. d. Click the enable-service toggle to turn on the NFS and/or iSCSI services based on your use case. If you installed the nfs-common package on the Kubernetes worker nodes, enable the NFS service. If you installed the open-iscsi package on the Kubernetes worker nodes, enable the iSCSI service.

        3. Create a new pool or locate a pool with enough storage to accommodate the Kubernetes cluster storage needs. Go to Storage Dashboard, identify a pool with enough storage capacity to suit your use case, or click Create Pool to add a new pool for Kubernetes volumes. For more information on creating new pools, see Creating Pools . To increase storage in an existing pool, see Expanding a Pool in Managing Pools .

        4. Verify the WebSocket API port is set to port 443. Go to System > General Settings. The GUI card should show the Web Interface HTTPS port set to 443. If not, click Settings, locate the Web Interface HTTPS Port field and change the value to 443. Click Save after making a change.

          Provide the pool name to the Kubernetes cluster administrator.

        Verifying the Network Configuration

        Check with your network administrator to verify the Kubernetes cluster can communicate with the TrueNAS server.

        Configuring Kubernetes

        First, download the container image and the deploy/truenas-csi-driver.yaml file found here:

          Or fetch it directly using the following command:

        curl -O https://raw.githubusercontent.com/truenas/truenas-csi/master/deploy/truenas-csi-driver.yaml

        For standard Kubernetes, the user needs to edit deploy/truenas-csi-driver.yaml before deploying. They update the ConfigMap with their TrueNAS connection details (URL, pool name, NFS server address, iSCSI portal) and the Secret with their API key. Then kubectl apply -f deploy/truenas-csi-driver.yaml. which is covered in step 4 in the procedure below.

          If using OpenShift, editing the YAML is not required. The user installs the operator from OperatorHub through the web console, then creates two small resources:

          1. A Secret with their API key

          2. A TrueNASCSI custom resource with their connection details (TrueNAS URL, pool name, etc.)

          Both of those can be created through the OpenShift console UI or via oc apply. The operator handles all the deployment details.

          After that, on either platform, the user creates StorageClass and PVC resources, but these are standard Kubernetes patterns, and not a driver-specific setup.

        The procedure below covers adding the API key and TrueNAS IP address to Kubernetes to establish communication, editing the deploy/yaml file, adding required packages, deploying the CSI driver, and setting up StorageClasses.

        Kubernetes automatically communicates with TrueNAS, making storage requests, driver calls to the TrueNAS API, and TrueNAS creates the resources. For more information on Kubernetes, refer to:

        To deploy the CSI Driver, the Kubernetes cluster administrator does the following:

        1. Install NFS packages on all nodes.

          # Debian/Ubuntu
          sudo apt-get install -y nfs-common
          
          # RHEL/CentOS
          sudo yum install -y nfs-utils
          
        2. Install iSCSI packages on all nodes (if using iSCSI).

          # Debian/Ubuntu
          sudo apt-get install -y open-iscsi
          sudo systemctl enable iscsid
          sudo systemctl start iscsid
          
          # RHEL/CentOS
          sudo yum install -y iscsi-initiator-utils
          sudo systemctl enable iscsid
          sudo systemctl start iscsid
          
        3. Verify kubectl access.

          kubectl cluster-info
          kubectl get nodes
          
        4. Configure the deployment manifest, by editing the deploy/truenas-csi-driver.yaml.

          Update ConfigMap (line ~160) in the YAML file:

           data:
             truenasURL: "wss://YOUR_TRUENAS_IP/api/current"
             truenasInsecure: "true"  # Set to "false" for production with valid certs
             defaultPool: "YOUR_POOL_NAME"  # e.g., "tank"
             nfsServer: "YOUR_TRUENAS_IP"
             iscsiPortal: "YOUR_TRUENAS_IP:3260"
             iscsiIQNBase: "iqn.2000-01.io.truenas"  # Optional: customize IQN prefix
          

          Update secret (line ~150) in the YAML file:

            stringData:
            api-key: "YOUR_TRUENAS_API_KEY"
          

          Update Image (line ~188, ~345):

            image: ghcr.io/truenas/truenas-csi:latest  # Or your registry path
            imagePullPolicy: IfNotPresent
          
        5. Deploy the CSI driver.

          # Apply the manifest
          kubectl apply -f deploy/truenas-csi-driver.yaml
          
          # Wait for pods to be ready
          kubectl wait --for=condition=Ready pod -n truenas-csi -l app=truenas-csi-controller --timeout=120s
          kubectl wait --for=condition=Ready pod -n truenas-csi -l app=truenas-csi-node --timeout=120s
          
          # Verify deployment
          kubectl get pods -n truenas-csi
          kubectl get csidriver csi.truenas.io
          
          Expected Output:
          NAME                                      READY   STATUS
          truenas-csi-controller-xxxxxxxxxx-xxxxx   6/6     Running
          truenas-csi-node-xxxxx                    3/3     Running
          truenas-csi-node-xxxxx                    3/3     Running
          
        6. Verify the driver started by checking controller logs for the startup message.

          kubectl logs -n truenas-csi -l app=truenas-csi-controller -c csi-controller | head -5
          
          Expected Output:
          "Starting TrueNAS CSI Driver" version="v1.0.2"
          

          A successful startup with no error messages indicates the driver is connected and authenticated.

        7. Create the StorageClasses for the package method used (NFS or iSCSI).

          Create NFS StorageClass:
          ```
          kubectl apply -f - <<EOF
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: truenas-nfs
          provisioner: csi.truenas.io
          parameters:
            protocol: "nfs"
            pool: "tank"
            compression: "lz4"
            sync: "standard"
          allowVolumeExpansion: true
          reclaimPolicy: Delete
          volumeBindingMode: Immediate
          EOF
          ```
          
          Create iSCSI StorageClass:
          kubectl apply -f - <<EOF
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: truenas-iscsi
          provisioner: csi.truenas.io
          parameters:
            protocol: "iscsi"
            pool: "tank"
            compression: "lz4"
            volblocksize: "16K"
          allowVolumeExpansion: true
          reclaimPolicy: Delete
          volumeBindingMode: Immediate
          EOF
          
        8. Create a test volume

          # Create test PVC
          kubectl apply -f - <<EOF
          apiVersion: v1
          kind: PersistentVolumeClaim
          metadata:
            name: test-volume
            namespace: default
          spec:
            accessModes:
              - ReadWriteMany
            storageClassName: truenas-nfs
            resources:
              requests:
                storage: 1Gi
          EOF
          
          # Wait for binding
          kubectl wait --for=jsonpath='{.status.phase}'=Bound pvc/test-volume --timeout=60s
          
          # Check status
          kubectl get pvc test-volume
          

          If PVC binds the installation is successful!

        StorageClass Parameters

        The following parameters are needed when configuring Kubernetes.

        Common Parameters

        ParameterTypeDefaultDescription
        protocolstringnfsStorage protocol: “nfs” or “iscsi”
        poolstring(from ConfigMap)ZFS pool name (overrides default)
        datasetPathstring-Relative path under pool for datasets (e.g., “k8s/volumes”)
        compressionstringlz4ZFS compression: lz4, gzip, zstd, off

        NFS and iSCSI Parameters

        ParameterTypeDefaultDescription
        syncstringstandardZFS sync: standard, always, disabled
        nfs.hostsstring-Comma-separated allowed hosts
        nfs.networksstring-Comma-separated allowed networks (CIDR)
        nfs.mapAllUserstringrootUser for NFS mapall (controls file ownership)
        nfs.mapAllGroupstringwheelGroup for NFS mapall (controls file ownership)

        Example:

        parameters:
          protocol: "nfs"
          pool: "tank"
          compression: "lz4"
          sync: "standard"
          nfs.networks: "10.0.0.0/8,192.168.0.0/16"
        
        ParameterTypeDefaultDescription
        volblocksizestring16KZVOL block size: 4K, 8K, 16K, 32K, 64K, 128K
        sparsestringfalseUse sparse (thin-provisioned) ZVOLs
        iscsi.blocksizestring512iSCSI extent logical block size
        iscsi.iqn-basestring(from ConfigMap)Custom IQN prefix per StorageClass

        Example:

        parameters:
          protocol: "iscsi"
          pool: "ssd-pool"
          compression: "lz4"
          volblocksize: "8K"
          iscsi.blocksize: "512"
        

        StorageClass Design Patterns

        • Pattern 1: Performance Tiers

          Fast tier - SSD pool with minimal compression
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: truenas-fast
          provisioner: csi.truenas.io
          parameters:
            protocol: "iscsi"
            pool: "ssd-pool"
            compression: "off"
            volblocksize: "8K"
          allowVolumeExpansion: true
          reclaimPolicy: Delete
          
          Standard tier - HDD pool with LZ4
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: truenas-standard
          provisioner: csi.truenas.io
          parameters:
            protocol: "nfs"
            pool: "hdd-pool"
            compression: "lz4"
          allowVolumeExpansion: true
          reclaimPolicy: Delete
          

          Archive tier - High compression
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: truenas-archive
          provisioner: csi.truenas.io
          parameters:
            protocol: "nfs"
            pool: "archive-pool"
            compression: "gzip-9"
          allowVolumeExpansion: true
          reclaimPolicy: Retain  # Keep data even if PVC deleted
          
        • Pattern 2: Protocol-Specific

          NFS for shared file storage
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: shared-files
          provisioner: csi.truenas.io
          parameters:
            protocol: "nfs"
            pool: "tank"
            compression: "lz4"
            sync: "standard"
            nfs.networks: "10.0.0.0/8"  # Restrict to internal network
          allowVolumeExpansion: true
          reclaimPolicy: Delete
          
          iSCSI for database block storage
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: database-block
          provisioner: csi.truenas.io
          parameters:
            protocol: "iscsi"
            pool: "tank"
            compression: "lz4"
            volblocksize: "16K"
            iscsi.blocksize: "4096"
          allowVolumeExpansion: true
          reclaimPolicy: Retain  # Keep DB data if PVC accidentally deleted
          

        • Pattern 3: Application-Specific

          PostgreSQL optimized
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: postgres-storage
          provisioner: csi.truenas.io
          parameters:
            protocol: "iscsi"
            pool: "db-pool"
            compression: "lz4"
            volblocksize: "8K"  # Match PostgreSQL page size
            zfs.recordsize: "8K"
          allowVolumeExpansion: true
          reclaimPolicy: Retain
          

          Media/video storage
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            name: media-storage
          provisioner: csi.truenas.io
          parameters:
            protocol: "nfs"
            pool: "media-pool"
            compression: "off"  # Media already compressed
            sync: "disabled"    # Better performance for streaming
            zfs.recordsize: "1M"  # Large files
          allowVolumeExpansion: true
          reclaimPolicy: Retain
          

        ReclaimPolicy Explained

        Delete (default):

        • When PVC is deleted, PV and backend storage are automatically deleted
        • Use for: Temporary data, dev/test environments
        • Risk: Accidental PVC deletion causes data loss

        Retain:

        • When PVC is deleted, PV and backend storage are kept
        • Admin must manually delete resources
        • Use for: Production databases, important data
        • Safety: Prevents accidental data loss

        Example:

        reclaimPolicy: Retain  # Safe for production
        reclaimPolicy: Delete  # Convenient for dev/test
        

        Advanced ZFS Properties

        Set advanced ZFS properties via StorageClass:

        Any parameter prefixed with zfs. is set as a ZFS property:

        parameters:
          protocol: "nfs"
          pool: "tank"
          zfs.recordsize: "128K"     # Sets recordsize property
          zfs.atime: "off"           # Disables access time updates
          zfs.dedup: "on"            # Enables deduplication (use cautiously!)
        

        Custom ZFS Properties

        apiVersion: storage.k8s.io/v1
        kind: StorageClass
        metadata:
          name: truenas-custom
        provisioner: csi.truenas.io
        parameters:
          protocol: "nfs"
          pool: "tank"
          compression: "lz4"
          zfs.recordsize: "1M"      # Large recordsize for large files
          zfs.atime: "off"          # Better performance (no access time updates)
          zfs.redundant_metadata: "most"  # Balance between performance and safety
          zfs.xattr: "sa"           # System attribute-based extended attributes
        

        Common ZFS Properties Descriptions

        • recordsize: Suggested block size (4K-1M) - affects performance
        • atime: Access time updates (on/off) - disable for performance
        • dedup: Deduplication (on/off) - requires lots of RAM
        • sync: Write behavior (standard/always/disabled)
        • redundant_metadata: Metadata redundancy level

        Warning: Some properties (like dedup) can significantly impact TrueNAS performance. Consult ZFS documentation and test before using in production.

        CSI Driver User Guide

        This guide is for developers/users using a Kubernetes cluster that want to use the TrueNAS CSI driver to create and submit requests for storage to use in pods. It covers creating PersistentVolumeClaims, mounting storage volumes, and using the features available to TrueNAS storage users.

        For an overview of the Kubernetes/CSI driver integration see TrueNAS CSI Driver

        For reference material including a glossary of terms, see CSI Driver Reference

        Kubernetes Cluster Administrators Guide provides instructions on configuring StorageClasses and the Kubernetes integration with the CSI driver. The process involves creating a yaml file stored locally, and then submitting it to create the PVC using kubectl commands.

        The Kubernetes uses the CSI driver to send the information from Kubernetes to TrueNAS. TrueNAS creates the storage volume based on the information in the PVC yaml file, and sends this back to Kubernetes through the CSI driver, where it can be mounted and used in a pod.

        Using the CSI Driver

        Developers/users should follow this process to set up storage they can mount in their Kubernetes pods.

        Replace my-app-data with the name of your PVC in the commands in this section.

        1. Create a PersistentVolumeClaim.
        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: my-app-data
          namespace: default
        spec:
          accessModes:
            - ReadWriteMany  # For NFS (multiple pods can access)
          storageClassName: truenas-nfs
          resources:
            requests:
              storage: 10Gi  # Request 10GB of storage
        
        1. Apply the PersistentVolumeClaim.

        kubectl apply -f my-app-data.yaml

        Where my-app-data is the name of the yaml file (and PVC) created locally by the developer/user.

        1. Check the PVC status.
        kubectl get pvc my-app-data
        
        Expected Output:
        NAME          STATUS   VOLUME                                     CAPACITY   ACCESS MODES
        my-app-data   Bound    pvc-a1b2c3d4-e5f6-7890-abcd-ef1234567890   10Gi       RWX
        

        Status Meanings:

        • Pending - Waiting for driver to create volume
        • Bound - Volume created and ready to use
        • Lost - PV was deleted but PVC still exists (error state)

        Using a Volume in a Pod

        apiVersion: v1
        kind: Pod
        metadata:
          name: my-app
          namespace: default
        spec:
          containers:
          - name: app
            image: nginx
            volumeMounts:
            - name: data
              mountPath: /usr/share/nginx/html  # Where to mount in container
          volumes:
          - name: data
            persistentVolumeClaim:
              claimName: my-app-data  # Reference the PVC
        

        Then to apply a volume in a pod:

        kubectl apply -f pod.yaml
        

        Verifying a Volume is Mounted

        These commands check if a pod is running, verify a mount inside a container, and then write test data to and read it back from the container.

        # Check pod is running
        kubectl get pod my-app
        
        # Verify mount inside container
        kubectl exec my-app -- df -h /usr/share/nginx/html
        
        # Write test data
        kubectl exec my-app -- sh -c "echo 'Hello from TrueNAS' > /usr/share/nginx/html/index.html"
        
        # Read it back
        kubectl exec my-app -- cat /usr/share/nginx/html/index.html
        

        Expanding a Volume

        1. Check the current size. The CAPACITY shows current size.

          kubectl get pvc my-app-data
          
        2. Edit a PVC to request a larger size. Change the storage size, then save and exit.

          kubectl edit pvc my-app-data
          
          # Change:
            resources:
                requests:
                      storage: 10Gi
          
          # To:
            resources:
                requests:
                      storage: 20Gi
          
          # Save and exit
          

          Alternatively, use kubectl patch:

          kubectl patch pvc my-app-data -p '{"spec":{"resources":{"requests":{"storage":"20Gi"}}}}'
          
        3. Wait for the expansion. Watch the CAPACITY column increase in size.

          kubectl get pvc my-app-data -w
          
          # Watch CAPACITY column increase to 20Gi
          

          Note: For iSCSI volumes, you might need to restart the pod for the filesystem resize to take effect.

        Creating a Snapshot

        1. Create a VolumeSnapshot, and then apply it.

          apiVersion: snapshot.storage.k8s.io/v1
          kind: VolumeSnapshot
          metadata:
            name: my-app-snapshot-20250102
            namespace: default
          spec:
            volumeSnapshotClassName: truenas-snapshot-class
            source:
              persistentVolumeClaimName: my-app-data
          

          Apply it:

           kubectl apply -f snapshot.yaml
          
        2. Verify the snapshot.

          kubectl get volumesnapshot my-app-snapshot-20250102
          
          Expected Result
          # Expected:
          # NAME                        READYTOUSE   SOURCEPVC     RESTORESIZE
          # my-app-snapshot-20250102    true         my-app-data   10Gi
          
        3. Check in TrueNAS.

          Navigate to Datasets, locate and select the dataset on the table, then click View Snapshots on the Data Protection card to open the Snapshots screen. Search for the snapshot. The snapshot name format is pool/dataset@snapshot-name

        Restoring from Snapshot

        You can restore from a snapshot by creating a new volume from a snapshot, or cloning an existing volume.

        Create New Volume from Snapshot

        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: my-app-restore
          namespace: default
        spec:
          accessModes:
            - ReadWriteMany
          storageClassName: truenas-nfs
          resources:
            requests:
              storage: 10Gi
          dataSource:
            name: my-app-snapshot-20250102
            kind: VolumeSnapshot
            apiGroup: snapshot.storage.k8s.io
        

        Apply it:

        kubectl apply -f restore-pvc.yaml
        kubectl wait --for=jsonpath='{.status.phase}'=Bound pvc/my-app-restore --timeout=120s
        

        Result: New volume with data from snapshot

        Cloning an Existing Volume

        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: my-app-clone
          namespace: default
        spec:
          accessModes:
            - ReadWriteMany
          storageClassName: truenas-nfs
          resources:
            requests:
              storage: 10Gi
          dataSource:
            name: my-app-data  # Source PVC to clone
            kind: PersistentVolumeClaim
        

        Apply it:

        kubectl apply -f clone-pvc.yaml
        kubectl wait --for=jsonpath='{.status.phase}'=Bound pvc/my-app-clone --timeout=120s
        

        Result: New independent volume with copy of source data

        Advanced Features

        The TrueNAS CSI driver supports advanced storage operations including snapshot-based backup and restore, volume cloning, and multi-protocol deployments. These features are available to all cluster users with the appropriate StorageClass configured by the cluster administrator.

        Creating Volume Snapshots for Backup and Restore

        The following is a backup workflow:

        1. Create Pre-Upgrade Snapshot.

          kubectl apply -f - <<EOF
          apiVersion: snapshot.storage.k8s.io/v1
          kind: VolumeSnapshot
          metadata:
            name: db-before-upgrade
            namespace: production
          spec:
            volumeSnapshotClassName: truenas-snapshot-class
            source:
              persistentVolumeClaimName: postgres-data
          EOF
          
        2. Perform Application Upgrade.

          kubectl set image deployment/postgres postgres=postgres:15
          
        3. Restore if upgrade fails. Stop the application and then create a new volume from a snapshot. Next update the deployment to use the restored volume and then restart the application.

          # Stop the application
          kubectl scale deployment postgres --replicas=0
          
          # Create new volume from snapshot
          kubectl apply -f - <<EOF
          apiVersion: v1
          kind: PersistentVolumeClaim
          metadata:
            name: postgres-data-restored
            namespace: production
          spec:
            accessModes: [ReadWriteOnce]
            storageClassName: truenas-iscsi
            resources:
              requests:
                storage: 100Gi
            dataSource:
              name: db-before-upgrade
              kind: VolumeSnapshot
              apiGroup: snapshot.storage.k8s.io
          EOF
          
          # Update deployment to use restored volume
          kubectl set volume deployment/postgres --add --name=data --claim-name=postgres-data-restored
          
          # Restart application
          kubectl scale deployment postgres --replicas=1
          

        Volume Cloning for Environments

        Volume cloning creates an instant copy of an existing volume using ZFS copy-on-write, making it ideal for spinning up staging or test environments with real production data.

        Cloning Production Data to Staging

        Benefits:

        • Instant copy via ZFS clones
        • Minimal storage overhead (copy-on-write)
        • Staging has real production data for testing
        • No impact on production volume
        # Clone production volume
        kubectl apply -f - <<EOF
        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: app-data-staging
          namespace: staging
        spec:
          accessModes: [ReadWriteMany]
          storageClassName: truenas-nfs
          resources:
            requests:
              storage: 50Gi
          dataSource:
            name: app-data-prod
            kind: PersistentVolumeClaim
        EOF
        

        Multi-Protocol Deployments

        Some applications benefit from using both protocols. Example content management system:

        # Media files - NFS for shared access
        ---
        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: cms-media
        spec:
          accessModes: [ReadWriteMany]
          storageClassName: truenas-nfs
          resources:
            requests:
              storage: 100Gi
        
        ---
        # Database - iSCSI for performance
        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          name: cms-database
        spec:
          accessModes: [ReadWriteOnce]
          storageClassName: truenas-iscsi
          resources:
            requests:
              storage: 20Gi
        

        CSI Driver Reference

        This article provides general reference information about the CSI Driver, a deployment checklist, capacity planning, troubleshooting and diagnostic commands for resolving issues between Kubernetes and the CSI driver, workflows for NFS and iSCSI deployments of the CSI driver integration with Kubernetes, best practices, a glossary of terms, as well as upgrade and suggested deployment options.

        This article provides information that is not included in the administration and user guide articles.

        Kubernetes Fundamentals

        Kubernetes is an open-source container orchestration platform that automates deployment, scaling, and management of containerized applications.

        The following are important terms and foundational to how the CSI driver works with Kubernetes:

        • Pod - A pod is the smallest deployable unit in Kubernetes. It contains one or more containers. Because pods can be created and destroyed frequently, they need persistent storage to retain data beyond their lifecycle.

        • Persistent Volume - A persistent volume is a piece of storage in the cluster, provisioned by the Kubernetes administrator or can be dynamically provisioned via storage classes (StorageClass). It exists independently of pods, and has a lifecycle independent of any pod that uses it.

        • PersistentVolumeClaims (PVC) - A persistent volume claim (PVC) is a request for storage by a user or application. It specifies size, access mode, and storage class. Kubernetes finds or creates a matching PV. It acts like a ticket that entitles a pod to use storage. Think of it like this:

          PV = a physical parking space PVC = a parking ticket requesting a space Pod = a car that parks in the space

        • StorageClass - A StorageClass defines classes of storage with different properties. They enable dynamic provisioning, specifying which provisioner to use (for example, TrueNAS CSI Driver), and contains parameters for that provisioner (pool name, compression, etc.).

        • Container Storage Interface (CSI) - A container storage interface (CSI) is an industry standard for storage plugins in Kubernetes. It enables storage vendors to write one plugin that works everywhere, and separates storage logic from Kubernetes core. The TrueNAS CSI driver implements this standard.

        How it works

        A user creates a PVC requesting storage (creates a YAML file specifying volume size, access mode, StorageClass, etc.). Kubernetes calls the CSI driver CreateVolume function (executes the kubectl apply -f filename.yaml command) The CSI driver creates storage on the backend (TrueNAS creates the volume per request in YAML file), and then returns volume information to Kubernetes. Kubernetes then creates a PV and binds it to a PVC. A pod can now mount and use the volume.

        Best Practices

        Before deploying the CSI driver integration, review the following best practices sections to assist with planning the implementation in Kubernetes.

        Deployment Best Practices

        1. Use Dedicated Namespace

          • Deploy driver in truenas-csi namespace (not default or kube-system)
          • Isolates driver from application workloads
        2. Resource Limits

          • Set memory and CPU limits on driver pods
          • Prevents resource exhaustion
          • Recommended: 128Mi-256Mi RAM, 100m-200m CPU per container
        3. High Availability

          • Controller uses leader election (supports multiple replicas)
          • For HA: Set replicas: 3 in controller deployment
          • Node driver runs on all nodes automatically (DaemonSet)
        4. Security

          • Use a strong TrueNAS API key
          • Rotate API keys periodically
          • Enable TLS verification in production (truenasInsecure: "false")
          • Restrict the NFS networks parameter to the cluster pod CIDR

        Storage Management Best Practices

        • Pool Planning

          • Use separate pools for different performance tiers
          • Monitor pool capacity
          • Set up TrueNAS alerts for pool >80% full
        • Naming Conventions

          • Use descriptive StorageClass names (e.g., fast-ssd, archive-hdd)
          • PVC names should indicate application and purpose
          • Snapshot names should include date/time
        • Quota Management

          • Set realistic default sizes in StatefulSet templates
          • Monitor actual usage
          • Use volume expansion when needed (don’t over-provision initially)
        • *Compression Strategy

          • lz4 (default) - Good balance of speed and compression
          • off - For pre-compressed data (videos, images, archives)
          • gzip or zstd - Higher compression for archives, backups
          • Test with your data to determine the best setting

        Application Usage Best Practices

        • StatefulSets for Databases

          apiVersion: apps/v1
          kind: StatefulSet
          metadata:
            name: postgres
          spec:
            serviceName: postgres
            replicas: 3
            volumeClaimTemplates:  # Automatic PVC per replica
            - metadata:
                name: data
              spec:
                accessModes: [ReadWriteOnce]
                storageClassName: truenas-iscsi
                resources:
                  requests:
                    storage: 50Gi
          
        • Shared Storage for Multi-Pod Apps

          # One PVC, multiple pods (NFS only)
          apiVersion: v1
          kind: PersistentVolumeClaim
          metadata:
            name: shared-uploads
          spec:
            accessModes: [ReadWriteMany]
            storageClassName: truenas-nfs
            resources:
              requests:
                storage: 100Gi
          
          ---
          # Multiple pods reference same PVC
          apiVersion: apps/v1
          kind: Deployment
          metadata:
            name: web-app
          spec:
            replicas: 5  # All 5 pods share same storage
            template:
              spec:
                volumes:
                - name: uploads
                  persistentVolumeClaim:
                    claimName: shared-uploads
          
        • Backup Strategy

          • Create a VolumeSnapshotClass before using snapshot features:
            apiVersion: snapshot.storage.k8s.io/v1
            kind: VolumeSnapshotClass
            metadata:
              name: truenas-snapshot-class
            driver: csi.truenas.io
            deletionPolicy: Delete
            
          • Daily snapshots via CronJob
          • Export snapshots to an external backup system
          • Test restore procedures regularly
          apiVersion: batch/v1
          kind: CronJob
          metadata:
            name: daily-snapshot
          spec:
            schedule: "0 2 * * *"  # 2 AM daily
            jobTemplate:
              spec:
                template:
                  spec:
                    serviceAccountName: snapshot-creator
                    containers:
                    - name: create-snapshot
                      image: bitnami/kubectl
                      command:
                      - /bin/sh
                      - -c
                      - |
                        kubectl apply -f - <<EOF
                        apiVersion: snapshot.storage.k8s.io/v1
                        kind: VolumeSnapshot
                        metadata:
                          name: db-snapshot-$(date +%Y%m%d)
                          namespace: production
                        spec:
                          volumeSnapshotClassName: truenas-snapshot-class
                          source:
                            persistentVolumeClaimName: postgres-data
                        EOF
                    restartPolicy: OnFailure
          

        Performance Optimization Best Practices

        • Choose the Right Protocol

          • NFS: Shared file access, ease of use, cross-platform
          • iSCSI: Better performance for databases, single-node access
        • Tune ZFS Properties

          • recordsize: Match application I/O patterns
            • Database: 8K-16K
            • Large files: 128K-1M
          • sync: Adjust based on durability vs performance needs
            • standard: Good balance (default)
            • always: Maximum durability, slower writes
            • disabled: Faster, risk of data loss on crash
        • Volume Block Size (iSCSI)

          • volblocksize: Must match application needs
          • Cannot be changed after creation
          • Default 16K is good for most uses
          • Database: Match DB page size (8K for PostgreSQL)
        • Network Optimization

          • Use a dedicated network for storage traffic (if possible)
          • 10GbE recommended for high throughput
          • MTU 9000 (jumbo frames) for better performance

        Production Deployment Checklist

        Pre-Deployment:

        • TrueNAS system properly sized for workload
        • Network connectivity tested from all K8s nodes to TrueNAS
        • API key generated with strong security
        • Pool created with appropriate RAID level
        • NFS/iSCSI services tested manually
        • Backup strategy for TrueNAS configuration

        Deployment:

        • Use production-grade container registry
        • Tag images with version numbers (not :latest)
        • Set truenasInsecure: "false" (validate TLS certificates)
        • Configure resource limits on driver pods
        • Enable leader election for controller HA
        • Deploy to dedicated namespace

        Post-Deployment:

        • Monitor driver logs for errors
        • Create test volume and verify in TrueNAS
        • Set up alerting for driver pod failures
        • Document StorageClasses for users
        • Train users on PVC creation
        • Establish snapshot/backup schedules

        Capacity Planning

        TrueNAS Side

        • Reserve 20% pool space for snapshots and overhead
        • Monitor pool space usage
        • Set up TrueNAS alerts for capacity thresholds

        Kubernetes Side

        • Use ResourceQuotas to limit PVC sizes per namespace
          apiVersion: v1
          kind: ResourceQuota
          metadata:
            name: storage-quota
            namespace: dev
          spec:
            hard:
              requests.storage: 1Ti  # Max 1TB total storage in namespace
              persistentvolumeclaims: "50"  # Max 50 PVCs
          

        Troubleshooting

        This section provides troubleshooting for common issues, and offers solutions to resolve them.

        “Pool name is required but not configured”

        Cause: Pool name is empty or not set

        Solution:

        • Check ConfigMap has defaultPool set
        • OR ensure StorageClass has pool parameter
        • Verify pool name is correct and exists in TrueNAS
        # Check ConfigMap
        kubectl get configmap truenas-csi-config -n truenas-csi -o yaml
        
        # Update if needed
        kubectl patch configmap truenas-csi-config -n truenas-csi -p '{"data":{"defaultPool":"tank"}}'
        kubectl rollout restart deployment truenas-csi-controller -n truenas-csi
        

        “Authentication failed: credentials were rejected by TrueNAS”

        Cause: Invalid or expired API key

        Solution:

        1. Generate new API key in TrueNAS (Settings → API Keys)

        2. Update Kubernetes secret:

          kubectl create secret generic truenas-api-credentials \
            --from-literal=api-key='NEW_KEY_HERE' \
            --namespace=truenas-csi \
            --dry-run=client -o yaml | kubectl apply -f -
          
        3. Restart controller:

          kubectl rollout restart deployment truenas-csi-controller -n truenas-csi
          

        “Please provide a valid dataset name according to ZFS standards”

        Cause: Dataset name starts with / or contains invalid characters

        Solution: This is fixed in v1.0.0. If using an older version, upgrade to the latest driver.

        Connection Timeout to TrueNAS

        Cause: Network connectivity issue

        Diagnosis:

        # Test from a pod
        kubectl run nettest --image=busybox --rm -it --restart=Never -- ping -c 3 TRUENAS_IP
        
        # Test WebSocket port
        kubectl run wstest --image=curlimages/curl --rm -it --restart=Never -- \
          curl -k -I https://TRUENAS_IP/api/current
        

        Solution:

        • Check firewall rules on TrueNAS
        • Check Kubernetes network policies
        • Verify TrueNAS is reachable from pod network (not just host network)
        • For Docker/kind: Add iptables rule to allow pod traffic

        NFS Mount Fails with “Permission Denied”

        Cause: NFS export doesn’t allow access from Kubernetes nodes

        Solution:

        1. Check NFS share in TrueNAS UI

        2. Verify “Authorized Networks” includes Kubernetes pod CIDR

        3. Update StorageClass to set network restriction:

          parameters:
            nfs.networks: "10.244.0.0/16"  # Your pod CIDR
          

        iSCSI: “No iSCSI session found”

        Cause: iscsid not running on nodes or login failed

        Diagnosis:

        # Check if iscsid is running
        kubectl exec -n truenas-csi <node-pod> -c csi-node -- ps aux | grep iscsid
        
        # Check node logs
        kubectl logs -n truenas-csi <node-pod> -c csi-node
        

        Solution:

        • Ensure open-iscsi package is installed on all nodes
        • Ensure iscsid service is enabled and started
        • Check iSCSI portal is reachable on port 3260

        Volume Expansion Stuck

        Cause: StorageClass doesn’t allow expansion

        Check:

        kubectl get storageclass truenas-nfs -o jsonpath='{.allowVolumeExpansion}'
        # Should return: true
        

        Solution:

        kubectl patch storageclass truenas-nfs -p '{"allowVolumeExpansion":true}'
        

        Diagnostic Commands

        This section provides diagnostic commands to resolve issues in the areas specified.

        Check Driver Health

        # All driver pods running?
        kubectl get pods -n truenas-csi
        
        # Controller healthy?
        kubectl get pod -n truenas-csi -l app=truenas-csi-controller -o jsonpath='{.items[0].status.conditions[?(@.type=="Ready")].status}'
        # Should return: True
        
        # Check authentication
        kubectl logs -n truenas-csi -l app=truenas-csi-controller -c csi-controller | grep -i "auth\|pool"
        

        Check Volume Status

        # List all PVCs
        kubectl get pvc --all-namespaces
        
        # Check specific PVC
        kubectl describe pvc <name> -n <namespace>
        
        # Check corresponding PV
        PV=$(kubectl get pvc <name> -n <namespace> -o jsonpath='{.spec.volumeName}')
        kubectl describe pv $PV
        
        # Check in TrueNAS (via logs)
        kubectl logs -n truenas-csi -l app=truenas-csi-controller -c csi-controller | grep -i "CreateVolume"
        

        Check Network Connectivity

        # From a pod
        kubectl run nettest --image=busybox --rm -it --restart=Never -- \
          sh -c "ping -c 3 TRUENAS_IP && nc -zv TRUENAS_IP 443 && nc -zv TRUENAS_IP 3260"
        

        Monitoring and Alerting

        Monitoring the CSI driver integration requires watching both the Kubernetes cluster and TrueNAS. Kubernetes tracks driver health and storage operations, while TrueNAS monitors pool capacity and service availability.

        For information on alerts in Kubernetes and TrueNAS see:

        Metrics to Monitor

        • Driver pod health and restarts
        • PVC binding success rate
        • Volume creation time
        • TrueNAS pool capacity
        • Network latency between K8s and TrueNAS
        • iSCSI session health (for iSCSI volumes)
        • Driver pod not running
        • PVC stuck in Pending > 5 minutes
        • TrueNAS pool > 80% full
        • Authentication failures
        • Volume creation failures

        API References

        CSI Standard Methods Implemented

        Identity Service

        • GetPluginInfo - Returns driver name and version
        • GetPluginCapabilities - Returns capabilities (CONTROLLER_SERVICE, VOLUME_ACCESSIBILITY_CONSTRAINTS)
        • Probe - Health check endpoint

        Controller Service

        • CreateVolume - Creates dataset/ZVOL and shares on TrueNAS
        • DeleteVolume - Removes dataset/ZVOL and associated resources
        • ControllerPublishVolume - Returns volume connection info (NFS path or iSCSI IQN)
        • ControllerUnpublishVolume - Cleanup on detach
        • ValidateVolumeCapabilities - Validates requested capabilities
        • ListVolumes - Lists all volumes managed by driver
        • GetCapacity - Returns available space in pool
        • ControllerExpandVolume - Expands volume size
        • CreateSnapshot - Creates ZFS snapshot
        • DeleteSnapshot - Deletes ZFS snapshot
        • ListSnapshots - Lists snapshots for a volume

        Node Service

        • NodeStageVolume - Discovers and logs into iSCSI targets
        • NodeUnstageVolume - Logs out of iSCSI targets
        • NodePublishVolume - Mounts volume into pod directory
        • NodeUnpublishVolume - Unmounts volume from pod directory
        • NodeGetCapabilities - Returns node capabilities
        • NodeGetInfo - Returns node ID and topology info
        • NodeGetVolumeStats - Returns volume usage statistics

        TrueNAS API Methods Used

        Dataset Management

        • pool.dataset.create - Create ZFS dataset or ZVOL
        • pool.dataset.get_instance - Get dataset details
        • pool.dataset.update - Update dataset properties (for expansion)
        • pool.dataset.delete - Delete dataset

        NFS Share Management

        • sharing.nfs.create - Create NFS share
        • sharing.nfs.query - Query NFS shares
        • sharing.nfs.delete - Delete NFS share

        iSCSI Management

        • iscsi.target.create - Create iSCSI target
        • iscsi.extent.create - Create extent (links to ZVOL)
        • iscsi.targetextent.create - Associate target with extent
        • iscsi.target.delete - Delete target (and associations)
        • iscsi.extent.delete - Delete extent

        Snapshot Management

        • pool.snapshot.create - Create ZFS snapshot
        • pool.snapshot.delete - Delete snapshot
        • pool.snapshot.clone - Clone dataset from snapshot
        • pool.snapshot.query - List snapshots

        Pool Management

        • pool.query - Query pool information (for capacity reporting)

        CSI Driver and Kubernetes Architecture Diagrams

        High-Level Component Interaction

        ┌────────────────────────────────────────────────────────────┐
        │                   Developer/User                           │
        │                        │                                   │
        │                        │ kubectl apply -f pvc.yaml         │
        │                        ▼                                   │
        │              ┌──────────────────────┐                      │
        │              │  Kubernetes API      │                      │
        │              │  (PVC Created)       │                      │
        │              └──────────┬───────────┘                      │
        │                         │                                  │
        │        ┌────────────────┴────────────────┐                 │
        │        │  PVC stored in etcd             │                 │
        │        └────────────────┬────────────────┘                 │
        │                         │                                  │
        │                         │ Watch for new PVCs               │
        │                         ▼                                  │
        │              ┌──────────────────────┐                      │
        │              │  CSI Provisioner     │                      │
        │              │  (Sidecar)           │                      │
        │              └──────────┬───────────┘                      │
        │                         │                                  │
        │                         │ gRPC: CreateVolume()             │
        │                         ▼                                  │
        │              ┌──────────────────────┐                      │
        │              │  TrueNAS CSI Driver  │                      │
        │              │  (Controller)        │                      │
        │              └──────────┬───────────┘                      │
        │                         │ WebSocket API                    │
        │                         │ (wss://truenas/api/current)      │
        └─────────────────────────┼──────────────────────────────────┘
                                  │
                                  ▼
                        ┌──────────────────────┐
                        │  TrueNAS Middleware  │
                        │  (API Server)        │
                        └──────────┬───────────┘
                                   │ Creates resources:
                                   │ • pool.dataset.create
                                   │ • sharing.nfs.create
                                   ▼
                        ┌──────────────────────┐
                        │    ZFS Storage       │
                        │  • Datasets created  │
                        │  • Shares configured │
                        └──────────────────────┘
        

        NFS Volume Mount Flow

        1. Pod Scheduled Pod → Node (Kubernetes scheduler assigns pod to node)

        2. Kubelet Calls CSI Node Plugin Kubelet → NodePublishVolume(volumeId, targetPath)

        3. CSI Node Plugin Mounts NFS Node Plugin executes: mount -t nfs TRUENAS_IP:/mnt/pool/dataset /var/lib/kubelet/pods/.../volumes/.../mount

        4. Bind Mount to Pod /var/lib/kubelet/pods/…/volumes/…/mount → bind mounted to /var/lib/kubelet/pods/…/volumes/…/data

        5. Container Starts Container sees volume at /data (or specified mountPath)

        iSCSI Volume Mount Flow

        1. Pod Scheduled Pod → Node

        2. CSI Attacher Creates VolumeAttachment Attacher → ControllerPublishVolume(volumeId, nodeId) Driver returns: targetPortal, targetIQN, LUN

        3. Kubelet Calls NodeStageVolume Node Plugin: a. Discover iSCSI target iscsiadm -m discovery -t sendtargets -p TRUENAS_IP:3260

          b. Log in to iSCSI target iscsiadm -m node -T <IQN> -p TRUENAS_IP:3260 --login

          c. Wait for block device /dev/sdX appears

          d. Create filesystem if needed mkfs.ext4 /dev/sdX

          e. Mount to staging path mount /dev/sdX /var/lib/kubelet/plugins/…/globalmount

        4. Kubelet Calls NodePublishVolume Bind mount staging path to pod volume path

        5. Container Starts Container sees volume at /data

        Integration with Prometheus

        Note

        The TrueNAS CSI driver does not currently expose a Prometheus metrics endpoint. The example below is provided for future reference when metrics support is added.

        # ServiceMonitor for driver metrics (if driver exposes metrics)
        apiVersion: monitoring.coreos.com/v1
        kind: ServiceMonitor
        metadata:
          name: truenas-csi-metrics
          namespace: truenas-csi
        spec:
          selector:
            matchLabels:
              app: truenas-csi-controller
          endpoints:
          - port: metrics
        

        Backup and Disaster Recovery

        Volume Snapshots:

        • Create daily snapshots via CronJob.
        • Retain seven daily, four weekly snapshots.
        • Document restore procedures.

        TrueNAS Snapshots:

        • Use TrueNAS snapshot tasks as an additional backup layer.
        • Replicate to a secondary TrueNAS system.

        Metadata Backup: Export PVC/PV definitions regularly.

        kubectl get pvc --all-namespaces -o yaml > pvc-backup.yaml
        kubectl get pv -o yaml > pv-backup.yaml
        

        Upgrade Strategy

        Driver Upgrade:

        1. Test new version in dev/staging cluster.
        2. Create snapshots of critical volumes.
        3. Update driver image in deployment.
        4. Rolling update automatically replaces pods.
        5. Verify existing volumes are still accessible.
        6. Test creating new volumes.

        TrueNAS Upgrade:

        1. Check the CSI driver compatibility with a new TrueNAS version.
        2. Perform TrueNAS upgrade during maintenance window.
        3. Verify API connectivity post-upgrade.
        4. Test volume operations.

        Kubernetes Upgrade:

        1. Check CSI specification compatibility.
        2. Might need to update sidecar container versions.
        3. Test in staging first.

        Glossary

        For definitions of Kubernetes terms (Pod, Persistent Volume, PersistentVolumeClaim, StorageClass, Container Storage Interface), see Kubernetes Fundamentals .

        ZFS: Advanced filesystem with features like snapshots, clones, compression, and data integrity.

        ZVOL: ZFS Volume - a block device created from a ZFS pool.

        Dataset: ZFS filesystem entity that can store files or act as a volume.

        NFS (Network File System): Protocol for sharing files over a network.

        iSCSI (Internet Small Computer Systems Interface): Protocol for block-level storage over a network.

        IQN (iSCSI Qualified Name): Unique identifier for iSCSI targets.

        LUN (Logical Unit Number): Identifier for iSCSI storage units.

        Extent: iSCSI term for the actual storage backing an iSCSI target.

        WebSocket: Communication protocol for persistent, bi-directional connection.

        Snapshot: Read-only point-in-time copy of data (instant with ZFS).

        Clone: Writable copy of data created from a snapshot.

        Copy-on-Write (CoW): ZFS technique where clones share data with the source until modified.

        Appendix A: Sample Deployment for Common Applications

        • PostgreSQL Database
          apiVersion: v1
          kind: PersistentVolumeClaim
          metadata:
            name: postgres-data
          spec:
            accessModes: [ReadWriteOnce]
            storageClassName: truenas-iscsi
            resources:
              requests:
                storage: 100Gi
          ---
          apiVersion: apps/v1
          kind: StatefulSet
          metadata:
            name: postgres
          spec:
            serviceName: postgres
            replicas: 1
            selector:
              matchLabels:
                app: postgres
            template:
              metadata:
                labels:
                  app: postgres
              spec:
                containers:
                - name: postgres
                  image: postgres:15
                  env:
                  - name: POSTGRES_PASSWORD
                    value: "changeme"
                  - name: PGDATA
                    value: /var/lib/postgresql/data/pgdata
                  ports:
                  - containerPort: 5432
                  volumeMounts:
                  - name: data
                    mountPath: /var/lib/postgresql/data
                volumes:
                - name: data
                  persistentVolumeClaim:
                    claimName: postgres-data
          
        • WordPress (Multi-Pod with Shared Storage)
          apiVersion: v1
          kind: PersistentVolumeClaim
          metadata:
            name: wordpress-uploads
          spec:
            accessModes: [ReadWriteMany]
            storageClassName: truenas-nfs
            resources:
              requests:
                storage: 50Gi
          ---
          apiVersion: apps/v1
          kind: Deployment
          metadata:
            name: wordpress
          spec:
            replicas: 3
            template:
              spec:
                containers:
                - name: wordpress
                  image: wordpress:latest
                  volumeMounts:
                  - name: uploads
                    mountPath: /var/www/html/wp-content/uploads
                volumes:
                - name: uploads
                  persistentVolumeClaim:
                    claimName: wordpress-uploads
          

        Appendix B: Network Requirements Reference

        ServiceProtocolPortSourceDestinationPurpose
        TrueNAS APITCP443K8s PodsTrueNASWebSocket management API
        NFSTCP/UDP2049K8s NodesTrueNASMount NFS shares
        RPC BindTCP/UDP111K8s NodesTrueNASNFS RPC services
        iSCSITCP3260K8s NodesTrueNASiSCSI target access

        Firewall Configuration:

        • Allow Kubernetes pod CIDR (e.g., 10.244.0.0/16) to TrueNAS IP
        • Allow Kubernetes node IPs to TrueNAS IP
        • For iptables/Docker environments: Configure DOCKER-USER chain

        Appendix C: Comparison with Other Storage Solutions

        FeatureTrueNAS CSINFS SubdirLocal PathCloud Provider CSI
        Dynamic Provisioning✓✓✓✓
        ReadWriteMany✓ (NFS)✓✗✗ (usually)
        Volume Expansion✓✗✗✓
        Snapshots✓✗✗✓
        Cloning✓✗✗✓
        Block Storage✓ (iSCSI)✗✓✓
        Enterprise Features✓ (ZFS)✗✗✓
        CostInfrastructure onlyInfrastructure onlyInfrastructure onlyPer-use cloud billing
        On-Premises✓✓✓✗

        Nextcloud

        Nextcloud in TrueNAS

        Nextcloud is a suite of client-server software for creating and using file hosting services.

        TrueNAS offers one deployment option for setting up Nextcloud, a Linux Debian-based TrueNAS version application available in TrueNAS releases 24.10 and later. For the Linux Debian-based app instructions, see Nextcloud .

        TrueNAS offered a FreeBSD-based TrueNAS Nextcloud plugin in releases 13.0 and earlier, and 13.3, but it is no longer available in TrueNAS 13.0 because of changes in FreeBSD, and it is soon to be unavailable in 13.3. Refer to release notes for more information on upcoming and current changes.

        This article provides instructions for the FreeBSD-based Nextcloud plugin.

        Plugin Catalogs

        Before You Begin

        Before installing the Nextcloud plugin:

        • Create a new or use an existing data pool to use for plugin storage.
        • Connect the system to the Internet. Go to Network > Interfaces, edit the intended plugin interface, and set Disable Hardware Offloading.

        To see the plugin catalog, go to the Plugins screen.

        First time in this menu?

        The first time you go to the Jails or Plugins screen TrueNAS prompts you to select a location on the system for storing jail-related data.

        JailsPluginsStorage

        By default, this location stores all data related to jails and plugins, including downloaded applications, data managed by the jail or plugin, and any jail snapshots.

        Disconnecting or deleting the pool that stores jail data can result in permanent data loss! Back up all critical data or snapshots stored in a jail before changing the storage configuration.

        To change the jails and plugins storage location, click , select a new pool, and click CHOOSE.

        I do not see anything!

        If the catalog does not load:

        • Go to Network > Global Configuration and confirm the Default Gateway and DNS Servers addresses are correct.
        • Open the Shell and enter the ping command and an Internet address. The output confirms the system is connected to the Internet.

        TrueNAS organizes plugins into two Collections:

        • TrueNAS maintained plugins
        • Open source plugins created and maintained by TrueNAS users.

        By default, TrueNAS shows the iXsystems-supported plugins. To see the community plugins, open Browse a Collection and select Community.

        Installing a Plugin

        You have two plugin installation options:

        Basic Install

        Go to Plugins and select Nextcloud, then click INSTALL.

        Enter a name in Jail Name and click SAVE.

        After Nextcloud installs successfully, you can manage your plugin instance.

        Click POST INSTALL NOTES to obtain your Nextcloud admin user and Nextcloud admin password information. Click MANAGE to access the Nextcloud login page within your browser.

        Enter the credentials from POST INSTALL NOTES and click Log in to access the Nextcloud Hub.

        Static IP Install

        Go to Plugins and select Nextcloud, then click INSTALL.

        Enter a name in Jail Name, then select the NAT checkbox to clear it, and then enter an available IP in the IPv4 Address field. Select an IPv4 Netmask (iX recommends 24), then click SAVE.

        After Nextcloud installs, you must add your Nextcloud IP to your Nextcloud jail trusted domains.

        Go to Jails and expand your Nextcloud jail, then click > SHELL.

        Enter ee /usr/local/www/nextcloud/config/config.php to edit your Nextcloud config file.

        Scroll to the trusted_domains section and type your Nextcloud IP as a new line item. Use the image below for reference.

        Type CTRL+C to close the editor, then type exit to close the config file.

        Go back to Plugins and expand your Nextcloud instance.

        Click POST INSTALL NOTES to obtain your Nextcloud admin user and Nextcloud admin password information. Click MANAGE to access the Nextcloud login page within your browser.

        Enter the credentials from POST INSTALL NOTES and click Log in. You are directed to the Nextcloud Hub.

        Refer to the Nextcloud documentation for details about using the Nextcloud platform:

        OpenStack Cinder Driver

        There is an unsupported, open source driver for Cinder available for TrueNAS, available at https://github.com/iXsystems/cinder . This is a simple driver that uses several scripts to allow block/iSCSI interactions between OpenStack Cinder and TrueNAS systems. To review the driver documentation, including minimum hardware requirements, install instructions, and basic usage, see https://github.com/iXsystems/cinder/blob/master/README.md .

        Proxmox VE Storage Plugin

        The TrueNAS Proxmox VE Storage Plugin lets you use TrueNAS as high-performance block storage for Proxmox VE clusters, accessible via iSCSI or NVMe/TCP. Unlike standard iSCSI, the plugin automates zvol creation, iSCSI extent mapping, and target association through the TrueNAS API. You provision storage directly from Proxmox without manual setup on the TrueNAS side. It uses ZFS to provide instant, space-efficient snapshots, including live VM state with RAM. It supports CHAP authentication, thin provisioning, ZFS compression, and multipath I/O. It works with Proxmox cluster deployments that use shared storage.

        Plugin and Platform Support

        The TrueNAS Proxmox VE Storage Plugin is developed and maintained by TrueNAS. Proxmox VE is a third-party virtualization platform not affiliated with TrueNAS. TrueNAS support covers plugin functionality only. For Proxmox VE issues, consult the Proxmox documentation and Proxmox support . To report a plugin bug or follow development progress, see the truenas-proxmox-plugin GitHub repository .

        Requirements

        Version Requirements

        This plugin requires Proxmox VE 8.x or later (9.x recommended) and TrueNAS 25.10 or later. NVMe/TCP mode requires Proxmox VE 9.x or later.

        Proxmox nodes must be able to reach TrueNAS on port 3260 (iSCSI) and port 443 (WebSocket API). For NVMe/TCP mode, install nvme-cli on each Proxmox node. You must also have a TrueNAS API key with sufficient privileges to create and manage datasets and iSCSI or NVMe/TCP resources.

        Before You Begin

        Before installing the plugin, complete these steps on TrueNAS:

        1. Create a ZFS dataset to use for Proxmox storage (for example, tank/proxmox). Set Dataset Preset to Generic.
        2. Enable the iSCSI service in System > Services and set it to start automatically.
        3. Create an iSCSI portal in Shares > iSCSI > Portals. Set the IP address to your TrueNAS IP and the port to 3260.
        4. Create an iSCSI initiator group in Shares > iSCSI > Initiators. Leave the defaults to allow all initiators.
        5. Create an iSCSI target in Shares > iSCSI > Targets. After saving, edit the target and add a group. Set the Portal Group ID to the portal you created in step 3. Set the Initiator Group ID to the initiator you created in step 4.
        6. Generate a TrueNAS API key in Credentials > Users. Select your user, then click Add API Key on the Access widget to open the Add API Key screen. For a user that already has a key, click View API Keys on the Access widget instead, then click Add on the User API Keys screen. Enter a name for the key and click Save. Save the key securely. TrueNAS does not show the key again after you close the screen.
        7. For NVMe/TCP mode, enable the NVMe-oF service in System > Services.

        Granting the built-in SHARING_ADMIN role to the user account for the API key covers the steps above. For a narrower, least-privilege role set instead, see Minimum API Permissions in Additional Resources.

        See the Installation Guide for detailed TrueNAS setup steps.

        Installation

        The plugin is installed on each Proxmox VE node, not on TrueNAS.

        The APT repository method provides automatic version detection and updates. Run the following command on each Proxmox node. The installer automatically detects your Proxmox VE version and selects the correct APT suite.

        Note

        This command installs from the alpha branch. The plugin team currently publishes its latest fixes there ahead of main.

        bash <(curl -sSL https://raw.githubusercontent.com/truenas/truenas-proxmox-plugin/alpha/install.sh) --non-interactive --apt-install
        
        Proxmox VE VersionAPT Suite
        8.xbookworm
        9.xtrixie
        Manual APT source setup

        If you prefer not to run the installer script, or the script did not work, you can add the APT source manually:

        cat >/etc/apt/sources.list.d/truenas-proxmox-plugin.sources <<'EOF'
        Types: deb
        URIs: https://truenas.github.io/truenas-proxmox-plugin/apt/
        Suites: <bookworm|trixie>
        Components: main
        Architectures: amd64
        Signed-By: /etc/apt/keyrings/truenas-proxmox-plugin.gpg
        EOF
        
        mkdir -p /etc/apt/keyrings
        curl -fsSL https://truenas.github.io/truenas-proxmox-plugin/apt/pubkey.gpg -o /etc/apt/keyrings/truenas-proxmox-plugin.gpg
        apt-get update
        apt-get install -y truenas-proxmox-plugin
        

        Replace <bookworm|trixie> with the suite that matches your Proxmox VE version.

        Option 2: Direct .deb Installation

        Download a release package from the releases page and install it directly. Replace <RELEASE_TAG> and <DEB_VERSION> with the values from the release you want to install:

        wget https://github.com/truenas/truenas-proxmox-plugin/releases/download/v<RELEASE_TAG>/truenas-proxmox-plugin_<DEB_VERSION>_all.deb
        dpkg -i truenas-proxmox-plugin_<DEB_VERSION>_all.deb
        apt-get -f install -y
        

        Option 3: Interactive Installer

        The interactive installer provides a menu-driven setup with a configuration wizard, health checks, and built-in validation. It supports both iSCSI and NVMe/TCP. Run the following command and follow the prompts:

        bash <(curl -sSL https://raw.githubusercontent.com/truenas/truenas-proxmox-plugin/alpha/install.sh)
        

        The interactive installer configures /etc/pve/storage.cfg automatically and supports cluster-wide installation across all nodes simultaneously. If you used the interactive installer, review the examples in the Configuration section below to verify or modify your setup.

        Configuration

        If you used the APT repository or .deb installation, manually add a storage backend entry to /etc/pve/storage.cfg on each Proxmox node using the GNU nano text editor.

        nano /etc/pve/storage.cfg
        

        iSCSI

        truenasplugin: truenas-storage
            tn_api_host 192.168.1.100
            tn_api_key 1-your-truenas-api-key-here
            tn_api_insecure 1
            tn_target_iqn iqn.2005-10.org.freenas.ctl:proxmox
            tn_dataset tank/proxmox
            tn_discovery_portal 192.168.1.100:3260
            content images
            shared 1
        

        NVMe/TCP

        truenasplugin: truenas-nvme
            tn_api_host 192.168.1.100
            tn_api_key 1-your-truenas-api-key-here
            tn_api_insecure 1
            tn_transport_mode nvme-tcp
            tn_subsystem_nqn nqn.2005-10.org.freenas.ctl:proxmox-nvme
            tn_dataset tank/proxmox
            tn_discovery_portal 192.168.1.100:4420
            content images
            shared 1
        

        In both examples, replace 192.168.1.100 with your TrueNAS IP address. Replace the API key value with your generated key, and tank/proxmox with your ZFS dataset path. tn_api_insecure 1 disables SSL certificate verification. Include this parameter when TrueNAS uses a self-signed certificate, which is the default. Remove this line only if TrueNAS uses a valid signed certificate.

        Note

        Every plugin-specific storage.cfg parameter uses a tn_ prefix (tn_api_host, tn_dataset, and so on). The content and shared parameters are standard Proxmox storage options and keep their unprefixed names.

        For all available configuration parameters, see the Configuration Reference .

        Additional Resources

        The plugin team maintains an extensive wiki covering setup, configuration, and operation in more depth than this overview.

        Setup and Configuration

        • Installation Guide : Full installation walkthrough, including cluster-wide deployment and update procedures.
        • Configuration Reference : Every storage.cfg parameter, with example configurations for single-node, cluster, HA, and IPv6 deployments.
        • NVMe/TCP Setup Guide : Detailed NVMe/TCP setup, including DH-CHAP authentication and multipath configuration.
        • Minimum API Permissions : A least-privilege role set for the plugin API user, as an alternative to a broad admin role.

        Operations

        • Troubleshooting Guide : Common error messages and diagnostic steps for installation, connection, and volume issues.
        • Known Limitations : Restrictions and workarounds to review before deploying to production.
        • Changelog : Version history for the plugin.

        Advanced Topics

        • Advanced Features : Performance tuning, cluster and HA configuration, and security hardening.
        • Multi-Tenancy : Guidance for safely sharing one TrueNAS system across multiple Proxmox clusters.
        • API Reference : Technical detail on the TrueNAS API integration used by the plugin, intended for integrators and contributors.

        Testing and Diagnostics

        • Testing Guide : Covers the plugin development test suite. The built-in installer already covers day-to-day health checks. This suite is for plugin development and debugging, not production systems.
        • Tools and Utilities : Reference for the installer diagnostics menu and other included tooling.

        Veeam

        TrueNAS Unified Storage appliances are qualified Veeam-ready and can be used to handle demanding file and VM backup requirements. These qualification tests measure the speed and effectiveness of the data storage repository using a testing methodology defined by Veeam for full backups, full restores, synthetic full backups, and instant VM recovery from within the Veeam Backup & Replication environment. With the ability to seamlessly scale to petabytes of raw capacity, high-performance networking and cache, and all-flash options, TrueNAS appliances are ideal for large and small Veeam Backup & Replication repositories.

        Qualified Hardware

        These TrueNAS products are qualified by Veeam:

        For more information, refer to the Veeam Ready list filtered for TrueNAS.

        This article discusses some of the best practices when deploying TrueNAS with Veeam, the specific considerations users must be aware of, and some tips to help with performance. The focus is on capabilities native to TrueNAS. For more information on using and optimizing Veeam deployments, users can review relevant Veeam documentation, such as the Veeam help center and Veeam best practices articles.

        Necessary Prerequisites

        When deploying TrueNAS with Veeam, prepare the following:

        • Veeam Backup & Replication dedicated server - either physical or VM
        • Windows Server for Veeam
        • TrueNAS appliance with users pre-configured as determined by the admin
        • Networking - 1/10/40/100GbE infrastructure and cables
        • Veeam connected to the Hypervisor or other clients to pull the data to TrueNAS
        • All appropriate licenses
        • Backup proxies as defined by Veeam - these can be virtual or physical machines or the backup server itself for low workloads
        • TrueNAS appliance configured with an S3 credential to use Veeam immutability and harden the server.
        Warning

        Veeam appliances, software, and infrastructure only works with TrueNAS 25.10 or later releases.

        Update your TrueNAS to 25.10 or later before deployment. Updating the TrueNAS release ensures the appliance has the latest bug fixes, security updates, and software enhancements to ensure maximum performance and security. If deploying on a closed network (LAN) without access to the Internet, users can also obtain and apply an update manually. For assistance, please contact TrueNAS support.

        Contacting TrueNAS Enterprise Support

        Customers who purchase TrueNAS hardware or that want additional support must have a support contract to use TrueNAS Support Services. The TrueNAS Community forums provides free support for users without a TrueNAS Support contract.

        TrueNAS Customer Support
        Support Portalhttps://support.truenas.com
        Emailsupport@truenas.com
        Telephone and Other Resourceshttps://www.truenas.com/support/

        Sizing Considerations

        When planning sizing, you must consider the TrueNAS storage appliances range from entry-level to high-end, and the user system current usage scenario and backup demands.

        Defining Your Storage Usage

        While this guide focuses on Veeam, the unified design of TrueNAS allows it to multitask. If TrueNAS is handling more than backup jobs, other usage needs should be taken into account. For example, if the storage appliance has one LUN (dataset or zvol) set as a VMware datastore for hosting VMs, and another LUN set to use for backups, you must consider both capacities.

        Estimating Capacity

        The first step when estimating required capacity is to understand how much capacity is currently used by existing VMs and by files that users need to back up. Veeam and the TrueNAS appliance apply data compression though different file types and data structures in those files can affect the achieved compression levels. Some tools for capacity estimation are listed at the end of this section, but it is always good to err on the side of caution, and three times (3x) the current storage used is not unreasonable. ZFS performs best with utilization below 80%. Snapshots, full backups, and incremental backups all require more storage than the primary storage used today.

        Estimating Network Bandwidth

        Bandwidth is harder to estimate and must account for backup timeframes, backup sizes, and available network resources. Typically, backups run during off-hours when IT equipment is under a lighter load. This timeframe can be set but if each backup is several terabytes you need more time and bandwidth. TrueNAS tests Veeam backups using a 10 GbE mixed network with the datastore storage, hypervisor hosts, and backup repository (the TrueNAS) on the same network. However, shorter backup windows, heavy network usage, and dozens of VMs being backed up simultaneously can require 40 or 100 GbE networking and multiple Veeam backup proxies used in tandem.

        For example, consider backing up 1000 VMs (each 100 GB in size) with a backup window of eight hours. This requires around five virtual proxy servers with eight vCores (16 GB memory each) and about 3.7 GB/s throughput. In such a scenario, we recommend 100 GbE interconnect and TrueNAS appliances with over 100+ hard drives. However, bandwidth can be greatly reduced if users accept incremental and staggered backups. For example, run an incremental backup on all VMs each day, and a full backup on 100 VMs per night, rotating a different VM of the 100 VMs each night. This strategy provides a 5X increase to the maximum number of VMs and reduces costs by 75%.

        Choosing a TrueNAS Model

        TrueNAS systems are excellent for backup and archiving, but must be correctly sized. Recommended sizing:

        ModelBackup Only?Number of VMs Backed UpNetwork MaxUsable Capacity
        TrueNAS M40No47,60040 GbE2.68 PB
        TrueNAS M50No204,000100 GbE10.23 PB
        TrueNAS M60No299,200100 GbE15.1 PB
        TrueNAS H10No13,60025 GbE873 TB
        TrueNAS H20No20,400100 GbE1.34 PB
        TrueNAS H30No20,400100 GbE1.34 PB
        TrueNAS F60No47,600100 GbE2.6 PB
        TrueNAS F100No115,600100 GbE6.1 PB
        • Backup Only? assumes only using the storage as a backup repository. This can be understood as a recommendation, not a rule. The number of VMs is based upon conservative throughput estimates, with an average VM size set to 100GB and a backup window of eight hours running full backups. All other requirements for the number of Veeam backup proxies and networking dependencies also apply.

        • Number of VMs backed up. Numbers are based on max capacity and estimate 100GB per VM and a 2:1 optimal compression ratio. Compression and deduplication settings can radically change the estimates, and Veeam allows for fine-tuning.

        Configuring the Pools, Datasets, and Zvols

        For high-capacity deployments, TrueNAS recommends 9+2+1 RAID groups (called virtual devices or vdevs by ZFS terminology). This configuration consists of a RAIDZ2 (similar to RAID 6 with two drive parity, so two drives can fail without data loss) with one to two global hot spares added to the pool. Pools can include several of these RAID groups, so the capacity can be expanded as needed. For example, 390 TB of usable space with 12 TB drives requires four groups and 48 drives. Detailed configurations can be discussed with TrueNAS sales representatives and engineers.

        Configuring Veeam Agent with SMB on TrueNAS

        Veeam Agent for Microsoft Windows supports backing up to SMB shares hosted on TrueNAS. This procedure details configuring a standard SMB share and dataset in TrueNAS. To use block or fast cloning, see Configuring Veeam with SMB and Fast Clone for the correct procedure.

        Creating the SMB Share

        1. Go to Datasets, create a dataset (example: veeam-backups), and set the Dataset Preset to SMB.
        2. Accept the option to create the share with the dataset.
        3. Create a TrueNAS user (example: veeam) and assign full access to the dataset ACL.
        4. Enable the SMB service.

        Use the Virtual IP (VIP) for high availability.

        Setting Up Veeam Agent

        1. Open Veeam Agent for Microsoft Windows.
        2. Click Configure Backup.
        3. Select Entire Computer, then Shared Folder as the destination.
        4. Enter the SMB path and TrueNAS local user credentials.
        5. Adjust backup schedule and retention if desired.
        6. Click Finish. You can now begin a backup.

        Configuring Veeam for SMB with Fast Clone

        TrueNAS Enterprise icon TrueNAS Enterprise

        To configure a TrueNAS SMB share for a Veeam repository with fast (block) cloning you must have an enterprise-licensed TrueNAS system.

        First set up the TrueNAS system storage and SMB share before adding the Veeam repository. Fast cloning fails if you add the Veeam repository before you configure TrueNAS. You cannot use an existing Veeam repository for SMB and fast cloning. There is no supported mechanism to convert an existing Veeam repository into one that a TrueNAS SMB share with fast cloning can use.

        TrueNAS properly aligns the TrueNAS ZFS record size and SMB share block size with the Veeam repository requirements when using these instructions.

        If not already created, go to Credentials > User and add a TrueNAS administrative user to serve as the share user. Refer to the basic SMB Share instructions for information on creating a share user. You can assign this admin user full control or a sharing admin role. Add this user to the ACL for the dataset created for Veeam SMB with fast cloning.

        Configuring TrueNAS Storage

        First, think about how you want to organize your data storage. We recommend creating the parent dataset structure before creating the dataset and share for Veeam SMB fast cloning. For example, organizing all datasets for shares (SMB, NFS, etc.) under one common parent dataset (shares) with datasets for each share type nested under it.

        If you have other Veeam data storage set up in the system and you want to nest the fast cloning dataset under the existing Veeam dataset, skip adding the dataset organization instructions below and go to the instructions for verifying the record size for the Veeam dataset at the bottom of this section.

        To create and organize datasets in a hierarchical structure for shares, for example, shares/smb/veeam, go to the Datasets screen, select the parent dataset row in the table, and click Add Dataset. Add the dataset for the next level in the organization, for example, the dataset named shares or if it exists, add one named smb, etc.

        Enter a name for the dataset, then select the SMB option under Dataset Preset. Clear the option to create the share. Clear the checkbox in Create SMB Share for these organizational datasets unless you plan to use them for other SMB share purposes.

        Next, verify the record size. Click Advanced Options, and scroll down to the Record Size field. If not set to 128 KiB, select it on the dropdown list.

        Click Save to create the dataset.

        Grant full access to the user created as the share admin in the dataset ACLs.

        If a parent datasets exist and you only need to create the dataset and SMB share for the Veeam repository, verify the record size for the parent dataset. Select the parent dataset row in the table, click Edit, and then Advanced Options. Scroll down to Record Size. Verify it is set to 128 KiB. Click Save if you make any changes.

        You are ready to create the share.

        Creating the SMB Share

        With the data structure organization in place and the correct record size set, go to Shares, and click Add on the Windows SMB Shares widget.

        Browse to select the parent dataset. Click on each dataset in the path to the parent dataset, for example: /tank/shares/smb/, and then click Create Dataset. Enter the name for the Veeam SMB dataset in the Create Dataset dialog, then click Create Dataset. The dialog closes and the Path on the Add SMB screen populates with the path to the new dataset.

        Select Veeam repository with Fast Clone on the Purpose dropdown list. Click Advanced Options and scroll down to Additional Parameters String. It should show block size = 131072. Select other SMB share settings you want to enable. For example, select Enable under Audit Logging to include SMB activities in audit logging.

        Click Save to create the share. Enable or restart the SMB service when prompted.

        Adding the Veeam Repository for SMB with Fast Cloning

        With the TrueNAS storage and share properly configured, you can now add the repository in Veeam. Follow the instructions in Setting Up Veeam Agent to add the repository.

        Planning Storage Lifecycle

        TrueNAS storage pools can be expanded online to the maximum size supported by a particular TrueNAS system. Storage pools can be expanded one vdev (RAID group) at a time, so long as each vdev shares the same type. When deploying an iSCSI share requiring a zvol (LUN), users should consider thin provisioning using the sparse option during setup.

        Other Considerations

        In addition to the above considerations, you can use the many tools, forums, and other discussion groups to help verify the amount of storage you need for Veeam backup. In many sites, Veeam compression or deduplication is around 1.5x to 2x, which is more of a reference than a rule. Backup types, applications, and the diversity of VMs can all factor into the amount of storage you need. You must also consider capacity alongside desired performance, as a smaller quantity of large drives often does not yield the same performance as a larger number of small drives. The resources listed below provide rough calculations available to determine the sizes and numbers of drives needed:

        Advantages

        TrueNAS is a robust, unified storage system well-suited for nearly any environment. For backups, the platform takes advantage of the data integrity offered by ZFS, which includes features such as copy-on-write, snapshots, and checksums that prevent bit-rot. You can expand TrueNAS Enterprise appliances at any time by simply adding more drives, allowing datasets to grow and keeping pace with your data storage needs. Here are additional key features that are offered out-of-the-box at no extra cost to the Enterprise user:

        • Self-healing file system - ZFS places data integrity first with data scrubs and checksums, ensuring files are saved correctly and preserved.
        • Native replication to TrueNAS systems - TrueNAS native replication is perfect for disaster recovery and compliance.
        • High-availability (HA) architecture with 99.999% availability - High Availability (HA) ensures the system is always ready to receive the latest backups.
        • Triple-parity - RAID groups (vdevs) can be configured with mirror, single-parity (RAIDZ), dual-parity (RAIDZ2), or triple-parity (RAIDZ3) levels, while copy-on-write, checksums, and data scrubbing help protect long-term data integrity.
        • Unrivaled scalability in a single dataset - TrueNAS allows scaling the backup repository from terabytes to petabytes of usable capacity. No LUN limits, clustering, or licenses needed.

        Setting Up TrueNAS as a Veeam Repository

        Veeam Backup & Replication runs on a Windows operating system, typically Windows Server 2012 or newer, and can connect to a variety of storage systems. TrueNAS recommends using iSCSI on TrueNAS with a Veeam scale-out repository architecture. Users can also directly mount the volume to the backup server using SMB. Refer to the SMB tutorial section for your version for more information. With support for SMB/CIFS, NFS, AFP, iSCSI, and FC, TrueNAS offers many ways to connect to Veeam backup servers.

        Veeam Backup & Replication provides three tiers of immutability to temporarily prohibit deleting data from extents. To use this immutability :

        • Enable S3 on the bucket you create. You can use Amazon S3 storage or another S3-compatible storage provider.
        • Configure Azure storage immutability policies for the blob version, and when you create the storage account, enable blob versioning for the storage account.

        Using a Veeam Backup & Replication hardened repository protects backup files from loss due to malware or unplanned actions. A hardened repository supports immutability and single-use credentials.

        Veeam Software Appliance

        Veeam version 13 includes a new Linux Software Appliance image that integrates with TrueNAS as a virtual machine deployment. The goal for this appliance image is smoother, more secure, and easily accessible deployments of Veeam Backup & Replication.

        Installation Instructions

        Veeam Infrastructure Appliance

        Veeam version 13 includes a new Veeam Infrastructure Appliance image that integrates with TrueNAS as a virtual machine deployment. The goal for this infrastructure appliance with TrueNAS is to integrate with an existing Veeam Backup & Replication deployment as a hardened backup repository for use in Veeam Jobs.

        Installation Instructions

        Veeam Immutability

        TrueNAS can act as S3-compatible object storage for immutable backups in Veeam Backup & Replication.

        Immutability is a feature of Veeam Backup & Replication. When configured with storage solutions such as TrueNAS, it prevents modifying or deleting data for a specified period of time. Set the immutability period based on your needs. After this period expires, backed up data can be modified or deleted again.

        The immutability feature increases data security, protects data from losses incurred through malware, attacks, or other harmful actions by bad actors, and can protect configuration backups. Veeam makes this feature available to work with a number of storage options such as S3 or S3-compatible object repositories.

        How Does Veeam Immutability Work?

        Veeam protects a backup chain and all the restore points of this chain for the specified immutability period. The immutability period is the number of days you have to respond to malicious actions. During this period you can roll back to the earlier state of your backup chain. Rolling back requires running Veeam PowerShell. See Rolling Back Immutable Data for more information.

        With S3 object storage, Veeam uses the S3 object lock feature to make backups immutable. Veeam sets a compliance mode retention period on each object it writes. No S3 client can delete or modify an object in compliance mode before its retention period ends, including a client that uses Veeam administrator credentials.

        Warning

        Choose the immutability period carefully. You cannot shorten the retention period or delete immutable backups before the period ends, even if you need to free storage space or must delete specific data.

        Because Veeam protects the whole backup chain, it extends the immutability of earlier restore points as it adds new ones. Immutable backups often use more storage than the number of immutable days suggests. Plan storage capacity with this in mind.

        For more detailed information on Veeam Immutability, see How Immutability Works .

        What is Required to Configure Veeam Immutability?

        • A TrueNAS system license that includes S3 versioning. Object lock requires versioning, which is a licensed feature. See Licensed S3 Features .
        • A dataset on TrueNAS to hold the bucket dataset, for example tank/s3.
        • Veeam Backup & Replication installed on a Windows server. The Veeam Software Appliance does not support the object storage repository type. See Veeam Software Appliance for more information.

        Configuring TrueNAS S3 Object Storage for Veeam

        Configure the S3 service, create an access key for Veeam, and add an object-locked bucket for the backup repository. See Configuring S3 Object Storage for detailed instructions on each task.

        1. Configure the S3 service. Go to Shares, click the more_vert icon on the Object Storage (S3) Buckets card, and then select Config Service.

          a. (Optional) Add a listen address with TLS selected to encrypt backup traffic between Veeam and TrueNAS.

          b. Select the Certificate for the TLS listen address, or keep Use UI certificate.

          c. Click Save.

        2. Create an access key for Veeam. Go to Credentials > S3 Access Keys, and then click Add.

          a. Enter a Name, and then select or create the user account for Veeam in User.

          b. Select Non-expiring. An expired access key stops Veeam from writing backups.

          c. Click Save, and then copy the Access Key ID and Secret Access Key from the S3 Access Key dialog. The web UI does not show the secret access key again.

        3. Add the bucket for the backup repository. Go to Shares, and then click Add on the Object Storage (S3) Buckets card.

          a. Enter a Name, select the Parent Dataset, and select the Veeam user account as the Owner.

          b. Select Enable Object Lock. Versioning changes to Enabled and Default Retention Mode shows.

          c. Select No default rule in Default Retention Mode. Selecting Enable Object Lock changes Default Retention Mode to Compliance. Veeam requires a bucket without a default retention rule because it sets the retention for each object.

          d. Click Save. If the Start S3 Service dialog opens, select Enable this service to start automatically, and then click Start.

        Warning

        Object lock is permanent. After you save the bucket, you cannot disable object lock or versioning on the bucket. Do not change the bucket settings after you add the bucket to Veeam.

        TrueNAS reports a recommended storage block size to Veeam based on the record size of the bucket dataset. The default 128 KiB record size reports no recommendation.

        Configuring Veeam for Immutability

        Add the TrueNAS bucket to Veeam as an S3-compatible object storage repository. See Adding S3 Compatible Object Storage for detailed instructions.

        1. Open the Veeam Backup & Replication Console, go to Backup Infrastructure, and click Backup Repositories.

        2. Click Object Storage, and choose S3 Compatible. The New Object Storage Repository wizard opens.

        3. Configure the Account screen.

          a. Enter the TrueNAS IP address and S3 listen port in Service Point, as IP address:port number, for example 192.168.1.10:9000.

          b. Enter a Region. If the Region setting on the TrueNAS S3 service is empty, TrueNAS accepts any region, such as us-east-1.

          c. Add the TrueNAS S3 access key in Credentials, using the Access Key ID and Secret Access Key.

          d. Select the connection type in Connection Mode. Select Direct to move data of processed VMs directly to object storage repositories. This requires specifying access permissions. Select Through gateway server to have Veeam Backup & Replication use a gateway server to transfer data from processed VMs or file shares to object storage repositories. This is the default setting.

          e. Click Next. If TrueNAS uses a self-signed certificate, a certificate security alert dialog opens. Click Continue to close the dialog.

        4. Configure the Bucket screen.

          a. Select the TrueNAS bucket for the repository.

          b. Add a folder to the bucket. You must add at least one folder.

          c. Select Make recent backups immutable for x days, and enter the number of days.

          d. (Optional) Select Limit object storage consumption to x TB, and enter the limit.

          e. Click Next.

        5. Configure the mount server. Veeam uses the mount server during restore operations to mount VM disks directly from objects in the object storage repository.

          a. Select the mount server. If not listed, click Add New. See Adding Windows Servers for instructions.

          b. Select the folder for the cache created during mount operations from the Instant recovery write cache folder dropdown list.

          c. (Optional) Enter the NFS service settings and the ports Veeam uses for the NFS service. See Specifying Mount Server Settings for more information.

        6. Click Next, review the configuration, and then click Finish. Veeam automatically installs additional components if needed.

        Create a new backup job in Veeam if desired. See Creating Immutable Configuration Backups for more information.

        Amazon S3 is a trademark of Amazon.com, Inc. or its affiliates.

        VMware

        There are several configuration recommendations and troubleshooting tips when using TrueNAS with a VMware hypervisor.

        iSCSI IQN is an acronym that stands for “iSCSI Qualified Name”. It is comprised of the following naming schema with a preamble, node name and unique identifier:

        VMware requires using an IQN in their software iSCSI implementation.

        A VMware datastore backed by iSCSI-based storage will consist of at least three distinct pieces: the storage host, the switching infrastructure, and the VMware host itself. In order to maximize service availability, each of these elements needs to be able to tolerate some level of failure without significantly disrupting iSCSI traffic.

        TrueNAS systems support high-availability (HA) through dual-controllers running in active/standby mode. A properly-configured HA TrueNAS system can offer up to 5x 9’s of system availability. TrueNAS also fully supports asymmetric logical unit access (ALUA) on iSCSI to significantly reduce failover time.

        Network switching infrastructure can be made redundant and fault-tolerant through a number of methods, but multipathing is recommended as the best practice for iSCSI networks.

        VMware’s official documentation details several ways the virtualization host(s) can be made redundant, so that is not covered here.

        For a VMware ESXi host to communicate with an iSCSI capable storage array, the iSCSI protocol must be configured to provide: Discovery, Authentication, and Access Control (DAAC).

        Discovery

        iSCSI offers two methods of target discovery: dynamic and static. Dynamic discovery lets the storage array respond automatically to the host initiator’s “SendTargets” request. Static discovery requires an administrator to manually add a list of the iSCSI targets to the initiator. Either method of discovery is fine, but dynamic discovery can make the iSCSI setup process easier.

        Authentication

        iSCSI authentication is handled via the Challenge Handshake Authentication Protocol, or CHAP. CHAP uses a shared secret between targets and initiators to let them validate each other’s authenticity. By default, no CHAP-based authentication is performed by the VMware iSCSI initiator. If you do decide to use CHAP, authentication can either be unidirectional (where only the target authenticates the initiator) or bidirectional (where both the iSCSI initiator and the iSCSI target are required to authenticate to each other prior to transmitting iSCSI data).

        VMware iSCSI initiators operating with unidirectional CHAP can be configured in two behavior modes. In “Required” mode, an iSCSI adapter will give precedence to non-CHAP connections, but if the iSCSI target requires it, the connection will use CHAP instead. Required mode is only supported by Software iSCSI and Dependent Hardware iSCSI adapters. Alternatively, initiators can run in “Prohibited” mode, where an iSCSI adapter will give precedence to CHAP connections, but if the iSCSI target does not support CHAP, the initiator can still connect.

        Bidirectional CHAP (called “mutual CHAP” in TrueNAS) offers greater security by ensuring that both sides of the iSCSI connection authenticate against each other. Unidirectional CHAP does not let the iSCSI initiator authenticate the target, and running without CHAP obviously disables all authentication. For this reason, bidirectional CHAP is usually recommended but requires additional configuration and comes with greater administrative overhead when troubleshooting iSCSI connections.

        Access Control

        Access control policies are set up within a storage array to ensure only certain initiators can connect to the target (even if they possess the correct CHAP password). Access control can be performed using the initiator’s name (IQN), its IP address, or its CHAP username.

        VMware and TrueNAS iSCSI Setup

        The setup of vCenter iSCSI to TrueNAS requires that ESXi hosts be set up as initiators and TrueNAS storage arrays are set up as targets. To configure ESXi hosts with vCenter, see the VMware vCenter documentation .

        To configure TrueNAS Enterprise storage arrays with vCenter, the TrueNAS team has developed a vCenter plugin . The plugin uses TrueNAS REST APIs to automate LUN creation and assignment. When an VMFS (iSCSI) datastore is created using the plugin, the TrueNAS systems automatically activate their iSCSI system services.

        Hosting VMware Storage with TrueNAS

        When using TrueNAS as a VMware datastore:

        VMware Snapshots on TrueNAS

        When TrueNAS is used as a VMware datastore, you can coordinate creating and using ZFS and VMware snapshots. See VMware Snapshots for details.

        vStorage APIs for Array Integration (VAAI) for iSCSI

        VMware’s VAAI allows storage tasks such as large data moves to be offloaded from the virtualization hardware to the storage array. These operations are performed locally on the NAS without transferring bulk data over the network.

        VAAI for iSCSI supports these operations:

        Allows multiple initiators to synchronize LUN access in a fine-grained manner rather than locking the whole LUN and preventing other hosts from accessing the same LUN simultaneously.
        Copies disk blocks on the NAS. Copies occur locally rather than over the network. This operation is similar to Microsoft ODX .
        Allows a hypervisor to query the NAS to determine whether a LUN is using thin provisioning.
        Pauses virtual machines when a pool runs out of space. The space issue can be fixed and the virtual machines continue instead of reporting write errors.
        The system reports a warning when a configurable capacity is reached. In TrueNAS, this threshold is configured at the storage pool level when using zvols or at the extent level for both file and device based extents. Typically, the warning is set at the pool level, unless file extents are used, in which case it must be set at the extent level.
        Informs TrueNAS that the space occupied by deleted files should be freed. Without unmap, the NAS is unaware of freed space created when the initiator deletes files. For this feature to work, the initiator must support the unmap command.
        Zeros out disk regions. When allocating virtual machines with thick provisioning, the zero write is done locally, rather than over the network. This makes virtual machine creation and any other zeroing of disk regions much quicker.

        Additional VMWare Articles

        TrueNAS Virtualized with ESXi

        This article describes deploying a TrueNAS virtual machine (VM) in a VMWare ESXi environment. ESXi version 8 is shown in this article.

        Before You Begin

        Before starting configuration work in VMWare:

        • Allocate a drive or a few drives in your server cluster for the TrueNAS virtual machine. The anticipated storage needs for your deployment determines the size and number of drives you need.

        • Download the .iso file from the TrueNAS.com downloads page .

        • Visit the TrueNAS hardware guide and take note of the minimum system requirements. Note the information in the Memory and Storage Device Sizing sections.

          The hardware guide provides guidance on how much memory, the number of CPUs, and drive size you need to configure.

        • Determine your data storage requirements. Consider the number of storage pools and the type of storage you need for your deployment or how you plan to use the TrueNAS. See Setting Up Storage for information on pool layouts.

          Determine the number of virtual hard drives (vmdks) you want to create when setting up your virtual machine. For example, if you want a mirror layout you need to add a minimum of three drives, one for the boot drive and two for the mirrored storage. If you want a mirror with a hot spare, you need to add a minimum of four drives, one for the boot drive, two for the mirrored storage and one for the hot spare.

        • Configure your network per your system requirements. Have the information ready when you configure your TrueNAS global network settings in the web interface.

        Deploying TrueNAS in VMWare ESXi

        Launch your VMware ESXi interface using your login credentials.

        Setting Up Storage

        Set up the storage needed for the new VM. First click on Storage and then the drive allocated for TrueNAS. Create the datastore directories for the ISO media and the TrueNAS virtual machine.

        Need more help setting up storage? Click here.
        1. Select Storage on the navigation panel on the left side of the screen.

        2. Select the drive you allocated for the TrueNAS VM. The example uses DS-1. The detailed view for this drive displays.

        3. Click Datastore Browser to open the browser window, and then click Create directory. Enter the name of the directory in the New Directory dialog.

          Add two directories. The first directory is for TrueNAS storage needs the other for the TrueNAS .iso file you downloaded. Choose a name that is easy to identify on a list of virtual machines. The example uses truenas 1 as the directory name for the storage needs. Click Create directory in the New directory dialog to create the directory.

          Click Create directory again to open the New directory dialog to create the second new directory. When finished you should have both directories listed in the Datastore Browser window.

        Uploading the TrueNAS ISO

        After creating the ISO directory, upload the TrueNAS .iso file to the ISO directory.

        Select the directory created for the .iso file and then click Upload.

        Creating the Virtual Machine

        After setting up the storage needs, create the new virtual machine. Select Virtual Machines on the navigation panel on the left side of the screen.

        Select the storage drive for the TrueNAS VM and then click Create/Register VM. The New virtual machine creation wizard displays. Use these settings:

        • On the Select a name and guest OS wizard screen, select Linux for Guest OS family and then Debian GNU/Linux 6 (64-bit) on the Guest OS Version dropdown list.

        • On the Customize settings wizard screen set CPU to 2, set Memory to 16 GB, and Hard disk 1 to 16 GB.

          You need a minimum of two drives set to at least 16 GB. To add a drive, click Add hard disk.

          You can add more hard drive now or use the Edit option to add drives later after saving the new virtual machine. To create a mirror layout you need at least three hard drives, one for boot and two to create the mirrored storage. Add as many hard drives as you need to create your desired storage layout. You can add more drives later after you install TrueNAS.

        Need more help using the ESXi VM Wizard? Click here.

        To create the virtual machine for your TrueNAS, from the Virtual Machines screen:

        1. Click Create/Register VM to display the configuration wizard. On the Select creation type screen select Create a new virtual machine and then click Next.

        2. Configure the VM name and guest OS settings. Type the name for the TrueNAS VM. Use the name you gave the new directory. The example uses truenas1.

          Select Linux for Guest OS family and then Debian GNU/Linux 6 (64-bit) on the Guest OS Version dropdown list.

          Click Next

        3. Select the storage drive you allocated for the TrueNAS VM. The example uses DS-1. Click Next

        4. Enter these settings in the Customize settings screen.

          SettingValue Description
          CPU2
          Memory8 GB
          Hard disk 116 GB. This first disk is the boot disk.
          CD/DVD Drive 1Select Datastore ISO file from the dropdown list of options.
          1. Add the second required disk. Click Add hard disk and select either New standard hard disk or Existing hard disk to add a second hard drive.

            In the New Hard disk row set the disk to 16 GB at a minimum.

            Click on the New Hard disk row to expand it. If the Location field does not display the drive and directory you created for TrueNAS, click Browse to open the Select directory window and select the directory for your TrueNAS deployment. Click on Select to change the location and close the Select directory window and return to the VM wizard screen.

            Change any other disk drive settings you want or need to change for your hard disk drive hardware.

            If needed, click Add hard disk again to add more hard drives if you want to equip your VM with more than the minimum required number of drives.

            In order to prevent potential errors when importing your pool, a custom parameter should be set to allow VMware to provide serial numbers for virtual hard disks. Click on the VM Options tab, and then click on Advanced to expand this section. Next to the Configuration Parameters section, click on Edit Configuration. Click Add parameter. In the Key column, enter disk.EnableUUID and enter TRUE in the Value column. Click OK.

            Click Next to finish creating the VM. You can use the Edit option later to add more drives to support your TrueNAS deployment.

            Each storage layout has different disk minimum disk requirements. See Setting Up Storage for information on pool layouts.

          2. Review the Ready to Complete screen to verify the settings are correct for your deployment.

            Click Finish. The new TrueNAS VM displays on the list of virtual machines.

        Reviewing the New TrueNAS VM

        To view the VM details screen click on the VM name.

        You can now edit your TrueNAS VM to change any setting or add more hard drives to support your deployment, or you can proceed to installing TrueNAS.

        Installing TrueNAS

        Click Power on and then click Console to display the dropdown list of console options. When the console opens, it displays the TrueNAS Console Setup screen.

        Follow the installation instructions to complete the installation of TrueNAS.

        Editing the Virtual Machine

        You can edit your VM settings after you complete the initial setup. You can add new hard drives to your VM using the edit option found on the VM details screen. Click Edit to display the Editing Settings screen.

        Click Add hard disk and select the option you want to use. For a new drive select New standard hard disk. A New Hard disk row displays and is highlighted.

        To edit the hard disk details click on the row to expand it and display the drive settings you can configure.

        TrueNAS vCenter Plugin

        TrueNAS Enterprise icon TrueNAS Enterprise

        This plugin is available to TrueNAS Enterprise customers. TrueNAS Enterprise Support staff are available to assist with deploying and upgrading the TrueNAS vCenter Plugin. Please contact TrueNAS Enterprise Support to learn more and schedule a time to deploy or upgrade the plugin.

        Contacting TrueNAS Enterprise Support

        Customers who purchase TrueNAS hardware or that want additional support must have a support contract to use TrueNAS Support Services. The TrueNAS Community forums provides free support for users without a TrueNAS Support contract.

        TrueNAS Customer Support
        Support Portalhttps://support.truenas.com
        Emailsupport@truenas.com
        Telephone and Other Resourceshttps://www.truenas.com/support/

        vCenter Server provides a web interface to manage physical and virtual machines. The TrueNAS vCenter Plugin activates management options for TrueNAS hardware attached to vCenter Server. This enables limited TrueNAS system management from a single interface.

        The TrueNAS vCenter plugin is currently compatible with VMware vCenter Server versions 8.0 and 7.0 .

        The vCenter plugin supports many different TrueNAS software versions installed on TrueNAS Enterprise licensed hardware:

        VersionSupported
        12.0Yes
        13.0Yes
        22.12Yes (exception)
        23.10Yes (exception)
        24.04Yes (exception)
        24.10Yes (exception)
        25.04Yes
        25.10Yes

        Exceptions

        • TrueNAS 22.12, 23.10, 24.04, and 24.10 do not support Fibre Channel for VMFS datastores.

        Plugin Release Notes

        TrueNAS vCenter Plugin 3.7.0

        January 6, 2026

        TrueNAS is pleased to release TrueNAS vCenter Plugin version 3.7.0! This release expands TrueNAS compatibility to 25.10 and include these changes:

        • Use the TrueNAS WebSocket API instead of the deprecated REST method.
        • More accurate space capacity reporting.
        • Remove read-only datasets for NFS datastore creation.
        • Fix Fibre Channel port selection.

        Previous Versions Release Notes

        3.6.0 (Click to expand)

        September 3, 2024

        TrueNAS is pleased to release TrueNAS vCenter Plugin version 3.6.0! This is a minor release to fix an issue with VMFS datastore management with TrueNAS 24.04 systems that have iSCSI ALUA enabled.

        Known Issues

        The TrueNAS vCenter Plugin deployment status can appear to be stuck in the vCenter activity panel. This is a cosmetic issue and the plugin deploys fully.

        3.5.0 (Click to expand)

        October 6, 2023

        TrueNAS is pleased to release TrueNAS vCenter Plugin version 3.5.0! This is a minor release designed to make the plugin compatible with vCenter 7.0 and 8.0 and minor bugfixes.

        TrueNAS 13.0 systems are compatible with the 3.5.0 plugin. TrueNAS 12.0 deployments connected to an earlier version of this plugin should upgrade to 13.0 before attempting to connect to the 3.5.0 version of the plugin.

        Changelog

        Individual tickets require an TrueNAS Jira login to view.

        • Plugin compatibility with vCenter 7.0 and 8.0
        • Fix plugin UI behavior when VMFS and NFS datastore types are selected
        • Plugin dependencies update
        • Offline installer fix
        3.4.0 (Click to expand)

        September 2, 2021

        TrueNAS is pleased to release version 3.4.0 of the TrueNAS vCenter plugin. The 3.4.0 plugin has numerous improvements, including:

        • Fibre Channel datastore support.
        • Development script rewritten.
        • Revamped plugin build and MANIFEST files.
        • HTTPS that was disabled in 3.3.0 due to MANIFEST errors, has been re-enabled.
        • Fixed deployment script logging.

        Please note that deploying this version of the TrueNAS vCenter Plugin requires TrueNAS host systems with version 11.3 or later installed and vCenter 6.7-U3 or earlier deployed.

        New Feature

        • [VCP-95] - Overhaul Deployment
        • [VCP-117] - Add Fibre Channel datastore support

        Improvement

        • [VCP-115] - Refocus snapshot and snapshot task creation for TrueCommand

        Bug

        • [VCP-114] - Deployment logging is not functional
        • [VCP-116] - vCenter Plugin Install
        • [VCP-125] - The error message should say "You don't have sufficient privilege to Create Datastore "
        • [VCP-127] - Cloning Fibre Channel datastores or parallel HBAs fails on target creation
        • [VCP-128] - Support log file Error states that it is an unsupported protocol scheme
        • [VCP-129] - Remove the text about vCenter removing datastores from the TrueNAS
        • [VCP-130] - Cloning a VMFS datastore created it on the TN but not on vCenter

        Known Issues

        KeySummaryWorkaround
        VCP-135FC datastore rollback fails.VMFS rollback fails. Users will have to continue rollback themselves, disabling FC port and then deleting the target, since this release doesn’t disable the FC port first, which causes an exception. See related ticket NAS-111676 .
        VCP-89vCenter 7.0b has issues rendering the plugin interface.This is scheduled to be resolved in a future plugin update, but it is recommended for customers to continue using vCenter 6.7-U3 or earlier with this plugin.
        The plugin replication feature has been removed due to numerous long-standing issues that could not be resolved for this version of the plugin.Please continue to create replication tasks using the TrueNAS web interface.
        VCP-113Cloned datastores always use the first listed interface.To work around this issue, either ensure the original datastore is using the desired interface or create a new datastore instead of making a clone.
        3.3.0 (Click to expand)

        November 24, 2020

        TrueNAS is pleased to release version 3.3.0 of the TrueNAS vCenter plugin! This is a maintenance release of the plugin, designed to improve functionality and add support for TrueNAS 12.0 host systems. As part of this maintenance release, additional testing resources have been devoted to the plugin and several large-scale improvements have also been identified for future plugin versions.

        Improvement

        • VCP-78 - Convert to TrueNAS API 2.0 for improved compatibility and reliability with TrueNAS 11.3 and 12.0

        Bug

        • VCP-84 - vCenter plugin does not function with TrueNAS 11.3 unless the legacy API 1.0 endpoint is enabled

        Known Issues

        • vCenter 7.0b has issues rendering the plugin interface (VCP-89 ). This is scheduled to be resolved in a future plugin update, but it is recommended for customers to continue using vCenter 6.7-U3 or earlier with this plugin.
        • https has been disabled for the 3.3.0 release (VCP-105 ) due to an issue with connector initialization failures and conflicts with the Apache HTTPClient dependency. TrueNAS users must enable http on their TrueNAS system for the 3.3.0 plugin to connect properly! To verify TrueNAS 11.3 or 12.0 can connect, log in to the web interface, go to System > General, and make sure Web Interface HTTP > HTTPS Redirect* is unset. This issue is scheduled for resolution in plugin version 4.0 .
        • The plugin replication feature has been removed due to numerous long-standing issues that could not be resolved for this version of the plugin. Continue to create replication tasks using the TrueNAS web interface.
        • Cloned datastores always use the first listed interface (VCP-113 ). To work around this issue, either ensure the original datastore is using the desired interface or create a new datastore instead of making a clone.
        • Plugin deployment complains about logging system error (VCP-114 ). This is a cosmetic error based on initial plugin deployments creating an empty log file. There is no impact to installing or using the vCenter Plugin.
        3.2.0 (Click to expand)

        March 24, 2020

        TrueNAS is pleased to release version 3.2.0 of the TrueNAS vCenter plugin! This is the newest release of the plugin, designed to allow managing TrueNAS systems from within VMware vCenter. The 3.2.0 plugin has numerous improvements, like iSCSI fixes, communication support, and new vCenter 7.0 support. Here are a few other highlights of this release:

        • Initial support for vCenter 7.0 [ NAS-102950 ]
        • Added support for secure communication with TrueNAS (HTTPS) [ NAS-103636 ]
        • Refresh asynchronously when adding a new datastore [ NAS-100183 ]
        • iSCSI configuration bug fixes [ NAS-103853 ]

        For a detailed list of all vCenter plugin 3.2.0 changes, please see the completed vCenter plugin 3.2.0 Jira tickets .

        3.1.0 (Click to expand)

        July 16, 2019

        TrueNAS is pleased to announce the availability of vCenter 3.1.0, a standalone plugin for managing TrueNAS systems within VMware vSphere.

        New Features

        • [NAS-100574] – Use standalone application for automatic deployment of vCenter plugin
        • [NAS-100839] – Add VMFS6 support

        Improvements

        • [NAS-100070] – Provide an indication when user times out for inactivity
        • [NAS-100075] – Add ability to remove user and role from RBAC
        • [NAS-101357] – Remove duplicate Configure and Update tabs
        • [NAS-101600] – Add ability to select cluster for VMFS datastore
        • [NAS-102360] – Store deployment and support logs in log folder

        Bug Fixes

        • [NAS-101355] – Fix issue that prevented re-adding a removed host
        • [NAS-101356] – Remove spurious Other Action from Actions menu
        • [NAS-101358] – Ensure network interfaces retrieve a bind IP to be used to create Portal
        • [NAS-101359] – Display High Availability status
        • [NAS-101791] – Update output text from installer
        • [NAS-101840] – Improve uninstall and upgrade handling
        • [NAS-101846] – Fix issue when mounting NFS share in a cluster
        • [NAS-102312] – Fix issue when creating a VMFS datastore in TrueNAS 11.2-U5
        • [NAS-102324] – Fix problem with stalls when cloning datastore
        • [NAS-102365] – Fix problems related to removing roles, users, and permissions
        • [NAS-102388] – Indicate that the user needs to use the stop then start commands to restart vCenter 6.5
        • [NAS-102429] – Ensure text box for Hostname is read-only
        • [NAS-102455] – Warn user in documentation of maximum supported volumes limit

        Using the Plugin

        After being assisted with plugin deployment, using the plugin involves connecting TrueNAS hosts and configuring the various features to your use case. The interface suspends after several minutes of inactivity and displays a warning that the interface is suspended and must be refreshed.

        Connecting TrueNAS Hosts

        In a browser, go to your vCenter Server web interface, log in, and click Menu > Global Inventory Lists > Manage TrueNAS > + Add host to add TrueNAS hosts to vCenter.

        Fill in the required information. A hostname or IP address can be used for the TrueNAS system. Using an API key with TrueNAS releases 25.04 and newer also requires configuring an HTTPS connection. For High Availability systems, use the VIP address or hostname to ensure the plugin remains connected in the event of a system failover. Click Add Host and the TrueNAS hostname or IP address appears in the list of connected systems.

        Right-click a list entry to see options to edit the host user credentials or remove that host from vCenter. Click a hostname to see the system management options. Clicking a system entry opens the management interface.

        System Management

        The system management screen shows a summary and options to modify the system.

        To modify the TrueNAS system, click Configure. Each submenu has a row of buttons to add or make changes to any items in the list. vCenter works in the background when resolving change requests. Refresh updates the list to see any items that might have finished being created or modified. Tasks in progress display in the collapsible Recent Tasks area across the bottom of the screen. Naming objects in the plugin follow a standard convention. Names can contain spaces, alphanumeric, -, and . characters.

        Click Summary to view basic information about this system. The IP address, installed version of TrueNAS, storage availability, and system service status are shown.

        The vCenter plugin can create two different kinds of datastores on a TrueNAS host:

        • Virtual Machine File System (VMFS) for iSCSI block-level access
        • Network File System (NFS) for file-level access

        List

        vCenter has a default limit of eight NFS datastores per ESX host. See this VMware article about maximum supported volumes for more details.

        The list shows Datastores that have been created and are managed by the plugin. The list does not display other types of shares created and managed through the TrueNAS web interface.

        Add Datastore

        Click + (Add) to create a new datastore.

        Choose an ESXi host for the datastore or an ESXi cluster to spread the reserved space across multiple systems. Clusters can be used as long as a single member of the cluster supports the datastore features. Click Next.

        Choose the datastore type. VMFS datastores provide block-level (iSCSI) storage for virtual machines. NFS datastores provide file-level storage access. Click Next to view specific options for each datastore type

        VMFS Datastore Configuration

        Enter a name for the new datastore. Enter a value and choose a unit for the Datastore Size. The size must be smaller than the chosen Volume. The minimum size for a VMFS datastore is 2GB.

        The Data Path IP shows the TrueNAS system IP address. Users can select other connected TrueNAS systems with the dropdown list.

        Select the datastore from the VMFS Version dropdown list. Choose between the modern version 6 or the legacy versions 3 and 5. See the VMware VMFS documentation for detailed comparisons.

        Enabling Sparse Volume reserves less than the total available size and metadata storage space, but it can cause writing to fail if the volume has little space remaining. See zfs(8) for more details.

        Select the TrueNAS pool to hold the datastore. The volume must be large enough to contain the chosen datastore size.

        If you have a high availability NAS with a Fibre Channel license and a network configured to form a Fibre Channel fabric with the NAS and ESXi, you are also able to select a Fibre Channel port for the datastore.

        Selecting a Fibre Channel port enables that port with the datastore target on the NAS and creates a datastore with a corresponding Fibre Channel HBA on the ESXi. One target per port is supported.

        NFS Datastore Configuration

        Enter a name for the new datastore. The Data Path IP shows the TrueNAS system IP address. Users can select other TrueNAS systems added to vCenter Server with the dropdown list. Select the path to the TrueNAS NFS share from the Mount Share Path dropdown list. Click Next.

        Review Datastore Configuration

        After configuring the VMFS or NFS datastore, vCenter shows a summary of the new datastore. To begin creating the datastore, review the settings and click Finish. The interface shows a warning when the datastore contains more than 80% of the available space. Click Refresh to see the new datastore after creating it.

        Extending a Datastore

        Users needing additional space can increase the total size of a VMFS datastore. Highlight a VMFS datastore from the list and click Edit to extend it.

        The new size must be larger than the current size and less than the total available capacity. For best performance, we recommend using less than 80% of the total available size. Using decimal notation rounds down the size to the nearest 1024 bytes (or whatever the configured default block size for the volume is). Click Extend Datastore. Datastores reserve some available space for internal use and set the available capacity to slightly less than the chosen amount.

        Cloning Datastores

        Cloning an NFS or VMFS datastore duplicates that datastore. Select a datastore from the list and click Clone. Choose an ESXi host to store the new datastore and click Next. Enter a name for the clone and click Clone Datastore.

        vCenter starts the cloning process and continues the task in the background. Click Refresh after some time to see the cloned datastore.

        An administrator can grant vCenter users specific role-based access to the TrueNAS systems managed by this plugin. New vCenter users must be created in Menu > Administration > Single Sign On > Users and Groups before RBAC roles can be created.

        Role NameUser is allowed to:
        DiscoveryAdd TrueNAS systems to vCenter
        Create ClonesCopy existing datastores
        Create StorageCreate new datastores
        Modify StorageEdit existing datastores
        Destroy StorageDelete datastores

        Each role gives the user the ability to perform the functions in that role and all of the roles that precede it in the list. For example, a user with a Create Storage role can create a new datastore and clone existing datastores. The vCenter administrator account always has all permissions.

        Add a Role to an Existing vCenter User

        Click + to open the Add Role Based Access Control window. Type a user name in the form DOMAIN.NAME\username, where DOMAIN.NAME is the user domain found in the vCenter Menu > Administration > Single Sign On > Users and Groups page. Open the Assign Role dropdown list and choose a role for the user. Click Add to add the role.

        If the entry does not appear in the list immediately, click Refresh.

        Hyper-V

        Hyper-V Best Practices

        Hyper-V hosts that use TrueNAS iSCSI storage need adjusted storage timeouts before they enter production.

        TrueNAS Enterprise systems provide high availability (HA) through dual controllers in active/standby mode. Only the active controller serves I/O. A failover transfers that role to the other controller, which imports the pool and starts the iSCSI targets. No controller serves I/O on the affected LUNs until the transfer completes.

        Windows storage defaults are shorter than this window. Multipath I/O (MPIO) removes a disk after 20 seconds without a path, and I/O does not resume on its own after Windows removes it. Recovery then requires an initiator restart, a storage rescan, or a reboot. The settings on this page raise those timers so disk objects survive the failover.

        Important

        These settings affect all iSCSI and MPIO traffic on the host. Review them with your storage and virtualization team before you apply them.

        Before You Begin

        Apply these settings to every Hyper-V host that mounts TrueNAS iSCSI LUNs. Open PowerShell as an administrator on each host.

        Some values require a restart, so plan a maintenance window that allows a restart of each host and a test failover.

        These values use the same 300-second envelope TrueNAS recommends for VMware . The new controller must finish the pool import and target startup before any host timer expires.

        Multipath I/O Timers

        Use the Set-MPIOSetting cmdlet for these values. Most take effect without a restart.

        ParameterDefaultRecommendedDescription
        -NewPDORemovePeriod20300Seconds MPIO keeps a lost device before it removes the disk from Windows. The most important value to size correctly.
        -CustomPathRecoveryDisabledEnabledLets MPIO probe a failed path instead of waiting for a session to reconnect.
        -NewPathRecoveryInterval4025Seconds between probes of a failed path.
        -NewRetryCount360Retries for an I/O that returns a SCSI error.
        -NewRetryInterval11Seconds between retries. Leave at the default.

        Per-Disk SCSI Timeout

        TimeOutValue sets the longest time a single SCSI command stays outstanding before Windows abandons it. It must exceed the failover window so queued I/O is held rather than failed. Raise it from the default of 60 seconds to 300.

        The value is under HKLM:\SYSTEM\CurrentControlSet\Services\disk. A restart is required.

        iSCSI Initiator Timers

        These values control initiator behavior while a session reconnects. All are under HKLM:\SYSTEM\CurrentControlSet\Services\iScsiPrt\Parameters, and a restart is required.

        Registry valueDefaultRecommendedDescription
        LinkDownTime1560Seconds the initiator tolerates a disconnect before it declares the session dead.
        MaxRequestHoldTime60300Seconds the initiator queues I/O while a session reconnects. Sized to match the MPIO and disk timeouts.
        DelayBetweenReconnect55Seconds between reconnection attempts. Leave at the default.

        Failover Cluster Heartbeat Settings

        If the Hyper-V hosts belong to a failover cluster, raise the heartbeat thresholds so the cluster does not evict a node while storage is mid-failover. These settings are cluster-wide, so run them one time on any cluster node. On Windows Server 2019 and later, some defaults already match these values.

        PropertyRecommended
        SameSubnetThreshold20
        CrossSubnetThreshold30
        RouteHistoryLength30

        Applying the Settings

        Run the following on every Hyper-V host as an administrator.

        # MPIO timers
        Set-MPIOSetting -NewPDORemovePeriod 300 `
                        -CustomPathRecovery Enabled `
                        -NewPathRecoveryInterval 25 `
                        -NewRetryCount 60 `
                        -NewRetryInterval 1
        
        # Per-disk SCSI timeout (restart required)
        Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\disk' `
                         -Name TimeOutValue -Value 300 -Type DWord
        
        # iSCSI initiator timers (restart required)
        Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\iScsiPrt\Parameters' `
                         -Name LinkDownTime -Value 60 -Type DWord
        Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\iScsiPrt\Parameters' `
                         -Name MaxRequestHoldTime -Value 300 -Type DWord
        

        Run the cluster settings one time on any cluster node.

        (Get-Cluster).SameSubnetThreshold  = 20
        (Get-Cluster).CrossSubnetThreshold = 30
        (Get-Cluster).RouteHistoryLength   = 30
        

        Restart each host after you apply the settings.

        Verifying the Settings

        Confirm the values after each host restarts. Windows accepts a registry write to an incorrect location without an error, so verify the values rather than assume they applied.

        Get-MPIOSetting
        Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\disk' TimeOutValue
        Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\iScsiPrt\Parameters' `
                         LinkDownTime, MaxRequestHoldTime
        Get-Cluster | Select-Object SameSubnetThreshold, CrossSubnetThreshold, RouteHistoryLength
        

        In Get-MPIOSetting output, the path recovery settings appear as UseCustomPathRecoveryTime and CustomPathRecoveryTime.

        Validating in a Maintenance Window

        Test the configuration after all hosts restart.

        First, click Initiate Failover on the TrueNAS web interface for the active controller. Confirm that virtual machines continue to run and that Get-ClusterSharedVolume reports the Cluster Shared Volumes online throughout.

        Next, issue a power reset to the active controller from the out-of-band management interface. Expect a longer pause than the controlled test, but confirm that virtual machines do not crash and the Cluster Shared Volumes stay online.

        Finally, fail back through the web interface and confirm the same results.

        Notes and Caveats

        These values trade fast detection of a genuine path failure for tolerance during a failover. They do not suit environments where rapid path-failure detection matters more than continuity.

        A large pool with many datasets, large deduplication tables, or slow drives can take longer to import than the 300-second envelope. Measure the worst-case failover time for your own system, then size PDORemovePeriod, TimeOutValue, and MaxRequestHoldTime together to exceed it by at least 50 percent.

        These settings do not remove the I/O pause during a failover. They reduce the chance that Hyper-V treats the pause as a permanent loss of the path. If a failover occurs before you apply them and virtual machines pause, recovery might require a storage rescan on each host with Update-HostStorageCache or a restart of the affected host.

        Entra Domain Services (Azure DS)

        Organizations can use Microsoft Entra Domain Services (formerly Azure Active Directory Domain Services) to manage users and groups by connecting TrueNAS to an Azure domain and joining the managed directory.

        Note

        Recommended best practice for increased security and flexible administration is to synchronize Entra ID with an on-premises active directory domain . However, some organizations prefer to use cloud-only domain services. This tutorial outlines how to join TrueNAS to an Entra ID without an on-premises domain.

        Third-Party Integration

        When you integrate third-party software or services, data can go to a third-party commercial vendor not directly affiliated with TrueNAS. You configure and maintain third-party services. TrueNAS does not provide support for them. Consult third-party vendor documentation, support, and/or bug reporting procedures for any functionality issues in third-party software.

        Third-Party Costs

        Microsoft Entra Domain Services pricing is based on SKU tier, which is selected based on auth load and object counts. These are guidelines for selecting a SKU, not hard limits. Pricing can be obtained through the Azure Pricing Calculator or a sales representative. The following links offer general pricing information:

        Please refer to Microsoft web resources or contact a Microsoft sales representative to discuss the best option for your use case before deploying this in your TrueNAS system.

        Preparing Entra Domain Services

        To join TrueNAS to Entra ID domain services, you need an active Azure account with Entra ID and Entra Domain Services enabled and configured as described in Microsoft documentation .

        After initial configuration of the domain:

        1. In the Entra admin center, go to the Microsoft Entra Domain Services Overview tab for your managed domain.

          Record the domain name. Click Properties under Settings and record the IP Address on virtual network addresses. Save these for later.

        2. Go to Security Settings and configure as shown.

          Click for Details
          SettingStatus
          TLS 1.2 Only ModeEnable
          NTLM v1 AuthenticationEnable
          Password Synchronization from On-PremisesEnable
          NTLM Password SynchronizationEnable
          Kerberos RC4 EncryptionDisable
          Kerberos ArmoringEnable
          LDAP SigningEnable
          LDAP Channel BindingEnable
        3. Create a site-to-site VPN gateway.

          Entra ID domain services uses hard-coded network addresses and a bundled DNS server, so a VPN is needed to ensure proper DNS resolution. There are numerous possible solutions for this purpose. The TrueNAS team does not suggest or support a specific third-party VPN service. For one option, see Tutorial: Create a site-to-site VPN connection in the Azure portal from Microsoft.

        Configuring TrueNAS

        Edit network configuration to enable TrueNAS to reach the Entra ID domain services instance and then join the domain.

        1. Configure network connections. Go to Network and click Settings on the Global Configuration widget to open the Edit Global Configuration screen.

          Enter the domain name from Entra ID domain services in Domain.

          Enter the Entra IP Address on virtual network, recorded above, as a nameserver to route connections to the Entra domain services DNS server.

        2. Confirm connectivity. Connect to a local TrueNAS shell or SSH session and enter the ping EntraDomain command, where EntraDomain is the domain name entered above. Verify the ping is successful.

          If the ping fails (click to expand)
          1. Go to Network and click Settings in the Global Configuration window.
          2. Ensure the DNS Servers and Default Gateway settings match the connection to the Entra domain.
        3. Join the domain.

          a. Go to Credentials > Directory Services and click Configure Active Directory to open the Active Directory screen.

          b. Enter the Entra domain name in Domain Name and the administrator account credentials in Domain Account Name and Domain Account Password.

          c. Select Enable to attempt to join the domain immediately after saving the configuration.

          d. Click Save.

          TrueNAS can take a few minutes to populate directory information after configuration. To check the join progress, open the Task Manager in the upper-right corner. TrueNAS displays any errors during the join process in the Task Manager.

        4. Verify domain users and groups are available.

          Go to Datasets and select any existing non-root dataset from the dataset tree table. Click Edit on the Permissions widget to open the permissions edit screen for the dataset.

          Use the User and Group dropdown menus to ensure domain accounts are present.