Tuesday, November 9, 2010

The disk is offline because of policy set by an administrator

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.

32 comments:

  1. 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?

    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

    ReplyDelete
  2. 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.
    Let me know if you need more help and if, so, please post more details about you configuration (servers and LUNs).
    Regards

    ReplyDelete
    Replies
    1. 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.
      Please help?!

      Delete
  3. 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.
    The 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.

    ReplyDelete
  4. Ahhh, nice! A perfect tutorial! Thanks a lot!

    ReplyDelete
  5. Great article! I just spent 2 hours trying to figure out why my san disks weren't showing and this was the fix.

    Thank you!

    ReplyDelete
  6. 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!

    ReplyDelete
  7. These settings are good for window server 2008 R1 and R2. It breaks again with R2 SP1 ;-(. Is there any solution for R2 SP1?

    ReplyDelete
  8. Thanks. Very helpful.

    ReplyDelete
  9. Wonderful article..thanks a lot dude!!

    ReplyDelete
  10. This worked perfectly for me. I tried figuring it out on my own but just couldn't get it to work within VMware Workstation.

    ReplyDelete
  11. let me know i how to remove is read only attribute and bring online. if i access san directly then it possible.
    i 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

    ReplyDelete
  12. Exactly the answer I was looking for!

    ReplyDelete
  13. Perfect answer for a vexing problem. I had no clue where to look for

    ReplyDelete
  14. This is really helpful article ! Many Thanks.

    ReplyDelete
  15. Thanks, this was very helpful for me.

    ReplyDelete
  16. Hi 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.
    Thanks

    ReplyDelete
  17. Even after setting the san policy =Online all ..I am getting the same issue. My server is Windows server 2008 r2.
    What could be the problem and solution?

    ReplyDelete
  18. 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.

    ReplyDelete
  19. Excellent article, worked perfectly.

    ReplyDelete
  20. Thanks for your help. Cheers!

    ReplyDelete
  21. Excellent. It worked!

    Thanks man

    ReplyDelete
  22. This help me a lot. Thanks! =D

    ReplyDelete
  23. Thanks! This helped.

    ReplyDelete
  24. Will SAN disks be offline if the SAN policy is set to offline for subsequent reboots after a hardware update to v7? What we did was bring the offline disks online but didn't run the command to change the policy.

    ReplyDelete
  25. what if disk status is reserved, i can bring online the disk

    ReplyDelete
  26. I'm so thankful for people like you who write articles with details like this. Worked like a charm! THANK YOU!

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...