Update Servers/Virtualization/Proxmox/Configuring iSCSI-based Cluster Storage.md
All checks were successful
GitOps Automatic Deployment / GitOps Automatic Deployment (push) Successful in 6s
All checks were successful
GitOps Automatic Deployment / GitOps Automatic Deployment (push) Successful in 6s
This commit is contained in:
@@ -56,52 +56,72 @@ zfs create -V ${ZVOL_SIZE} \
|
||||
!!! 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
|
||||
|
||||
## Configure iSCSI Target (TrueNAS CLI)
|
||||
```sh
|
||||
# Enable iSCSI Service
|
||||
service ctld start
|
||||
sysrc ctld_enable=YES
|
||||
```
|
||||
|
||||
# Create iSCSI Portal
|
||||
ctladm create -b block -l /dev/zvol/CLUSTER-STORAGE/iscsi-storage iscsi-lun-0
|
||||
### Create the iSCSI LUN Backing (CLI)
|
||||
This step creates the **actual block-backed LUN** that will be exported via iSCSI.
|
||||
|
||||
# Create Target
|
||||
ctladm create -t iqn.2026-01.io.bunny-lab:storage
|
||||
|
||||
# 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
|
||||
```sh
|
||||
# Sanity check: confirm the backing zvol exists
|
||||
ls -l /dev/zvol/${POOL_NAME}/${ZVOL_NAME}
|
||||
|
||||
# --- Create the CTL LUN (iSCSI "extent") ---
|
||||
# Name identity is carried via Serial Number and Device ID
|
||||
# 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 sized correctly (must be NON-ZERO)
|
||||
### Verify the LUN is real and correctly sized
|
||||
|
||||
```sh
|
||||
ctladm devlist -v
|
||||
```
|
||||
|
||||
!!! 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
|
||||
|
||||
Perform the following **on each Proxmox node**.
|
||||
|
||||
```sh
|
||||
# Install iSCSI Utilities
|
||||
apt update
|
||||
@@ -131,7 +151,6 @@ vgcreate vg_proxmox_iscsi /dev/sdX
|
||||
```
|
||||
|
||||
## Register Storage in Proxmox
|
||||
|
||||
### Rescan LVM (Other Nodes)
|
||||
```sh
|
||||
pvscan
|
||||
@@ -139,7 +158,6 @@ vgscan
|
||||
```
|
||||
|
||||
### Add Storage (GUI or CLI)
|
||||
|
||||
**Datacenter → Storage → Add → LVM**
|
||||
|
||||
- ID: `iscsi-lvm`
|
||||
|
||||
Reference in New Issue
Block a user