I know I'm reviving an older thread here but we implemented our own simple "hardware aware" scheduler for Cactus. Maybe it will help you?<div><br></div><div><a href="https://github.com/canarie/dair/blob/master/OpenStack/misc/hardware.py">https://github.com/canarie/dair/blob/master/OpenStack/misc/hardware.py</a></div>
<div><br></div><div>Everett<br><br><div class="gmail_quote">On Thu, Nov 10, 2011 at 11:35 AM, Christian Wittwer <span dir="ltr"><<a href="mailto:wittwerch@gmail.com">wittwerch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks a lot for your answers. Unfortunately I can't follow the trunk<br>
and I have to use the Diablo release. Is it possible to backport that<br>
new scheduler to Diablo?<br>
Anyway I gave the least cost scheduler a try, it loads but never<br>
schedules a vm correctly.<br>
<br>
--compute_scheduler_driver=nova.scheduler.least_cost.LeastCostScheduler<br>
<br>
But then log fires that message when I try to launch an instance<br>
<br>
2011-11-10 19:31:15,588 DEBUG nova.scheduler.least_cost [-] Weighted<br>
Costs => [] from (pid=1697) weigh_hosts<br>
/usr/lib/pymodules/python2.7/nova/scheduler/least_cost.py:170<br>
2011-11-10 19:31:15,591 ERROR nova.rpc [-] Exception during message handling<br>
(nova.rpc): TRACE: Traceback (most recent call last):<br>
(nova.rpc): TRACE:   File<br>
"/usr/lib/pymodules/python2.7/nova/rpc/impl_kombu.py", line 620, in<br>
_process_data<br>
(nova.rpc): TRACE:     rval = node_func(context=ctxt, **node_args)<br>
(nova.rpc): TRACE:   File<br>
"/usr/lib/pymodules/python2.7/nova/scheduler/manager.py", line 103, in<br>
_schedule<br>
(nova.rpc): TRACE:     host = real_meth(*args, **kwargs)<br>
(nova.rpc): TRACE:   File<br>
"/usr/lib/pymodules/python2.7/nova/scheduler/abstract_scheduler.py",<br>
line 231, in schedule_run_instance<br>
(nova.rpc): TRACE:     raise driver.NoValidHost(_('No hosts were available'))<br>
(nova.rpc): TRACE: NoValidHost: No hosts were available<br>
(nova.rpc): TRACE:<br>
<br>
My compute hosts are up and running, and there are no other instances running.<br>
<br>
root@unic-dev-os-controller:~# nova-manage service list<br>
Binary           Host                                 Zone<br>
Status     State Updated_At<br>
nova-compute     unic-dev-os-controller               nova<br>
enabled    :-)   2011-11-10 18:35:06<br>
nova-scheduler   unic-dev-os-controller               nova<br>
enabled    :-)   2011-11-10 18:35:06<br>
nova-network     unic-dev-os-controller               nova<br>
enabled    :-)   2011-11-10 18:35:06<br>
nova-compute     unic-dev-os-compute1                 nova<br>
enabled    :-)   2011-11-10 18:35:06<br>
<br>
Any ideas why the scheduler does not find a valid host?<br>
<br>
Christian<br>
<br>
2011/11/1 Lorin Hochstein <<a href="mailto:lorin@isi.edu">lorin@isi.edu</a>>:<br>
<div class="HOEnZb"><div class="h5">> Christian:<br>
><br>
> Sandy's branch just landed in the repository. You should be able to use the distributed scheduler with the least cost functionality by specifying the following flag in nova.conf for the nova-scheduler service:<br>

><br>
> --compute_scheduler_driver=nova.scheduler.distributed_scheduler.DistributedScheduler<br>
><br>
> By default, this uses the nova.scheduler.least_cost.compute_fill_first_cost_fn weighting function.<br>
><br>
> Note, however, that this function will favor scheduling instances to nodes that have the smallest amount of RAM available that can still fit the instance. If you're looking for the opposite effect (deploy to the node that has the most amount of RAM free), then you'll have to write your own cost function.  One way would be to add the following method to least_cost.py:<br>

