26

Can someone define the difference between the two in the ARM portal. Also what would be the PowerShell if i need to add a new Azure RM VM to a existing AS(Availability Set)? Thanks Prab

Prab Thind
  • 371
  • 1
  • 3
  • 8

6 Answers6

38

An availability set consists of a set of discrete VMs which have their own names and individual properties, but are spread across fault domains, which means when you have more than one VM in a set it reduces the chances of losing all your VMs in event of a hardware failure in the host or rack.

A scale set consists of a set of identically configured VMs, also spread across fault domains (in fact a scale set is an implicit availability set with 5 fault domains). The main difference is scale sets, being identical, make it very easy to add or remove VMs from the set while preserving high availability, which in turn makes it easy to implement autoscale, and to perform operations on the whole set or a subset of VMs. There are also API calls that support re-imaging and upgrading VMs, allowing you to roll out an update while keeping the service running. They are useful for cloud architectures which require deploying large numbers of similar VMs, or need to be elastic. A typical architecture might use a scale set for agent or worker nodes, and an availability set for master or control nodes. See https://azure.microsoft.com/en-us/services/virtual-machine-scale-sets/ for more detail.

For your question about adding a new VM to an existing AS, see Azure Resource Manager: move VM to availability group and https://gallery.technet.microsoft.com/Set-Azure-Resource-Manager-f7509ec4

Community
  • 1
  • 1
sendmarsh
  • 1,046
  • 7
  • 11
  • 2
    But i think the AS also needs identical sets of VMs according to MS. Is that not correct? – Prab Thind Jul 19 '16 at 12:20
  • 5
    VMs in an AS don't have to be identical, though it often makes good sense to be. For example you could have 2 VMs running database servers in an AS. One configured as a database replication Primary and one configured as a Secondary. Being in an AS provides availability guarantees for the 2-VM database solution, but the VMs can have their own names, public IP addresses, and even be different sizes. – sendmarsh Jul 21 '16 at 17:27
  • 3
    Adding a comment to my comment. Scale sets now support public IP addresses per VM (in preview at time of writing). You can also have scale sets containing different sized VMs, but a scale set always has a current "model" which defines the VM size and other properties, which can be applied to the set, or a subset of VMs depending on upgradePolicy settings. Scale set VM machine names always consist of the same name prefix, followed by a number, compared to an availability set which can have individually named VMs. – sendmarsh May 11 '17 at 23:37
26
  1. The main difference is that Scale Sets have Identical VMs where in Availability Sets does not require them to be identical.

  2. Availability set, in concept, are for enhancing application availability in case one primary VM fails/needs update another VM from Fault/Update domain can be provisioned

    Scale sets on another hand, in concept, are designed for automatic scaling (horizontal) in application where load can vary extensively to fulfill more compute needs.

  3. Provisioning new VM in Azure when needed is easier for Scale sets as all other VMs are same in all aspects & replica of one golden copy.

For more details refer:

https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/

https://learn.microsoft.com/en-us/cli/azure/vm/availability-set?view=azure-cli-latest

Community
  • 1
  • 1
Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
7

After reading all of the answers here, I still didn't feel confident in my knowledge. I got the impression that a scale set would be safe because it had multiple fault domains by default, but couldn't understand why people were still going for availability sets.

To put my mind at ease, I hacked around with the azure CLI and found that you can run this command to list the instances of your scale set and actually verify they are in different fault domains:

az vmss get-instance-view --subscription "your-subscription-id" \ 
--resource-group "your-rg" --name "your-scale-set-name" \
--instance-id "*" | grep platformFaultDomain
    "platformFaultDomain": 0,
    "platformFaultDomain": 1,
    "platformFaultDomain": 2,
    "platformFaultDomain": 4,
    "platformFaultDomain": 0,
    "platformFaultDomain": 1,
    "platformFaultDomain": 3,
    "platformFaultDomain": 4,
    "platformFaultDomain": 2,
    "platformFaultDomain": 3

Hope that puts someone else's mind at ease as well!

I provided some more info and links here as well if you're interested in further resources: https://coding-stream-of-consciousness.com/2019/02/27/azure-scale-set-vs-availability-set/

John Humphreys
  • 37,047
  • 37
  • 155
  • 255
4

A scale set is an implicit availability set with five fault domains and five update domains. Scale sets of more than 100 VMs span multiple placement groups, which are equivalent to multiple availability sets.

For more information about placement groups, see Working with large virtual machine scale sets. An availability set of VMs can exist in the same virtual network as a scale set of VMs. A common configuration is to put control node VMs (which often require unique configuration) in an availability set and put data nodes in the scale set.

2

Availability set is a predecessor of scale set. It will eventually be replaced although right now they are created in conjunction. What's more scale sets introduce autoscaling.

Konrad G
  • 419
  • 7
  • 14
  • 3
    I'm not sure that one will replace another, those are two different solution for 2 different problems. it's clear that if you are interested in Scale Set your will want to have Availability Set as well but the inverse it's not always true. – Roberto Borges Apr 03 '19 at 12:56
2

incorrect, AVSETs have 1 goal and that is to protect against downtime. Scale Sets are a special kind of VM where a single golden image is used for horizontal scaling needs.

  • 1
    I'm wondering as well to this point, for example if you have a problem with you "Image" and want to debug separately it's just impossible in Scale Set, the think that I don't like about Scale Set it's the concept all works or nothing works. – Roberto Borges Apr 02 '19 at 17:20