Default scheduler to spread-first

* Fixes bug 965732

Change-Id: I239b2b235905b30879974144263037eba6ed409f
This commit is contained in:
Vishvananda Ishaya 2012-03-26 14:33:39 -07:00
parent 2483dbfe42
commit d4d081ad4c
3 changed files with 7 additions and 5 deletions

View File

@ -986,8 +986,8 @@
######### defined in nova.scheduler.least_cost #########
###### (FloatOpt) How much weight to give the fill-first cost function
# compute_fill_first_cost_fn_weight=1.0
###### (FloatOpt) How much weight to give the fill-first cost function. A negative value will reverse behavior: e.g. spread-first
# compute_fill_first_cost_fn_weight=-1.0
###### (ListOpt) Which cost functions the LeastCostScheduler should use
# least_cost_functions="nova.scheduler.least_cost.compute_fill_first_cost_fn"
###### (FloatOpt) How much weight to give the noop cost function

View File

@ -39,8 +39,10 @@ least_cost_opts = [
default=1.0,
help='How much weight to give the noop cost function'),
cfg.FloatOpt('compute_fill_first_cost_fn_weight',
default=1.0,
help='How much weight to give the fill-first cost function'),
default=-1.0,
help='How much weight to give the fill-first cost function. '
'A negative value will reverse behavior: '
'e.g. spread-first'),
]
FLAGS = flags.FLAGS

View File

@ -170,7 +170,7 @@ class FilterSchedulerTestCase(test_scheduler.SchedulerTestCase):
fns = fixture.get_cost_functions()
self.assertEquals(len(fns), 1)
weight, fn = fns[0]
self.assertEquals(weight, 1.0)
self.assertEquals(weight, -1.0)
hostinfo = host_manager.HostState('host', 'compute')
hostinfo.update_from_compute_node(dict(memory_mb=1000,
local_gb=0, vcpus=1))