<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Thank you for the suggestions on the topic.<br>I ended up to add these lines to the RamFilter file "/usr/lib/python2.6/site-packages/nova/scheduler/filters/ram_filter.py":<br>----<br> if usable_ram >= big_ram_node and requested_ram < big_ram_flavor:<br> LOG.debug(_("%(host_state)s has %(usable_ram)s MB usable ram,"<br> "which is too much for a %(requested_ram)s MB VM"),<br> locals())<br> return False<br>---- <br><br>where
"big_ram_node" and "big_ram_flavor" are the thresholds I considered for big VMs and big resources.<br><br>By this means I beleive it became more flexible, such that, if all the regular nodes were occupied, the small VMs would go on the big nodes.<br></div><div id="RTEContent"><div><img src="http://www.sharemation.com/Ahmadbut/Ahmad_Ahmadi.gif?unq=-vc9zlo"> </div></div><div><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Narayan Desai <narayan.desai@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Ahmad Ahmadi <ahmadidamha@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "openstack-operators@lists.openstack.org" <openstack-operators@lists.openstack.org> <br>
<b><span style="font-weight: bold;">Sent:</span></b> Tuesday, July 2, 2013 7:33 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Openstack-operators] Instance Scheduling on Hosts<br> </font> </div> <div class="y_msg_container"><br><div id="yiv8658655766"><div dir="ltr">We put this in a filter (/usr/share/pyshared/nova/scheduler/filters/hostname_filter.py)<div><br></div><div style="">In our case, we have several different classes of hardware. (gpu, idp, mem) We've created a series of instance types for each chassis type (mem.100, idp.50, etc, with the appropriate resource definitions). Our users mostly use these.</div>
<div style=""><br></div><div style="">I just realized that the basic instance types aren't being filtered from running on special chassis types (mem, and gpu). We haven't hit this so far because we have 50X more IDP nodes than mem or GPU, but we've just been lucky.</div>
<div style=""><br></div><div style="">To fix that, you could remove the blank lines between clauses and bottom out with a case that enforces that the node name is one of your lowmem nodes for the generic instance types.</div><div style="">
-nld</div><div><br><div><div>from nova.scheduler import filters</div><div><br></div><div>from nova import log as logging</div><div>from nova import utils</div><div><br></div><div>LOG = logging.getLogger(__name__)</div><div>
<br></div><div>class HostnameFilter(filters.BaseHostFilter):</div><div> """Assign instance type name prefix to specific hostnames"""</div><div><br></div><div> def host_passes(self, host_state, filter_properties):</div>
<div> #LOG.warning("Flavor name %s", filter_properties.get('instance_type')['name'].split('.')[0])</div><div> #LOG.warning("host_state %s", host_state)</div><div> #LOG.warning("host name %s", host_state.host)</div>
<div><br></div><div> if filter_properties.get('instance_type')['name'].split('.')[0] == 'mem':</div><div> if host_state.host.startswith('m',1):</div><div> return True</div>
<div><br></div><div> if filter_properties.get('instance_type')['name'].split('.')[0] == 'idp':</div><div> if host_state.host.startswith('c',1):</div><div> return True</div>
<div><br></div><div> if filter_properties.get('instance_type')['name'].split('.')[0] == 'gpu':</div><div> if host_state.host.startswith('g',1):</div><div> return True</div>
</div></div></div><div class="yiv8658655766gmail_extra"><br><br><div class="yiv8658655766gmail_quote">On Tue, Jul 2, 2013 at 4:56 PM, Ahmad Ahmadi <span dir="ltr"><<a rel="nofollow" ymailto="mailto:ahmadidamha@yahoo.com" target="_blank" href="mailto:ahmadidamha@yahoo.com">ahmadidamha@yahoo.com</a>></span> wrote:<br>
<blockquote class="yiv8658655766gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size:12pt;font-family:times new roman, new york, times, serif;">This is exactly what I'm looking for, but don't know how!<br>
Would you please describe a bit more?<br><br>Thanks<br><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div class="yiv8658655766hm yiv8658655766HOEnZb"> </div><div style="font-family:times new roman, new york, times, serif;font-size:12pt;">
<div class="yiv8658655766hm yiv8658655766HOEnZb"> <div dir="ltr"> <hr size="1"> <font face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Narayan Desai <<a rel="nofollow" ymailto="mailto:narayan.desai@gmail.com" target="_blank" href="mailto:narayan.desai@gmail.com">narayan.desai@gmail.com</a>><br>
<b><span style="font-weight:bold;">To:</span></b> Ahmad Ahmadi <<a rel="nofollow" ymailto="mailto:ahmadidamha@yahoo.com" target="_blank" href="mailto:ahmadidamha@yahoo.com">ahmadidamha@yahoo.com</a>> <br><b><span style="font-weight:bold;">Cc:</span></b> "<a rel="nofollow" ymailto="mailto:openstack-operators@lists.openstack.org" target="_blank" href="mailto:openstack-operators@lists.openstack.org">openstack-operators@lists.openstack.org</a>" <<a rel="nofollow" ymailto="mailto:openstack-operators@lists.openstack.org" target="_blank" href="mailto:openstack-operators@lists.openstack.org">openstack-operators@lists.openstack.org</a>> <br>
<b><span style="font-weight:bold;">Sent:</span></b> Tuesday, July 2, 2013 3:30 PM<br> <b><span style="font-weight:bold;">Subject:</span></b> Re:
[Openstack-operators] Instance Scheduling on Hosts<br> </font> </div></div><div><div class="yiv8658655766h5"> <div><br>
<div><div dir="ltr">We accomplished with a scheduler filter that only routes big mem requests to nodes with large memory footprint and doesn't consider these for smaller instance types.<div> -nld</div></div><div>
<br><br><div>On Tue, Jul 2, 2013 at 3:55 PM, Ahmad Ahmadi <span dir="ltr"><<a rel="nofollow" ymailto="mailto:ahmadidamha@yahoo.com" target="_blank" href="mailto:ahmadidamha@yahoo.com">ahmadidamha@yahoo.com</a>></span> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-size:12pt;font-family:times new roman, new york, times, serif;"><div>I have two groups of hosts as compute nodes:</div><div><br>BigGroup: a few machines with very big RAM</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;">
<span>SmallGroup: a lot of machines with smaller RAM each.</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;"><br><span></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;">
<span>My goal is to assigne bigger instances (from bigger flavors) to BigGroup and </span><span>smaller instances to SmallGroup.</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;">
<span>I tried the "AggregateInstanceExtraSpecsFilter" filtering with assigning different keys to instances and making aggregated hosts (<a rel="nofollow" target="_blank" href="http://docs.openstack.org/folsom/openstack-compute/admin/content/host-aggregates.html">http://docs.openstack.org/folsom/openstack-compute/admin/content/host-aggregates.html</a>), but didn't work and all the instance boots will end up to error.</span></div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;">Any idea?</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;">
<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;">More over does anyone know how can I assign higher cost to
bigger nodes for weighting?</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman, new york, times, serif;">
Thanks,<br><span></span></div></div></div><br>_______________________________________________<br>
OpenStack-operators mailing list<br>
<a rel="nofollow" ymailto="mailto:OpenStack-operators@lists.openstack.org" target="_blank" href="mailto:OpenStack-operators@lists.openstack.org">OpenStack-operators@lists.openstack.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators</a><br>
<br></blockquote></div><br></div>
</div><br><br></div> </div></div></div> </div> </div></div></blockquote></div><br></div></div><br><br></div> </div> </div> </div></body></html>