How I do see the amount of time a VM has run on a CPU?

How to see the amount of time a VM has run on a CPU

You can see the amount of time a virtual machine has run on a CPU by using the /proc file system. VMware ESX has

a built-in “scheduler” which checks the status of Virtual Machine and schedules its threads to be processed on the least busy processor. Using /proc we can see on which processor the virtual machine has been used most frequently.

Open a session to the Service Console and type:

cat /proc/vmware/sched/cpu-run-times

This will give you an output like so:

vcpu   vm name                 cpu00         cpu01
 127  127 console            192.331         0.000
 128  128 idle1                0.000      2142.883
 129  129 idle0                3.545         0.000
 130  130 helper0-0           60.442         0.009
 131  131 helper0-1            0.009         0.580
 132  132 helper1-0            0.000         0.000
 133  133 helper1-1            0.000         0.000
 134  134 helper2-0            0.000         0.000
 135  135 helper3-0            0.004         0.000
 136  136 reset-handle         0.000         0.000
 137  137 reset-watchd         0.000         0.218
 138  138 driver               0.000         0.000
 139  139 driver               0.000         0.000
 140  140 driver               0.000         0.000
 141  141 vmm0:dc1             4.298       638.617

World ID number 141 is my virtual machine (a Windows 2003 Domain Controller) and as we can see, it has spent more time running on CPU1 than on CPU0

This was first published in February 2006

Dig deeper on VMware ESX and ESXi administrative tips

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchServerVirtualization

SearchVirtualDesktop

SearchDataCenter

SearchCloudComputing

Close