Skip to main content
Pure1 Support Portal

Windows Reporting Drives Offline After Reboots

Applies to Platforms: FA-3xx, FA-4xx, FlashArray//M, FlashArray//X

Applies to Operating Systems: Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Storage Server 2012, Windows Storage Server 2016, Windows Server, version 1709

Resolved in Purity//FA: 4.7.104.8.84.9.3

Symptoms

After reboot, LUNs previously connected to Windows Servers remain in an OFFLINE (VDS_SP_OFFLINE) state due to the following reason:

"The disk is offline because of policy set by an administrator".

You are able to bring the drive back into service manually by opening Disk Manager and right-clicking the drive and selecting "online". Once the disk is online it is able to service IO as expected and no further issues are noted.

Diagnosis

This issue can be seen after a Purity//FA upgrade has been performed on the FlashArray sometime since the last reboot was completed on the Windows Host. 

The reason the disks are in an offline state is that our LUNs are assigned new 'revision numbers' when an upgrade of Purity//FA is performed. The Windows 2008 and Windows 2012 servers then interpret these as "new" disks because of this new revision number and then sets the drives to offline after a host reboot.

The primary reason this happens is a design change within Windows 2008 and forward where the default SAN policy for shared drives is set to the following:

VDS_SP_OFFLINE_SHARED

This means if a new shared drive is presented to a Windows Host it will keep the drive offline to ensure that drive should be presented to this host. If that drive is supposed to be presented to the specific host then it can be brought online as needed by the Administrator.

Solution

Workaround

The fastest resolution is to bring the drive back into service manually by opening Disk Management and right-clicking the drive and selecting "online". Once the disk is online it is able to service IO as expected and no further issues are noted. As the Product Revision will no longer change in future versions of Purity//FA.

Long-Term Fix

SAN Policy Changes

The first step to resolving this issue long term is changing the SAN Policy to "Online All"  as per our Step 04 -- Disk Policy Configuration (SAN Policy) KB. By setting this policy you ensure that any newly created disks attached to the Windows Server will be in an online state after a Windows Server reboot. Windows Server defaults to OfflineShared which is the correct setting when using Windows Server Failover Clustering. 

This task can be completed by following the Microsoft TechNet Article: https://technet.microsoft.com/en-us/library/gg252636.aspx

Update Existing Disk Attributes for Future Compliance

If the SAN Policy was set to 'Offline Shared', and disks were already presented to the Windows host from the FlashArray, then you must edit the existing disks 'Attributes' to ensure they will remain online following a Purity//FA upgrade and Windows host reboot. However, if this volume is used in Windows Server Failover Clustering you must ensure the disks are returned to the correct state following a reboot since setting the SAN Policy will not set the disk to read and write as these disks are on a "shared bus (such as SCSI and iSCSI)" and will be set to read-only as per the TechNet article above.  

To quickly edit the FlashArray volumes Attributes, the following script has been created. The script will modify the Registry values of Pure Storage FlashArray volumes to OnlineAll.

This script will ask the user to create a registry backup and iterate through the Pure Storage volumes attached to the host and change the registry value to "VDS_SP_ONLINE".

The script will not bring any volumes into an "Online" state. Please use PowerShell or the Disk Manager to bring any Offline volumes Online. This script is meant to be used with stand-alone Windows hosts and should not be used with Windows Server Failover Clustering configured hosts.

Details regarding the process the script does can be found in the following Microsoft article: https://support.microsoft.com/en-us/help/2849097/how-to-set-the-partmgr-attributes-registry-value-using-powershell

When editing the Windows Registry, making a backup is recommended and included as part of the script. Please review the script's contents.

Clear-Host
Write-Host "----------------------------------------------------------------------------------------------------------"
Write-Host " Purpose"
Write-Host "----------------------------------------------------------------------------------------------------------"
Write-Host " This script is intended to change the Pure Storage disk 'Attributes' to a SAN Policy"
Write-Host " equivalent of 'OnlineAll'. This is intended to ensure disks presented to the Windows Host"
Write-Host " are brought online after a Purity upgrade and Windows Server reboot are performed."
Write-Host "----------------------------------------------------------------------------------------------------------"
Write-Host " Value for VDS_SAN_POLICY"
Write-Host "   VDS_SP_UNKNOWN         = 0x0 (0)"
Write-Host "   VDS_SP_ONLINE          = 0x1 (1)"
Write-Host "   VDS_SP_OFFLINE_SHARED  = 0x2 (2)"
Write-Host "   VDS_SP_OFFLINE         = 0x3 (3)"
Write-Host " Refer to Virtual Disk Service (VDS) Documentation for more details `n`r https://msdn.microsoft.com/en-us/library/bb525577%28vs.85%29.aspx?f=255&MSPPError=-2147217396."
Write-Host "----------------------------------------------------------------------------------------------------------"
Write-Host 

#Requires -Version 3

