Red Hat Bugzilla – Bug 800366
libvirt does not report the system and user cpu usage separately for vms.
Last modified: 2012-06-20 02:49:42 EDT
Description of problem: In RHEVM 3.0 the history database vm system cpu usage is always 0. This is because libvirt do not report the system and user cpu usage separately and vdsm send all the vm cpu usage as user cpu only. Need to add this separation.
System usage is an important statistic to troubleshoot various performance related problems. So i think it's very important to have this.
Upstream patch proposed: https://www.redhat.com/archives/libvir-list/2012-March/msg00404.html
In POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-March/msg01167.html
Note that the C API part is now included in libvirt-0.9.10-5.el6 but the bug is not finished as the python bindings are still missing Daniel
Upstream patch sent: https://www.redhat.com/archives/libvir-list/2012-March/msg00583.html
In POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-March/msg02065.html
packages: libvirt-0.9.10-8.el6.x86_64 qemu-kvm-0.12.1.2-2.265.el6rhev.x86_64 kernel-2.6.32-251.el6.x86_64 libvirt-python-0.9.10-8.el6.x86_64 steps: 1. prepare a running domain 2. check with python # python Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) [GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn = libvirt.open(None) >>> dom = conn.lookupByName("rhel6u2") >>> dom.getCPUStats(True, 0) [{'cpu_time': 31014583290L, 'system_time': 11450000000L, 'user_time': 1210000000L}] >>> dom.getCPUStats(False, 0) [{'cpu_time': 15015195428L}, {'cpu_time': 11334981960L}, {'cpu_time': 2948233412L}, {'cpu_time': 1722428230L}] 3. check with virsh # virsh cpu-stats rhel6u2 --total --start 0 --count 4 CPU0: cpu_time 15.321903938 seconds CPU1: cpu_time 11.410812819 seconds CPU2: cpu_time 2.948269295 seconds CPU3: cpu_time 1.724287630 seconds Total: cpu_time 31.405273682 seconds user_time 1.310000000 seconds system_time 12.860000000 seconds
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0748.html