Using Hyper-V Manager, I can connect to a remote VM host, go to the settings of a VM, and add an existing .VHD file as a new hard disk. If the VM host is running Server 2008 R2, and the disk is being attached to a SCSI controller, I can even do this while the VM is running (see What's new in Hyper-V R2).
Doing this manually, everything works great. The trouble is, now I want to automate it so I can attach different VHDs on-the-fly during some automated tests.
I already have C# code that connects to the remote VM host over WMI and starts/stops VMs by calling RequestStateChange, and I'd like to extend it to be able to say "here's the path to a VHD, attach it as a SCSI drive to this VM". But looking at the list of WMI virtualization classes, I can't figure out how to do this.
The closest I've found is the Mount method of Msvm_ImageManagementService, but this appears to mount a VHD inside the current OS, which isn't what I want.