From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Mey Subject: remote xend - howto connect?? Date: Mon, 6 Feb 2006 15:56:32 +0100 Message-ID: <200602061556.36972.michael.mey@to.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0494967371==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============0494967371== Content-Type: multipart/signed; boundary="nextPart2265118.kDTcepKzfP"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2265118.kDTcepKzfP Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, currently, I am planning to implement a command line based tool to query mo= re=20 than one xends for their running domains at the same time. Unfortunately, I cannot connect to any other xend as the local one. This is= =20 what I was trying to do: =2D------------------------------------------------------------------------= =2D-------------------------- #!/usr/bin/env python # -*- mode: python; -*- import sys import os # add fallback path for non-native python path installs if needed sys.path.append('/usr/lib/python') sys.path.append('/usr/lib64/python') from xen.xend.XendClient import server from xen.xend import sxp def parse_doms_info(info): def get_info(n, t, d): return t(sxp.child_value(info, n, d)) return { 'dom' : get_info('domid', int, -1), 'name' : get_info('name', str, '??'), 'mem' : get_info('memory', int, 0), 'vcpus' : get_info('online_vcpus', int, 0), 'state' : get_info('state', str, '??'), 'cpu_time' : get_info('cpu_time', float, 0), 'ssidref' : get_info('ssidref', int, 0), } def xm_brief_list(doms): print 'Name ID Mem(MiB) VCPUs State Time(s= )' for dom in doms: d =3D parse_doms_info(dom) if (d['ssidref'] !=3D 0): d['ssidstr'] =3D (" s:%04x/p:%04x" % ((d['ssidref'] >> 16) & 0xffff, d['ssidref'] & 0xffff)) else: d['ssidstr'] =3D "" print ("%(name)-32s %(dom)3d %(mem)8d %(vcpus)5d %(state)5s =09 %(cpu_time)7.1f%(ssidstr)s" % d) server.bind('192.168.111.18:8000',) xm_brief_list(server.xend_list_domains()) =2D------------------------------------------------------------------------= =2D-------------------------- I am running this script form my xenhost1 (192.168.111.17) and want to quer= y=20 xenhost2 (192.168.111.18). But I only get the local informations. Even if I manually hack class Xend: """Client interface to Xend. """ """Default location of the xend server.""" SRV_DEFAULT =3D "192.168.111.18:8000" into xen/xend/XendClient.py it's still the same. telnetting to 192.168.111.18 to port 8000 and do a manual GET /xend/domain/?detail=3D1 works nicely. Maybe someone could give me a hint how to query a remote xen host with=20 XendClient.py?=20 Regards, Michael =2D-=20 =2D------------------------------------------------------------------------= =2D-------------- Michael Mey=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0=20 Thinking Objects Software GmbH =A0 |=A0 mailto: michael.mey@to.com=20 Lilienthalstrasse 2/1 =A0 =A0 =A0 =A0 =A0 =A0 | phone: +49 711 88770-147 70825 Stuttgart-Korntal, Germany =A0| =A0fax: +49 711 88770-449 =2D------------------------------------------------------------------------= =2D-------------- --nextPart2265118.kDTcepKzfP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBD52Ok3rj8BeD5OvMRAn8AAKCe+miz5cP5b3veXS78hHoT9doPmACdF2EP YV9MOnRkgGcJbk4sAQZoBG8= =NZC0 -----END PGP SIGNATURE----- --nextPart2265118.kDTcepKzfP-- --===============0494967371== 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 --===============0494967371==--