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,40 +93,70 @@ ctladm devlist -v
!!! tip !!! tip
`Size (Blocks)` must be **non-zero** and match the zvol size. If it is `0`, stop and correct before proceeding. `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) ### Configure iSCSI Portal, Target, and Extent Association (CLI Only)
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:
=== "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` - Do **not** add, edit, or view iSCSI objects in the GUI
* Port: `3260` - 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` # Write a clean /etc/ctl.conf
* Authentication: `None` cat > /etc/ctl.conf <<'EOF'
* Portal Group: `<Select the portal created above>` # --- 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` # Export LUN 0 backed by the zvol device
* Extent Type: `Device` lun 0 {
* Device: `/dev/zvol/${POOL_NAME}/${ZVOL_NAME}` (e.g. `CLUSTER-STORAGE/iscsi-storage (8T)`) 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'
* Target: `iqn.2026-01.io.bunny-lab:storage` # Verify CTL now shows an iSCSI frontend
* Extent: `ISCSI-STORAGE` ctladm portlist -v | egrep -i '(^Port|iscsi|listen=)'
```
## Connect from Proxmox VE Nodes !!! 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
## Connect from ProxmoxVE Nodes
Perform the following **on each Proxmox node**. Perform the following **on each Proxmox node**.
```sh ```sh
@@ -140,6 +170,9 @@ iscsiadm -m discovery -t sendtargets -p <TRUENAS_IP>
# Log In # Log In
iscsiadm -m node --login iscsiadm -m node --login
# Rescan SCSI Bus
iscsiadm -m session -P 3
### Verify Device ### Verify Device
lsblk lsblk
``` ```