Backing up Hyper-V guests / vhdx

Are there any advanced options that are a good idea to add when backing up a handfull of Hyper-V guests?

Is there any difference if I backup either by:

  • choosing a Hyper-V guest under the Hyper-V icon/tree
  • manually selecting the vhd/vhdx files plus vmrs/vmcx files by browsing disks and folders?

(Maybe if a guest adds or moves it’s vhds the first way of doing things will still pick up the correct files and the latter way of doing things will not of course)

Thx all!!

Disclaimer - I have never tested Duplicati for doing Hyper-V backups - I didn’t even know it could.

But I may be able to answer your question from a more generalized backup point of view, as I have experience with other backup products and Hyper-V (Commvault, DPM, Backup Exec, Veeam, etc).

If you protect the VHD files directly, you will be getting crash-consistent copies of those hard disks. You will not back up VM configurations themselves. And as you pointed out, if the VHD files moved your backups would need to be reconfigured. If you had a server failure you’d have to configure Hyper-V, recreate the VMs, and then attach the restored VHD disks to the VMs.

If you are working with a Hyper-V-aware backup product, it’s almost always better to select the VMs themselves from the Hyper-V selection tree in the backup program. This will ensure all associated data for the VM is backed up: its configuration, VHD files (where ever they may be located), etc. Also the disks can be backed up in an application-consistent state instead of just crash-consistent (think of a clean shutdown vs dirty shutdown).

No idea if Duplicati can interface with Hyper-V in a way to actually achieve application-consistent backups. Would be cool if it were the case.

Thx for your reply!!

I toally agree that backing up VHD files when the guests are running is not a good idea.

But backing up a whole Hyper-V guest using VSS and temporarily saving or pausing it should be ok, I presume that is what Duplicati does when I use the built in “backup-hyper-v-guest” option instead of backing up individual VHD files?

And so then I wondered if backing up individual VHD files would also use VSS and also temporarily pause or save the status of the process using/locking the file. I’d guess it’s not doing it the same way, that Duplicati doesn’t notify the guest in this case which it probably does when backing up the guest as a whole. And if a guest has multiple VHDs and they are shadow copied at different times (doing one file at a time) things would get veeeeery interesting.

What I’m looking for is a solution to exclude one single VHD file (huge huge storage volume) from a server when backing it up. Hence my train of thought… :slight_smile:

PS:
I can definitely cope with backups of only VHDs and not the Hyper-V configs. The guests are all very basic and it only takes a few minutes to set them up using the VHDs only.

Is you experience with restoring was good? I stumbled with infinite restoring…

Yes, I’ve run backing up the Hyper-V guests for a number of years now and restoring has worked without any problems. All VHD and VHDX files are less than 100GB a piece though

2 Likes

BTW what’s your best practice with remote volume size and dblock-size? What’s time needed to restore VM with size 100Gb?

I have been using Duplicati to back up Hyper-V guests for many years.

Here is my understanding of how it works (which could be wrong):

Duplicati does not backup the running state of Hyper-V guests, no matter how you configure it. It doesn’t pause/suspend the guests prior to backing them up. It uses the Hyper-V VSS Writer, which in turn uses the Guest Integration Services to request the guests and their applications to make themselves consistent before the shadow copy is made. It’s up to the individual applications on the guest to honor these requests (not everything does).

When doing test restores of these guests, upon first boot they behave as though they were powered off without being shut down. (“The previous system shutdown at XXX was unexpected”). I have never encountered any data consistency problems with any of these test restores, but thankfully they’ve only ever been test restores. I’ve never had to do it for real.

When selecting guests to back up, if you select the guest from the “Hyper-V Machines” part of the UI, then it will include all possible relevant files for the guest. If you choose the individual files from the filesystem itself, you’ll have to keep track of all that yourself. As far as I know, choosing either the entire guest, or all of the guest’s files individually makes no material difference in the backup itself.

2 Likes