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

Re: [Xen-API] Xen-Api -Retrieving the Xen master node IP using Xen API



Hi Shafi,

  I am working on a backup application . Our solution works fine for a
single Xen host . But on A Xen Pool Configuration, session() call
works only for the master , Is there any call to retrieve the IP of
the master when we are working with the slave nodes ,so that a
redirection can be made to that obtained master IP when slave node is
enquired for backup .

In python, you can use the following code :

        session = XenAPI.Session('https://'+self.xcphost)
        try:
            session.login_with_password(user_xen,password_xen)
        except XenAPI.Failure, error:
            msg,ip = error.details

            if msg == 'HOST_IS_SLAVE':
                xcphost = ip
                session = XenAPI.Session('https://'+xcphost)
                session.login_with_password(user_xen,password_xen)


(from our inhouse backup application https://github.com/tranquilit/TISbackup/blob/master/libtisbackup/backup_xva.py)

HTH,

Denis





Thank you
Shafi Mohammed

_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api



--
Denis Cardon
Tranquil IT Systems
Les Espaces Jules Verne, bâtiment A
12 avenue Jules Verne
44230 Saint Sébastien sur Loire
tel : +33 (0) 2.40.97.57.55
http://www.tranquil-it-systems.fr


_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


 


Rackspace

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