Manually adding a virtual machine configuration file to Hyper-V

People have been asking for a while for a way to add a virtual machine configuration file (.XML) directly to an instance of Hyper-V without first needing to export and import it.  Well, Robert Vierthaler beat me to the punch and blogged about this a little while ago: https://blogs.msdn.com/robertvi/archive/2008/12/19/howto-manually-add-a-vm-configuration-to-hyper-v.aspx

Some key things that I want to point out about this approach:

  1. This is in no way supported - and no guarantees are provided.
  2. It is critical that all the files (.VHDs, .VSVs, .BINs, .AVHDs, etc...) have exactly the same path as they did when the virtual machine was last running under Hyper-V.
  3. It is also critical that you get all XML files for all associated snapshots added - otherwise you could suffer data loss.
  4. You *can* use this method to store a virtual machine on a USB disk that you move between multiple servers, but:
    1. Really, really, really (yada yada yada) not supported.
    2. You should be careful about taking / deleting snapshots - as links will need to be updated accordingly.
    3. You will need to restart the VMMS after attaching the USB disk to a Hyper-V server that already knows about the virtual machine in question (don't worry - this will not effect already running virtual machines).

Cheers,
Ben