[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Error getting VM-informations with Python on Xen 3.0.2



On Wed, Apr 05, 2006 at 09:24:42PM +0200, Thorolf Godawa wrote:

> Hi all,
> 
> I wrote a small python-script to monitor the status of the started VMs
> based on the xenmon.py and the following code I got from Anthony Liguori:
>
> [Snip]
>
> It breaks at line "doms = server.xend_list_domains()" with the following
> error:
> 
> ----------------------------------------
> Traceback (most recent call last):
>   File "xentest1.py", line 22, in ?
>     doms = server.xend_list_domains()
>   File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
>     return self.__send(self.__name, args)
>   File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
>     verbose=self.__verbose
>   File "/usr/lib/python2.4/site-packages/xen/util/xmlrpclib2.py", line
> 46, in request
>     return Transport.request(self, host, '/RPC2', request_body, verbose)
>   File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
>     return self._parse_response(h.getfile(), sock)
>   File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in _parse_response
>     return u.close()
>   File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
>     raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault 1: 'Traceback (most recent call last):\n  File
> "/usr/lib/python2.4/site-packages/xen/util/xmlrpclib2.py", line 74, in
> _marshaled_dispatch\n    response = self._dispatch(method, params)\n
> File "/usr/lib/python2.4/SimpleXMLRPCServer.py", line 408, in
> _dispatch\n    raise Exception(\'method "%s" is not supported\' %
> method)\nException: method "xend_list_domains" is not supported\n'>
> ----------------------------------------
> 
> If I see right it now uses "/usr/lib/python2.4/SimpleXMLRPCServer.py"
> (what does not exist in Xen 3.0_8659-2) and breaks because the method
> "xend_list_domains" is not supported anymore I use to get the
> domain-informations with the script.
> 
> Is there a better way to get the VM-status like name, memory, state,
> CPU-usage etc. via Python than using the mechanism from xenmon.py and
> the above one?

Try server.xend.domains(True).  This changed with the new XML-RPC interface,
courtesy of the aforementioned hacker.

Ewan.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.