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

Re: [Xen-devel] Accessing Xen on remote machine

  • To: jd sw <jdsw2002@xxxxxxxxx>, Ewan Mellor <ewan@xxxxxxxxxxxxx>
  • From: jd sw <jdsw2002@xxxxxxxxx>
  • Date: Fri, 30 Jun 2006 16:36:13 -0700 (PDT)
  • Cc: xendevel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 30 Jun 2006 16:36:44 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=BELnq0duO+c4zrdqHSsMIkDDEvU+rpL8YLhKnwsu7Q+amNJOJsO/lF0In7oxH88iRf7djM+ot1ZcuVhJ3YsWzgDpSWLTd8CgUcGCO8y4OlypaPYscadnQDL58e35zj5IfCfgaESKHknbtMM/BFiqeb9FMzGWfTN/QHlgC8+K2ss= ;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

  I tried the SSH patch from Anthony.. using the following test code. It seems that it works only once... I mean for executing only one command over the established channel/connection.

Any thoughts?


from xmlrpclib import Transport
from xen.util.xmlrpclib2 import ServerProxy

server = ServerProxy("ssh://root@xxxxxxxxxxxxx/RPC2", None, None, 1, 1)
l = server.xend.domains(1)
print l
# try again
l = server.xend.domains(1)
print l

Output :
['Domain-0', 'U1']
Traceback (most recent call last):
  File "/home/jd/test/t.py", line 15, in ?
    l = server.xend.domains(0)
  File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.4/site-packages/xen/util/xmlrpclib2.py", line 155, in __request
    response = xmlrpclib.ServerProxy.__request(self, methodname, params)
  File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
  File "/usr/lib/python2.4/site-packages/xen/util/xmlrpclib2.py", line 68, in request
    ssh.stdin.write("""POST /%s HTTP/1.1
IOError: [Errno 32] Broken pipe


jd sw <jdsw2002@xxxxxxxxx> wrote:
Thanks much. I really appreciate the prompt reply. I tried the tcp-xml rpc and it worked. (I will look in to Unix based scheme next)

Now, with the modification I can get stats, stop, kill remote vm.  I have couple of related questions..

a. How do I start a VM on a remote machine, given a (remote or local) conf file . (currently for local machine I use xen.xm.create.main(filename) )

b. Is it possible to get console of a remote domu ? currently I am  spawning, xm console with domid which works locally but not for remote doms.

c. Is it possible to save snapshot of a remote dom on a local machine directly? (This is similar to migrating to local machine and saving snapshot.)

Thanks in advance.

Ewan Mellor <ewan@xxxxxxxxxxxxx> wrote:
On Sun, Jun 25, 2006 at 11:39:35PM -0700, jd sw wrote:

> Hi
> What do I need to do to access Xen on a remote machine ? Currently my
> program is using the 'server' object from the XendClient.py.
> There seems to be http, unix, tcp-xmlrpc, unix-xmlrpc servers. When
> should each one of them be enabled/used. What port do they listen to ?

http and unix are s-expressions or HTML pages over HTTP/TCP or HTTP over Unix
domain sockets respectively. These are deprecated.

tcp-xmlrpc and unix-xmlrpc is XML-RPC over HTTP/TCP or HTTP/Unix
respectively. These are what you want to use. You can:

a) use unix-xmlrpc, with Anthony Liguori's recent patch to transparently SSH
into your local machine and issue commands to the Unix socket. This uses
your SSH authentication scheme. See xm serve for details.

b) enable and use tcp-xmlrpc, using the attached patch. This will listen on
port 8005, and will use no authentication / encryption at all (SSL support
is planned). Only use this on a secure network, obviously.

> Also, relocation server uses which protocol. I would really appreciate if
> someone can point me to some document/details.

It's a proprietary protocol -- a small handshake and exchange of VM config,
and then a dump of all the pages in memory. You'll have to dig into the code
for details -- tools/python/xen/xend/{XendCheckpoint,XendDomainInfo}.py and
tools/libxc/xc_linux_save.c should start you off.

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

-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)
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)

How low will we go? Check out Yahoo! Messenger�s low PC-to-Phone call rates._______________________________________________
Xen-devel mailing list

Want to be your own boss? Learn how on Yahoo! Small Business.
Xen-devel mailing list



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