## Purpose This document describes the **end-to-end procedure** for creating a **thick-provisioned iSCSI-backed shared storage target** on **TrueNAS CORE**, and consuming it from a **Proxmox VE cluster** using **shared LVM**. This approach is intended to: - Provide SAN-style block semantics - Enable Proxmox-native snapshot functionality (LVM volume chains) - Avoid third-party plugins or middleware - Be fully reproducible via CLI ## Assumptions - TrueNAS **CORE** (not SCALE) - ZFS pool already exists and is healthy - SSH service is enabled on TrueNAS - Proxmox VE nodes have network connectivity to TrueNAS - iSCSI traffic is on a reliable, low-latency network (10GbE recommended) - All VM workloads are drained from at least one Proxmox node for maintenance !!! note "Proxmox VE Version Context" This guide assumes **Proxmox VE 9.1.4 (or later)**. Snapshot-as-volume-chain support on shared LVM (e.g., iSCSI) is available and improved, including enhanced handling of vTPM state in offline snapshots. :contentReference[oaicite:5]{index=5} !!! warning "Important" `volblocksize` **cannot be changed after zvol creation**. Choose carefully. ## Target Architecture ``` ZFS Pool └─ Zvol (Thick / Reserved) └─ iSCSI Extent └─ Proxmox LVM PV └─ Shared VG └─ VM Disks ``` ## Create a Dedicated Zvol for Proxmox ### Variables Adjust as needed before execution. ```sh POOL_NAME="CLUSTER-STORAGE" ZVOL_NAME="iscsi-storage" ZVOL_SIZE="14T" VOLBLOCKSIZE="16K" ``` ### Create the Zvol (Thick-Provisioned) ```sh zfs create -V ${ZVOL_SIZE} \ -o volblocksize=${VOLBLOCKSIZE} \ -o compression=lz4 \ -o refreservation=${ZVOL_SIZE} \ ${POOL_NAME}/${ZVOL_NAME} ``` !!! note The `refreservation` enforces **true thick provisioning** and prevents overcommit. ## Configure iSCSI Target (TrueNAS CORE) This section uses a **hybrid approach**: - **CLI** is used for ZFS and LUN (extent backing) creation - **TrueNAS GUI** is used for iSCSI portal, target, and association - **CLI** is used again for validation ### Enable iSCSI Service ```sh service ctld start sysrc ctld_enable=YES ``` ### Create the iSCSI LUN Backing (CLI) This step creates the **actual block-backed LUN** that will be exported via iSCSI. ```sh # Sanity check: confirm the backing zvol exists ls -l /dev/zvol/${POOL_NAME}/${ZVOL_NAME} # Create CTL LUN backed by the zvol ctladm create -b block \ -o file=/dev/zvol/${POOL_NAME}/${ZVOL_NAME} \ -S ISCSI-STORAGE \ -d ISCSI-STORAGE ``` ### Verify the LUN is real and correctly sized ```sh ctladm devlist -v ``` !!! tip `Size (Blocks)` must be **non-zero** and match the zvol size. If it is `0`, stop and correct before proceeding. ### Configure iSCSI Portal, Target, and Association (GUI) In the TrueNAS Web UI, navigate to **Sharing → Block Shares (iSCSI)** then proceed to perform the tasks seen in the tabs below, from left-to-right: === "Portal" * **Portals → Add** * IP Address: `0.0.0.0` * Port: `3260` === "Target" * **Targets → Add** * Target Name: `iqn.2026-01.io.bunny-lab:storage` * Authentication: `None` * Portal Group: `