Fail over and fail back Hyper-V VMs replicated to Azure
This tutorial describes how to fail over a Hyper-V VM to Azure. After you've failed over, you fail back to your on-premises site when it's available. In this tutorial, you learn how to:
- Verify the Hyper-V VM properties to check conform with Azure requirements
- Run a failover to Azure
- Fail back from Azure to on-premises
- Reverse replicate on-premises VMs, to start replicating to Azure again
This tutorial is the fifth tutorial in a series. It assumes that you have already completed the tasks in the previous tutorials.
- Prepare Azure
- Prepare on-premises Hyper-V
- Set up disaster recovery for Hyper-V VMs, or for Hyper-V VMs managed in System Center VMM clouds
- Run a disaster recovery drill
Prepare for failover and failback
Make sure there are no snapshots on the VM, and that the on-premises VM is turned off during failback. It helps ensure data consistency during replication. Don't turn on on-premises VM during failback.
Failover and failback have three stages:
- Failover to Azure: Failover Hyper-V VMs from the on-premises site to Azure.
- Failback to on-premises: Failover Azure VMs to your on-premises site when the on-premises site is available. It starts synchronizing data from Azure to on-premises and on completion, it brings up the VMs on on-premises.
- Reverse replicate on-premises VMs: After failed back to on-premises, reverse replicate the on-premises VMs to start replicating them to Azure.
Verify VM properties
Before failover verify the VM properties, and make sure that the VM meets with Azure requirements.
In Protected Items, click Replicated Items > VM.
In the Replicated item pane, there's a summary of VM information, health status, and the latest available recovery points. Click Properties to view more details.
In Compute and Network, you can modify the Azure name, resource group, target size, availability set, and managed disk settings.
You can view and modify network settings, including the network/subnet in which the Azure VM will be located after failover, and the IP address that will be assigned to it.
In Disks, you can see information about the operating system and data disks on the VM.
Failover to Azure
- In Settings > Replicated items, click the VM > Failover.
- In Failover, select the Latest recovery point.
- Select Shut down machine before beginning failover. Site Recovery attempts to do a shutdown of source VMs before triggering the failover. Failover continues even if shutdown fails. You can follow the failover progress on the Jobs page.
- After you verify the failover, click Commit. It deletes all the available recovery points.
Don't cancel a failover in progress: If you cancel in progress, failover stops, but the VM won't replicate again.
Failback Azure VM to on-premises and reverse replicate the on-premises VM
Failback operation is basically a failover from Azure to the on-premises site and in reverse replicate it again starts replicating VMs from the on-premises site to Azure.
- In Settings > Replicated items, click the VM > Planned Failover.
- In Confirm Planned Failover, verify the failover direction (from Azure), and select the source and target locations.
- Select Synchronize data before failover (synchronize delta changes only). This option minimizes VM downtime because it synchronizes without shutting down the VM.
- Initiate the failover. You can follow the failover progress on the Jobs tab.
- After the initial data synchronization is done and you're ready to shut down the Azure VMs click Jobs > planned-failover-job-name > Complete Failover. It shuts down the Azure VM, transfers the latest changes on-premises, and starts the on-premises VM.
- Log on to the on-premises VM to check it's available as expected.
- The on-premises VM is now in a Commit Pending state. Click Commit. It deletes the Azure VMs and its disks, and prepares the on-premises VM for reverse replication. To start replicating the on-premises VM to Azure, enable Reverse Replicate. It triggers replication of delta changes that have occurred since the Azure VM was switched off.
Send feedback about: