Skip to main content
emnode
Cost

Right-size or shut down underutilised VM scale sets

One capability for VM scale sets: find the ones whose instances run far below the SKU and instance count they are paying for, then resize the SKU, reduce the instance count, or shut the idle ones down, so the bill matches the load you actually carry.

14 min·10 sections·AZURE

Last reviewed

Right-sizing VM scale sets: the basics

What does an underutilised VM scale set actually look like?

A virtual machine scale set is a pool of identical VMs sized by two numbers: the SKU each instance runs on, and how many instances are in the pool. You pay for both, continuously, whether or not the workload uses them. Underutilisation shows up when those two numbers were chosen for a peak that rarely arrives, or for headroom that was never trimmed: instances sitting at a few per cent CPU, a pool of ten running work that two could carry, or a whole scale set spun up for a project that ended and never torn down. The compute meter keeps running at the size you provisioned, not the size you use.

Azure Advisor turns this into a single cost recommendation, 'Right-size or shutdown underutilized virtual machine scale sets', against the microsoft.compute/virtualMachineScaleSets resource type. It uses machine-learning on the last seven days of CPU, memory and outbound-network metrics (the lookback is configurable up to ninety days) to spot pools that would fit on a cheaper SKU or fewer instances. For a scale set it has three moves: reduce the instance count, resize to a smaller or cheaper SKU, or, if the pool was not used at all over the lookback window, shut it down. Each carries an estimated saving against retail rates.

Most of this is drift, not a sizing mistake. A scale set provisioned for a launch that never reached its forecast, a pool whose instance count was bumped up during an incident and left there, a SKU chosen before a newer, cheaper generation existed. The work is to find every scale set running well below what it pays for, decide which can shrink without touching the load they carry, and prove the change is safe before you make it.

In this lesson you will learn how a VM scale set expresses its cost through SKU and instance count, how Azure Advisor decides a scale set is underutilised, and how to act on the recommendation safely: reduce the instance count, resize the SKU, or shut an idle pool down without taking a live service offline. The keep-learning section links the exact Microsoft references for each action.

Fun fact

The pool nobody scaled back down

The most common reason a scale set is oversized is not a bad initial estimate, it is an incident. A pool gets scaled out by hand or by a one-off rule to ride out a traffic spike or a noisy-neighbour problem, the fire is put out, and the instance count is never brought back down because nothing forces it to. The extra instances run on quietly, billed by the hour, until a right-sizing review or an Advisor recommendation notices that the pool has been sitting at single-digit CPU for weeks. This is exactly why Advisor prioritises the instance-count recommendation for scale sets: reducing the count is the quickest, most reversible way to undo that kind of drift.

Finding underutilised scale sets across a subscription

Priya runs the platform team at a SaaS company that has grown by acquisition, so its Azure estate is a patchwork of scale sets created by teams that no longer own them. The monthly bill has crept up and compute is the largest line.

Rather than guess at which pools are oversized, Priya pulls the cost recommendations Azure Advisor has already generated, then cross-checks each flagged scale set against its current SKU and instance count before deciding what to do with it.

Start by listing the right-sizing and shutdown recommendations Advisor has already raised in the Cost category. Each one names a scale set and an action.

$ az advisor recommendation list --category Cost --query "[?contains(impactedField, 'virtualMachineScaleSets')].{resource:impactedValue, action:shortDescription.solution}" -o table
Resource Action
----------------- -----------------------------------------
checkout-vmss Right-size or shutdown underutilized VMSS
batch-pool-old Right-size or shutdown underutilized VMSS
# batch-pool-old has been idle for the whole lookback. Check it for shutdown first.

Advisor has already done the detection. The CLI lists every scale set it flagged so you can triage shutdown candidates from resize candidates before changing anything.

How Azure Advisor decides a scale set is underutiliseddeep dive

Advisor evaluates the resource against CPU, memory and outbound-network utilisation. By default it analyses the last seven days of metrics, and you can widen the lookback to 14, 21, 30, 60 or 90 days in the Advisor configuration. Metrics are sampled every 30 seconds and aggregated up to 30-minute windows, and for a scale set the per-instance figures are combined across the pool: averaged across instances for instance-count recommendations, and taken at the maximum across instances for SKU-change recommendations, so a busy instance is not hidden by quiet ones when it decides the SKU can shrink.

From that, Advisor produces one of three actions. If the scale set was not used at all over the window (broadly, P95 CPU below about 3 per cent and outbound network below about 2 per cent), it recommends shutting it down. Otherwise it looks for a cheaper fit that keeps performance headroom, a smaller or newer-generation SKU, or simply fewer instances of the same SKU. For scale sets specifically, Advisor prioritises the instance-count recommendation over the SKU change, because changing the count is easily actionable and banks the saving faster. It also checks whether a burstable B-series SKU would suit a pool with low average CPU but occasional spikes.

