Why it matters
Running only during working hours cuts a VM’s compute hours by almost two thirds.How nOps finds it
nOps reads the last 14 days of Azure VM billing. A VM is flagged when it was billed for a full day (23.5 to 24.5 hours) on at least 13 of the 14 days, including at least 3 of the 4 weekend days, and at least 90% of its cost is non-production. Non-production comes from the VM’s environment tag, then the environment nOps assigns, then the resource group name. The saving is the 7-day pay-as-you-go compute cost, scaled to a month, times (1 minus 60/168), assuming the VM runs 60 hours a week. Scale sets, Databricks VMs, AKS nodes (unless tagged non-production), VMs mostly covered by reservations, and savings under $25 a month are left out.Before you start
Confirm with the owner when the VM is needed, and permission to start and stop it (or to set up automation).How to implement
- Agree working hours with the people who use the VM.
- For a simple nightly stop, open the VM in the Azure portal, go to Auto-shutdown, and set a time. This stops the VM but does not start it again.
- To stop and start on a schedule, use the Start/Stop VMs v2 solution or an Azure Automation runbook that runs
az vm deallocateandaz vm start. - Tag the VM with its schedule so others know why it is off.
Risks and considerations
- Managed disks keep billing while the VM is deallocated, so the saving covers compute only.
- A VM with a dynamic public IP gets a new address each time it starts.
- Anything that runs overnight (backups, batch jobs, patching) needs to move into the working window.
- To roll back, remove the schedule.
FAQs
How does nOps decide a VM is non-production?
How does nOps decide a VM is non-production?
From its environment tag first, then the environment nOps assigns, then words like dev, test or staging in the resource group name. At least 90% of its cost must be non-production.
Why are scale sets left out?
Why are scale sets left out?
Azure bills scale sets per instance, so daily billing cannot show that a scale set runs around the clock. Use a scheduled autoscale profile for them.