CubeAPM
CubeAPM CubeAPM

How to Monitor Azure Virtual Machines: CPU, Memory, and Disk 

How to Monitor Azure Virtual Machines: CPU, Memory, and Disk 

Table of Contents

Monitoring Azure Virtual Machine performance requires understanding a distinction that catches most teams off guard: host metrics and guest OS metrics are collected by different mechanisms and measure different things. Host metrics come from the Azure hypervisor and are available without any agent installed on the VM. Guest OS metrics, such as in-guest memory usage percentage and per-process CPU, come from inside the VM and require the Azure Monitor Agent (AMA) to be installed and configured with a Data Collection Rule.

Two legacy agents must no longer be used. The Log Analytics agent (MMA/OMS) was retired on August 31, 2024, and data upload from it can stop without notice after March 2, 2026. The Azure Diagnostics extensions for Windows (WAD) and Linux (LAD) were deprecated and retired on March 31, 2026, and are no longer supported. The Azure Monitor Agent is the only supported agent for VM monitoring.

Key Takeaways

  • Host metrics (CPU, disk throughput, network) come from the Azure hypervisor and are available without any agent. They require no configuration to start collecting
  • Guest OS metrics (in-guest memory usage, pagefile, per-process counters) require the Azure Monitor Agent installed on the VM and configured with a Data Collection Rule (DCR)
  • The Log Analytics agent (MMA/OMS) was retired August 31, 2024 and data upload from it can stop without notice after March 2, 2026. The Azure Diagnostics extensions (WAD/LAD) were retired March 31, 2026. The Azure Monitor Agent is the only supported collection agent
  • Percentage CPU (the host metric) measures hypervisor-allocated CPU, not the same as the guest OS CPU percentage shown in Task Manager or top. For precise guest-level CPU, use AMA with the appropriate performance counter
  • Available Memory Bytes and Available Memory Percentage are platform metrics available without an agent. For detailed in-guest memory breakdown, AMA is required
  • VM insights is the recommended starting point for comprehensive VM performance monitoring. It provides pre-built performance charts, a top-N list of VMs by resource utilization, and a dependency map showing connections between VMs and processes

Host Metrics vs Guest OS Metrics

This distinction determines what you need to install and what you can measure.

Metric typeSourceAgent requiredExamples
Host (platform) metricsAzure hypervisorNonePercentage CPU, Disk Read Bytes, Network In Total, Available Memory Bytes
Guest OS metricsInside the VM OSAzure Monitor Agent and DCRIn-guest CPU per process, memory committed bytes, pagefile usage, disk queue length

Why this matters for memory monitoring: The Available Memory Bytes platform metric shows free physical memory, useful for alerting on low memory. It does not show committed memory, memory used by specific processes, or paged memory for those who need AMA. On both Windows and Linux VMs, available memory is a platform metric that requires no agent.

Why this matters for CPU monitoring: The Percentage CPU host metric measures CPU credits allocated to the VM by the hypervisor. Under most workloads, it correlates closely with guest OS CPU percentage, but they are not identical. Under high steal time or CPU credit exhaustion on B-series VMs, they diverge significantly. Use the host metric for alerting on sustained load. Use the guest OS counter for precise process-level analysis.

The Key Platform Metrics: What Azure Exposes Without an Agent

These metrics are available in the Azure portal under your VM’s Monitoring > Metrics section with no configuration needed.

CPU Metrics

Metric nameREST API nameWhat it measuresAlert guidance
Percentage CPUPercentage CPUHypervisor CPU usage as a percentage of the VM’s allocated vCPUsAlert above 85% sustained for 5 minutes
CPU Credits ConsumedCPU Credits ConsumedCredits consumed by burstable B-series VMsMonitor alongside Percentage CPU on B-series
CPU Credits RemainingCPU Credits RemainingRemaining burst credits on B-series VMsAlert below 20 credits to avoid throttling

Memory Metrics

Metric nameREST API nameWhat it measuresAlert guidance
Available Memory BytesAvailable Memory BytesPhysical memory available for allocation, in bytesAlert below 500MB or below 10% of total RAM
Available Memory PercentageAvailable Memory PercentagePhysical memory available, as a percentageAlert below 10%

Disk Metrics

