You have just installed or cloned a VM with Windows 2008 Enterprise or Datacenter or you have upgraded the VM to Virtual Hardware 7 and under Disk Management you get an error message saying:
"the disk is offline because of policy set by an administrator".
This is because, and this is by design, all virtual machine disk files (VMDK) are presented from Virtual hardware 7 (the one of ESX 3.5) to VMs as SAN disks.
At the same time, and this is by design too, Microsoft has changed how SAN disks are handled by its Windows 2008 Enterprise and Datacenter editions.
In fact, on Windows Server 2008 Enterprise and Windows Server 2008 Datacenter (and this is true for R2 too), the default SAN policy is now VDS_SP_OFFLINE_SHARED for all SAN disks except the boot disk.
Having the policy set to Offline Shared means that your SAN disks will be simply offline on startup of your server and if your paging file is on one of this secondary disks it will be unavailable.
Here's the solution to this annoying problem.
What you have to do is first to query the current SAN policy from the command line with DISKPART and issue the following SAN commands:
= = = = = = = = = = = = = = = = = =
DISKPART.EXE
DISKPART> san
SAN Policy : Offline Shared
= = = = = = = = = = = = = = = = = =
Once you have verified that the applied policy is Offline Shared, you have two options to set the disk to Online.
The first one is to log in to your system as an Administrator, click Computer Management > Storage > Disk Management, right-click the disk and choose Online.
The second one is to make a SAN policy change, then select the offline disk, force a clear of its readonly flag and bring it online. Follow these steps:
= = = = = = = = = = = = = = = = = =
DISKPART> san policy=OnlineAll
DiskPart successfully changed the SAN policy for the current operating system.
DISKPART> LIST DISK
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 40 GB 0 B
* Disk 1 Offline 10 GB 1024 KB
DISKPART>; select disk 1
Disk 1 is now the selected disk.
DISKPART> ATTRIBUTES DISK CLEAR READONLY
Disk attributes cleared successfully.
DISKPART> attributes disk
Current Read-only State : No
Read-only : No
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
Clustered Disk : No
DISKPART> ONLINE DISK
DiskPart successfully onlined the selected disk.
= = = = = = = = = = = = = = = = = =
Once that is done, the drive mounts automagically.
So, I'm trying all this but the return message I get in disk part is "DiskPart failed to clear disk attributes.". Any further advice?
ReplyDeleteDISKPART> san policy=OnlineAll
DiskPart successfully changed the SAN policy for the current operating system.
DISKPART> rescan
Please wait while DiskPart scans your configuration...
DiskPart has finished scanning your configuration.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> attributes disk clear readonly
DiskPart failed to clear disk attributes.
DISKPART> attributes disk
Current Read-only State : Yes
Read-only : Yes
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
Clustered Disk : Yes
DISKPART> san
SAN Policy : Online All
I see you problem. Have you checked that you have full access to the volume you want to change attributes for? Is it a cluster resource? I think so because your log says "clustered disk: yes". In this case you should stop all nodes but one and then you will be allowed to use diskpart to reset the flags. The general idea is to grant the server you are connected to write access to the volume.
ReplyDeleteLet me know if you need more help and if, so, please post more details about you configuration (servers and LUNs).
Regards
I am having this same problem. It is in cluster and I have shut down the other node. I am still unable to change the read only flag.
DeletePlease help?!
Wacky problem - a SAN volume mounted to a 2008 (not R2) 32bit enterprise server had been working fine. After a reboot of the server, the disk was offline. Putting it back online, no problem, diskpart details for the volume show "Read Only: No". Got support feom Dell and foud the the Volume was listed as Read Only. Simple fix, change the Volume to "Read Only: No" with Diskpart. 4 hours later, the Volume is marked as "read only" again.No chnages made by us, nothing in the Windows logs.
ReplyDeleteThe disk is an Dell/Emc SAN LUN, fiber connected, exclusive use to this machine. Have another LUN, almost the same size attached the same way to this machine, no problems with that. Appreciate any thoughts or places to look.
Ahhh, nice! A perfect tutorial! Thanks a lot!
ReplyDeleteGreat article! I just spent 2 hours trying to figure out why my san disks weren't showing and this was the fix.
ReplyDeleteThank you!
Thank you, thank you, thank you! This article helped me with an IBM DS3000 and an IBM System x3650M3 Windows Server 2008 R2. Thumbs up to you! I'd be still trying to figure why I couldn't configure these drives!
ReplyDeleteThese settings are good for window server 2008 R1 and R2. It breaks again with R2 SP1 ;-(. Is there any solution for R2 SP1?
ReplyDeleteThanks. Very helpful.
ReplyDeleteCool !!! Thank a lot
ReplyDeleteWonderful article..thanks a lot dude!!
ReplyDeleteThis worked perfectly for me. I tried figuring it out on my own but just couldn't get it to work within VMware Workstation.
ReplyDeletegreat post. Thanks
ReplyDeletelet me know i how to remove is read only attribute and bring online. if i access san directly then it possible.
ReplyDeletei have two server in one server its show online but in second server its display reserved the disk offline message.
I'm also trying all this but the return message I get same problem in disk part is "DiskPart failed to clear disk attributes.". Any further advice?
DISKPART> san policy=OnlineAll
DiskPart successfully changed the SAN policy for the current operating system.
DISKPART> rescan
Please wait while DiskPart scans your configuration...
DiskPart has finished scanning your configuration.
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> attributes disk clear readonly
DiskPart failed to clear disk attributes.
DISKPART> attributes disk
Current Read-only State : Yes
Read-only : Yes
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
Clustered Disk : Yes
DISKPART> san
SAN Policy : Online All
Exactly the answer I was looking for!
ReplyDeleteWell done - fixed me right up.
ReplyDeletePerfect answer for a vexing problem. I had no clue where to look for
ReplyDeleteThis is really helpful article ! Many Thanks.
ReplyDeleteThanks for your reply!
DeleteThanks, this was very helpful for me.
ReplyDeleteHi same problem here, the disk says its a clustered disk but i don't have it in the Failover cluster manager. Its just a dedicated disk to one server from the san.. have cleared simultaneous connections and only one server is connected now but still won't come online. Any help would be great.
ReplyDeleteThanks
Even after setting the san policy =Online all ..I am getting the same issue. My server is Windows server 2008 r2.
ReplyDeleteWhat could be the problem and solution?
Thanks a lot for this; just starting out with Windows Server 2012 and starting a VM Lab as well. Would have had no idea about VMDK being treated as a SAN if not for your great post here.
ReplyDeleteExcellent article, worked perfectly.
ReplyDeleteThanks for your help. Cheers!
ReplyDeleteExcellent. It worked!
ReplyDeleteThanks man
This help me a lot. Thanks! =D
ReplyDelete