Virtual machine scale sets flexible orchestration mode (and benefits over regular VMs)
Tags: azure, vmss, compute, iaas
Published: 2021-08-11 09:25:56

# Introduction and VMSS benefits

When we close our eyes and we try and picture "the cloud", two quintessential **IaaS** services come to mind: **Virtual machines** and **Virtual machine scale sets** (in **Azure**).

Historically, **VMs** and **VMSSs** are the first iteration of our cloud migration journey; a **VM** facilitates the **lift-and-shift** pattern and a **VMSS** our first step towards leveraging cloud scaling for our workload.

A traditional **VMSS** sacrifices control in favour of simpler deployment, simpler management, faster recovery and faster horizontal scaling.

You define an image and the service will stamp instances of that blueprint on demand, it can auto-scale based on the usage, on failure, on updates; all on your behalf.

# Downsides of VMSS

Those glorious benefits have some drawbacks:

1) **VMSS API** diverges from the standard **VM API** for individual instances
2) Lack of **RBAC** granular permissions per **VM**
3) Lack of **Azure Site Recovery** and **Azure Backup** support

In addition, to handle **VMs** availability, there are two different patterns making the experience inconsistent between **VMSSs** and **VMs**; for datacenter redundancy for **VMs**, availability sets must be used, **VMSSs** have native support for distribution across fault and update domains.

# Enter VMSS flexible

A new option for **VMSS** has been created, the **"orchestration mode"**.

The classic experience, has been re-branded as **uniform orchestration**, but is no different from the traditional **VMSS** experience.

The new option, still in preview at the time of writing, is called **flexible orchestration** and it promises to:

* Unify the experience, no more **availability sets**, the availability experience will be handled in the same way between individual **VMs** and **VMSSs**
* Individual instances have full control with the same **VM** API as regular **VMs**
* **VMs** can be added to **VMSS flex** after creation
* Custom instance naming
* Target individual **VMs** with extensions
* Assign machines to specific fault domains
* In guest OS security patching (without re-imaging)
* Mix Windows and Linux in the same set

# Why should I use that instead of regular VMs?

**VMSS flex** shines when managing a substantial number of **VMs** (30+).

It provides a single control plane for distribution of the machines across a datacenter with automatic and optimized spread.

When dealing with many machines, it can be a significant overhead to manage availability.

It does also support the template-based scaling  like a **uniform** scale set should you need that, but, I believe, its main purpose is to unify the experience between **VMs** and **VMSSs**.

It supports up to 1000 instances spread across **fault domains**, whereas **uniform** supports only up to 100. **Fault domains** are also treated the same as **update domains**.

There are obvious advantages (and some cons) over a **uniform** mode, including having different machine sizes and other features listed above in the article; in addition, there is a comprehensive table in the official [Microsoft documentation](https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-orchestration-modes#a-comparison-of-flexible-uniform-and-availability-sets) that would be pointless to copy and paste here.

# Current limitations

**VMSS flex** does not currently support **availability zones**.

Does not support single placement groups.

# How to get started

To try **VMSS flex** you need to register the feature in your subscription, see the full guide here: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-orchestration-modes#register-for-flexible-orchestration-mode

Quickstart **ARM template** to deploy **VMSS flex**: https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.compute/vm-vmss-flexible-orchestration-mode