Update Servers/Virtualization/Proxmox/Configuring iSCSI-based Cluster Storage.md
All checks were successful
GitOps Automatic Deployment / GitOps Automatic Deployment (push) Successful in 6s

This commit is contained in:
2026-01-06 23:53:34 -07:00
parent ec2c6cfb28
commit 425da31bd1

View File

@@ -56,52 +56,72 @@ zfs create -V ${ZVOL_SIZE} \
!!! note !!! note
The `refreservation` enforces **true thick provisioning** and prevents overcommit. 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
## Configure iSCSI Target (TrueNAS CLI)
```sh ```sh
# Enable iSCSI Service
service ctld start service ctld start
sysrc ctld_enable=YES sysrc ctld_enable=YES
```
# Create iSCSI Portal ### Create the iSCSI LUN Backing (CLI)
ctladm create -b block -l /dev/zvol/CLUSTER-STORAGE/iscsi-storage iscsi-lun-0 This step creates the **actual block-backed LUN** that will be exported via iSCSI.
# Create Target ```sh
ctladm create -t iqn.2026-01.io.bunny-lab:storage # Sanity check: confirm the backing zvol exists
# Create Extent
ctladm create -b block -l /dev/zvol/${POOL_NAME}/${ZVOL_NAME} proxmox-extent
### Associate Target + Extent
ctladm add -t proxmox-target -l proxmox-extent
----------
# Enable iSCSI Service (TrueNAS CORE)
service ctld start
sysrc ctld_enable=YES
# Sanity Check: Confirm the backing zvol exists
ls -l /dev/zvol/${POOL_NAME}/${ZVOL_NAME} ls -l /dev/zvol/${POOL_NAME}/${ZVOL_NAME}
# --- Create the CTL LUN (iSCSI "extent") --- # Create CTL LUN backed by the zvol
# Name identity is carried via Serial Number and Device ID
ctladm create -b block \ ctladm create -b block \
-o file=/dev/zvol/${POOL_NAME}/${ZVOL_NAME} \ -o file=/dev/zvol/${POOL_NAME}/${ZVOL_NAME} \
-S ISCSI-STORAGE \ -S ISCSI-STORAGE \
-d ISCSI-STORAGE -d ISCSI-STORAGE
```
# Verify the LUN is real and sized correctly (must be NON-ZERO) ### Verify the LUN is real and correctly sized
```sh
ctladm devlist -v ctladm devlist -v
``` ```
!!! tip !!! tip
At this point, the LUN is live and can be discovered by initiators. `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)**:
#### Create Portal
* **Portals → Add**
* IP Address: `0.0.0.0`
* Port: `3260`
#### Create Target
* **Targets → Add**
* Target Name: `iqn.2026-01.io.bunny-lab:storage`
* Authentication: `None`
* Portal Group: `<Select the portal created above>`
#### Create Extent
* **Extents → Add**
* Extent Name: `ISCSI-STORAGE`
* Extent Type: `Device`
* Device: `/dev/zvol/${POOL_NAME}/${ZVOL_NAME}` (e.g. `CLUSTER-STORAGE/iscsi-storage (8T)`)
#### Associate Target + Extent
* **Associated Targets → Add**
* Target: `iqn.2026-01.io.bunny-lab:storage`
* Extent: `ISCSI-STORAGE`
## Connect from Proxmox VE Nodes ## Connect from Proxmox VE Nodes
Perform the following **on each Proxmox node**. Perform the following **on each Proxmox node**.
```sh ```sh
# Install iSCSI Utilities # Install iSCSI Utilities
apt update apt update
@@ -131,7 +151,6 @@ vgcreate vg_proxmox_iscsi /dev/sdX
``` ```
## Register Storage in Proxmox ## Register Storage in Proxmox
### Rescan LVM (Other Nodes) ### Rescan LVM (Other Nodes)
```sh ```sh
pvscan pvscan
@@ -139,7 +158,6 @@ vgscan
``` ```
### Add Storage (GUI or CLI) ### Add Storage (GUI or CLI)
**Datacenter → Storage → Add → LVM** **Datacenter → Storage → Add → LVM**
- ID: `iscsi-lvm` - ID: `iscsi-lvm`