iSCSI targets disconnect, or disks appear offline after a reboot
The initiator lost its session, or the disks are present and offline because of the SAN policy rather than a storage fault.
What you see
Volumes disappear mid-operation, or come back as Offline after every reboot. Event 20 and 39 from iScsiPrt in the system log.
What is actually wrong
A network interruption on the storage path, no multipath so a single failure drops everything, or the SAN policy set to Offline Shared, which keeps every new disk offline by design.
Codes and articles
Fixes (2)
Set the SAN policy and make the connection persistent
Disks come back offline after a reboot.
Check the current SAN policy. On Server it defaults to Offline Shared, which is why every new disk arrives offline.
Get-StorageSetting | Format-List NewDiskPolicyThis is by design and protects clustered storage from being mounted by two nodes at once. On a standalone server with dedicated LUNs it is simply an obstacle, and it is the cause of almost every "my iSCSI disks are offline again" report.
On a standalone server with dedicated LUNs, change it.
Set-StorageSetting -NewDiskPolicy OnlineAllOn a cluster node, leave the policy alone — the cluster service brings disks online. Changing it there causes corruption.
Bring the disks online and clear the read-only flag.
Get-Disk | Where-Object OperationalStatus -eq 'Offline' | Set-Disk -IsOffline $falseGet-Disk | Where-Object IsReadOnly -eq $true | Set-Disk -IsReadOnly $false
Make the iSCSI connection persistent so it re-establishes at boot.
Get-IscsiTarget | Connect-IscsiTarget -IsPersistent $true -IsMultipathEnabled $trueGet-IscsiSession | Format-Table TargetNodeAddress,IsPersistent,IsConnected
Set the volumes to mount by GUID or a persistent letter so drive letters do not move.
mountvol
Get-Disk | Format-Table Number,FriendlyName,OperationalStatus,IsOffline,BusTypeGet-Volume | Format-Table DriveLetter,FileSystemLabel,HealthStatus
Give the storage a redundant path and the right network
Sessions drop during use.
Read the events to see whether the target or the network went away.
Get-WinEvent -LogName System -MaxEvents 200 | Where-Object ProviderName -like '*iScsiPrt*' | Format-Table TimeCreated,Id,Message -WrapCheck whether MPIO is installed and claiming the devices.
Get-WindowsFeature Multipath-IO | Format-Table Name,InstallStateGet-MPIOAvailableHWmpclaim -s -d
Without MPIO, two paths to the same LUN present as two separate disks, and the operating system will happily corrupt the filesystem by writing through both. It is not an optional optimisation on a multi-path SAN.
Install and configure MPIO for iSCSI.
Install-WindowsFeature Multipath-IO -RestartEnable-MSDSMAutomaticClaim -BusType iSCSISet-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR
Put storage traffic on dedicated adapters and a separate subnet or VLAN, with no default gateway on the storage interfaces.
Get-NetAdapter | Format-Table Name,InterfaceDescription,LinkSpeed,StatusGet-NetIPConfiguration | Format-Table InterfaceAlias,IPv4Address,IPv4DefaultGateway
Turn off any power saving on the storage adapters, and disable flow control or enable it consistently at both ends — a mismatch causes exactly this pattern of drop.
Raise the disk timeout so a brief path failure does not fail the I/O.
Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\Disk' -Name TimeOutValue -Value 60 -Type DWord
mpclaim -s -d 0Get-IscsiSession | Format-Table TargetNodeAddress,IsConnected,NumberOfConnections
Where this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.