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-07 00:40:11 -07:00
parent 5188bf6689
commit e9837f85af

View File

@@ -93,38 +93,68 @@ 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 in order from left-to-right:
### Configure iSCSI Portal, Target, and Extent Association (CLI Only)
=== "Portals"
!!! warning "Do NOT Use the TrueNAS iSCSI GUI"
**Once you choose a CLI-managed iSCSI configuration, the TrueNAS Web UI must never be used for iSCSI.**
Opening or modifying **Sharing → Block Shares (iSCSI)** in the GUI will **overwrite CTL runtime state**, invalidate manual `ctladm` configuration, and result in targets that appear correct but expose **no LUNs** to initiators.
**Portals → Add**
**This configuration is CLI-owned and CLI-managed.**
* IP Address: `0.0.0.0`
* Port: `3260`
- Do **not** add, edit, or view iSCSI objects in the GUI
- Do **not** use the iSCSI wizard
- Do **not** mix GUI extents with CLI-created LUNs
=== "Targets"
#### Create iSCSI Portal (Listen on All Interfaces)
**Targets → Add**
```sh
# Backup any existing ctl.conf
cp -av /etc/ctl.conf /etc/ctl.conf.$(date +%Y%m%d-%H%M%S).bak 2>/dev/null || true
* Target Name: `iqn.2026-01.io.bunny-lab:storage`
* Authentication: `None`
* Portal Group: `<Select the portal created above>`
# Write a clean /etc/ctl.conf
cat > /etc/ctl.conf <<'EOF'
# --- Bunny Lab: Proxmox iSCSI (CLI-only) ---
=== "Extents"
# Listen on all interfaces on the default iSCSI port
portal-group "pg0" {
listen 0.0.0.0:3260
}
**Extents → Add**
# Create a target IQN
target "iqn.2026-01.io.bunny-lab:storage" {
portal-group "pg0"
* Extent Name: `ISCSI-STORAGE`
* Extent Type: `Device`
* Device: `/dev/zvol/${POOL_NAME}/${ZVOL_NAME}` (e.g. `CLUSTER-STORAGE/iscsi-storage (8T)`)
# Export LUN 0 backed by the zvol device
lun 0 {
path /dev/zvol/CLUSTER-STORAGE/iscsi-storage
serial "ISCSI-STORAGE"
device-id "ISCSI-STORAGE"
}
}
EOF
=== "Associated Targets"
# Restart ctld to apply the configuration file
service ctld restart
**Associated Targets → Add**
# Verify the iSCSI listener is actually up
sockstat -4l | grep ':3260'
# Verify CTL now shows an iSCSI frontend
ctladm portlist -v | egrep -i '(^Port|iscsi|listen=)'
```
!!! success
At this point, the iSCSI target is live and correctly exposing a block device to initiators.
You may now proceed to **Connect from Proxmox VE Nodes**.
---
If you want, next we can:
* Adjust the **earlier sections** to explicitly lock the document into “CLI-only iSCSI mode”
* Add a **one-line guardrail** near the top of the document to prevent future foot-guns
* Or validate the final CTL state against what Proxmox expects before PV creation
* Target: `iqn.2026-01.io.bunny-lab:storage`
* Extent: `ISCSI-STORAGE`
## Connect from ProxmoxVE Nodes
Perform the following **on each Proxmox node**.
@@ -140,6 +170,9 @@ iscsiadm -m discovery -t sendtargets -p <TRUENAS_IP>
# Log In
iscsiadm -m node --login
# Rescan SCSI Bus
iscsiadm -m session -P 3
### Verify Device
lsblk
```