The error occurs majorly in two scenarios. First is when restoring a guest virtual machine from a snapshot, and second, when there are the same disk identifiers when connecting an additional disk to the system. In this post, we will share how you can resolve the error The disk is offline because of policy set by an administrator.
The disk is offline because of policy set by an administrator
You will need admin privileges to fix this error. The second tip uses the Diskpart tool, which one should use with extreme caution. I would strongly suggest getting in touch with a technical person to assist if it’s too complicated for you.
1] Restoring Guest VM from a snapshot
When you restore a guest virtual machine using a backup snapshot, the restored guest OS (in the virtual machine) doesn’t automatically mount the attached drives. While the disks are visible using the utilities, they display error message Disk is offline because of the policy set by the administrator.” It occurs because of an issue in the Windows SAN or Storage Area Network policy. According to Microsoft, they are disabled by default to avoid any data corruption. Here is how to enable SAN Policy to Online.
san [policy={onlineAll | offlineAll | offlineShared}] [noerr]
In the virtual machine, open Command Prompt or PowerShell with admin privileges.
Launch the diskpart tool by using the following command.
C:> diskpart
Type SAN to check the policy status. It should be Offline Shared in our scenario.
DISKPART> SAN SAN Policy : Offline Shared
Change the policy to OnlineAll:
DISKPART> SAN POLICY=OnlineAll
Next, when you restore the snapshot, the disk will automatically become online.
Related: Boot Device Not Found in Windows.
2] Disk Identifier Issue
Assuming you have a lot of drives connected to the server and one or two of them are offline. The Disk Management and diskpart utility also fail to help; then, it is because of the same disk identifiers. Each disk has a unique identifier. If they are the same, then one of them will be deactivated and will appear as offline with a warning message The disk is offline because of a policy set by an administrator. It is also called the Disk Signature Collision.
However, if you check the logs, you should identify a message similar to Disk N has the same disk identifiers as one or more disks connected to the system. It is a typical case of duplicate disks. Use the Diskpart tool to find it:
- Open diskpart from the command prompt
- List disk
- Select disk 1
- Uniqueid disk
Note down the identifier. Check if they are the same for other drives. If there is a disk with duplicate id, then you need to change the signature using Uniqueid command.
uniqueid disk [id={<dword> | <GUID>}] [noerr]
- To change the signature, think of a unique number.
- In the Diskpart prompt, type uniqueid disk ID=[NEW SIGNATURE]” with the brackets
- Hit Enter, and it will set a new identifier. Usually, generating a GUID makes more sense.
uniqueid disk id=baf784e7-6bbd-4cfb-aaac-e86c96e166ee
Once it is applied, the computer should automatically identify the disk.
I hope both of these tips were able to resolve the error.