Windows Server  ·  critical  ·  Storage, SAN & file services

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

Event 20Event 39 iScsiPrtEvent 129Target did not respondConnection to the target was lostSAN policy

Fixes (2)

Set the SAN policy and make the connection persistent
Elevated PowerShell25 minutesmedium riskreversible

Disks come back offline after a reboot.

  1. Check the current SAN policy. On Server it defaults to Offline Shared, which is why every new disk arrives offline.

    PowerShell
    Get-StorageSetting | Format-List NewDiskPolicy

    This 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.

  2. On a standalone server with dedicated LUNs, change it.

    PowerShell
    Set-StorageSetting -NewDiskPolicy OnlineAll
  3. On a cluster node, leave the policy alone — the cluster service brings disks online. Changing it there causes corruption.

  4. Bring the disks online and clear the read-only flag.

    PowerShell
    Get-Disk | Where-Object OperationalStatus -eq 'Offline' | Set-Disk -IsOffline $falseGet-Disk | Where-Object IsReadOnly -eq $true | Set-Disk -IsReadOnly $false
  5. Make the iSCSI connection persistent so it re-establishes at boot.

    PowerShell
    Get-IscsiTarget | Connect-IscsiTarget -IsPersistent $true -IsMultipathEnabled $trueGet-IscsiSession | Format-Table TargetNodeAddress,IsPersistent,IsConnected
  6. Set the volumes to mount by GUID or a persistent letter so drive letters do not move.

    PowerShell
    mountvol
Confirm it workedAfter a reboot the disks come back online with the same letters.
PowerShell
Get-Disk | Format-Table Number,FriendlyName,OperationalStatus,IsOffline,BusTypeGet-Volume | Format-Table DriveLetter,FileSystemLabel,HealthStatus
If you need to undo itSet-StorageSetting -NewDiskPolicy OfflineShared restores the default.
Give the storage a redundant path and the right network
Elevated PowerShell90 minuteshigh riskreversible

Sessions drop during use.

  1. Read the events to see whether the target or the network went away.

    PowerShell
    Get-WinEvent -LogName System -MaxEvents 200 | Where-Object ProviderName -like '*iScsiPrt*' | Format-Table TimeCreated,Id,Message -Wrap
  2. Check whether MPIO is installed and claiming the devices.

    PowerShell
    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.

  3. Install and configure MPIO for iSCSI.

    PowerShell
    Install-WindowsFeature Multipath-IO -RestartEnable-MSDSMAutomaticClaim -BusType iSCSISet-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR
  4. Put storage traffic on dedicated adapters and a separate subnet or VLAN, with no default gateway on the storage interfaces.

    PowerShell
    Get-NetAdapter | Format-Table Name,InterfaceDescription,LinkSpeed,StatusGet-NetIPConfiguration | Format-Table InterfaceAlias,IPv4Address,IPv4DefaultGateway
  5. 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.

  6. Raise the disk timeout so a brief path failure does not fail the I/O.

    PowerShell
    Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Services\Disk' -Name TimeOutValue -Value 60 -Type DWord
Confirm it workedBoth paths are active, and pulling one cable does not interrupt I/O.
PowerShell
mpclaim -s -d 0Get-IscsiSession | Format-Table TargetNodeAddress,IsConnected,NumberOfConnections
If you need to undo itMPIO can be removed with Uninstall-WindowsFeature, though not while paths depend on it.

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.