From: Ewan Mellor Subject: Re: Error getting VM-informations with Python on Xen 3.0.2 Date: Thu, 6 Apr 2006 01:27:23 +0100 Message-ID: <20060406002723.GB30672@leeni.uk.xensource.com> References: <4434197A.8000308@godawa.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <4434197A.8000308@godawa.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Thorolf Godawa Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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: "/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.