I have built a Windows 2012 Hyper-V host and have installed some physical disks that I want to publish directly to a VM which will then use the disk in a storage space.
This worked well when I set the server up and I was able to take the physical disks offline in order to publish them to the VM as well as create the storage space.
My problems started when we had a power cut and the Hyper-V server restarted. When it rebooted the Hyper-V server had mounted the disk itself so it wasn't available to the VM. This was made worse by the fact that the Hyper-V host was having trouble reading the configuration on the disk.
When I tried to take the physical disk offline using either diskpart or the disk management console it would return an access denied message.
In order to get the around the trouble reading the disk configuration I upgraded the server to Windows 2012R2 so that the Hyper-V server was the same version as the VM that created it. Now the storage space configuration is reading and I can mount it on the Hyper-V host but I still can't take the disk offline.
I have also disconnected all the drives and run "diskpart automount disable" and "diskpart automount scrub" and then rebooted the server with the disk attached but it still mounts the disks again.
How can these disks be taken offline?