On 07/03/2014 08:29 AM, Gleb Voronich wrote:>> Eric Blake <mailto:eblake@redhat.com> >> > >> > In the case of the memory balloon device, libvirt CAN provide stats from >> > the guest, because of the way the balloon device works. But if you >> > aren't using a balloon, or if the guest is not cooperative, this won't >> > work. Better would be a guest-agent command for getting at this >> > information (but again, you are relying on guest cooperation). In >> > short, libvirt is great at stats from the HOST point of view, but for >> > stats from the GUEST point of view, you are often better off using the >> > same mechanisms that you would for getting stats from a remote bare >> > metal machine, without needing libvirt in the mix. >> >> Thanks Eric. >> >> 1. I use the balloon for all of my guests: >> <memballoon model='virtio'> >> But how can I get stats?virDomainMemoryStats() gets those stats, if qemu is new enough to provide them, and if the guest cooperates to provide them.>> >> 2. I've tried the latest QEMU GA 2.0.0Right now, there are no memory stats available through the guest agent, only through the balloon device. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
> virDomainMemoryStats() gets those stats, if qemu is new enough to > provide them, and if the guest cooperates to provide them.Well I use the latest QEMU 2.0.0 I have the latest CentOS 6.5 installed on the guest and unfortunately I can't get more stats that I have.> Which OS are you using in your guests? > > Of course, you need to have the virtio balloon driver up and runnig in > your guests.CentOS 6.5 x86_64 It has the balloon driver and it is up and running: # modinfo virtio_balloon filename: /lib/modules/2.6.32-431.17.1.el6.x86_64/kernel/drivers/virtio/virtio_balloon.ko license: GPL description: Virtio balloon driver srcversion: BB9F75B2CAF3435CC507998 alias: virtio:d00000005v* depends: virtio,virtio_ring vermagic: 2.6.32-431.17.1.el6.x86_64 SMP mod_unload modversions
On 07/03/2014 08:46 AM, Gleb Voronich wrote:> >> virDomainMemoryStats() gets those stats, if qemu is new enough to >> provide them, and if the guest cooperates to provide them. > Well I use the latest QEMU 2.0.0 > I have the latest CentOS 6.5 installed on the guest and unfortunately I > can't get more stats that I have.Then your problem is your libvirt is too old. It is the combination of qemu new enough to provide stats (qemu 1.4; probably not present in the qemu shipped in CentOS, but present in your self-built 2.0) and libvirt new enough to read stats (v1.1.1 or newer; which is in RHEL 7.0, but not backported to the libvirt 0.10.2 of RHEL 6.5, and therefore not in your CentOS setup). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
At Thu, 03 Jul 2014 17:46:14 +0300, Gleb Voronich wrote:> > > > virDomainMemoryStats() gets those stats, if qemu is new enough to > > provide them, and if the guest cooperates to provide them. > Well I use the latest QEMU 2.0.0 > I have the latest CentOS 6.5 installed on the guest and unfortunately > I can't get more stats that I have. > > > Which OS are you using in your guests? > > > > Of course, you need to have the virtio balloon driver up and runnig in > > your guests. > CentOS 6.5 x86_64 > It has the balloon driver and it is up and running: > > # modinfo virtio_balloon > filename: > /lib/modules/2.6.32-431.17.1.el6.x86_64/kernel/drivers/virtio/virtio_balloon.ko > license: GPL > description: Virtio balloon driver > srcversion: BB9F75B2CAF3435CC507998 > alias: virtio:d00000005v* > depends: virtio,virtio_ring > vermagic: 2.6.32-431.17.1.el6.x86_64 SMP mod_unload modversionsIn this case, it's your guest kernel that's too old to support these stats. Apparently, reporting statistics in the balloon driver was introduced in the kernel on 24th Feb 2010 (commit 9564e138b1f6eb137f7149772438d3f3fb3277dd) which clearly predates version 2.6.32 (2nd December 2009). Claudio