Metric nameREST API nameWhat it measuresAlert guidance
Disk Read BytesDisk Read BytesTotal bytes read from all disks per intervalTrend alerting on sustained increases
Disk Write BytesDisk Write BytesTotal bytes written to all disks per intervalTrend alerting on sustained increases
Disk Read Operations/SecDisk Read Operations/SecRead IOPS across all disksAlert relative to the disk’s IOPS limit
Disk Write Operations/SecDisk Write Operations/SecWrite IOPS across all disksAlert relative to the disk’s IOPS limit
Data Disk IOPS Consumed PercentageData Disk IOPS Consumed PercentageIOPS used as a percentage of the data disk’s provisioned IOPS limit (premium storage only)Alert above 90%
OS Disk IOPS Consumed PercentageOS Disk IOPS Consumed PercentageIOPS used as a percentage of the OS disk’s provisioned IOPS limit (premium storage only)Alert above 90%
Data Disk LatencyData Disk LatencyAverage IO completion time per data disk, in millisecondsAlert above 20ms for latency-sensitive workloads
OS Disk LatencyOS Disk LatencyAverage IO completion time for the OS disk, in millisecondsAlert above 20ms
Data Disk Queue DepthData Disk Queue DepthNumber of outstanding IO requests queued on the data diskAlert above 4 sustained: indicates disk saturation

The Data Disk IOPS Consumed Percentage and OS Disk IOPS Consumed Percentage metrics are only available on VM series that support premium storage (Standard_DS, Standard_ES, Standard_GS, and similar). They are the most actionable disk metrics for production workloads because they show how close you are to the disk’s provisioned limit, not just the absolute IO rate.

Network Metrics

Metric nameWhat it measures
Network In TotalBytes received on all network interfaces
Network Out TotalBytes sent on all network interfaces
Inbound FlowsNumber of active inbound network flows (connections)

Network In and Network Out (without “Total”) are deprecated. Use Network In Total and Network Out Total.

Step 1: Enable VM Insights

VM Insights is the recommended starting point for comprehensive VM performance monitoring. It installs the Azure Monitor Agent automatically, creates a Data Collection Rule, and provides pre-built performance views without requiring you to write queries or configure charts manually.

Enable it from the portal: navigate to your VM, then Monitoring > Insights > Enable. Or enable multiple VMs at scale via Azure Policy.

What VM insights provides after enabling:

  • Performance tab: pre-built charts for CPU utilization, available memory, logical disk IOPS, logical disk I/O, and network send/receive across the top N VMs in a workspace
  • Map tab: dependency map showing connections between processes, VMs, and external endpoints, useful for understanding application dependencies
  • Guest OS performance counters are collected automatically for Windows and Linux without manual DCR authoring

The agent and DCR that VM Insights creates can be reused or extended for additional data collection.

Step 2: Install Azure Monitor Agent and Configure a Data Collection Rule

If you need custom performance counters beyond what VM Insights collects, or want to configure data collection without enabling the full VM Insights feature, install AMA and create a DCR manually.

Install AMA via the Azure portal

Navigate to your VM, then Settings > Extensions + applications > Add, and select Azure Monitor Agent. Or deploy at scale using the built-in Azure Policy definitions Deploy Azure Monitor Agent for Windows VMs and Deploy Azure Monitor Agent for Linux VMs.

Create a Data Collection Rule for performance counters

In the Azure portal, navigate to Monitor > Data Collection Rules > Create. Configure the rule to collect the performance counters you need.

For Windows VMs, recommended counters:

\Processor(_Total)\% Processor Time

\Memory\Available MBytes

\Memory\% Committed Bytes In Use

\LogicalDisk(_Total)\% Disk Time

\LogicalDisk(_Total)\Disk Read Bytes/sec

\LogicalDisk(_Total)\Disk Write Bytes/sec

\LogicalDisk(_Total)\Avg. Disk Queue Length

\Network Interface(*)\Bytes Total/sec

For Linux VMs, recommended counters:

Processor(*)\\% Processor Time

Memory(*)\\% Used Memory

Memory(*)\\% Available Memory

LogicalDisk(*)\\% Used Space

LogicalDisk(*)\\Disk Read Bytes/sec

LogicalDisk(*)\\Disk Write Bytes/sec

