Skip to main content
RunBook Academy

← All labs in Proxmox VE

Lab · advanced · ~90 min

Configure iSCSI target and connect via multipath on PVE

A · Physical hardwareB · Nested virtualisation

Objectives

  • Stand up an iSCSI target (LIO / targetcli) on a Linux host
  • Configure multiple LUNs and CHAP authentication
  • Connect from Proxmox using multipath for redundancy
  • Test failover when one path goes down

Prerequisites

  • A Proxmox host with at least two NICs
  • A separate Linux host for the iSCSI target (or a nested VM)
  • A managed switch with both NICs trunked or on the same VLAN

iSCSI target + multipath lab

This lab builds a small iSCSI fabric with two paths and verifies that Proxmox survives the loss of either path without I/O interruption.

Environment

RoleHostNICs
iSCSI targettgt-hosteth0 (10.0.10.1), eth1 (10.0.11.1)
PVE initiatorpve-hosteth0 (10.0.10.2), eth1 (10.0.11.2)

Steps

1. Configure the iSCSI target (tgt-host)

apt install -y targetcli-fb

# Create a backing store
targetcli /backstores/block create lun0 /dev/sdb
targetcli /backstores/block create lun1 /dev/sdc

# Create an iSCSI target with two portals
targetcli /iscsi create iqn.2026-08.lab.runbook:tgt1
targetcli /iscsi/iqn.2026-08.lab.runbook:tgt1/tpg1/portals create 10.0.10.1
targetcli /iscsi/iqn.2026-08.lab.runbook:tgt1/tpg1/portals create 10.0.11.1

# Map LUNs and enable CHAP
targetcli /iscsi/iqn.2026-08.lab.runbook:tgt1/tpg1/luns create /backstores/block/lun0
targetcli /iscsi/iqn.2026-08.lab.runbook:tgt1/tpg1/luns create /backstores/block/lun1
targetcli /iscsi/iqn.2026-08.lab.runbook:tgt1/tpg1 set attribute authentication=1
targetcli /iscsi/iqn.2026-08.lab.runbook:tgt1/tpg1/acls create iqn.2026-08.lab.runbook:pve1
targetcli /iscsi/iqn.2026-08.lab.runbook:tgt1/tpg1/acls/iqn.2026-08.lab.runbook:pve1 set auth userid=pveuser
targetcli /iscsi/iqn.2026-08.lab.runbook:tgt1/tpg1/acls/iqn.2026-08.lab.runbook:pve1 set auth password=CHAPpassword
targetcli saveconfig

2. Discover and login from Proxmox

# On pve-host
iscsiadm -m discovery -t sendtargets -p 10.0.10.1
iscsiadm -m node -T iqn.2026-08.lab.runbook:tgt1 -o update -n node.session.auth.authmethod -v CHAP
iscsiadm -m node -T iqn.2026-08.lab.runbook:tgt1 -o update -n node.session.auth.username -v pveuser
iscsiadm -m node -T iqn.2026-08.lab.runbook:tgt1 -o update -n node.session.auth.password -v CHAPpassword
iscsiadm -m node -T iqn.2026-08.lab.runbook:tgt1 --login

Confirm both paths are visible:

iscsiadm -m session -P 1
# Expected: 2 sessions (one per portal)

3. Configure multipath

apt install -y multipath-tools
cat > /etc/multipath.conf << 'EOF'
defaults {
  user_friendly_names yes
  find_multipaths yes
}
EOF
systemctl enable --now multipathd
multipath -ll
# Expected: one dm device per LUN with 2 active paths

4. Add iSCSI storage to Proxmox

In the GUI: Datacenter → Storage → Add → iSCSI. Use the multipath device (/dev/mapper/mpath0) as the LUN path.

5. Create a test VM on the iSCSI LUN

qm create 901 --name iscsi-test --memory 2048 --cores 2 \
  --scsi0 iscsilun:32 --net0 virtio,bridge=vmbr0 --ostype l26
qm start 901

6. Test failover

Run I/O inside the VM:

# Inside VM
fio --name=randwrite --ioengine=libaio --iodepth=32 \
  --rw=randwrite --bs=4k --direct=1 --size=1G --filename=/tmp/fiotest

Pull one NIC on the target (or ip link set eth0 down on the target):

# On tgt-host
ip link set eth0 down

The fio job should continue with slightly elevated latency but no errors. Check multipath status from PVE:

multipath -ll
# Expected: 1 active, 1 failed path

Restore the link:

# On tgt-host
ip link set eth0 up
multipath -ll
# Expected: 2 active paths again

Verification

  • Multipath shows 2 paths per LUN, both active
  • VM I/O continues during a single-path outage
  • After path recovery, multipath re-balances automatically

Cleanup

qm stop 901 && qm destroy 901
iscsiadm -m node -T iqn.2026-08.lab.runbook:tgt1 --logout
# On tgt-host: targetcli clearconfig confirm=True

Deliverables

  • · An iSCSI target exporting two LUNs with CHAP
  • · Proxmox initiator with multipath configured
  • · Demonstrated failover when one NIC is disconnected

Verification status

Executed end to end
not yet run on hardware

The commands and configuration here have been reviewed against the verified software versions, but nobody has run this lab start to finish on a system meeting its prerequisites. Treat the Expected Outcome as the intended result rather than an observed one, and keep the Cleanup section to hand.