This is not the end of the world, but it's very annoying so I'm hoping somebody can explain what's going on or perhaps suggest some additional troubleshooting.
Here's the scenario: Server 2012 Core VM with the file services role installed and running as a role on a Server 2012 Hyper-V failover cluster. IDE 0 is a standard VHDX in clustered storage. There are 2 pass through disks on SCSI targets 1 and 2. I
proceed to attempt to add a 3rd pass-through disk:
1. Create a 750GB LUN
2. Mask the LUN to the cluster
3. Online the new disk on a cluster node
4. Initialize the disk on the node
5. Offline the disk
6. Using Failover manager, add the disk as new Available Storage in the cluster
7. Using Failover manager to modify the file server VM's settings, add the new storage to SCSI target 3
8. Using diskpart on the VM, clear the readonly flag from the disk
At this point, I was able to create a partition on the disk using new-partition with the -usemaximumsize flag, but I was unable to format it. It turns out the new partition size was 0 bytes. So I went back into diskpart and lo and behold, although the readonly flag is cleared, the "Current readonly status" on the disk is still yes.
To test the issue, I offlined the disk in the VM, removed it from the virtual SCSI chain, removed it from cluster storage and then onlined it in the owner node. I was able to partition it, format it and create an empty folder, so it is not flagged readonly at the host or SAN.
So I offlined it on the node and added it back to cluster available storage and then added it back to SCSI target 3 on the VM.
Again, I removed the readonly flag from the disk and again it cleared but the disks "current" status remained "Yes" and I was unable to manipulate the disk.
Stop/start vds did nothing and as this is a production server I could not restart it midday.
So I offlined the disk in the VM and removed it from SCSI target 3, then added it to SCSI target 4. This time, when I online it in the VM and use diskpart to clear readonly, both readonly and "current" readonly clear just fine and now the pass-through disk is operating as expected alongside the other 2 pass-through disks on the server.
Any ideas what went wrong in all this or how I can clear SCSI target 3 for another disk without having to restart the VM?