Skip to main content

πŸ“ Azure Virtual Machine is underutilized 🟒

  • Contextual name: πŸ“ Virtual Machine is underutilized 🟒
  • ID: /ce/ca/azure/virtual-machine/virtual-machine-underutilized
  • Located in: πŸ“ Azure Virtual Machine

Flags​

Our Metadata​

  • Policy Type: COMPLIANCE_POLICY
  • Policy Category:
    • COST
    • PERFORMANCE

Logic​

Description​

Open File

Description​

Identify Azure Virtual Machines that are potentially underutilized and rightsize (downsize) them to optimize cloud expenditure. A VM is classified as underutilized if, over a 14-day period, its average CPU utilization remains below 40% and its maximum CPU utilization does not exceed 50%. Persistently underutilized VMs indicate over-provisioning, leading to inefficient resource usage and elevated operational costs.

Rationale​

Detecting and addressing underutilized VMs is a key cost optimization strategy in cloud environments. By rightsizing or decommissioning over-provisioned VMs, you can reduce unnecessary spending, improve overall resource utilization, and reallocate compute capacity to higher-priority workloads.

Impact​

Downsizing actions must be carefully evaluated to avoid negatively impacting performance, particularly for workloads that may experience occasional bursts or are stateful in nature.

Audit​

This policy evaluates an Azure Virtual Machine based on their performance over the preceding 14 days.

... see more

Remediation​

Open File

Remediation​

Considerations​

  1. Virtual machines (VMs) with local temporary disks cannot be resized to VM SKUs that do not support temporary disks, and vice versa.
  2. Resizing from a SCSI-based VM SKU to a remote NVMe-enabled VM SKU is not supported.

Right-Sizing UNderutilized Virtual Machine​

Resizing a VM should be treated as a disruptive operation, particularly for stateful workloads. Ensure proper planning and downtime windows if required.

For VMs leveraging Premium Storage, it is critical to select an s-series SKU to retain support. For instance, use Standard_E4s_v3 instead of Standard_E4_v3 to maintain Premium disk compatibility.

Azure CLI​
resourceGroup={{resource-group-name}}
vmName={{vm-name}}
newSize={{desired-vm-size}}

### Deallocate the VM
az vm deallocate --resource-group $resourceGroup --name $vmName

### Resize the VM
az vm resize --resource-group $resourceGroup --name $vmName --size $newSize

### Start the VM
az vm start --resource-group $resourceGroup --name $vmName
PowerShell​
$resourceGroup = "{{resource-group-name}}"

... [see more](remediation.md)

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlags
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Resource Right-Sizing4
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Workload Efficiency6