Using Powershell to create Azure VMs in an Availability Set


Azure futures Availability Sets. Workloads placed in an Availability Set are placed in different Fault and Upgrade domains. A Fault domain is a group of Azure resources that are subject to concurrent failure. For example, servers connected to a switch may be in the same Fault domain since switch unplanned failure will disrupt access to that group of servers. An Upgrade domain is a group of Azure resources that are subject to planned down-time as Microsoft performs routine maintenance and upgrades. By placing 2 VMs for example in an Availability Set, Microsoft ensures that they’re placed in different Upgrade and Fault domains. So, in case of unplanned failure or planned upgrade, one of the VMs is always up.

This script is a demo/test of an Availability Set done after the VMs have been provisioned. Adding/removing VM from Availability Set cause the VM to reboot.

The script output may look like:

AvSet05a

At the bottom you can see that the 2 VMs are in different Upgrade and Fault Domains. The Azure Management Interface also reflects the changes performed by the script:

AvSet03a

The Availability Set details can also be seen in the Azure Management Interface under the Cloud Service\Instances page:

AvSet04b

This script is a demo/test of setting up an Availability Set at the time of VM creation. Output may look like:

AvSet04a

 

Advertisements

3 responses

  1. Pingback: Using Powershell to create Azure VMs in an Availability Set | MakeThingsGo

  2. Pingback: Using Powershell to Create Azure VMs in an Availability Set - makethingsgo

  3. Hi, do you know what’s happened to these fault and availability domain properties of the virtual machines? Get-AzureRmVM no longer seems to support them?

    Thanks!

    Dave

    October 24, 2016 at 11:45 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s