How I do 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        

    Requires Free Membership to View

 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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.