Azure Site Recovery replication for Azure virtual machines (VMs) is currently in preview.
This article describes how to replicate Azure VMs between Azure regions by using the Site Recovery service in the Azure portal.
Post comments and questions at the bottom of this article or on the Azure Recovery Services forum.
Disaster recovery in Azure
Built-in Azure infrastructure capabilities and features contribute to a robust and resilient availability strategy for workloads that run on Azure VMs. However, there are many reasons why you need to plan for disaster recovery between Azure regions yourself:
- You need to meet compliance guidelines for specific apps and workloads that require a business continuity and disaster recovery (BCDR) strategy.
- You want the ability to protect and recover Azure VMs based on your business decisions, and not only based on inbuilt Azure functionality.
- You need to test failover and recovery in accordance with your business and compliance needs, with no impact on production.
- You need to fail over to the recovery region in the event of a disaster and fail back to the original source region seamlessly.
Use Site Recovery for Azure-to-Azure VM replication to help you do all these tasks.
Why use Site Recovery?
Site Recovery provides a simple way to replicate Azure VMs between regions:
- Automatic deployment. Unlike an active-active replication model, there's no need for an expensive and complex infrastructure in the secondary region. When you enable replication, Site Recovery automatically creates the required resources in the target region, based on source region settings.
- Control regions. With Site Recovery, you can replicate from any region to any region within a continent. Compare this with read-access geo-redundant storage, which replicates asynchronously between standard paired regions only. Read-access geo-redundant storage provides read-only access to the data in the target region.
- Automated replication. Site Recovery provides automated continuous replication. Failover and failback can be triggered with a single click.
- RTO and RPO. Site Recovery takes advantage of the Azure network infrastructure that connects regions to keep RTO and RPO very low.
- Testing. You can run disaster-recovery drills with on-demand test failovers, as and when needed, without affecting your production workloads or ongoing replication.
- Recovery plans. You can use recovery plans to orchestrate failover and failback of the entire application running on multiple VMs. The recovery plan feature has rich first-class integration with Azure automation runbooks.
Here's a summary of what you need to do to set up replication of VMs between Azure regions:
- Create a Recovery Services vault. The vault contains configuration settings and orchestrates replication.
- Enable replication for the Azure VMs.
- Run a test failover to make sure that everything's working as expected.
You can check the support matrix for Azure VM replication.
For information on how to configure the required network outbound connectivity for Azure VMs for Site Recovery replication, see the networking guidance document.
Before you start
- Your Azure user account needs to have certain permissions to enable replication of an Azure virtual machine.
- Your Azure subscription should be enabled to create VMs in the target location that you want to use as the disaster recovery region. Contact support to enable the required quota.
Create a Recovery Services vault
- Sign in to the Azure portal > Site Recovery.
- Click New > Monitoring & Management > Backup and Site Recovery.
- In Name, specify a friendly name to identify the vault. If you have more than one subscription, select one of them.
- Create a resource group, or select an existing one. Specify an Azure region. To check supported regions, see geographic availability in Azure Site Recovery Pricing Details.
If you want to quickly access the vault from the dashboard, click Pin to dashboard and then click Create.
The new vault will appear on the Dashboard > All resources and on the main Recovery Services vaults blade.
We recommend that you create the Recovery Services vault in the location where you want your VMs to replicate. For example, if your target location is the central US, create the vault in Central US.
In Recovery Services vaults, click the vault name. In the vault, click the +Replicate button.
Step 1. Configure the source
- In Source, select Azure - PREVIEW.
- In Source location, select the source Azure region where your VMs are currently running.
- Select the deployment model of your VMs: Resource Manager or Classic.
Select the Source resource group for Resource Manager VMs or cloud service for classic VMs.
Step 2. Select virtual machines
Select the VMs you want to replicate, and then click OK.
Step 3. Configure settings
To override the default target settings and specify the settings of your choice, click Customize. For more information, see Customize target resources.
By default, Site Recovery creates a replication policy that takes app-consistent snapshots every 4 hours and retains recovery points for 24 hours. To create a policy with different settings, click Customize next to Replication Policy.
To start provisioning the target resources, click Create target resources. Provisioning takes a minute or so. Don't close the blade during provisioning, or you need to start over.
To trigger replication of the selected VM, click Enable replication.
You can track progress of the Enable protection job in Settings > Jobs > Site Recovery Jobs.
In Settings > Replicated Items, you can view the status of VMs and the initial replication progress. Click the VM to drill down into its settings.
Run a test failover
After you set up everything, run a test failover to make sure everything's working as expected:
To fail over a single machine, in Settings > Replicated Items, click the VM +Test Failover icon.
To fail over a recovery plan, in Settings > Recovery Plans, right-click the plan Test Failover. To create a recovery plan, follow these instructions.
In Test Failover, select the target Azure virtual network to which Azure VMs are connected after the failover occurs.
To start the failover, click OK. To track progress, click the VM to open its properties. Or you can click the Test Failover job in the vault name > Settings > Jobs > Site Recovery jobs.
After the failover finishes, the replica Azure machine appears in the Azure portal > Virtual Machines. Make sure that the VM is the appropriate size, that it's connected to the appropriate network, and that it's running.
To delete the VMs that were created during the test failover, click Cleanup test failover on the replicated item or the recovery plan. In Notes, record and save any observations associated with the test failover.
Learn more about test failovers.
After you test the deployment: