Uredi

Deli z drugimi prek


Tutorial: Fail over Azure VMs to a secondary region

Learn how to fail over Azure VMs that are enabled for disaster recovery with Azure Site Recovery, to a secondary Azure region. After failover, you reprotect VMs in the target region so that they replicate back to the primary region. In this article, you learn how to:

  • Check prerequisites
  • Verify VM settings
  • Run a failover to the secondary region
  • Start replicating the VM back to the primary region.

Note

This tutorial shows you how to fail over VMs with minimal steps. If you want to run a failover with full settings, learn about Azure VM networking, automation, and troubleshooting.

Prerequisites

Before you start this tutorial, you should have:

  1. Set up replication for one or more Azure VMs. If you haven't, complete the first tutorial in this series to do that.
  2. We recommend you run a disaster recovery drill for replicated VMs. Running a drill before you run a full failover helps ensure everything works as expected, without impacting your production environment.

Verify the VM settings

  1. In the vault > Replicated items, select the VM.

    Option to open the VM properties on the overview page

  2. On the VM Overview page, check that the VM is protected and healthy, before you run a failover. Page to verify the VM properties and state

  3. Before you fail over, check that:

Run a failover

  1. On the VM Overview page, select Failover.

    Failover button for the replicated item

  2. In Failover, choose a recovery point. The Azure VM in the target region is created using data from this recovery point.

    • Latest processed: Uses the latest recovery point processed by Site Recovery. The time stamp is shown. No time is spent processing data, so it provides a low recovery time objective (RTO).
    • Latest: Processes all the data sent to Site Recovery, to create a recovery point for each VM before failing over to it. Provides the lowest recovery point objective (RPO), because all data is replicated to Site Recovery when the failover is triggered.
    • Latest app-consistent: This option fails over VMs to the latest app-consistent recovery point. The time stamp is shown.
    • Custom: Fail over to particular recovery point. Custom is only available when you fail over a single VM, and don't use a recovery plan.

    Note

    If you added a disk to a VM after you enabled replication, replication points shows disks available for recovery. For example, a replication point created before you added a second disk will show as "1 of 2 disks".

  3. Select Shut down machine before beginning failover if you want Site Recovery to try to shut down the source VMs before starting failover. Shutdown helps to ensure no data loss. Failover continues even if shutdown fails.

    Failover settings page

  4. To start the failover, select OK.

  5. Monitor the failover in notifications.

    Progress notification Success notification

  6. After the failover, the Azure VM created in the target region appears in Virtual Machines. Make sure that the VM is running, and sized appropriately. If you want to use a different recovery point for the VM, select Change recovery point, on the Essentials page.

  7. When you're satisfied with the failed over VM, select Commit on the overview page, to finish the failover.

    Commit button

  8. In Commit, select OK to confirm. Commit deletes all the available recovery points for the VM in Site Recovery, and you won't be able to change the recovery point.

  9. Monitor the commit progress in notifications.

    Commit progress notification Commit success notification

Reprotect the VM

After failover, you reprotect the VM in the secondary region, so that it replicates back to the primary region.

  1. Make sure that VM Status is Failover committed before you start.

  2. Check that you can access the primary region is available, and that you have permissions to create VMs in it.

  3. On the VM Overview page, select Re-Protect.

    Button to enable reprotect for a VM for a VM.

  4. In Re-protect, verify the replication direction (secondary to primary region), and review the target settings for the primary region. Resources marked as new are created by Site Recovery as part of the reprotect operation.

    Reprotection settings page

  5. Select OK to start the reprotect process. The process sends initial data to the target location, and then replicates delta information for the VMs to the target.

  6. Monitor reprotect progress in the notifications.

    Reprotect progress notification Reprotect success notification

Next steps

In this tutorial, you failed over from the primary region to the secondary, and started replicating VMs back to the primary region. Now you can fail back from the secondary region to the primary.