Hyper-V

Hyper-V backups saved state vs child VM snapshots

Hyper-V utilizes a couple of different methods of taking backups of VMs. Let's look at Hyper-V backups saved state vs child VM snapshots and compare

When thinking about backing up Hyper-V workloads, we want to consider the mechanisms that can be used to perform the backup of the virtual machines.ย  Hyper-V can use two means for backing up virtual machines โ€“ the โ€œsaved state methodโ€ and the โ€œchild VM snapshotโ€ method.ย  Letโ€™s take a look at Hyper-V backups saved state vs child VM snapshots, why one is used as opposed to the other, and which one is typically preferred for capturing virtual machine backups in our Hyper-V environment.ย  Also, we will look at considerations with Hyper-V and Windows updates that are applied.

Hyper-V Backups Saved State vs Child VM Snapshots

As mentioned the two mechanisms that can be utilized are the saved state and the child VM snapshot methods.ย  Letโ€™s start with the โ€œsaved stateโ€ backup mechanism.ย  The saved state mechanism is the default method that Hyper-V uses for backups.ย  In other words, if no other means is requested or the virtual machine does not qualify for the child VM snapshot method, the saved state mechanism is used.

Hyper-V-backups-saved-state-vs-child-vm-snapshot
Hyper-V backups saved state vs child vm snapshot – offline vs online

Saved State

A โ€œsaved stateโ€ virtual machine backup is also referred to as an โ€œoffline backupโ€ as it requires at least a brief bit of downtime for the virtual machine.ย  Saved state means that Hyper-V VSS writer places the virtual machine in a โ€œhibernatedโ€ state.ย  When the saved state method is requested the VM is placed in saved state during the PrepareForSnapshot event.ย  Snapshots are taken of the appropriate volumes and then the virtual machine is then returned back to the previous state which is handled with the PostSnapshot event.

The saved state method generally translated into a couple of seconds or more where the virtual machine is not responsive while the PrepareForSnapshot event is underway.

A saved state backup is not โ€œapplication awareโ€ so is not transactionally consistent.ย  They are generally not recommended for production backups due to the aforementioned reasons:

  • Requires downtime of the virtual machine
  • Are not application aware

Child VM Snapshot

The โ€œchild VM snapshotโ€ method is the preferred way for a backup solution to backup a Hyper-V virtual machine.ย  However, there are certain requirements that must first be met before the child VM snapshot method can be requested.ย  The following must be true before the child VM snapshot method is used during a Hyper-V virtual machine backup.

  • Hyper-V Integration Services must be installed, enabled, and running on the virtual machine being backed up. Hyper-V integration services are the specialized bundle software/services that allow special interaction between the Hyper-V host and the guest virtual machines.
    • To look at a listing of available integration services that are installed, take a look at the Microsoft Technet article here.
    • The service we are interested in as regards to backups โ€“ Hyper-V Volume Shadow Copy service
    • ***Note*** Windows 2000 โ€“ the Hyper-V Integration service is not supported
  • The Hyper-V virtual machine must be running
  • The snapshot file must location has to be the same location as the virtual machine files (VHDs) are located
  • The guest operation system must be running on volumes that are configured as basic disks and not dynamic disks
  • The guest virtual machine disks must be formatted using a file system that supports snapshots such as NTFS. FAT32 is not supported as an example for an online backup.

Child VM Snapshot backups are preferred because they are:

  • Online backups
  • Application aware

Backing up VMs Similar to VSS snapshots

For the most part, the process that is used to backup a Hyper-V virtual machine using the child VM snapshot method is similar to a backup using VSS.ย  The unique process to Hyper-V happens when the Hyper-V VSS writer included with the integration services processes the PrepareForSnapshot.ย  In event that the child VM snapshot was used, there is additional processing ran.

Saved State

When backup software interacts with Hyper-V and requests a backup of a specific virtual machine that is either powered off or doesnโ€™t qualify for the child VM snapshot method the following happens:

  • The virtual machine is hibernated
  • Hyper-V host VSS provider takes a VSS snapshot of a volume on which the VM disks are located
  • After processing the PostSnapshot event, VMs that were backed up using the saved state method are returned to the state they were in before the backup started.

Child VM Snapshot

VMs using the child VM snapshot method have the Hyper-V volume shadow copy requestor service in the child VM processes the backup.ย  The child VM operations happen when the PrepareForSnapshot event happens with the host operating system processing.

The Hyper-V VSS writer then returns from the PrepareForSnapshot event and the host image of the VHD files that had the snapshots taken are rolled back to the snapshot taken during the PrepareForSnapshot processing event.ย  This processing is done independently of the VSS writers in the child VM.

Windows Updates and Hyper-V Integration Services

One thing to note as a Hyper-V administrator is to make sure you keep the integration services updated on guest virtual machines as outdated integration services on guest virtual machines will cause backups to utilize the โ€œsaved stateโ€ method of performing backups which brings interruptions to virtual machine service.

Thoughts

Understanding there are differences in the way backups are handled in a Hyper-V environment can make the difference in downtime for a particular virtual machine as well as whether or not the backup is a transactionally consistent backup.ย  Looking at Hyper-V backups saved state vs child VM snapshots can yield some interesting finds as we see that saved state are not as desirable, but are the default โ€œall else failsโ€ mechanism.ย  Child VM snapshots method is the preferred method of the two and can create online backups that are application aware.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.