Technical

Enterprise iSCSI support in PVE: multipath and CHAP with a TrueNAS target

Enterprise iSCSI support in PVE: multipath and CHAP with a TrueNAS target

Enterprise iSCSI support in PVE is solid once you get multipath and CHAP sorted. TrueNAS makes a decent target, but the LUN mapping can trip you up if you’re not careful. Here’s what I’d do.

Empty metal storage racks in a spacious industrial warehouse setting.

Set up the TrueNAS target

On TrueNAS, create a zvol and an iSCSI extent. Then create a target and map the extent to it. Give the target a portal IP — that’s the IP Proxmox will connect to. If you want multipath, add a second portal IP on a different subnet or VLAN. Enable CHAP if you need it, and set a username and secret. Write those down; you’ll need them on the Proxmox side.

Connect Proxmox to the target

In Proxmox, go to Datacenter → Storage → Add → iSCSI. Enter the portal IP and the CHAP credentials if you set them. Proxmox will discover the target and list the LUNs. You can then add an LVM or LVM-thin on top of the iSCSI LUN, or use it directly for VM disks. I’d go with LVM-thin for snapshots.

Multipath setup

Multipath gives you failover if one path drops. Install multipath-tools on the Proxmox host: apt install multipath-tools. Then edit /etc/multipath.conf and add a device section for your TrueNAS target. The wwid you can get from multipath -ll after connecting. Set path_grouping_policy to failover and path_selector to "round-robin 0". Restart multipathd. Then in Proxmox, when adding the iSCSI storage, use the multipath device instead of the raw LUN. The multipath device shows up as /dev/mapper/ something.

Bright modern warehouse featuring pallets and storage racks for logistics and inventory management.

CHAP authentication

CHAP is just a username and password for the iSCSI session. On Proxmox, you put the same credentials you set on TrueNAS in the storage configuration. If they don’t match, the login fails and you get an error in the syslog. One thing: CHAP is per-target, not per-LUN, so if you have multiple LUNs on one target they all share the same credentials. That’s fine for a homelab.

Quirks and caveats

The LUN mapping on TrueNAS can be confusing. The LUN ID you set in the extent mapping is what Proxmox sees. If you change it later, Proxmox might not pick up the change until you rescan. You can rescan with iscsiadm -m session --rescan. Also, if you’re using multipath, make sure the udev rules are correct or you’ll get duplicate devices. That’s a pain to clean up.

Overall, enterprise iSCSI support in PVE is there and it works. Just don’t expect it to be as polished as a commercial SAN. For a homelab, it’s plenty.

If you’d rather pay for this

If you want iSCSI without the setup hassle, a Synology NAS with iSCSI support runs about $500 for a 2-bay unit. It’s worth it if you want a set-and-forget target with a web UI. But if you already have TrueNAS, stick with that — the extra cost isn’t worth it for most homelabs.

Related: Proxmox configuration validation: check /etc/pve files before you reboot

Leave a comment

Comments are reviewed before they appear. Your email is never published.