[afnog] Xen can only see 2.9G of 8G RAM on Dell R200 with CentOS 5.5
Shepherd Magumo
shepherd at snowball.co.za
Fri Apr 29 13:12:24 UTC 2011
Thanks a lot Hugo, I will test it and advise.
On 29 April 2011 14:35, Hugo Lombard <hal at elizium.za.net> wrote:
> On Fri, Apr 29, 2011 at 02:09:43PM +0200, Hugo Lombard wrote:
> >
> > libvirt can expose that (and more)
> >
>
> Quick example (requires libvirt-python):
>
> #!/usr/bin/python -u
> import libvirt
> import sys
> import os
>
> if not os.access("/proc/xen", os.R_OK):
> print 'System is not running a Xen kernel'
> sys.exit(1)
>
> conn = libvirt.openReadOnly(None)
> if conn == None:
> print 'Failed to open connection to the hypervisor'
> sys.exit(1)
>
> ids = conn.listDomainsID()
> if ids == None or len(ids) == 0:
> print 'Failed to list running domains'
> sys.exit(1)
>
> for id in ids:
> try:
> dom = conn.lookupByID(id)
> (state, maxmem, mem, nvcpu, cputime) = dom.info()
> print '%d %s %d %d' % (dom.ID(), dom.name(), mem, maxmem)
> except:
> print 'Failed to find the domain with ID %d' % id
> sys.exit(1)
>
>
> --
> Hugo Lombard
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://afnog.org/pipermail/afnog/attachments/20110429/b4ce50ff/attachment.html>
More information about the afnog
mailing list