To check performance of virtual machine running on Windows Server 2012 Hyper-V hypervisor it is not even necessary to connect to Hyper-V Manager – all commands are passed via (remote) PowerShell. Anyway in the console all we get is the real-time information:
Not very impressing. But the PS way is much better and quicker. To get more in-depth information, first enable performance counters on a VM:
Enable-VMResourceMetering –VMName Name_of_your_VM
Too see the output run:
Measure-VM –VMName Name_of_your_VM
Now it is just a minute to write a script that will get the information every 15s. or 5 min or every hour and put it into csv file. Cool.
What other properties are available:
so we know also how long the counters are running – so the script can stop gathering data after certain period.
It can also disable the counters with a simple cmdlet, yes, you guessed it:
Disable-VMResourceMetering –VMName Name_of_your_VM
There’s also a way to check performance for the whole resource pool. First I create a new recource pool of Ethernet type, I add a new NIC for my VM from this resource pool and finally I enable resource metering on the whole resource pool. Then a cmdlet Measure-VMResourcePool is used to get the data.
When we’re done, we can use Disable-VMResourceMetering cmdlet with -ResourcePoolName and -ResourcePoolType parameters to disable the metering on this resource pool. Finally we can check virtual machines and resource pools to see if there’s any with metering enabled:
That’s it. I guess I am used to awesome performance meters in vCenter and even better stats from esxtop on ESX(i) because I don’t find the performance measuring in Hyper-V very powerful. If you have SCVMM, it’s a different story.