<html><head></head><body bgcolor="#ffffff" text="#2e3436" link="#2a76c6" vlink="#215d9c"><div>On Wed, 2016-04-13 at 09:19 +0300, Yedidyah Bar David wrote:</div><blockquote type="cite"><pre>On Wed, Apr 13, 2016 at 12:03 AM, Brett I. Holcomb <<a href="mailto:biholcomb@l1049h.com">biholcomb@l1049h.com</a>> wrote:
<blockquote type="cite">
snipped
</blockquote></pre></blockquote><div><br></div><blockquote type="cite"><pre><blockquote type="cite">
One question I have as I read this. In a hosted-engine environment how
do I use the SDK to tell if the Engine VM is running. I could dump a
hosted-engine --vm-status and parse it's output but is there a better
way. Assuming that since the host is running the Engine is does not
always hold true.
</blockquote>
You can simply try to connect to the api. If you succeed, the engine is up.
You can also use this url, which is what hosted-engine
--deploy uses:
<a href="http://">http://</a>{fqdn}/ovirt-engine/services/health
Not sure why we keep using it, as it was considered deprecated at some point,
see this:
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1026723">https://bugzilla.redhat.com/show_bug.cgi?id=1026723</a>
<a href="https://gerrit.ovirt.org/20846">https://gerrit.ovirt.org/20846</a>
If you want more, you can write something and start from the file implementing
--vm-status, ovirt_hosted_engine_setup/vm_status.py . It uses
ovirt_hosted_engine_ha.client to get the data and does rather shallow massaging
around that. Not sure ovirt_hosted_engine_ha.client is an official API, IIRC no
other project uses it, and even if it is, it's still not part of the engine API.
Another option is to add an option to --vm-status to output machine-readable
info. patches are welcome :-)
Best,
</pre></blockquote><div><br></div><div>Thanks. I'll go with the if api connects engine running if not engine down method. I don't want to use a deprecated method and I'll stick with whats part of the API. </div><div><br></div><div><br></div><div><br></div></body></html>