First, you need to see if VM resource metering is enabled

run PowerShell as admin on a hyper v host (or using remote powershell)

Get-VM | Format-List Name,ResourceMeteringEnabled


To Enable Metering

Enable-VMResourceMetering -VMName NameOfVM

To Disable Metering

Disable-VMResourceMetering -VMName NameOfVM

If you want to enable this for all vm’s on a host replace NameOfVM with *


Basic overview

Use the below command (values only 0 if VM is off)

Get-VM | Measure-VM

This shows the columns: VMName, Avg CPU, Avg Ram, Max Ram, Min Ram, Total Disk, Network Inbound, Net Outbound

Focus on IOPS

Measure-VM -VMName NameOfVM | select VMName,
@{Label=’TotalIO’;Expression = {$_.AggregatedDiskDataRead + $_.AggregatedDiskDataWritten}},
@{Label=’%Read’;Expression={“{0:P2}” -f ($_.AggregatedDiskDataRead/($_.AggregatedDiskDataRead + $_.AggregatedDiskDataWritten))}},
@{Label=’%Write’;Expression={“{0:P2}” -f ($_.AggregatedDiskDataWritten/($_.AggregatedDiskDataRead + $_.AggregatedDiskDataWritten))}},
@{Label=’TotalIOPS’;Expression = {“{0:N2}” -f (($_.AggregatedDiskDataRead + $_.AggregatedDiskDataWritten)/$_.MeteringDuration.Seconds)}} | ft