Run a failback for Hyper-V VMs
This article describes how to fail back Azure VMs that were created after failover of Hyper-V VMs from an on-premises site to Azure, with Azure Site Recovery.
- You fail back Hyper-V VMs from Azure by running a planned failover from Azure to the on-premises site. If the failover direction is from Azure to on-premises, it's considered a failback.
- Since Azure is a highly available environment and VMs are always available, failback from Azure is a planned activity. You can plan for a small downtime so that workloads can start running on-premises again.
- Planned failback turns off the VMs in Azure, and downloads the latest changes. No data loss is expected.
Before you start
- Review the types of failback you can use - original location recovery and alternate location recovery.
- Ensure that the Azure VMs are using managed disks. Failback of Hyper-V virtual machines, that failed over to Azure machines using managed disks, is supported. It is not recommended to use storage accounts, as they will be fully retired on September 30, 2025.
- Check that the on-premises Hyper-V host (or System Center VMM server if you're using with Site Recovery) is running and connected to Azure.
- Make sure that failover and commit are complete for the VMs. You don't need to set up any specific Site Recovery components for failback of Hyper-V VMs from Azure.
- The time needed to complete data synchronization and start the on-premises VM will depend on a number of factors. To speed up data download, you can configure the Microsoft Recovery Services agent to use more threads to parallelize the download. Learn more.
Note
Failing back to alternate location is not possible when using recovery plans.
Fail back to the original location
To fail back Hyper-V VMs in Azure to the original on-premises VM, run a planned failover from Azure to the on-premises site as follows:
In the vault > Replicated items, select the VM. Right-click the VM > Planned Failover. If you're failing back a recovery plan, select the plan name and click Failover > Planned Failover.
In Confirm Planned Failover, choose the source and target locations. Note the failover direction. If the failover from primary worked as expected and all virtual machines are in the secondary location this is for information only.
In Data Synchronization, select an option:
- Synchronize data before failover (synchronize delta changes only)—This option minimizes downtime for VMs as it synchronizes without shutting them down.
- Phase 1: Takes a snapshot of Azure VM and copies it to the on-premises Hyper-V host. The machine continues running in Azure.
- Phase 2: Shuts down the Azure VM so that no new changes occur there. The final set of delta changes is transferred to the on-premises server and the on-premises VM is started.
- Synchronize data during failover only (full download)—This option is faster because we presume that most of the disk has changed, and don't want to spend time calculating checksums. This option doesn't perform any checksum calculations.
- It performs a download of the disk.
- We recommend you use this option if you've been running Azure for a while (a month or more) or if the on-premises VM is deleted.
- Synchronize data before failover (synchronize delta changes only)—This option minimizes downtime for VMs as it synchronizes without shutting them down.
For VMM only, if data encryption is enabled for the cloud, in Encryption Key, select the certificate that was issued when you enabled data encryption during Provider installation on the VMM server.
Initiate the failover. You can follow the failover progress on the Jobs tab.
If you selected the option to synchronize the data before the failover, after the initial data synchronization is complete and you're ready to shut down the virtual machines in Azure, click Jobs > job name > Complete Failover. This does the following:
- Shuts down the Azure machine.
- Transfers the latest changes to the on-premises VM.
- Starts the on-premises VM.
You can now sign into the on-premises VM machine to check that it's available as expected.
The virtual machine is in a commit pending state. Click Commit to commit the failover.
To complete the failback, click Reverse Replicate to start replicating the on-premises VM to Azure again.
Fail back to an alternate location
Fail back to an alternate location as follows:
If you're setting up new hardware, install a supported version of Windows, and the Hyper-V role on the machine.
Create a virtual network switch with the same name that you had on the original server.
In Protected Items > Protection Group > <ProtectionGroupName> -> <VirtualMachineName>, select the VM you want to fail back, and then select Planned Failover.
In Confirm Planned Failovers, elect Create on-premises virtual machine if it does not exist.
In Host Name, select the new Hyper-V host server on which you want to place the VM.
In Data Synchronization, we recommend you select the option to synchronize the data before the failover. This minimizes downtime for VMs as it synchronizes without shutting them down. It does the following:
- Phase 1: Takes snapshot of the Azure VM and copies it to the on-premises Hyper-V host. The machine continues running in Azure.
- Phase 2: Shuts down the Azure VM so that no new changes occur there. The final set of changes is transferred to the on-premises server and the on-premises virtual machine is started up.
Click the checkmark to begin the failover (failback).
After the initial synchronization finishes and you're ready to shut down the Azure VM, click Jobs > <planned failover job> > Complete Failover. This shuts down the Azure machine, transfers the latest changes to the on-premises VM, and starts it.
You can sign into the on-premises VM to verify that everything is working as expected.
Click Commit to finish the failover. Commit deletes the Azure VM and its disks, and prepares the on-premises VM to be protected again.
Click Reverse Replicate to start replicating the on-premises VM to Azure. Only the delta changes since the VM was turned off in Azure will be replicated.
Note
- If you cancel the failback job during data synchronization, the on-premises VM will be in a corrupted state. This is because data synchronization copies the latest data from Azure VM disks to the on-premises data disks, and until the synchronization completes, the disk data may not be in a consistent state. If the on-premises VM starts after data synchronization is canceled, it might not boot. In this case, rerun the failover to complete data synchronization.
- Failing back to alternate location is not possible when using recovery plans.
Next steps
After the on-premises VM is replicating to Azure, you can run another failover to Azure as needed.