I have a Windows Server 2008 R2 cluster with a number of guest VMs that are undergoing weekly maintenance for backups, performed in a
save -> export -> start process. This process was taking up to several hours because of the VHD size, and clients have recently became impatient. Upgrading the host to Windows Server 2012 R2 is unfortunately out of option right now, but will be performed in a foreseeable future, but until then our clients demand to lessen the downtime of their VMs.
To perform this task, I have designed a crude "export VM snapshot" routine using Powershell and PSHyperV module, which involves the snapshot as a means to get unchanged VM state while the original VM is still running, and then a save-merge-start routine can be performed to not degrade VM's performance. The exporting script backs up all the VHDs of the VM, the snapshot XML and the memory state, and puts it as a structured folder similar to those Hyper-V makes if one doesn't change the VM data's default location. Of course, this is different from the regular "export VM" process, thus the VM is unable to be directly imported into a 2008R2 Hyper-V.
In order to enable the restore on demand, I have tried to change the snapshot's XML to resemble the XML of a VM, also backing up the XML of a VM itself, and then performing this solution: Re-registering of an orphaned VM which for some unclear reason failed on the very first step - making the Hyper-V console to display the XML as a valid VM.
So, how to restore a VM from a backed up snapshot using Windows Server 2008 R2 Hyper-V?