Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Default scheduler to spread-first
 * Fixes bug 965732

Change-Id: I239b2b235905b30879974144263037eba6ed409f
  • Loading branch information
vishvananda committed Mar 27, 2012
1 parent 2483dbf commit d4d081a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions etc/nova/nova.conf.sample
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions nova/scheduler/least_cost.py
Expand Up @@ -39,8 +39,10 @@
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
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/scheduler/test_filter_scheduler.py
Expand Up @@ -170,7 +170,7 @@ def test_get_cost_functions(self):
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))
Expand Down

0 comments on commit d4d081a

Please sign in to comment.