Measuring CPU %steal on VMware and Hyper-V hypervisors

8,598

The only way to get these (and more) performance counters inside a VMware guest, is by using the VMGuestLib SDK as shipped with the vmware-tools.

I wrote a python wrapper for this library, called python-vmguestlib and a tool vmguest-stats to get access to these counters. And there are now three Dstat plugins to correlate these performance counters with other system resources. It is as simple as:

dstat -c –vm-cpu -m –vm-mem –vm-mem-adv

You can find the python wrapper, the vmguest-stats tool and Dstat at:

Feedback and improvements welcomed !

Share:
8,598

Related videos on Youtube

Yolo Perdiem
Author by

Yolo Perdiem

Updated on September 18, 2022

Comments

  • Yolo Perdiem
    Yolo Perdiem over 1 year

    For Xen Linux guests, %steal time is readily available via top and other utilities.

    Is it possible to get this and related metrics from within a Linux guest when running a non-Xen hypervisor such as ESXi or Hyper-V?

    For Windows guests, both VMware and Microsoft provide perfmon counters. Example: vmware perfmon

    But these don't seem to be exposed via vanilla top in Centos 6.4.

    • slm
      slm over 10 years
      See this Q&A from SF: serverfault.com/questions/392216/…. Read Ryan's answer for details on the hypervisors support.
    • Yolo Perdiem
      Yolo Perdiem over 10 years
      It's a great answer and I contributed an update but my question above is intended to be much more narrow: Linux guest, standard tools, two specific hypervisors.
    • slm
      slm over 10 years
      Check the command mpstat -P ALL as well. It too reports %steal.
  • Paul M
    Paul M almost 8 years
    Hmm, sometimes my script prints 140; so I must have misunderstood the units in Dag's program? My VM has four cores, so perhaps the CPU steal could go to 400%, if it's measuring one core at 100%?
  • Andy Smith
    Andy Smith about 7 years
    –vm-cpu no longer appears to be available with this tool
  • Dag Wieers
    Dag Wieers about 7 years
    Andy, did you install the plugins, because the options are tight to the availability of the plugins. github.com/dagwieers/dstat/blob/master/plugins/dstat_vm_cpu.‌​py
  • Andy Smith
    Andy Smith about 7 years
    Aah, I did not, I installed using my OS (CentOS 7) package manager. Thanks
  • tomer.z
    tomer.z about 6 years
    Im trying to use this library from open vm tools in my ubuntu installed on vmware workstation 12 but im getting an error not enabled when calling UpdateInfo, did you encounter this problem?