How to monitor CPU usage and performance on a Hyper-V server with several VM's

I have a server that is running Windows 2008 64 bit Hyper-V, with 8 gigs of RAM and Intel Xeon X3440 @ 2.53 Ghz, which gives me 8 logical cores in the performance monitor on the host system.

I have set up three Virtual Machines, all running Windows 2008 32 bit.

  1. Build server, running Team City
  2. Staging server
  3. SQL Server, running SQL Server 2005

I have some troubles with the setup in that the host monitor remains responsive at all times, even though the VM's are seemingly working at 100% cpu and are very sluggish and unresponsive. (I have asked a separate question about that.)

So the question here is: What is the best way to monitor how the physical CPU's are actually utilized? The reason I am asking is that I am being told that i cannot reliably use the task manager to monitor CPU usage in a VM.


Solution 1:

First, you have to remember that in Hyper-V that the "host" is called a parent partition and it really just like a virtualized guest with special permissions and roles. Just like any other child/guest, when you open up Task Manager, you can not see the CPU usage of the other children on the server.

Ben Armstrong has a good explanation of this here: http://blogs.msdn.com/virtual_pc_guy/archive/2008/02/28/hyper-v-virtual-machine-cpu-usage-and-task-manager.aspx

To summarize his post, you need to check three things to get an accurate picture of CPU utilization:

  1. View the CPU usage on each guest - this is available through Hyper-V Manager or Performance Monitor.

  2. CPU usage due to context switching - this is the perfmon counter called % Hypervisor Run Time under Hyper-V Hypervisor Virtual Processor

  3. Child partition worker process - vmwp.exe running on the parent partition (1 per child). This handles Hyper-V operations like saving state.