[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-API] Is the host a Xen Master ??
Just my two cents but to determinate if a host is the pool master, i just look for the word "master" in /etc/xensource/pool.conf like : # Check if we're running on the pool master if [ `cat /etc/xensource/pool.conf` != "master" ]; then exit 0 fi SÃbastien ------ Original Message ------ From: "Denis Cardon" <denis.cardon@xxxxxxxxxxxxxxxxxxxxxx> To: "Shafi Mohammed S" <shafi@xxxxxxxxx> Cc: "Thileepan S" <thileepan@xxxxxxxxx>; xen-api@xxxxxxxxxxxxx Sent: 20.01.2014 10:35:27 Subject: 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-77048d9c1e02It shouldn't be too hard to translate this in api calls. And like David told earlier, xapi API doc is your best friend.Cheers, DenisThanks . 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 _______________________________________________ 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 |