LogicalDisk(*)\\Disk Transfers/sec

LogicalDisk(*)\\% Disk Read Time

Performance counter data collected by AMA flows to the Perf table in your Log Analytics workspace and can be queried with KQL.

Step 3: Query VM Performance Data Using KQL

Once AMA is collecting data into Log Analytics, use KQL to query and visualize performance trends.

Average CPU utilization by VM over the last 24 hours

Perf

| where TimeGenerated > ago(24h)

| where ObjectName == "Processor" and CounterName == "% Processor Time"

| where InstanceName == "_Total"

| summarize avg_cpu = avg(CounterValue) by bin(TimeGenerated, 5m), Computer

| render timechart

VMs with available memory below 1GB in the last hour

Perf

| where TimeGenerated > ago(1h)

| where ObjectName == "Memory"

| where CounterName == "Available MBytes"

| summarize available_mb = avg(CounterValue) by Computer, bin(TimeGenerated, 5m)

| where available_mb < 1024

| order by available_mb asc

Top 10 VMs by average disk queue length (last hour)

Perf

| where TimeGenerated > ago(1h)

| where ObjectName == "LogicalDisk"

| where CounterName == "Avg. Disk Queue Length"

| where InstanceName == "_Total"

| summarize avg_queue = avg(CounterValue) by Computer

| top 10 by avg_queue desc

CPU utilization using host platform metrics via AzureMetrics

AzureMetrics

| where ResourceProvider == "MICROSOFT.COMPUTE"

| where MetricName == "Percentage CPU"

| where TimeGenerated > ago(24h)

| summarize avg_cpu = avg(Average) by bin(TimeGenerated, 5m), Resource

| render timechart

Step 4: Configure Metric Alerts

Create Azure Monitor metric alerts on the most critical platform metrics. These alerts fire within minutes of a threshold being crossed and do not require Log Analytics query latency.

# Alert when CPU exceeds 85% for 5 minutes

az monitor metrics alert create \

  --name "AzureVM-HighCPU" \

  --resource-group myResourceGroup \

  --scopes "/subscriptions/{sub-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" \

  --condition "avg Percentage CPU > 85" \

  --window-size 5m \

  --evaluation-frequency 1m \

  --severity 2 \

  --action "/subscriptions/{sub-id}/resourceGroups/myResourceGroup/providers/microsoft.insights/actionGroups/myActionGroup"
# Alert when available memory drops below 500MB

az monitor metrics alert create \

  --name "AzureVM-LowMemory" \

  --resource-group myResourceGroup \

  --scopes "/subscriptions/{sub-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" \

  --condition "avg Available Memory Bytes < 524288000" \

  --window-size 5m \

  --evaluation-frequency 1m \

  --severity 2
# Alert when OS disk IOPS consumed percentage exceeds 90%

az monitor metrics alert create \

  --name "AzureVM-DiskIOPS" \

  --resource-group myResourceGroup \

  --scopes "/subscriptions/{sub-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" \

  --condition "avg OS Disk IOPS Consumed Percentage > 90" \

  --window-size 5m \

  --evaluation-frequency 1m \

  --severity 2

Step 5: Monitor at Scale with Azure Monitor Workbooks

For environments with many VMs, the VM insights Workbook provides a multi-VM view. Navigate to Monitor > Virtual Machines > Performance in the Azure portal to see top-N charts for CPU, memory, disk, and network across all monitored VMs in a subscription or resource group.

For custom multi-VM dashboards, use Log Analytics KQL queries pinned to Azure Dashboards or Azure Monitor Workbooks.

Common Setup Problems

