在线备份
Online backup is the recommended backup method for Microsoft Hyper-V VMs. This type of backup requires no downtime. VMs remain running for the whole period of backup, and users can access them without any interruption.
Online backup can be performed if Microsoft Hyper-V VMs meets a number of requirements. For more information, see Microsoft Hyper-V documentation.
The procedure of online backup depends on the Microsoft Hyper-V Server version:
- Microsoft Hyper-V Server 2008 R2 and 2012
- Microsoft Hyper-V Server 2012 R2
- Microsoft Hyper-V Server 2016 and later
Microsoft Hyper-V Server 2008 R2 and 2012
For online backup of VMs on Microsoft Hyper-V Server 2008 R2 and 2012, Veeam Backup & Replication uses a native Microsoft Hyper-V approach. To quiesce VM data, Microsoft Hyper-V employs two Microsoft VSS frameworks that work at two different levels and communicate with each other:
- Microsoft VSS framework inside the VM guest OS. This framework is responsible for quiescing data of Microsoft VSS-aware applications inside the VM and creating a snapshot inside the VM guest OS. This snapshot is known as internal snapshot.
- Microsoft VSS framework at the Microsoft Hyper-V host level. This framework is responsible for creating a snapshot of a volume on which VM disks are located. This snapshot is known as external snapshot.
Online backup for VMs on Microsoft Hyper-V Server 2008 R2 and 2012 is performed in the following way:
- Veeam Backup & Replication interacts with the Microsoft Hyper-V host VSS Service and requests backup of a specific VM.
- The Microsoft VSS Writer on the Microsoft Hyper-V host passes the request to the Microsoft Hyper-V Integration Components (HV-IC) installed inside the VM guest OS.
- The HV-IC acts as a VSS Requestor for the framework inside the VM. It communicates with this framework and requests backup of Microsoft VSS-aware applications running on the VM.
- VSS Writers for Microsoft VSS-aware applications on the VM are instructed to quiesce application data.
- After the applications are quiesced, the framework inside the VM takes an internal snapshot using a Microsoft VSS software provider in the VM guest OS.
- The VM returns from the read-only state to the read-write state, and operations inside the VM are resumed. The created snapshot is passed to the HV-IC.
- The HV-IC notifies the hypervisor that the VM is ready for backup.
- The Microsoft Hyper-V host VSS provider takes a snapshot of a volume on which VM disks are located (external snapshot). After that, Microsoft VSS triggers the auto-recovery process. For more information, see Auto-Recovery.
- The volume snapshot is presented to Veeam Backup & Replication. Veeam Backup & Replication reads VM data from the volume snapshot in one of two backup modes — on-host backup or off-host backup.
- After the backup is complete, the volume snapshot is deleted.
Internal and external snapshots are taken one after another, with a little time difference. During this time interval, the VM on the volume is not frozen — its applications and OS are working as usual. For this reason, when the external snapshot is created, there may remain unfinished application transactions inside the VM, and this data can be lost during backup.
To make sure the VM data is consistent at the moment of backup, Microsoft Hyper-V VSS Writer performs additional processing inside the created external snapshot. This process is also known as auto-recovery.
Auto-recovery is performed after a volume snapshot is taken. The auto-recovery process is performed in the following way:
- Right after the snapshot of a volume is taken, Microsoft Hyper-V host VSS allows the Microsoft Hyper-V host VSS Writer time to update data inside the external snapshot, before it is permanently put to the read-only state.
- The volume snapshot is temporarily mounted to the Microsoft Hyper-V host as a new volume with the read-write access.
- The Microsoft Hyper-V host VSS Writer rolls back a VM on the external snapshot to the state of the internal snapshot. All changes that took place after the internal snapshot was taken are discarded. This way, VM data inside the external snapshot is brought to a completely consistent state.
At the same time, the internal snapshot inside the VM guest OS is deleted.
As a result, you have a VM on the production volume, and a consistent volume snapshot that Veeam Backup & Replication can use for backup.
Note |
Auto-recovery may take up to several minutes. |
Microsoft Hyper-V Server 2012 R2
For backup of VMs on Microsoft Hyper-V Server 2012 R2, Microsoft VSS uses backup and auto-recovery checkpoints.
To quiesce VM data, Veeam Backup & Replication leverages two Microsoft VSS frameworks that work at two different levels and communicate with each other:
- Microsoft VSS framework inside the VM guest OS. This framework is responsible for quiescing data of Microsoft VSS-aware applications inside the VM and creating a snapshot inside the VM guest OS.
- Microsoft VSS framework at the Microsoft Hyper-V host level. This framework is responsible for creating a snapshot of a volume on which VM disks are located.
Online backup for VMs on Microsoft Hyper-V 2012 R2 is performed in the following way:
- Veeam Backup & Replication interacts with the Microsoft Hyper-V host VSS Service and requests backup of a specific VM.
- The Microsoft VSS Writer on the Microsoft Hyper-V host passes the request to the Microsoft Hyper-V Integration Components (HV-IC) installed inside the VM guest OS.
- The HV-IC acts as a VSS Requestor for the framework inside the VM. It communicates with this framework and requests backup of Microsoft VSS-aware applications running on the VM.
- VSS Writers for Microsoft VSS-aware applications on the VM are instructed to quiesce application data.
- After the applications are quiesced, Microsoft Hyper-V VSS takes a backup checkpoint of the VM. Every virtual disk of a VM receives a temporary file named as vm_disk_name_GUID.avhdx. For example, the name of the received file can be: disk_1_A1C3FDA5-5DFE-4001-A6D7-EBE18195A85C.avhdx. All new writes that occur to the VM until the volume snapshot is taken are redirected to this file.
- Right after taking the backup checkpoint, Microsoft Hyper-V VSS takes another auxiliary checkpoint — auto-recovery checkpoint. Every virtual disk of a VM receives a temporary file named as vm_disk_name-AutoRecovery.avhdx. For example, the name of the received file can be: disk_1-AutoRecovery.avhdx. The auto-recovery checkpoint helps make sure that VM data is consistent during backup.
The auto-recovery checkpoint does not depend on the backup checkpoint — it is taken independently in a new checkpoint chain.
- The framework inside the VM takes an internal snapshot using a Microsoft Hyper-V Integration Services Shadow Copy provider in the VM guest OS.
- The created internal snapshot is passed to the HV-IC.
- The HV-IC notifies the hypervisor that the VM is ready for backup.
- Microsoft Hyper-V VSS performs auto-recovery — it mounts the auto-recovery checkpoint to the VM, rolls back data on the VM to the consistent state.
- The Microsoft Hyper-V host VSS provider takes a snapshot of a volume on which VM disks are located (external snapshot).
- The auto-recovery checkpoint is merged with the original VM.
- The volume snapshot is presented to Veeam Backup & Replication. Veeam Backup & Replication reads VM data from the volume snapshot in one of two backup modes — on-host backup or off-host backup.
- After the backup is complete, the volume snapshot is deleted, and the backup checkpoint is merged with the original VM.
Microsoft Hyper-V Server 2016 and later
Online backup of VMs on Microsoft Hyper-V 2016 relies on production checkpoints.
Production checkpoints are point-in-time images of VMs. When producing production checkpoints, Microsoft Hyper-V does not put VMs to the saved state. Instead, it quiesces data on VMs with the help of the Microsoft VSS technology (for Microsoft Windows VMs) or file system freeze (for Linux VMs). The resulting checkpoints are application-consistent, so you can recover VMs without any data loss.
Veeam Backup & Replication performs online backup with the help of production checkpoints only if the following conditions are met:
- VM configuration version is upgraded to 8.x.
- VMs are deployed on Microsoft Hyper-V Server 2016
- [For Microsoft Hyper-V clusters] All hosts in the cluster are upgraded to Microsoft Hyper-V Server 2016 and the cluster functional level is upgraded.
Online backup is performed in the following way:
- Veeam Backup & Replication requests a production checkpoint of a specific VM.
- Microsoft Hyper-V Virtual Machine Management Service (for Microsoft Windows VMs) or file system freeze (for Linux VMs) brings data on the VM guest OS to a consistent state.
- Microsoft Hyper-V Virtual Machine Management Service creates a production checkpoint for the VM. Every virtual disk of a VM receives a temporary AVHDX file. All new writes are redirected to temporary AVHDX files.
- Further activities depend on the backup mode:
- In the onhost backup mode, Veeam Backup & Replication reads data from a VM checkpoint. After the VM processing completes, the production checkpoint is merged with the original VM.
- In the offhost backup mode, the Microsoft Hyper-V host VSS provider takes a snapshot of a volume on which VM disks are located. The volume snapshot is mounted to the offhost backup proxy and presented to Veeam Backup & Replication. Veeam Backup & Replication reads VM data from the volume snapshot. After the VM processing completes, the production checkpoint is merged with the original VM. When all VMs in the group for which the volume snapshot is created are processed, Veeam Backup & Replication triggers volume snapshot deletion.
Related Topics