Bug 800366 - libvirt does not report the system and user cpu usage separately for vms.
libvirt does not report the system and user cpu usage separately for vms.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.2
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Gunannan Ren
Virtualization Bugs
:
Depends On:
Blocks: 800367 800372
  Show dependency treegraph
 
Reported: 2012-03-06 07:02 EST by Yaniv Lavi
Modified: 2012-06-20 02:49 EDT (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-7.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 800367 (view as bug list)
Environment:
Last Closed: 2012-06-20 02:49:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Yaniv Lavi 2012-03-06 07:02:45 EST
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.
Comment 2 Yaniv Lavi 2012-03-06 07:50:55 EST
System usage is an important statistic to troubleshoot various performance
related problems. So i think it's very important to have this.
Comment 3 Eric Blake 2012-03-09 12:37:46 EST
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2012-March/msg00404.html
Comment 7 Daniel Veillard 2012-03-13 05:04:12 EDT
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
Comment 8 Gunannan Ren 2012-03-14 02:03:27 EDT
Upstream patch sent:
https://www.redhat.com/archives/libvir-list/2012-March/msg00583.html
Comment 12 Wayne Sun 2012-03-28 02:22:24 EDT
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
Comment 14 errata-xmlrpc 2012-06-20 02:49:42 EDT
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

Note You need to log in before you can comment on or make changes to this bug.