Mastering Windows Server 2016 Hyper-V

(Romina) #1

machine, but it’s still important to ensure that the overall cluster has sufficient
resources and that it has sufficient resources even if a certain number of nodes fail
within the cluster.


Resource Metering


Performance monitoring is useful for troubleshooting performance problems and
even seeing details of virtual machines, but it’s a fairly involved process. You will end
up with a lot of data if you leave performance monitoring running for a long duration,
and it’s server specific, which means that if a virtual machine was moved between
servers using Live Migration or any other migration technology, you would have to
start monitoring the virtual machine on the new server and add all the counters
together across multiple nodes.


Windows Server 2012 introduced a better option if you want to track the resource
utilization of one or more virtual machines, typically for the purpose of billing based
on the resource utilization of the virtual machine. Instead of detailed metrics of the
resource usage every 5 seconds, the resource metering functionality simply tracks the
total and average resource utilizations of a virtual machine, which can then be viewed
at any time. The great thing about the resource metering feature is not just its
simplicity, but that the metering data persists even if the virtual machine is moved
between Hyper-V nodes using any of the migration technologies.


The resource metering metrics that are gathered can be accessed via PowerShell
cmdlets or using WMI.


To enable resource metering for a virtual machine, use this command:


Enable-VMResourceMetering - VMName


To view the current measurements for a virtual machine in a detailed list format, use
the following command:


Measure-VM - VMName | fl


The metrics for a virtual machine never reset unless you either disable metering or
perform a manual reset. Use this command to perform a manual reset:


Reset-VMResourceMetering - VMName


Finally, to disable the metering, use this command:


Disable-VMResourceMetering - VMName


To check which virtual machines have metering enabled, run the following command:


Get-VM | Format-Table Name, ResourceMeteringEnable


Here is an example of the output of metering from a Hyper-V 2016 virtual machine. If
you used metering in Hyper-V 2012 , you will notice new metrics, specifically around

Free download pdf