# Set up disaster recovery for Azure VMs to secondary Azure regions ## Introduction [**Site Recovery**](https://docs.microsoft.com/en-us/azure/site-recovery/site-recovery-overview) helps ensure business continuity by keeping business applications and workloads performing during outages. Site Recovery copies workloads performed on physical and virtual machines (VMs) from the primary platform to the secondary location. When your primary platform is interrupted, you are mistakenly moved to a secondary location from where you access the application. After performing again at the primary location, you can tolerate fault-tolerant replies. ## Scenario When you enable replication for a VM to set up disaster recovery, the Site Recovery Mobility service extension installs on the VM and registers it with Azure Site Recovery. During replication, VM disk writes are sent to a cache storage account in the source region. Data is sent from there to the target region, and recovery points are generated from the data. When you failover a VM during disaster recovery, a recovery point is used to restore the VM in the target region. ![](https://i.imgur.com/21E6ySD.png) ## Prerequisites 1. An Azure account with Azure Subscription 2. Confirm the VM configurations was in the [**Support List**](https://docs.microsoft.com/en-us/azure/site-recovery/vmware-physical-azure-support-matrix) * This tutorial presumes that VM **Disks** are **NOT** encrypted. If you want to set up disaster recovery for encrypted VM **Disks**, [**follow this document**](https://docs.microsoft.com/en-us/azure/site-recovery/azure-to-azure-how-to-enable-replication-ade-vms). ## Step by step ### Step 1: Create a VM 1. Type **virtual machines** in the search. ![](https://i.imgur.com/JBmAkls.png) * Under **Services**, select **Virtual machines**. * In the **Virtual machines** page, select **+ Add**. And select **+ virtual machine**. ![](https://i.imgur.com/L4TdbI8.png) * In the **Basics** tab, under **Project details**, make sure the correct subscription is selected, In **Resource group**, select an existing resource group, or create a new one. ![](https://i.imgur.com/wvq2dw2.png) * Under **Instance details**, type the name for the **Virtual machine name**, choose *East US* for your **Region**, and choose Red Hat for your **Image**. Leave the other defaults. >Site Recovery supports replication of Azure VMs running the operating systems listed in this section.[**Replicated machine operating systems**](https://docs.microsoft.com/en-us/azure/site-recovery/azure-to-azure-support-matrix#linux) ![](https://i.imgur.com/gxYP2oD.png) * Under **Administrator account**, select **Password**. * Under **Inbound port rules** > **Public inbound ports**, choose **Allow selected ports** and then select **SSH (22)** and **HTTP (80)** and **SSH (443)** from the drop-down. * Leave the remaining defaults and then select the **Review + create** button at the bottom of the page. ![](https://i.imgur.com/Oymip7S.png) 2. On the **Create a virtual machine page**, you can see the details about the VM you are about to create. When you are ready, select **Create**. ![](https://i.imgur.com/zs8iwFj.png) ### Step 2: Create a Recovery Services vault 1. Sign in to the **Azure portal** 2. In the search box, type *recovery*. Under **Services**, select **Recovery Services vaults**. ![](https://i.imgur.com/M0ChtR2.png) 3. In **Recovery Services vaults**, select **+New**. ![](https://i.imgur.com/fjQae4T.png) 4. In **Create Recovery Services vault** > **Basics**, select the subscription in which to create the vault. 5. In **Resource group**, select an existing resource group for the vault, or create a new one. 6. In **Vault name**, specify a friendly name to identify the vault. 7. In **Region**, select the Azure region in which to place the vault. 8. Select **Review + create**. ![](https://i.imgur.com/dIcl8PV.png) 9. In **Review + create**, select **Create**. ![](https://i.imgur.com/LGfblGj.png) 10. Select **Go to resource** to open the new vault. ![](https://i.imgur.com/ur5kzc6.png) ### Step 3: Enable Site Recovery 1. In the vault settings, select **Enable Site Recovery**. ![](https://i.imgur.com/Xbdubgz.png) ### Step 4: Enable replication > Select the source settings and enable VM replication. 1. Select source settings * In the vault >**Site Recovery** page, under **Azure virtual machines**, select **Enable replication**. ![](https://i.imgur.com/fGogqOH.png) * In **Source> Source location**, select the source Azure region in which VMs are currently running. * In **Azure virtual machine deployment model**, leave the default **Resource Manager** setting. * In **Source subscription**, select the subscription in which VMs are running. * In **Source resource group**, select the resource group containing the VMs. * In **Disaster recovery between availability zones**, leave the default **No** setting. * Select **Next**. ![](https://i.imgur.com/DUKAm2Y.png) 2. Select the VMs * In **Virtual Machines**, select the VMs you want to enable for disaster recovery. * Select **Next**. ![](https://i.imgur.com/qmZd2rX.png) 3. Review replication settings * In **Replication settings**, review the settings. Site Recovery creates default settings/policies for the target region. * Select **Enable replication**. ![](https://i.imgur.com/xbrn4N8.png) 4. Track replication progress in the notifications. ![](https://i.imgur.com/QUfKEQ3.png) 5. The VMs you enable appear on the vault > **Replicated items** page. ![](https://i.imgur.com/5fxkEhH.png) ### Step 5: Run a test failover 1. On the Overview page, select **Test Failover**. ![](https://i.imgur.com/hmAggtE.png) 2. In **Test Failover**, choose a recovery point. The Azure VM in the target region is created using data from this recovery point. 3. In **Azure virtual network**, select the target network in which to place Azure VMs created after failover. Select a non-production network if possible, and not the network that was created when you enabled replication. ![](https://i.imgur.com/d4PETqv.png) 4. To start the failover, select **OK**. 5. After the failover finishes, the Azure VM created in the target region appears in the Azure portal **Virtual Machines**. Make sure that the VM is running, sized appropriately, and connected to the network you selected. ### Chech if the site recovery works ![](https://i.imgur.com/M4wYE7t.png) ## Cleanup resources >You can clean up the resources created in this lab by deleting the Azure resource group. To delete the resource group. 1. In the search box, type *Resource Group*. Under **Services**, select **Resource Group**. ![](https://i.imgur.com/H9rHhUF.png) 2. Select the resource group that you create earlier ![](https://i.imgur.com/csYOtti.png) 3. Select **Delete resource group**. ![](https://i.imgur.com/Y6PgPXr.png) 4. Type the resource group name, and Select **Delete**. ![](https://i.imgur.com/AMoV522.png) ## Conclusion * In this lab, You learn how to: * Verify Azure settings and permissions * Prepare VMs you want to replicate * Create a Recovery Services vault * Enable VM replication