To guarantee high availability, your applications should run on multiple identical virtual machines so that your application is not affected when a small subset of these VMs is not available due to updates or power failures. Using several VMs for your application may require you to set up an Azure Load Balancer. This post will cover the section Manage ARM VM Availability of the 70-532 Developing Microsoft Azure Solutions certification exam.
Availability sets help you to increase the availability of your VMs by grouping VMs which never should be turned off at the same time. Additionally, these VMs are physically separated therefore they have different network and power connections. At no point in time should all VMs of your availability set offline. Availability sets consists of update and fault domains.
An update domain works similarly to the Availability Set and constraints how Azure updates the host machines which run your VM. By default, Azure uses five update domains in which your VMs are placed in a round-robin process. Azure ensures that only one update domain at a time is affected by updates and restarts. This means if you have two VMs in your update domains, never more than 50% of your VMs are affected by updates to the host machine.
Fault domains provide isolation regarding power and network. VMs in separate fault domains will not be on the same host machine or even the same server rack as another. By default, Azure places VMs in a round-robin fashion into the fault domains.
It is best practice for multi-tier applications to place all VMs belonging to a single tier in an unique availability set and have separate availability sets for each application tier.
To create a new VM and put it into an availability group, follow these steps:
- Go to the Marketplace in the Azure Portal.
- Select Compute and then click on Windows Server 2016 Datacenter.
- On the Create virtual machine, provide a name, user name, password, subscription, and location for your new VM.
- Select the desired size of your VM on the Choose a size blade.
- On the Settings blade, click on Availability set. Either add a new one by clicking on Create new or select an existing one.
- After adding the availability set click OK.
- On the Summary blade, click Create to start the deployment process of your VM.
An existing VM can’t be added to an availability set. You can add a VM to an availability set only when creating the VM. To move a VM to an availability set, you have to recreate it.
The Azure Load Balancer distributes the incoming traffic to all VMs within an availability set in a round robin manner. It also checks the health of the VM and removes unresponsive VMs automatically from the rotation.
To add an Azure Load Balancer, follow these steps:
- In the Azure Portal, go to the Marketplace and search for Load Balancer.
- Select the Load Balancer and click Create.
- On the Create a Load Balancer blade, provide a name, subscription, resource group, and location.
- Select Public as type, if you want to load balance traffic from the Internet, or internal if you want to load balance traffic from your virtual network
- Select or add a new Public IP address.
- Click Create.
- After the Load Balancer is deployed, select Backend pools under the Settings menu and click + Add.
- On the Add backend pool blade, provide a name and in the Associated to drop-down list select Availability set.
- Click + Add a target network IP configuration to add your VM. Repeat this step for each VM you want to add.
- Click OK.
- Select Health probes under the Settings menu and click + Add.
- On the Add health probe, provide a name. You can leave the remaining options as they are. Optionally you can change the checking interval, and after how many failed tries a VM should be marked as unhealthy.
- Click OK.
- Select Load balancing rules under the Settings menu and click + Add.
- On the Add load balancing rule, provide a name, the previously created pool, and health probe. You can leave the remaining options as they are.
- Click OK.
This post explained what availability sets are and how they use fault and update domains to guarantee that never all your VMs are turned off at the same time. Then I talked about the Azure Load Balancer and how it can be configured to load balance traffic to different VMs within your availability set. These topics covered the part Manage ARM VM Availability of the 70-532 Developing Microsoft Azure Solutions certification exam.
For more information about the 70-532 exam get the Exam Ref book from Microsoft and continue reading my blog posts. I am covering all topics needed to pass the exam. You can find an overview of all posts related to the 70-532 exam here.