Important:
Vendor Documentation Priority: This guide is for reference only. Always consult official vendor documentation for your distribution. Test thoroughly in a lab environment before production use.
- Debian 11+ or Ubuntu 20.04 LTS+
- iSCSI storage array with portal IPs and target IQN
- Dedicated storage network interfaces
- Root or sudo access
Warning:
If using multiple interfaces on the same subnet, configure ARP settings.
-
Install Packages
sudo apt update
sudo apt install -y open-iscsi multipath-tools
sudo systemctl enable --now open-iscsi multipathd
-
Configure Network Interfaces
Configure dedicated storage interfaces using Netplan (Ubuntu/Debian 11+):
sudo tee /etc/netplan/50-storage.yaml > /dev/null <<EOF
network:
version: 2
renderer: networkd
ethernets:
<INTERFACE_NAME_1>:
addresses:
- <HOST_IP_1>/<CIDR>
mtu: 9000
dhcp4: no
dhcp6: no
<INTERFACE_NAME_2>:
addresses:
- <HOST_IP_2>/<CIDR>
mtu: 9000
dhcp4: no
dhcp6: no
EOF
sudo netplan apply
ip addr show
Warning:
If using multiple interfaces on the same subnet, configure ARP settings.
-
Configure Firewall
Allow all traffic on storage interfaces (recommended for dedicated storage networks):
# Using UFW
sudo ufw allow in on <INTERFACE_NAME_1>
sudo ufw allow in on <INTERFACE_NAME_2>
-
Configure iSCSI Initiator
# View/generate initiator name
cat /etc/iscsi/initiatorname.iscsi
# Set automatic startup
sudo sed -i 's/^node.startup = manual/node.startup = automatic/' /etc/iscsi/iscsid.conf
sudo systemctl restart open-iscsi
Register this initiator IQN with your FlashArray.
-
Create Interface Bindings
# Create and bind first interface
sudo iscsiadm -m iface -I iface0 --op=new
sudo iscsiadm -m iface -I iface0 --op=update -n iface.net_ifacename -v <INTERFACE_NAME_1>
# Create and bind second interface
sudo iscsiadm -m iface -I iface1 --op=new
sudo iscsiadm -m iface -I iface1 --op=update -n iface.net_ifacename -v <INTERFACE_NAME_2>
-
Discover and Login
# Discover targets
sudo iscsiadm -m discovery -t sendtargets -p <PORTAL_IP_1>:3260
sudo iscsiadm -m discovery -t sendtargets -p <PORTAL_IP_2>:3260
# Login via each interface to each portal
sudo iscsiadm -m node -T <TARGET_IQN> -p <PORTAL_IP_1>:3260 -I iface0 --login
sudo iscsiadm -m node -T <TARGET_IQN> -p <PORTAL_IP_2>:3260 -I iface0 --login
sudo iscsiadm -m node -T <TARGET_IQN> -p <PORTAL_IP_1>:3260 -I iface1 --login
sudo iscsiadm -m node -T <TARGET_IQN> -p <PORTAL_IP_2>:3260 -I iface1 --login
# Set automatic login
sudo iscsiadm -m node -T <TARGET_IQN> --op=update -n node.startup -v automatic
# Verify sessions
sudo iscsiadm -m session
-
Configure Multipath
Create /etc/multipath.conf:
sudo tee /etc/multipath.conf > /dev/null <<'EOF'
defaults {
find_multipaths no
polling_interval 10
path_selector "service-time 0"
path_grouping_policy group_by_prio
failback immediate
no_path_retry 0
}
# Blacklist local devices and NVMe to prevent dm-multipath management
# NVMe uses native multipath (nvme_core multipath=Y), not dm-multipath
blacklist {
# Local boot devices (adjust patterns for your environment)
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^sd[a]$" # Adjust if boot device differs
# All NVMe devices - use native NVMe multipath instead
devnode "^nvme"
# Virtual devices
devnode "^vd[a-z]"
}
# Add device-specific settings for your storage array
# Default configurations for many storage arrays are included in the multipath package
# Example for a storage array supporting ALUA:
#devices {
# device {
# vendor "VENDOR"
# product "PRODUCT"
# path_selector "service-time 0"
# hardware_handler "1 alua"
# path_grouping_policy group_by_prio
# prio alua
# failback immediate
# path_checker tur
# fast_io_fail_tmo 10
# dev_loss_tmo 60
# no_path_retry 0
# }
#}
EOF
# Restart multipathd to apply configuration
sudo systemctl restart multipathd
# Verify multipath devices (should only show iSCSI devices)
sudo multipath -ll
Note:
-
Why blacklist local and NVMe devices?
-
Local devices: Prevents dm-multipath from managing boot drives and local storage
-
NVMe devices: NVMe uses native kernel multipath (nvme_core multipath=Y), not dm-multipath. Managing NVMe with dm-multipath causes conflicts and performance issues.
-
Why find_multipaths off? This ensures ALL paths to iSCSI storage devices are claimed by multipath immediately, rather than waiting to detect multiple paths. See iSCSI Best Practices for detailed explanation.
-
Create LVM Storage
# Find multipath device
sudo multipath -ll
# Example: mpatha
# Create LVM
sudo pvcreate /dev/mapper/mpatha
sudo vgcreate iscsi-storage /dev/mapper/mpatha
sudo lvcreate -L 500G -n data iscsi-storage
# Format and mount (Debian/Ubuntu: ext4 recommended)
sudo mkfs.ext4 /dev/iscsi-storage/data
sudo mkdir -p /mnt/iscsi-storage
sudo mount /dev/iscsi-storage/data /mnt/iscsi-storage
# Add to fstab
echo '/dev/iscsi-storage/data /mnt/iscsi-storage ext4 defaults,_netdev 0 0' | sudo tee -a /etc/fstab
-
Verify Configuration:
# Check sessions
sudo iscsiadm -m session
# Check multipath
sudo multipath -ll
# Verify storage
df -h | grep iscsi
Note:
Quick Reference
| Command |
Description |
sudo iscsiadm -m session
|
List active iSCSI sessions |
sudo iscsiadm -m discovery -t sendtargets -p <IP>:3260
|
Discover targets |
sudo iscsiadm -m node -T <IQN> -p <IP>:3260 --login
|
Login to target |
sudo iscsiadm -m node -T <IQN> -p <IP>:3260 --logout
|
Logout from target |
sudo multipath -ll
|
Show multipath devices |
Next Steps
For production deployments, see iSCSI Best Practices for:
- Network design and VLAN configuration
- Multipath configuration details
- Security best practices (AppArmor, CHAP, firewall options)
- Monitoring and troubleshooting
- High availability considerations
Additional Resources: