Right-sizing virtual machines: the basics
What does an underutilised Azure VM actually cost you?
A virtual machine bills for the SKU you chose, not the work it does. A Standard_D8s_v5 sitting at three per cent CPU costs exactly the same as one running flat out, because you pay for the cores and memory you reserved, not the cycles you burned. Across an estate, this drift is the single largest avoidable line on most Azure compute bills: machines provisioned generously 'to be safe', dev and test boxes left running overnight and at weekends, lift-and-shift servers that kept their on-premises sizing, and workloads that shrank after launch while the VM that served them never did.
Azure Advisor turns this into a concrete, named recommendation: 'Right-size or shut down underutilised virtual machines'. It uses machine-learning over the last several days of telemetry, CPU, memory and outbound network, to flag VMs and scale sets that are paid for around the clock but barely used, and it offers one of two actions per resource. Shut down, when a machine is idle enough that it should not be running at all. Resize, when a machine is doing real but modest work that a smaller, cheaper SKU would serve just as well. For a resize it names the current SKU and a target SKU; for a shutdown it estimates the saving from stopping the machine.
Most of this is not waste in the sense of mistakes, it is sizing that was right once and never revisited. The work is to find every VM that is over-provisioned or idle, separate the ones that are genuinely busy or latency-sensitive from the ones that are simply oversized, resize or schedule the rest, and then keep the estate honest as workloads change.
In this lesson you will learn how Azure Advisor decides a VM is underutilised, how to pull the full list of right-size and shutdown recommendations across a subscription, and how to act on them safely, resizing, scheduling or shutting down machines without disrupting the workloads that genuinely need their size. The links at the end go deeper on the Advisor recommendation, the resize mechanics, and the auto-shutdown options.
The five per cent that costs full price
Azure Advisor's default trigger for flagging a VM as low-utilisation is strikingly low: average CPU at or below five per cent, with outbound network at or below seven megabytes, sustained over the lookback window. A machine ticking along at three per cent CPU is billing at exactly the same rate as one pinned at a hundred, because Azure charges for the SKU you reserved, not the cycles you used. You can raise that five per cent threshold and lengthen the lookback period (the options run from seven up to ninety days) if your workloads are spiky, but the default is deliberately conservative: Advisor would rather miss a borderline case than tell you to shrink a machine that is quietly busy.
Finding underutilised VMs across a subscription
Priya is the platform lead at a growing SaaS company whose Azure bill has crept up faster than its customer base. Advisor's cost page shows a stack of right-size and shutdown recommendations across two subscriptions, but the portal lists them one screen at a time and she wants the whole picture, sorted by saving, before she touches anything.
Rather than work the portal recommendation by recommendation, Priya pulls the full cost recommendation set from the CLI so she can see every flagged machine, the suggested action, and the estimated saving in one list, then decide which are safe shutdowns and which need a workload check before resizing.
Pull every cost recommendation for the subscription. The right-size and shutdown items are the ones tied to virtual machines.
The estimated saving is the sort key. An idle non-production machine is a near risk-free shutdown; a production resize is a saving worth a quick workload check first.
How Azure Advisor decides a VM is underutiliseddeep dive
Advisor runs a machine-learning model over the resource's recent telemetry rather than a single static threshold. For a shutdown recommendation it looks at CPU and outbound network utilisation; memory is deliberately excluded there, because Microsoft found CPU and outbound network alone are sufficient to identify a machine that is effectively idle. For a resize recommendation it considers CPU, memory and outbound network together, so it does not advise shrinking a machine that is light on CPU but genuinely pressed for memory. When it recommends a resize it names both the current SKU and a target SKU; when it recommends a shutdown it estimates the saving from stopping the machine.
The default low-utilisation trigger is average CPU at or below five per cent and outbound network at or below seven megabytes, sustained for four or more days over a seven-day lookback. Both the CPU threshold and the lookback are configurable, the lookback can be set to 7, 14, 21, 30, 60 or 90 days, which matters for spiky workloads: a machine that idles most of the month but runs a heavy batch job at period-end will look idle on a seven-day window and busy on a thirty-day one. Tuning the lookback to your workload's rhythm is how you avoid being told to shrink a machine that has a real but infrequent peak.
Acting on a recommendation is a control-plane change, but the recommendation list itself refreshes on Advisor's own cycle rather than instantly, so a resize or shutdown you make today will clear from the list on the next refresh, not the moment you finish. The estimated savings Advisor shows are based on pay-as-you-go rates; if the machine is already covered by a reservation the real-world saving differs, which is one reason to right-size before you commit to reservations rather than after.
What is the impact of leaving VMs oversized?
The direct impact is recurring overspend. Every oversized or idle machine bills at its full SKU rate every hour it exists, regardless of how little work it does, so the cost compounds quietly month after month. A single over-provisioned production VM left one tier too large is a modest monthly leak; a fleet of dev and test machines running twenty-four hours a day when they are used eight is a large one. None of it shows up as a spike or an alert, which is exactly why it accumulates: there is no failure, just a bill that is bigger than it needs to be.
The second-order impact is that the overspend distorts every other cost decision built on top of it. Buy a reservation or a savings plan against an estate that is twenty per cent too large and you have just committed one to three years of spend to capacity you were about to remove, locking in the waste instead of clearing it. Right-sizing first, then committing against what remains, is the order that compounds savings rather than freezing them.
There is also an opportunity cost. Money spent on idle cores is money not spent on the work that actually moves the business, and a compute bill that grows faster than usage erodes the unit economics that leadership and investors watch. A right-sized estate is the cheapest, most defensible evidence that cloud spend is under active management rather than drifting.
How do you right-size VMs safely?
Work the recommendations as one loop ordered by saving and risk, not machine by machine in report order. The order matters: confirm a machine really is oversized, and capture the safe shutdowns before the trickier resizes, so you bank the easy savings without risking a live workload.
1. Pull the full recommendation list with savings
Export every Advisor cost recommendation with its impacted resource, suggested action and estimated saving. Treat this as the source of truth and sort it by saving, so the biggest recoverable amounts surface first rather than being buried in a long portal list.
2. Separate safe shutdowns from production resizes
Idle non-production machines, dev build agents, test environments, sandbox boxes, are near risk-free: schedule them off out of hours or shut them down entirely. Production resizes carry a trade-off, so for each one check the workload's real peaks over a longer lookback before shrinking it, in case it has an infrequent but genuine busy period.
3. Capture the savings, biggest and safest first
For an idle machine, attach an auto-shutdown schedule or stop and deallocate it. For an oversized one, deallocate, resize to the SKU Advisor suggests (or the smaller of two candidates if you want headroom), and start it again. A resize on a running machine restarts it, so do production resizes in a maintenance window. Each change takes effect on the next billing hour.
4. Keep it right-sized, then commit
Make right-sizing a recurring routine, not a one-off, by tuning Advisor's lookback to your workloads and reviewing the list each month so new drift is caught early. Enforce auto-shutdown on non-production VMs with a schedule baked into your infrastructure-as-code. Only once the estate is right-sized should you buy a reservation or savings plan against what remains, so you commit to capacity you actually use.
# Safe win first: schedule an idle dev VM to shut down every evening (UTC).
az vm auto-shutdown \
--resource-group rg-dev \
--name dev-build-01 \
--time 1800 \
--email "[email protected]"
# Oversized production VM: confirm the target SKU is available on the
# current cluster, then deallocate, resize and start (do this in a window).
az vm list-vm-resize-options \
--resource-group rg-prod --name api-prod-03 \
--query "[].name" -o tsv | grep Standard_D2s_v5
az vm deallocate --resource-group rg-prod --name api-prod-03
az vm resize --resource-group rg-prod --name api-prod-03 \
--size Standard_D2s_v5
az vm start --resource-group rg-prod --name api-prod-03 Quick quiz
Question 1 of 5Azure Advisor flags a virtual machine under 'Right-size or shut down underutilised virtual machines'. What does that recommendation actually offer?
You scored
0 / 5
Keep learning
Go deeper on how Advisor identifies underutilised machines and on the mechanics of resizing and scheduling them.
- Optimise VM or scale set spend by resizing or shutting down underutilised instances How Advisor's model identifies low-utilisation machines and what the resize and shutdown actions offer.
- Resize a virtual machine The deallocate, resize and start flow, including when a target SKU needs the VM stopped first.
- Auto-shutdown a VM Schedule idle machines to stop out of hours, with notifications before shutdown.
You can now treat right-sizing as one capability rather than a scatter of portal recommendations: pull the full Advisor cost list sorted by saving, separate the safe shutdowns from the production resizes, capture the biggest and safest savings first, and keep the estate honest with a monthly routine and auto-shutdown on non-production machines, only committing to reservations once the estate is right-sized. The links above go deeper on each step.
Back to the library