• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Disclaimer & Policy

Elan Shudnow's Blog

MVP Logo
  • Azure
  • Exchange
  • Lync

Pin Azure VM Availability Sets into an Availability Zone

April 9, 2022 by Elan Shudnow Leave a Comment

Overview

Update (10/12/2022): This instructions in this article are no longer necessary with the new feature Proximity Placement Group intent feature that has been added where you can specify the VM Sizes and Availability Zone a Proximity Placement Group can be aligned to. More information here.

When you deploy a Virtual Machine and want High Availability, you have one of two options which are mutually exclusive:

  • Availability Set
  • Availability Zone

When you want to deploy Virtual Machines that are close together along with its disks to ensure the lowest latency possible, you can assign Azure Virtual Machines to a Proximity Placement Group.

Some relationships Proximity Placement Groups have to resources are:

  • Assigning an Availability Set to a Proximity Placement Group so that Virtual Machines associated with an Availability Set leverage the Fault Domain and Update Domain capabilities of an Availability Set while also being located within the same “Network Spine” which is typically the same Datacenter. These Virtual Machines would carry a 99.95% SLA.
  • Virtual Machines not in an Availability Set, but in the same Proximity Placement Group, are also located within the same “Network Spine” but could potentially land up in the same Network Rack sharing the same networking and power components. This carries a lower Service Level Agreement (SLA) than Virtual Machines that are in an Availability Set. The SLA depends on the type of disk used:
    • 99.9% SLA if using Premium or Ultra SSD Managed Disk(s)
    • 99.5% SLA if using Standard SSD Disk(s)
    • 95% SLA if using Standard HDD Disk(s)
  • Virtual Machines not in an Availability Set, but in an Availability Zone and also a Proximity Placement Group, are also located within the same “Network Spine” but could potentially land up in the same Network Rack sharing the same networking and power components. This carries a higher Service Level Agreement (SLA) than Virtual Machines that are in an Availability Set with a 99.99% SLA.

Reference to Azure Virtual Machine SLAs: SLA for Virtual Machines.

The scope of this article isn’t to go over an overview of Availability Sets, Availability Zones, or Proximity Placement Groups in detail. It is expected you, the reader, are familiar with these technologies.

What I go into below is how you can pin an Availability Set to a specific Availability Zone. Another way to look at it is, how can a workload that is comprised of multiple Virtual Machines leverage 2 or more Availability Zones and Availability Sets at the same time. With this, you can have the benefit of having Virtual Machines spread across Availability Zones but still leverage Availability Sets to ensure in a deployment where you have multiple Virtual Machines in more than one Availability Zone within a Region can leverage Availability Sets to ensure they are in separate Fault Domains and Update Domains.

For example, a Highly Available application that consists of:

  • 2 Virtual Machines in Availability Zone 1 in Central US also leveraging an Availability Set with at least 2 Fault Domains and 2 Update Domains
  • 2 Virtual Machines in Availability Zone 2 in Central US also leveraging an Availability Set with at least 2 Fault Domains and 2 Update Domains

Then creating a zone-redundant Azure Load Balancer or Azure Application Gateway to load balance traffic to your 4 Virtual Machines.

Note

The mapping between Availability Zones to Datacenters is different between Subscriptions. Therefore, one Subscription’s Availability Zone 1 to Datacenter mapping will be different than another Subscription’s Availability Zone 1 to Datacenter mapping.

Proximity Placement Groups Alignment Process is the Magic

Understanding Proximity Placement Groups and the alignment process is the key to understanding how you can pin Availability Sets into an Availability Zone. The key to pinning an Availability Set into an Availability Zone lies with this statement in the Proximity Placement Group article linked in the last sentence, “When you ask for the first virtual machine in the proximity placement group, the data center is automatically selected.”

When I deploy my first Azure Virtual Machine in a Proximity Placement Group, the alignment process will align the Proximity Placement Group, the datacenter is automatically selected and any future VMs that are in that same Proximity Placement Group will be aligned to that same datacenter.

Let’s look at the relationships with Proximity Placement Groups:

  • An Availability Set can be assigned to a Proximity Placement Group
  • A Virtual Machine can be assigned to a Proximity Placement Group
  • A Virtual Machine can be assigned to an Availability Set.

Thinking about that last bullet, if I create a Virtual Machine into a Proximity Placement Group and an Availability Set that’s assigned to a Proximity Placement Group, I can’t select an Availability Zone though. So how can I ensure all Virtual Machines in that Availability Set are in a specific Availability Zone? Again, think back to the statement, “When you ask for the first virtual machine in the proximity placement group, the data center is automatically selected.”

