I had a PC with two physical disks:
- C: containing the host operating system
- D: containing a folder
D:\VMs
where all my virtual machines were stored
Now, the C: disk died. I bought a new one, reinstalled Windows on it, enabled Hyper-V feature and now I just need to open the VMs from the D:\VMs
folder. However, I don't seem to be able to find a menu item or anything that would allow me to do that - the only thing I see is the "import" command which unfortunately requires the VMs to be explicitly exported (my machines weren't).
I would think that when I have all the files constituting a VM (the VHD file, some XML files describing the settings etc.) it should be somehow possible to just "open" these existing VMs in Hyper-V, right? What command am I missing?
Edit: I know I can create a blank virtual machines and then just point them to use existing VHDs. However, I am not sure about all the different settings I've made to those VMs so I hope there's a way to simply open those existing VMs instead of recreating them.
You will want to create a new VM in the Hyper-V console, and when you get to the part about creating a new .vhd, or selecting one, simply browse to the existing .vhd files you have.
This method will bring them up exactly as they were when the server died, just reapply the same network, cpu and memory settings. Any machines that had snapshots will only be able to load them if you do an actual export/import, otherwise you are loading the base .vhd
this is possible, but it's not supported by microsoft.
basically, you have to create a new VM, copy the settings to the XML files, and rename the snapshots.
complete directions are here: http://eniackb.blogspot.com/2009/05/how-to-recover-hyper-v-virtual-machine.html
I had some success by importing an existing VM and just ensuring that the folders point to the original ones. A bit risky though as theoretically less robust import logic may try to overwrite the (disk) files with themselves, corrupting data. It worked for me - but I would make a copy first or ensure a backup is present and recoverable.