From: Ewan Mellor Subject: Re: question on XML-RPC interface to xend Date: Sun, 28 May 2006 17:56:31 +0100 Message-ID: <20060528165631.GA22622@leeni.uk.xensource.com> References: <871640aa0605280731t6a10c7f8k4f386b3689b62fff@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="BOKacYhQ+x31HxR3" Return-path: Content-Disposition: inline In-Reply-To: <871640aa0605280731t6a10c7f8k4f386b3689b62fff@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jayesh Salvi Cc: xen-devel List-Id: xen-devel@lists.xenproject.org --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, May 28, 2006 at 02:31:29PM +0000, Jayesh Salvi wrote: > Hi, > > I noticed that an XMLRPC interface has been introduced from 3.0.2+. This > is breaking the remote execution of xm commands I used to do. > > This change entirely changed the tools/python/xen/xend/XendClient.py. I > used to remotely control the pool of servers by doing: > XEND= xm > > For this I had to change last line of XendClient.py from getUnixServer() > to getHttpServer() . This tweak changed the way "xm" connects to xend > process - instead of Unix domain sockets it uses Http connections. > > This setup used to work fine. I however do not understand the XML-RPC > behavior from "xm"'s point of view. The XendClient.py now just opens a > ServerProxy for a xmlrpc socket, which take httpu URI. I don't know how I > can direct xm operations to the remote physical servers now. > > Is remote access using xm discontinued because of this change? Or is there > some method? It's certainly the intention that xm can work remotely, though it does seem to be broken at the moment. The attached patch is enough for me to be able to use xm remotely. This might be enough for you for now. Bear in mind that by enabling the TCP server, you are opening a very large security hole -- you should only use this on a secure network. There is work already planned to fix this whole area, so if you can wait a few weeks, all this should be in a good state for you again. Cheers, Ewan. --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="remote-xm.patch" diff -r 187180382772 tools/python/xen/xend/XendClient.py --- a/tools/python/xen/xend/XendClient.py Tue May 23 16:23:10 2006 +0100 +++ b/tools/python/xen/xend/XendClient.py Sun May 28 17:54:47 2006 +0100 @@ -25,4 +25,4 @@ ERROR_GENERIC = 2 ERROR_GENERIC = 2 ERROR_INVALID_DOMAIN = 3 -server = ServerProxy('httpu:///var/run/xend/xmlrpc.sock') +server = ServerProxy('http://:8005/RPC2') diff -r 187180382772 tools/python/xen/xend/server/XMLRPCServer.py --- a/tools/python/xen/xend/server/XMLRPCServer.py Tue May 23 16:23:10 2006 +0100 +++ b/tools/python/xen/xend/server/XMLRPCServer.py Sun May 28 17:54:47 2006 +0100 @@ -89,7 +89,7 @@ class XMLRPCServer: if self.use_tcp: # bind to something fixed for now as we may eliminate # tcp support completely. - self.server = TCPXMLRPCServer(("localhost", 8005), logRequests=False) + self.server = TCPXMLRPCServer(('', 8005), logRequests=False) else: self.server = UnixXMLRPCServer(XML_RPC_SOCKET, False) diff -r 187180382772 tools/examples/xend-config.sxp --- a/tools/examples/xend-config.sxp Tue May 23 16:23:10 2006 +0100 +++ b/tools/examples/xend-config.sxp Sun May 28 17:55:54 2006 +0100 @@ -16,7 +16,7 @@ #(xend-http-server no) #(xend-unix-server no) -#(xend-tcp-xmlrpc-server no) +(xend-tcp-xmlrpc-server yes) #(xend-unix-xmlrpc-server yes) #(xend-relocation-server no) (xend-relocation-server yes) --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --BOKacYhQ+x31HxR3--