XCP-ng supports High Availability (HA) that works with iSCSI storage.
HA Requirements:
-
Minimum 3 hosts recommended
-
Shared storage accessible by all hosts (iSCSI multipath)
-
HA heartbeat storage (can use separate SR or same SR)
HA Architecture with iSCSI
Creating iSCSI Storage Repository
Via Xen Orchestra (Recommended): 1. Go to New -> Storage 2. Select iSCSI as storage type 3. Enter portal IPs, target IQN, and authentication details 4. Select the LUN to use 5. Click Create
Via xe CLI:
# Discover targets
iscsiadm -m discovery -t sendtargets -p <PORTAL_IP_1>:3260
iscsiadm -m discovery -t sendtargets -p <PORTAL_IP_2>:3260
# Create iSCSI SR
xe sr-create name-label="iSCSI Storage" type=lvmoiscsi shared=true \
device-config:target=<PORTAL_IP_1>,<PORTAL_IP_2> \
device-config:targetIQN=<TARGET_IQN> \
device-config:SCSIid=<SCSI_ID>
Path Redundancy
Verify path redundancy:
# Check multipath status
multipath -ll
# Expected output with 4 paths (2 NICs 2 portals):
# 3600... dm-X VENDOR,PRODUCT
# size=100G features='0' hwhandler='1 alua' wp=rw
# |-+- policy='service-time 0' prio=50 status=active
# | |- 1:0:0:1 sda 8:0 active ready running
# | `- 2:0:0:1 sdb 8:16 active ready running
# `-+- policy='service-time 0' prio=10 status=enabled
# |- 3:0:0:1 sdc 8:32 active ready running
# `- 4:0:0:1 sdd 8:48 active ready running
Test failover:
# Simulate path failure (disconnect one NIC)
ip link set eth1 down
# Verify I/O continues on remaining paths
multipath -ll
# Restore path
ip link set eth1 up
# Verify path returns
multipath -ll