><br>
><br>
> def compute_least_loaded_cost_fn(host_info):<br>
>    return -compute_fill_first_cost_fn(host_info)<br>
><br>
><br>
> Then add the following flag to your nova.conf<br>
><br>
> --least_cost_functions=nova.scheduler.least_cost.compute_least_loaded_cost_fn<br>
><br>
><br>
> Lorin<br>
> --<br>
> Lorin Hochstein, Computer Scientist<br>
> USC Information Sciences Institute<br>
> <a href="tel:703.812.3710" value="+17038123710">703.812.3710</a><br>
> <a href="http://www.east.isi.edu/~lorin" target="_blank">http://www.east.isi.edu/~lorin</a><br>
><br>
><br>
><br>
><br>
> On Nov 1, 2011, at 11:37 AM, Sandy Walsh wrote:<br>
><br>
>> I'm hoping to land this branch asap.<br>
>> <a href="https://review.openstack.org/#change,1192" target="_blank">https://review.openstack.org/#change,1192</a><br>
>><br>
>> It replaces all the "kind of alike" schedulers with a single DistributedScheduler.<br>
>><br>
>> -S<br>
>><br>
>> ________________________________________<br>
>> From: openstack-bounces+sandy.walsh=<a href="mailto:rackspace.com@lists.launchpad.net">rackspace.com@lists.launchpad.net</a> [openstack-bounces+sandy.walsh=<a href="mailto:rackspace.com@lists.launchpad.net">rackspace.com@lists.launchpad.net</a>] on behalf of Christian Wittwer [<a href="mailto:wittwerch@gmail.com">wittwerch@gmail.com</a>]<br>

>> Sent: Tuesday, November 01, 2011 5:38 AM<br>
>> To: Lorin Hochstein<br>
>> Cc: <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
>> Subject: Re: [Openstack] Which nova scheduler for different hardware sizes?<br>
>><br>
>> Lorin,<br>
>> Thanks for your reply. Well the least cost scheduler with these cost<br>
>> functions looks interesting.<br>
>> Unfortunately there is not much documenation about it. Can somebody<br>
>> give me an example how to switch to that scheduler using the memory<br>
>> cost function which already exist?<br>
>><br>
>> Cheers,<br>
>> Christian<br>
>><br>
>> 2011/10/24 Lorin Hochstein <<a href="mailto:lorin@isi.edu">lorin@isi.edu</a>>:<br>
>>> Christian:<br>
>>> You could use the least cost scheduler, but I think you'd have to write your<br>
>>> own cost function to take into account the different number of cores.<br>
>>> Looking at the source, the only cost function it comes with only takes into<br>
>>> account the amount of memory that's free, not loading in terms of total<br>
>>> physical cores and allocated virtual cores. (We use a custom scheduler at<br>
>>> our site, so I don't have any firsthand experience with the least-cost<br>
>>> scheduler).<br>
>>> Lorin<br>
>>> --<br>
>>> Lorin Hochstein, Computer Scientist<br>
>>> USC Information Sciences Institute<br>
>>> <a href="tel:703.812.3710" value="+17038123710">703.812.3710</a><br>
>>> <a href="http://www.east.isi.edu/~lorin" target="_blank">http://www.east.isi.edu/~lorin</a><br>
>>><br>
>>><br>
>>><br>
>>> On Oct 22, 2011, at 3:17 AM, Christian Wittwer wrote:<br>
>>><br>
>>> I'm planning to build a openstack nova installation with older<br>
>>> hardware. These servers obviously doesn't have the same hardware<br>
>>> configuration like memory and cores.<br>
>>> It ranges from 2 core and 4GB memory to 16 core and 64GB memory. I<br>
>>> know that there are different scheduler, but I'm not sure which one to<br>
>>> choose.<br>
>>> The simple scheduler tries to find the least used host, but the amount<br>
>>> of used cores per host (max_cores) is a constant, which doesn't work<br>
>>> for me.<br>
>>> Maybe the least cost scheduler would be the right one? But I'm not<br>
>>> sure, because I did not find any documenation about how to use it.<br>
>>><br>
>>> Cheers,<br>
>>> Christian<br>
>>><br>
>>> _______________________________________________<br>
>>> Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
>>> Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
>>> Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
>>> More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
>>><br>
>>><br>
>><br>
>> _______________________________________________<br>
>> Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
>> Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
>> Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
>> More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
><br>
><br>
<br>
_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</div></div></blockquote></div><br></div>