ProblemLikely causeFix
Memory usage metrics not appearingAMA not installed or DCR not collecting Memory countersInstall AMA via Extensions, create a DCR with Memory performance counters, and assign it to the VM
Still using Log Analytics agent (MMA)MMA was not migrated before the August 2024 retirementMigrate to AMA immediately. Data upload from MMA can stop without notice after March 2, 2026
Still using Azure Diagnostics extension (WAD/LAD)WAD/LAD were not migrated before the March 31, 2026 retirementWAD/LAD are retired and no longer supported. Migrate to AMA with a DCR to continue collecting guest OS performance counters
Percentage CPU alert firing but VM feels responsiveB-series burstable VM exhausting CPU credits rather than experiencing sustained loadCheck CPU Credits Remaining. If near zero, the VM is being throttled. Consider resizing to a non-burstable series
Disk IOPS percentage metrics not showingVM is not on a premium storage seriesData Disk IOPS Consumed Percentage and OS Disk IOPS Consumed Percentage only appear on premium storage VM series. Use absolute Disk Read/Write Operations/Sec on standard storage
Available Memory Bytes shows healthy but application crashes with OOMPlatform metric shows OS-level free memory, not application heapInstall AMA and collect Memory\% Committed Bytes In Use for the fuller picture. Application heap exhaustion is separate from OS memory pressure
Guest OS performance counters not in Perf tableDCR not assigned to the VM or wrong performance counter path syntaxConfirm the DCR is associated with the VM’s resource scope. Check counter path syntax (Windows uses backslash, Linux uses forward slash)

Seeing the VM and the Application Together

Azure Monitor gives you CPU, memory, and disk metrics for a VM. What it does not show on its own is the connection between a VM-level spike and the specific application request responsible for it. A CPU spike at 14:47 is visible in the metrics chart. Whether that spike came from a specific API endpoint handling a surge, a background job that ran over time, or a memory leak causing excessive garbage collection is not visible from infrastructure metrics alone.

CubeAPM ingests infrastructure metrics alongside application traces and logs using the shared OpenTelemetry context. When a CPU or disk alert fires, you can move from the VM metric to the application trace from that time window and see which request, query, or background process drove the resource spike. It runs self-hosted inside your own infrastructure at $0.15/GB ingestion with no per-user fees, so your telemetry data never leaves your environment.

Summary

Monitoring Azure VM performance for CPU, memory, and disk requires two layers. Host platform metrics cover CPU, disk throughput, IOPS, network, and available memory without any agent and are available immediately. Guest OS metrics for in-depth memory breakdown, per-process CPU, and logical disk counters require the Azure Monitor Agent with a Data Collection Rule. The Log Analytics agent (MMA/OMS) was retired August 31, 2024 and data upload can stop after March 2, 2026. The Azure Diagnostics extensions (WAD/LAD) were retired March 31, 2026 and are no longer supported. Use VM insights for the fastest path to comprehensive VM monitoring. For custom counters and at-scale analysis, use KQL against the Perf table in Log Analytics.

SignalCollection methodKey metrics
CPU (host)Platform metric, no agent neededPercentage CPU, CPU Credits Remaining (B-series)
Memory (basic)Platform metric, no agent neededAvailable Memory Bytes, Available Memory Percentage
Memory (detailed)AMA and DCRAvailable MBytes, % Committed Bytes In Use, Page Faults/sec
Disk throughputPlatform metric, no agent neededDisk Read/Write Bytes, Disk Read/Write Operations/Sec
Disk IOPS consumedPlatform metric, premium storage onlyData Disk IOPS Consumed Percentage, OS Disk IOPS Consumed Percentage
Disk latencyPlatform metricData Disk Latency, OS Disk Latency (milliseconds)
Disk queue depthPlatform metricData Disk Queue Depth
NetworkPlatform metric, no agent neededNetwork In Total, Network Out Total
Per-process countersAMA and DCRProcessor/% Processor Time per instance, Memory/Working Set
Multi-VM overviewVM insights (installs AMA)Pre-built top-N performance charts, dependency map

Disclaimer: Host metric names and availability, guest OS metric collection requirements, AMA as the required agent, Log Analytics agent (MMA) retirement on August 31, 2024 with data upload stopping after March 2, 2026, Azure Diagnostics extensions (WAD/LAD) retirement on March 31, 2026, and VM insights capabilities are verified against Microsoft Learn official documentation including learn.microsoft.com/en-us/azure/virtual-machines/monitor-vm-reference, learn.microsoft.com/en-us/azure/azure-monitor/agents/azure-monitor-agent-migration, and learn.microsoft.com/en-us/azure/azure-monitor/agents/diagnostics-extension-overview as of May 2026.

Also read:

How to Monitor Azure SQL Database Performance and Deadlocks 

How to Monitor Cron Jobs for Silent Failures 

How to Monitor Google Cloud SQL for Performance and Replication

×
×