Azure Site Recovery (ASR) is a disaster recovery service for Azure VMs. In the event of a disaster, you can failover your VMs to a different Azure region. ASR will recreate your Virtual Network, and create the new VMs using point-in-time recovery points. For some applications, it is important to failover certain VMs together as a set. For example, if you have several VMs that are each nodes for a service, they need to failover as a group. In addition, you may have a requirement that the VMs be brought back online in a certain order. ASR can handle all of that.
Set up a test environment
First, let’s set up a couple of VMs so we can see how it works.
Create a resource group
- Go to the Azure portal and click the green plus in the upper left corner to create a new item.
- Type “Resource” and press enter. Select “Resource Group” to create a new resource group. Click the “Create button” in the blade that opens up.
- Fill in the new resource group name, subscription, and region. Items in the resource group can be located in a different region. This is simply a logical grouping of resources.
Create Virtual Network
We will create just one virtual network that will contain all of our assets.
- In the resource group you just created, click the “Add” button.
- Define the name, address space, and subnet information.
- Name of virtual network
- Address space in CIDR notation
- Select your subscription
- Select the resource group you just created
- Select a region. All of the other assets should also be created in this region
- Name your subnet or accept the name “default”
- Select the address space for the subnet. You can accept the default.
We will create a couple of VMs to test with. 1. Click the green “Add a resource” button in the upper left corner of the Azure portal and select “Compute”. Click on “See all” to get an expanded list of available VMs in the Azure Marketplace. 2. You can narrow the selection by operating system. 2. Fill out the basic information for a new VM.
- Select your subscription
- Select your resource group
- Give the VM a name that will be unique in your virtual network
- Select the same region as your resource group
- Make sure the image selected is the one you want
- You can change the size of the VM by clicking “Change size”
- Select “Password” for authentication type, and fill in the username and password you want to use. Make a note of it since you won’t be able to view the password later.
- Open up the SSH port so you can log into your VM using SSH.
- Select OS disk type
- Add any data disks
- Select the virtual network you created earlier
- Select the subnet
- Accept the name for the public IP address
- Click “Review + create” to validate your selections
- On the final screen, make sure you see “Validation passed”, and then click “Create”
After a few minutes, you should see “Your deployment is complete”. Set up a second VM similar to the first one so we can test failing over a group of VMs together.
Setting up Azure Site Recovery
We will set up Azure Site Recovery to test failing over our VMs. To test the VM failover,