Two limits matter when you read the estimate. The saving is calculated against retail rates, so it does not reflect any discount, reservation or savings plan you already hold, and Advisor explicitly cautions that a cross-series resize can increase cost if a reservation was bought for the original family. The recommendation also will not know about capacity you provisioned deliberately for an upcoming launch, a disaster-recovery standby, or a homogeneity requirement. Those are valid reasons to dismiss or postpone the recommendation rather than act on it.

What is the impact of leaving scale sets oversized?

The direct impact is recurring spend with nothing behind it. Every instance in an over-provisioned pool, and every step of SKU larger than the workload needs, is a compute charge that bills every hour regardless of load. Because it is steady and unremarkable, it rarely triggers a review: an oversized scale set does not page anyone, it just quietly inflates the monthly invoice until someone goes looking. The idle batch pool that ran for a month after its project ended is the same money as a small headcount, spent on nothing.

The second-order impact is that this waste compounds. An oversized scale set sets a baseline that the next reservation or savings-plan purchase is sized against, so the over-provisioning gets locked in as a committed spend that is harder to unwind. Right-sizing before you commit means the commitment is bought against real usage, which is where the durable saving comes from.

There is an upside framing too: this is one of the few cost levers where Azure quantifies the prize for you. A clean set of acted-on right-sizing recommendations is both an immediate, repeating saving and a signal that the estate is actively managed rather than left to drift, which is exactly what a cost-conscious board or an incoming finance owner wants to see.

How do you right-size a scale set safely?

Work the recommendation in order of how risk-free each action is, and verify against the workload's real peak before you shrink anything. The sequence matters: confirm a pool is genuinely idle or over-provisioned before you touch a live service, and check for reservations before a cross-family SKU change.

1. Triage shutdown candidates from resize candidates

Pull the Advisor cost recommendations and separate the scale sets it says were not used at all over the lookback window (shutdown candidates) from those it says are over-provisioned (resize candidates). A scale set that has been idle for the whole window is the cleanest saving; confirm with the owning team that it is genuinely retired, not a standby, before deallocating or deleting it.

2. Prefer reducing the instance count first

For over-provisioned pools, Advisor prioritises cutting the instance count over changing the SKU, because it is reversible and lands the saving fast. Check that the workload's peak is comfortably carried by the smaller count, then scale the pool down. If the scale set autoscales, lower the minimum and maximum capacity rather than fighting the autoscale rule.

3. Resize the SKU only after checking the peak and any reservation

A SKU change alters the performance ceiling of every instance, so size it against the maximum across instances, not the average, and keep the headroom Advisor targets. Critically, check whether the pool sits under a reservation or savings plan: a cross-family resize can strand it and increase net cost. If the new SKU is not supported on the current hardware, the instances must be deallocated before the SKU name can change.

4. Apply the model, then make right-sizing a routine

After changing the scale set model, bring the existing instances up to it (manual upgrade mode requires an explicit update-instances call). Then schedule a recurring review of the Advisor cost recommendations so new drift, especially instance counts bumped up during an incident and never lowered, is caught within weeks. Dismiss or postpone, with a reason, any recommendation against capacity held deliberately for a launch, disaster recovery or a homogeneity requirement.

# Take the lowest-risk saving first: reduce the instance count on an over-provisioned pool.
# Advisor prioritises this for scale sets because it is reversible and lands fast.
az vmss scale \
  --resource-group myResourceGroup \
  --name checkout-vmss \
  --new-capacity 3

# Higher-judgement saving: resize the SKU to a cheaper fit.
# Size against the peak, and confirm no reservation covers this pool before a cross-family change.
az vmss update \
  --resource-group myResourceGroup \
  --name checkout-vmss \
  --set sku.name=Standard_D2s_v5

# In manual upgrade mode the model change does not touch running instances until you apply it.
az vmss update-instances \
  --resource-group myResourceGroup \
  --name checkout-vmss \
  --instance-ids "*"

# Clean shutdown saving: deallocate an idle pool so it stops billing compute (storage still charges).
az vmss deallocate \
  --resource-group myResourceGroup \
  --name batch-pool-old

Quick quiz

Question 1 of 5

Azure Advisor raises 'Right-size or shutdown underutilized virtual machine scale sets' against several pools. For a scale set, which action does Advisor prioritise, and why?

You can now treat scale-set right-sizing as one capability: pull the Azure Advisor cost recommendations, triage the idle pools to shut down from the over-provisioned ones to trim, reduce the instance count before reaching for a SKU change, verify each change against the workload's peak and any reservation, apply the model to running instances, and put the review on a recurring cadence so the saving stays banked.

Back to the library