A: Windows Server 2012 introduces the ability to track certain metrics for virtual machines (VMs):

  • Average CPU usage, measured in megahertz over a period of time
  • Average physical memory usage, measured in megabytes
  • Minimum memory usage (lowest amount of physical memory)
  • Maximum memory usage (highest amount of physical memory)
  • Maximum amount of disk space allocated to a virtual machine
  • Total incoming network traffic, measured in megabytes, for a virtual network adapter
  • Total outgoing network traffic, measured in megabytes, for a virtual network adapter

To start the gathering of metric data for a VM, you use the Enable-VMResourceMetering Windows PowerShell cmdlet:

Enable-VMResourceMetering -VMName <virtual machine name>

To reset the counters, use this command:

Reset-VMResourceMetering

and to disable them, use

Disable-VMResourceMetering

To view the collected metrics, use this command:

Measure-VM cmdlet

Notice that in my example below, I pass the output object to the formal list (fl) alias to get full information you see below that (by default a table view is used which does not show all data). There is also a Measure-VMResourcePool cmdlet if resource pools are used.

<br>
PS C:\> <strong>measure-vm -Name savdaldc10 | fl<br></strong><br>
ComputerName                   : SAVDALHV01<br>
VMId                           : 89173c3f-6d85-434e-80a0-9dd631a21d0e<br>
VMName                         : savdaldc10<br>
MeteringDuration               : 00:01:33.9600000<br>
AverageProcessorUsage          : 171<br>
AverageMemoryUsage             : 2244<br>
MaximumMemoryUsage             : 2244<br>
MinimumMemoryUsage             : 2244<br>
TotalDiskAllocation            : 40960<br>
NetworkMeteredTrafficReport    : {Microsoft.HyperV.PowerShell.VMNetworkAdapterPortAclMeteringReport, <br>
                                Microsoft.HyperV.PowerShell.VMNetworkAdapterPortAclMeteringReport, <br>
                                Microsoft.HyperV.PowerShell.VMNetworkAdapterPortAclMeteringReport, <br>
                                Microsoft.HyperV.PowerShell.VMNetworkAdapterPortAclMeteringReport}<br>
AvgCPU                         : 171<br>
AvgRAM                         : 2244<br>
MinRAM                         : 2244<br>
MaxRAM                         : 2244<br>
TotalDisk                      : 40960