How to Find and Resize Azure VM with Low CPU Usage
Lower your cloud costs by resizing Azure Virtual Machines with low CPU usage. Follow our step-by-step guide and learn how to avoid idle or unused VM resources.
Lower your cloud costs by resizing Azure Virtual Machines with low CPU usage. Follow our step-by-step guide and learn how to avoid idle or unused VM resources.
Low-usage virtual machines can quickly skyrocket your cloud computing costs. You can save significant money by identifying low-usage virtual machines and reducing their size.
Azure provides various instance types to cater to different workload requirements and resource types. By allocating VMs according to their specialized purpose and workload requirements, you can avoid idle or unused VM resources and, in turn, significantly save your cloud computing costs.
Calculating and optimizing the costs of your VMs is easier with the right tools and services. Microsoft provides Azure Cost Management, Azure Advisor, and Azure Pricing Calculator.
Azure Advisor identifies underutilized virtual machines by monitoring your virtual machine's usage for seven days. Virtual machines have low usage if their network usage is 7 MB or less and CPU utilization percentage is 5% or less averaged over four or more days.
You can configure the average CPU utilization rule on a per subscription basis. It can be set to 5%, 10%, 15%, or 20% — 5% is the default setting.
To access a virtual machine's performance or utilization insights, perform the following steps.
The page shows performance utilization charts, CPU Utilization, Available Memory, Logical Disk Space Used, Logical Disk IOPS, Logical Disk MB/s, Max Logical Disk Used, and Bytes Sent and Receive Rate for each logical disk.
There are multiple ways to resize Azure virtual machines. Virtual machines restart while resizing, so scheduling the restart can reduce disruptions caused by the unavailability.
Azure Advisor provides various cost optimization recommendations.
A notification appears when the VM resizes effectively.
If the new size is unavailable on the hardware cluster hosting the virtual machine, deallocate the VM before resizing it.
Note: Choose the s version of the virtual machine size that uses premium storage.
To resize a VM using the Azure CLI, use the script below. You can also consider switching to a low-code platform like Blink to perform these tasks in a few clicks.
1. You can view the current size of a VM with az vm show. This script lists the VM size of "blinkVM" in the "blinkResourceGroup" region:
2. View the available VM sizes on the hardware cluster hosting the VM using az vm list-vm-resize-options. This script displays VM sizes for "blinkVM" in the "blinkResourceGroup" region:
3. If the desired VM size is listed, resize the VM with az vm resize. This script resizes "blinkVM" to the "Standard_D3_v2" size:
After the VM restarts, your data disks and OS are remapped. Data on the temporary disk is erased.
4. If the VM size you want is not listed, first deallocate the VM with az vm deallocate. Afterward, you can resize the VM to any available size supported by the region. The following steps deallocate, resize, and start the VM:
Any dynamic IP addresses assigned to the VM are released during deallocation. The OS and data disks are unaffected.
As your business and engineering requirements evolve against internal operational needs and external market developments, your resizing efforts should be just as agile.
Whether you want to aggregate reports on your CPU usage or navigate instance migrations, having an easy way to navigate the steps is critical.
With Blink, you can use this automation to regularly identify Azure instances with low CPU utilization and gather details about them.
When this automation runs, it executes the following steps:
You can also customize this automation to add a removal step for low CPU instances if approved via Slack.
There are over 5K automations in the Blink library you can use right away, or you can build new automations from scratch with drag-and-drop actions to fit your unique use case.
Get started with Blink today to see how easy automation can be.
Blink is secure, decentralized, and cloud-native. Get modern cloud and security operations today.