We recently have started deploying Hyper-V in addition to ESXI. One thing we immediately noticed was that USB passthrough was going to be a challenge. As we worked through the problem we found that we could pass a USB Hard Drive through, but as we rotated through the set, our disks did not reconnect. Immediately my mind turned to Powershell. “There must be a way”, I thought, “to remount these disks on the hypervisor before the backup tries to run.” Indeed I was right. With the release of Server 2012 Microsoft has added some great Powershell management cmdlets to manage both VMs and disks.
Below is the script that we have running just before the backup kicks off. Note that you will need to edit the serial numbers appropriately so you can mount your disks. I’m sure this will be able to be dolled up to include a dynamic approach to the controller location (we even batted around the idea of a dedicated backup SCSI controller on the machine). Pay specific attention to the Controller Number, Type and location and the VMName.
Note: As we have had this running for a while we have noticed that this script prevents the machine from starting up if the USB disk last mounted is not present. We are working on a solution to that problem.