This connects a Windows server to disks shared from a storage box over iSCSI, using two network paths at once. If one path fails, the disks stay connected.
The server sees shared disks over two paths, so one path can fail without losing storage.
A single path to storage is a single point of failure for every VM on it.
Start the iSCSI service, turn on multipath, add the storage box on each path and connect.
The storage box must already share the disks, as in Share disks over iSCSI. The server needs a card on each storage network and the Multipath I/O feature, as in Add team and storage network cards and Install the Hyper-V and clustering roles.
The example
| Path | This server | Storage box |
|---|---|---|
| A | 10.0.61.11 | 10.0.61.10 |
| B | 10.0.62.11 | 10.0.62.10 |
Start the iSCSI service
Set-Service MSiSCSI -StartupType Automatic Start-Service MSiSCSI
Turn on multipath for iSCSI
With two paths, Windows sees every disk twice. Multipath I/O joins the two views into one disk. Do this before you connect.
Enable-MSDSMAutomaticClaim -BusType iSCSI | Out-Null Set-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR
RR is round robin: Windows uses both paths in turn.
Tell Windows where the storage is
Add the storage box once per path. Naming the server's own address on each line pins that path to the right card.
New-IscsiTargetPortal -TargetPortalAddress 10.0.61.10 -InitiatorPortalAddress 10.0.61.11 | Out-Null New-IscsiTargetPortal -TargetPortalAddress 10.0.62.10 -InitiatorPortalAddress 10.0.62.11 | Out-Null
Connect to every share on both paths
foreach ($t in Get-IscsiTarget) {
Connect-IscsiTarget -NodeAddress $t.NodeAddress -TargetPortalAddress 10.0.61.10 -InitiatorPortalAddress 10.0.61.11 -IsMultipathEnabled $true -IsPersistent $true | Out-Null
Connect-IscsiTarget -NodeAddress $t.NodeAddress -TargetPortalAddress 10.0.62.10 -InitiatorPortalAddress 10.0.62.11 -IsMultipathEnabled $true -IsPersistent $true | Out-Null
}-IsPersistent makes Windows reconnect after every restart.
Check it
Get-IscsiTarget | Format-Table NodeAddress, IsConnected -AutoSize
Get-IscsiSession | Format-Table TargetNodeAddress, InitiatorPortalAddress, IsConnected, IsPersistent -AutoSize
Get-Disk | Where-Object BusType -eq 'iSCSI' |
Format-Table Number, FriendlyName, @{n='GB';e={[math]::Round($_.Size/1GB,1)}}, PartitionStyle, OperationalStatus -AutoSize| Table | What you want, with two shares |
|---|---|
| Targets | Both shares listed, connected. |
| Sessions | Four rows: each share once on each path, connected and persistent. |
| Disks | Two disks, shown as RAW and Offline. That is correct for new disks. |
If four disks are listed for two shares, Multipath I/O has not taken over yet. Restart the server and check again.
Note the server's iSCSI name
(Get-InitiatorPort | Where-Object ConnectionType -eq 'iSCSI').NodeAddress
It looks like iqn.1991-05.com.microsoft:con-hv-01.ad.contoso.com. The storage box uses this name to allow only your servers to connect.
Test the paths by failing a storage card
First look at the paths while everything is healthy. Each disk should show 02 Paths.
mpclaim -s -d mpclaim -s -d 0 mpclaim -s -d 1
Now take one storage card away. On a physical server, pull its cable. If the server is a VM, disconnect the card on the machine it runs on:
Disconnect-VMNetworkAdapter -VMName 'CON-HV-01' -Name 'iSCSI-A'
Wait half a minute, then run the three mpclaim commands again. Each disk should show 01 Paths and still be Active/Optimized. The disks stay in Get-Disk throughout.
Get-IscsiSession can fail with "Invalid property" while a session is retrying, and can still count the lost sessions as connected for the first half minute. It works again once the path is back.
Put the card back and check it kept its VLAN:
Connect-VMNetworkAdapter -VMName 'CON-HV-01' -Name 'iSCSI-A' -SwitchName 'CON-LAN'
Get-VMNetworkAdapterVlan -VMName 'CON-HV-01' | Format-Table @{n='Card';e={$_.ParentAdapter.Name}}, OperationMode, AccessVlanId -AutoSizeAfter a minute, each disk should be back to 02 Paths and the session count back to two per share. The sessions are persistent, so they reconnect on their own. Then repeat with iSCSI-B.
Once the disks are formatted and in use, run the test again and write a file to the disk while the card is out. That proves the disk still works on one path, not just that it is still listed.
Do not format yet
For a cluster, connect every node first, then bring the disks online and format them from one node only. Formatting from two nodes at once damages the disk.
Done when
Every share shows two connected, persistent sessions, and each share appears as one disk.


