[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-API] Is the host a Xen Master ??
Hi Shafi, Is there any API call or any other method to detect whether the host in question is a Pool master or a member of a Xen POOL ? This question was covered a few days ago... Using python : 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)(sample code from https://github.com/tranquilit/TISbackup/blob/master/libtisbackup/backup_xva.py) And is there a call to get the host info using the snapshot (UUID) of its VMS ? by host info, do you mean the param-list of the host where the vm is running? You can get the VM uuid from snapshot uuid usingxe vm-list uuid=$(xe snapshot-param-get param-name=snapshot-of uuid=35e68b3d-cadd-afc6-0f57-833be773b9ba ) Then you can query the resident-on value (at least for running vm)xe vm-param-get param-name=resident-on uuid=71e1795e-a1fa-16ea-4f22-77048d9c1e02 It shouldn't be too hard to translate this in api calls. And like David told earlier, xapi API doc is your best friend. Cheers, Denis Thanks . Regards, Shafi, Vembu Technologies. This body part will be downloaded on demand. -- 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |