[libvirt] getFreeMemory reporting incorrectly?
Hany Fahim
hany.fahim at gmail.com
Wed Jun 10 23:28:51 UTC 2009
Hey Daniel,
Here is the output of 'xm list' from both machines:
Xen 3.0.3 - This machine has 2GB total memory and should report 256MB free:
[root at node2 ~]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 997 1 r----- 31431.7
test1 74 255 1 -b---- 2412.4
test2 73 511 1 -b---- 2434.3
Xen 3.3 - This machine has 3GB total memory and should report 0MB free:
[root at node1 ~]# xm list
Name ID Mem VCPUs State
Time(s)
Domain-0 0 2901 2 r-----
588.5
Both machines are i386 architecture.
Here's the output of the getCellsFreeMemory call:
Xen 3.0.3:
[root at node2 ~]# python
Python 2.4.3 (#1, Jan 21 2009, 01:10:13)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open('xen:///')
>>> print(conn.getCellsFreeMemory(0,10))
[268972032L]
Xen 3.3:
[root at node1 ~]# python
Python 2.4.3 (#1, Jan 21 2009, 01:10:13)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open('xen:///')
>>> print(conn.getCellsFreeMemory(0,10))
[576460752303423488L]
I appreciate the help.
Hany
On Wed, Jun 10, 2009 at 6:24 AM, Daniel P. Berrange <berrange at redhat.com>wrote:
> On Tue, Jun 09, 2009 at 06:00:29PM -0400, Hany Fahim wrote:
> > Hi,
> > I'm currently running 2 CentOS 5.3 systems, one running Xen 3.3 and
> libvirt
> > 0.6.4 (called node1) and the other running Xen 3.0.3 (stock CentOS) and
> > libvirt 0.6.4 (called node2). The machines are practically identical
> except
> > for the upgraded Xen installation. When using the libvirt-python module,
> I'm
> > getting strange values from getFreeMemory() on the Xen 3.3 machine. See
> > below:
> >
> > Xen 3.0.3:
> >
> > [root at node2 ~]# python
> > Python 2.4.3 (#1, Jan 21 2009, 01:10:13)
> > [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import libvirt
> > >>> conn = libvirt.open('xen:///')
> > >>> print(conn.getFreeMemory())
> > 268959744
> > >>>
> >
> > Which is correct since there's approximately 256MB free. Now in the Xen
> 3.3
> > box:
> >
> > Xen 3.3:
> >
> > [root at node1 ~]# python
> > Python 2.4.3 (#1, Jan 21 2009, 01:10:13)
> > [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import libvirt
> > >>> conn = libvirt.open('xen:///')
> > >>> print(conn.getFreeMemory())
> > 576460752303423488
> > >>>
> >
> > node1 should actually be reporting 0MB free, but instead I'm getting this
> > huge number. It would be nice if I had this much memory though... Anybody
> > else run into this?
>
> For Xen we get the free memory information from a hypercall. I suspect
> that Xen 3.3 has changed the hypercall ABI in some way that is tripping
> up libvirt. Can you provide the output of 'xm info' for the 2 machines
> you have. Also what architecture are they ?
>
> Also can you check the per-node info with
> print(conn.getCellsFreeMemory(0,10))
>
>
> Daniel
> --
> |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/:|
> |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org:|
> |: http://autobuild.org -o- http://search.cpan.org/~danberr/:|
> |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505
> :|
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20090610/a560569d/attachment-0001.htm>
More information about the libvir-list
mailing list