$VDS_SP_UNKNOWN = 0
$VDS_SP_ONLINE = 1
$VDS_SP_OFFLINE_SHARED = 2
$VDS_SP_OFFLINE = 3
$DeviceInfoFile = ".\Desktop\PureStorage-Devices-Information-$(Get-Date -Format FileDateTime).txt"
$RegistryBackup = '.\Desktop\PureStorage-RegistryBackup.reg'
$DeviceHKLMHive = 'HKLM:\SYSTEM\CurrentControlSet\Enum\SCSI\Disk&Ven_PURE&Prod_FlashArray\*\Device Parameters\'
$DeviceIds = Get-ChildItem $DeviceHKLMHive
$Devices = @()

# Registry backup is required to execute this script. 
$retBackupReg = Read-Host -Prompt "`n`rThis script makes changes to the Windows Server Registry. Backup the HKLM Registry before beginning? [Y/N]"
if ($retBackupReg.ToUpper() -eq 'Y') {
    # Backup registry via export, see REG EXPORT /?
    REG EXPORT HKLM $RegistryBackup /y
} else {
    Write-Warning -Message 'No Windows Server Registry backup created. Please create a Registry backup manually before proceeding.'
    Break
}
$retScriptMode = Read-Host -Prompt "Would you like to Update or Restore the configuration on $($env:COMPUTERNAME)? [U/R]"
if ($retScriptMode.ToUpper() -eq 'U') {
    foreach ($DeviceId in $DeviceIds) {
        $RegistryPath = $DeviceId.PSPath + "\Partmgr\"
        $DeviceSANPolicy = Get-ItemProperty -Path $RegistryPath -Name Attributes -ErrorAction SilentlyContinue
        if (!$DeviceSANPolicy) {
            Write-Host "$($DeviceId.Name.Substring(84)) did not have an Attributes property. A new Attributes REG_DWORD as been created and value set to VDS_SP_ONLINE." 
            Set-ItemProperty -Path "$($DeviceId.PSPath)\Partmgr" -Name Attributes -Value $VDS_SP_ONLINE
        }
            
        $Devices += ((($DeviceId.Name).Replace('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SCSI\Disk&Ven_PURE&Prod_FlashArray\',"")).Replace(($DeviceId.PSChildName),""))+$DeviceSANPolicy.Attributes
            
        switch ($DeviceSANPolicy.Attributes) {
            $VDS_SP_UNKNOWN { 
                # Setting a value of 0 (VDS_SP_UNKNOWN) will be mapped to VDS_SP_ONLINE, so a value of 0 or 1 may be used to bring a disk online.
                Write-Host "$($DeviceId.Name.Substring(84)) is set to VDS_SP_UNKNOWN." 
            }
            $VDS_SP_ONLINE { 
                Write-Host "$($DeviceId.Name.Substring(84)) is set to VDS_SP_ONLINE."
            }
            $VDS_SP_OFFLINE_SHARED { 
                Write-Host "$($DeviceId.Name.Substring(84)) is set to VDS_SP_OFFLINE_SHARED." -ForegroundColor Red
                $retUpdateAttributes = Read-Host -Prompt "Update device to VDS_SP_ONLINE? [Y/N]"
                if ($retUpdateAttributes.ToUpper() -eq 'Y') {
                    Set-ItemProperty -Path $RegistryPath -Name Attributes -Value $VDS_SP_ONLINE
                }
            }
            $VDS_SP_OFFLINE { 
                Write-Host "$($DeviceId.Name.Substring(84)) is set to VDS_SP_OFFLINE."  -ForegroundColor Red
                $retUpdateAttributes = Read-Host -Prompt "Update device to VDS_SP_OFFLINE? [Y/N]"
                if ($retUpdateAttributes.ToUpper() -eq 'Y') {
                    Set-ItemProperty -Path $RegistryPath -Name Attributes -Value $VDS_SP_ONLINE
                }
            }
        }
    }
    # Store DeviceId Name and Attributes
    Add-Content -Value $Devices -LiteralPath $DeviceInfoFile
} else {
    $DeviceFiles = Get-ChildItem -Path '.\Desktop\' -Filter 'PureStorage-Devices-Information*' | Select Name
    Write-Host "The following Pure Storage Devices Information files exist on $($env:COMPUTERNAME). Please select which file to use for restore.`n`r"
    for($i=0;$i -lt ($DeviceFiles.Count);$i++) {
        Write-Host "($($i+1)) $($DeviceFiles[$i].Name)"
    }
    Write-Host
    [uint16]$RestoreFile = Read-Host "Which file?"
    $DeviceProperties = Get-Content -Path ".\Desktop\$($DeviceFiles[$RestoreFile-1].Name)"
    foreach ($DeviceProperty in Get-Content -Path ".\Desktop\$($DeviceFiles[$RestoreFile-1].Name)") {
        $RestoreRegistryPath = "HKLM:\SYSTEM\CurrentControlSet\Enum\SCSI\Disk&Ven_PURE&Prod_FlashArray\$($DeviceProperty.Substring(0,$DeviceProperty.Length-2))\Device Parameters\Partmgr\"
        Set-ItemProperty -Path $RestoreRegistryPath -Name Attributes -Value $($DeviceProperty.Substring($DeviceProperty.Length-1,1))
    }    
}