This post is focusing on different types of maintenance activities that can happen on your Azure Virtual Machine (VM). Depending on the actions that need to be done on your VM, this can have a direct or indirect impact on the machine availability or performance.
First of all, let's identify how a machine can be impacted by different maintenance activities. We do not include in this discussion cases like outages or disasters.
- Performance decrease: During a live migration of a machine, the performance of the machine can be lower than usual. This happens because of the live migration of a machine from one physical hardware to another that consumes resources.
- Pause: For a short period of time the machine is paused, but without data loss or connectivity problems (E.g., RDP connection is maintained, but delayed for a short period of time).
- Unplanned reboot: There are isolated cases when the VM needs a restart. In this situation, there is a short period of downtime until the machine restarts.
- Loss temporary drive: In specific situations, the temporary drive of the machine is lost. This shall not impact the applications that are running on the machine because the temporary drive should be used only for temporary data.
- Planned reboot: In this situation in the time window specified by the user when system redeploy is allowed, Azure initiates a system update that might request a system reboot.
There are 3 types of cases when our machine availability is impacted.
- Unplanned hardware maintenance: This is one of the most impressive scenarios. The platform can predict a hardware failure and trigger a migration from one physical hardware to another. This migration is done using live migrations technology that reduces the impact on the machine.
- Unexpected downtime: It is represented by the cases when physical hardware fails (E.g., disk failure, network failure) and the only thing that is possible to do is to migrate the machine to another hardware on another rack or datacenter. In this situations, the machine is down for a specific time. Even if the temporary disk can be lost, the data and OS disk are preserved.
- Planned maintenance: Normal maintenance activities that are happening on Azure or machine level (E.g., OS update). In general, there is no impact on the machine availability, expect exceptional cases when a reboot is required. For this scenarios, Maintenance-Redeploy can be used to trigger the restart in a convenable time window.
There are some small things that we can do on our side to mitigate these situations and reduce at minimal the impact on our machines.
- Availability Sets: The first thing that we can do is to add multiple machines inside an availability set. This ensures us that in the case of a hardware failure the machines are stored on different physical resources, that are shared between them (fault domains). The same thing is applicable from how updates are pushed automatically to the VMs and how the reboot is happening (update domains). This combination of update and fault domains is called Available Set and is managed automatically by Azure. Using Availability Sets, Azure is offering a 99.95% uptime SLA.
- Azure Load Balancer: It is not enough to have all the machines up and running. Besides this, you need a load balancer that can manage the load between machines and detect when a machine is rebooted.
- Azure Zones: Are entirely different from Availability Sets and ensures that machines are running in separate physical locations in the same Azure Regions. This means that each zone has its own storage, cooling system, network and power source.
- Manage Disk: This goes hand in hand with Availability Sets and ensures that the machine disks are isolated from each other. Behind the scene, each machine disk is added on different storage fault domains to ensure that in a case of a storage failure only a part of instances of that machine is affected.
- Separate Availability Sets for each Application Tier: This simple solution ensures that it is impossible to have all machine restarts from the same application tier at the same time. If you use only one Availability Sets for all tiers, there is a small chance that all the machines from a specific tier to be restarted in the same time (odds are low, but still exists).
As we can even if there are situations when we can have our machine down for a short period of times, there are simple things that we can do to avoid this kind of situations. Combining Availability Sets with Manage Disks and by keeping different application tiers on different Availablity Sets improves the odds to have our system offline.