From: Joanna Rutkowska <joanna@invisiblethingslab.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: XenAPI: vm_metrics sometimes does not return valid data
Date: Thu, 20 May 2010 13:08:06 +0200 [thread overview]
Message-ID: <4BF51816.3080509@invisiblethingslab.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2067 bytes --]
Hello,
In order to get per-VM CPU utilization I use a code similar to this one
[1] (simplified version):
uuids = xend_session.session.xenapi.VM.get_by_name_label (name)
session_uuid = uuids[0]
session_metrics = session.xenapi.VM.get_metrics(session_uuid)
cpus_util = session.xenapi.VM_metrics.get_VCPUs_utilisation
(session_metrics)
Now, this works well, except for when it doesn't... Namely, very rarely,
XenAPI seems to break down and starts to return 0.0s for CPU load for
all the VMs for all the VCPUs.
I have verified that all the other objects are not "None", i.e. that
XenAPI keeps returning valid uuids, and session_metrics objects, but the
cpus_util list is always this:
cpus_util = {'0': 0.0}
(For the case with 1 VCPU assigned to a VM).
I keep getting this for all the VMs in the system, despite the fact that
those VMs actually do some work (e.g. xentop correctly reports some load
on their VCPUs).
The above doesn't apply to Dom0 CPUs utilization, which I obtain using
the following code [2]:
session_hosts = session.xenapi.host.get_all()
session_cpus = session.xenapi.host.get_host_CPUs(session_hosts[0])
for cpu in self.session_cpus:
cpu_total_load += session.xenapi.host_cpu.get_utilisation(cpu)
cpu_total_load /= len(session_cpus)
In that case I always keep getting the following values (Dom0 uses 2 CPUs):
0.361701816398
0.299435554096
Once I reboot the system the problems vanish.
Have no idea how to reproduce it -- occurs very rarely, but still
annoying. Anybody run into a similar problem?
I'm running Xen 3.4.3-rc3, but I don't think saw any commit that would
be dealing with such a problem in the more recent rc's.
joanna.
[1] The actual code is here, in case you're interested:
http://qubes-os.org/gitweb/?p=mainstream/core.git;a=blob;f=dom0/qvm-core/qubes.py;h=6e5a686b4a43b3b1b3c2cfba04b63232a6ef6edf;hb=HEAD#l326
[2]
http://qubes-os.org/gitweb/?p=mainstream/core.git;a=blob;f=dom0/qvm-core/qubes.py;h=6e5a686b4a43b3b1b3c2cfba04b63232a6ef6edf;hb=HEAD#l867
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 226 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2010-05-20 11:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BF51816.3080509@invisiblethingslab.com \
--to=joanna@invisiblethingslab.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.