[libvirt] Re: [Libvir] How to get the memory used by a guest domin

Richard W.M. Jones rjones at redhat.com
Mon May 19 11:27:39 UTC 2008


On Wed, Apr 30, 2008 at 01:57:21PM +0100, Daniel P. Berrange wrote:
> You'll want to have some monitoring agent inside your guest OS. One example
> lightweight agent is 'collected'. It'll transmit utilization data to any

Dan means collectd, from http://collectd.org/

I'll emphasize what Dan said: The only way to reliably get things like
real memory usage, process lists and so on from the guest is to run
some agent/program inside the guest.  This is how VMWare does it.

I've been chipping away at these restrictions, because I think it'd be
useful for sysadmins to be able to see guest status from the dom0
without needing to install software in the guests.  For disk usage, we
now have virt-df (http://et.redhat.com/~rjones/virt-df/) which runs
entirely in the dom0.  Virt-df works by parsing the guest's disk image
-- a hard but tractable problem that turns out to give pretty reliable
results in most scenarios.

However for getting guest memory / process lists the situation is much
more complicated.  You'd need to peek into the guest's memory and read
kernel structures, a very complex problem indeed (and not even
tractable on a certain popular closed-source operating system).

A more tractable alternative is to run an agent in the guest which is
common and widely available, such as a simple kernel module that
shares data over a common host <-> guest bus.  It would be kind of
like virtio [http://lwn.net/Articles/239238/] for monitoring.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v




More information about the libvir-list mailing list