WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Thorolf Godawa <nospam@xxxxxxxxx>
Subject: Re: [Xen-devel] Error getting VM-informations with Python on Xen 3.0.2
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Thu, 6 Apr 2006 01:27:23 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 05 Apr 2006 17:27:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4434197A.8000308@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4434197A.8000308@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
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