Skip to contentSkip to conversation

question on XML-RPC interface to xend

DISCUSSION Jayesh Salvi 2 participants 3 messages May 28, 2006

lore
Share & tools
lore
#0 lore raw

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=<remote server name> xm <operation>

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?

Please let me know.
Thanks,

Signature · 3 lines
Jayesh
------------------------------------------------------------------------
Everything you can imagine is real

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 13 lines · Jayesh Salvi

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=<remote server name> xm <operation>

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.

Quoted 7 lines

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.

tools/python/xen/xend/XendClient.py +1 -1
diff -r 187180382772 tools/python/xen/xend/XendClient.py
@@ -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://<your server name here>:8005/RPC2')
tools/python/xen/xend/server/XMLRPCServer.py +1 -1
diff -r 187180382772 tools/python/xen/xend/server/XMLRPCServer.py
@@ -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)
 
tools/examples/xend-config.sxp +1 -1
diff -r 187180382772 tools/examples/xend-config.sxp
@@ -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)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 29 lines · Ewan Mellor
Quoted 9 lines · Jayesh Salvi

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=<remote server name> xm <operation>

Quoted 7 lines

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

Quoted 3 lines

can direct xm operations to the remote physical servers now.

Is remote access using xm discontinued because of this change? Or is

there

Quoted 1 line

some method?

It's certainly the intention that xm can work remotely, though it does seem to be broken at the moment.

Quoted 7 lines

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.

Thanks Ewan for the patch. I will try it. Or if it's matter of weeks I will stick to 3.0.1 using my old method.

Cheers,

Quoted 5 lines

Ewan.

Signature · 3 lines
Jayesh
------------------------------------------------------------------------
Everything you can imagine is real

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel