<div dir="ltr"><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 6, 2017 at 6:48 PM, Juan Hernández <span dir="ltr"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 07/06/2017 02:07 PM, Nicolas Ecarnot wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[For the record]<br>
<br>
Juan,<br>
<br>
Thanks to your hint, I eventually found it more convenient for me to use a SQL query to find out which VM was unsed for months :<br>
<br>
SELECT<br>
vm_static.vm_name,<br>
vm_dynamic.status,<br>
vm_dynamic.vm_ip,<br>
vm_dynamic.vm_host,<br>
vm_dynamic.last_start_time,<br>
vm_dynamic.vm_guid,<br>
vm_dynamic.last_stop_time<br>
FROM<br>
public.vm_dynamic,<br>
public.vm_static<br>
WHERE<br>
vm_dynamic.vm_guid = vm_static.vm_guid AND<br>
vm_dynamic.status = 0<br>
ORDER BY<br>
vm_dynamic.last_stop_time ASC;<br>
<br>
Thank you.<br>
<br>
</blockquote>
<br></span>
That is nice. Just keep in mind that the database schema isn't kept backwards compatible. A minor change in the engine can make your query fail or return incorrect results.</blockquote><div><br><div style="font-size:large;display:inline" class="gmail_default">I tend to agree </div> <div style="font-size:large;display:inline" class="gmail_default">with Juan that if you are doing that periodically then using the Python SDK will insure that your script will survive schema changes </div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/users</a><br>
</div></div></blockquote></div><br></div></div>