The key to making all this work is as follows:

  1. Create a Proximity Placement Group
  2. Create an Availability Set that’s assigned to the Proximity Placement Group
  3. Create a Virtual Machine (not assigned to the Availability Set) but assign the Virtual Machine to the Proximity Placement Group. With this “anchor” Virtual Machine, you’ll choose the Availability Zone you want your Proximity Placement pinned to. Therefore, the datacenter in that Availability Zone will automatically be selected.
  4. Deploy your subsequent Virtual Machines into the Availability Set that’s assigned to the Proximity Placement Group. When creating these Virtual Machines, make sure to also specify the Proximity Placement Group as well. These Virtual Machines will all automatically be aligned/pinned to that specific Availability Zone and be pinned to that single “Network Spine” that you provisioned your anchor Virtual Machine into.

Deployment Process in Action

Create a Proximity Placement Group into an Azure Region that supports Availability Zones.

Create the Availability Set and on the Advanced tab, choose the Proximity Placement Group you selected above.

Create your anchor Azure Virtual Machine. This Azure Virtual Machine will not be in the Availability Set and will only be used for anchoring purposes. Be sure to select the Availability Zone you want all future Virtual Machines in your Availability Set and Proximity Placement Group pinned to.

On the Advanced Page, be sure to select the Proximity Placement Group we created.

Now that we have our Proximity Placement Group, Availability Set, and our Anchor Virtual Machine created, go into your Proximity Placement Group and let’s verify the Availability Set and Anchor Virtual Machine are aligned.

And because they are aligned and we know that the datacenter for the Proximity Placement Group was automatically selected; because again, refer to the documented statement mentioned earlier, “When you ask for the first virtual machine in the proximity placement group, the data center is automatically selected.” Any subsequent Virtual Machines deployed into the Availability Set will automatically be deployed into the Availability Zone we selected and you have the benefits of ensuring these Virtual Machines will be deployed into separate Fault Domains and Update Domains based on the configuration of your Availability Set.

I hope this helps and feel free to ask any questions in the comments.

Share this:

  • Twitter
  • LinkedIn
  • Reddit

Filed Under: Azure Tagged With: Availability Sets, Availability Zones, Azure, Proximity Placement Groups, Virtual Machines

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • YouTube

More to See

Azure Runbooks Connecting to Exchange Online and Microsoft Graph

July 22, 2022 By Elan Shudnow

Using Python 3.8.0 Azure Runbooks with Python Packages

July 11, 2022 By Elan Shudnow

Preserving UNC Path after Azure Files Migration using DFS-N

April 10, 2022 By Elan Shudnow

Pin Azure VM Availability Sets into an Availability Zone

April 9, 2022 By Elan Shudnow

Tags

ACR Always Encrypted Ansible Automation Availability Sets Availability Zones Azure Azure Active Directory Azure Application Gateway Azure Files Azure Firewall Azure Key Vault Azure Load Balancer Azure Migrate Azure Monitor Azure Web App Backup Exec CDN Cluster DevOps DFS Docker DPM Event Grid Exchange Exchange 2010 Function App ISA iSCSI Log Analytics Logic App Lync Microsoft Graph OCS Office Personal PowerShell Proximity Placement Groups Runbook SCOM SQL Storage Accounts Virtual Machines Windows Server 2008 Windows Server 2008 R2

Footer

About Me

Microsoft Cloud Solution Architect focused on Azure IaaS, PaaS, DevOps, Ansible, Terraform, ARM and PowerShell.

Previously a 6x Microsoft MVP in Exchange Server and Lync Server.

My hobbies include watching sports (Baseball, Football and Hockey) as well as Aviation.

Recent

  • Pre-creating Azure AD App for Azure Migrate
  • Azure Runbooks Connecting to Exchange Online and Microsoft Graph
  • Using Python 3.8.0 Azure Runbooks with Python Packages
  • Preserving UNC Path after Azure Files Migration using DFS-N
  • Pin Azure VM Availability Sets into an Availability Zone

Search

Tags

ACR Always Encrypted Ansible Automation Availability Sets Availability Zones Azure Azure Active Directory Azure Application Gateway Azure Files Azure Firewall Azure Key Vault Azure Load Balancer Azure Migrate Azure Monitor Azure Web App Backup Exec CDN Cluster DevOps DFS Docker DPM Event Grid Exchange Exchange 2010 Function App ISA iSCSI Log Analytics Logic App Lync Microsoft Graph OCS Office Personal PowerShell Proximity Placement Groups Runbook SCOM SQL Storage Accounts Virtual Machines Windows Server 2008 Windows Server 2008 R2

Copyright © 2023 · Magazine Pro on Genesis Framework · WordPress · Log in