<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div apple-content-edited="true"><p>This will probably not work for the vmware driver since it does not return a standard uptime string.  Here's an example of what you would get:</p><div><div>$ nova hypervisor-uptime 1</div><div>+---------------------+--------------------------------------------+</div><div>| Property            | Value                                      |</div><div>+---------------------+--------------------------------------------+</div><div>| hypervisor_hostname | domain-c7(OpenStackCluster)                |</div><div>| id                  | 1                                          |</div><div>| uptime              | Please refer to 10.0.7.1 for the uptime |</div><div>+---------------------+--------------------------------------------+</div></div><br class="Apple-interchange-newline">
</div>
<br><div><div>On Feb 14, 2014, at 10:29 AM, sahid <<a href="mailto:sahid.ferdjaoui@cloudwatt.com">sahid.ferdjaoui@cloudwatt.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Greetings,<br><br>I would like to add a new filter based on the load averages.<br><br>This filter will use the command uptime and will provides an option to choice a<br>period between 1, 5, and 15 minutes and an option to choice the max load<br>average (a float between 0 and 1).<br><br>Why:<br>  During a scheduling it could be useful to exclude a host that have a too<br>heavy load and the command uptime (available in all linux system) <br>can return a load average of the system in different periods.<br><br>About the implementation:<br>  Currently 'all' drivers (libvirt, xenapi, vmware) supports a method<br>get_host_uptime that returns the output of the command 'uptime'. We have to add<br>in compute/stats.py a new method calculate_loadavg() that returns based on the<br>output of driver.get_host_uptime() from compute/ressource_tracker.py a well<br>formatted tuple of load averages for each periods. We also need to update<br>api/openstack/compute/contrib/hypervisors.py to take care of this new<br>field.<br><br>  The implementation will be divided in several parts:<br>    * Add to host_manager the possibility to get the loads_averages<br>    * Implement the filter based on this new property<br>    * Implement the filter with a per-aggregate configuration<br><br>The blueprint: <a href="https://urldefense.proofpoint.com/v1/url?u=https://blueprints.launchpad.net/nova/%2Bspec/filter-based-uptime&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=2CQc966BQ6s3Cdd6nQ79uvWP17nF9g%2FX4m3XppGg1xQ%3D%0A&m=%2F2SxxIStRB5OioDQormYLfKPx3nAoxbjqTWRezbId4U%3D%0A&s=1c937276a79b45279a009231915f5cac684c565b7b6b1e1cd40c659404f83a03">https://urldefense.proofpoint.com/v1/url?u=https://blueprints.launchpad.net/nova/%2Bspec/filter-based-uptime&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=2CQc966BQ6s3Cdd6nQ79uvWP17nF9g%2FX4m3XppGg1xQ%3D%0A&m=%2F2SxxIStRB5OioDQormYLfKPx3nAoxbjqTWRezbId4U%3D%0A&s=1c937276a79b45279a009231915f5cac684c565b7b6b1e1cd40c659404f83a03</a><br><br>I will be happy to get any comments about this filter, perharps it is not implemented<br>yet because of something I didn't see or my thinking of the implementation is wrong.<br><br>PS: I have checked metrics and cpu_resource but It does not get an averages of the<br>system load or perhaps I have not understand all.<br><br>Thanks a lot,<br>s.<br><br>_______________________________________________<br>OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>https://urldefense.proofpoint.com/v1/url?u=http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=2CQc966BQ6s3Cdd6nQ79uvWP17nF9g%2FX4m3XppGg1xQ%3D%0A&m=%2F2SxxIStRB5OioDQormYLfKPx3nAoxbjqTWRezbId4U%3D%0A&s=78d752c782f43b4e3ae29988f60c7cf1dc743190bddd55e732c73c378fb12e3d<br></blockquote></div><br></body></html>