1

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?

  • Is this used as desaster recovery? Or just when something with the VM goes wrong? – MichelZ May 12 '14 at 10:49
  • This is planned to be used as disaster recovery, instead of regular snapshots as they hinder host and guest performance. The restore of this isn't planned to be done on a regular basis. – Vesper May 12 '14 at 11:39
  • 1
    1. Why would you export the VM's for DR when you have them clustered? 2. Why don't you use one of the myriad backup products to backup your VM's, such as Windows Server Backup? – joeqwerty May 12 '14 at 14:33
  • 1. In case of client data corruption. Those VMs are mostly terminal+file servers, they have some client data inside, and clients tend to be unstable with their data in terms of "Oh wow, we've got files deleted! Get them back please!". And 2 - I'd like to, but finances are stringent, we don't even have a streamer. – Vesper May 12 '14 at 16:23
3

There's already a feature in Hyper-V that will take a snapshot of the VM and export it in a manner that can be later imported. It's called "Backup." If you don't want to spend any money on a deeply integrated, end-to-end experience, use Windows Server Backup and point it at your VMs.

| improve this answer | |
  • This feature is fully fledged only in 2012, and I'm talking about 2008R2, where you cannot export a VM snapshot, only a VM as a whole. – Vesper May 13 '14 at 5:23
  • Also, as I understand it, Windows Server Backup for 2008R2 backups hosts, not VMs, and hosts as a whole (like, C: and VM's disks). It's also said it's not supported for 2008 (R2 unclear) to back up VMs on cluster shared volumes. – Vesper May 13 '14 at 5:28
  • I think that you missed my point a little. Even in Server 2008R2, when you ask for a backup of a VM (which very much does exist as a feature) what it actually does is create a snapshot of the VM and then allow you to copy that snapshot to other media. It just doesn't label it a "snapshot." It's labeled as a "backup." – Jake Oshins May 13 '14 at 20:19
  • As I understand it, this "backup" can only be performed in a shutdown state, that is, you first shutdown the VM, then back it up via snapshot, then start. If it's so, then plain export works better. And we already have such a backup running. – Vesper May 14 '14 at 5:30
  • No. It can be backed up while it's running. If it has the Backup Integration Component installed within the VM, the VM will actually keep running through the whole process. If not, it's is paused briefly. – Jake Oshins May 15 '14 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.