In my home environment I tried to add a VHD disk to one of my virtual machines.
I was surprised to see that, even after deletion and re-add of the disk, the disk remained with a status of “offline” and would not come online. To make it even stranger, the only option I saw when right-clicking on the disk in Disk Management, was “Help”.
Now what could have been the cause of this issue? The disk was alright, because when I added it to a Windows Server 2003 machine, it worked perfectly! Perhaps somehow my virtual SCSI controller experienced some problems? No, because when I added the disk to an IDE controller the issue remained.
Now here comes the fun part. When I hoover over the exclamation mark on Disk 1, I saw the following message: “the disk is offline because of a policy set by an administrator”.
Say what?! The user and server had no policies set on them; none whatsoever!
Troubleshooting
Open a command prompt and type “diskpart.exe”.
You will now receive a diskpart-prompt:
Diskpart>
Now type “san”. This will provide you with the current configured SAN policy:
SAN Policy : Offline Shared
So this means that the system was right… there was a policy configured… but I didn’t configure it, did I? Anyway, back to solving the issue.
The Solution
In the diskpart-prompt, type “san policy=OnlineAll”.
This will result in the following message:
Diskpart successfully changed the SAN policy for the current operating system.
Now type “list disk”, which will give this message:
Disk ### Status Size Free Dyn Gpt
Disk 0 Online 30 GB 0 B
Disk 1 Offline 50 GB 1024 KB
In my case, disk 1 was offline so I typed “select disk 1” which provided:
Disk 1 is now the selected disk
Now type “attributes disk clear readonly”.
Disk attributes cleared successfully.
And to check if all the settings are now correct, type “attributes disk”.
This will give an output something like:
Current Read-only State : No
Read-only : No
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
Clustered Disk : No
After the last check has been successful, type “online disk” to bring the disk online.
The disk should be available right away in Disk Management. If not the case, close and re-open Disk Management.
The cause
After I’ve found the solution I started searching on the internet. It seems that Microsoft has decided to change how disks are handled as of Windows Server 2008 Enterprise/DataCenter. The default SAN disk policy is now VDS_SP_OFFLINE_SHARED, with an exception for the boot-disk.