]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Replace Simple/Chance Scheduler with FilterScheduler
authorZhiteng Huang <zhithuang@ebaysf.com>
Tue, 31 Dec 2013 07:00:52 +0000 (15:00 +0800)
committerZhiteng Huang <zhithuang@ebaysf.com>
Tue, 31 Dec 2013 16:10:16 +0000 (00:10 +0800)
commit289f63934459baccae1e7c547890cc5f4e9f26b3
treeb7ce7ee544dcc766c92a16a91749da18caa4934c
parent254e37ab3c995f6514084d38f2f797da9cf5e5a9
Replace Simple/Chance Scheduler with FilterScheduler

This patch replaces SimpleScheduler and ChanceScheduler with
FilterScheduler. Scheduler manager is changed so that when it
detects 'scheduler_driver' is set to SimpleScheduler or
ChanceScheduler, it changes underlying scheduler driver to
FilterScheduler, and then host manager will use a pre-defined
combination of filters & weighers to keep scheduler behavior *MOSTLY*
the same as its old counterparts.

To simulate ChanceScheduler/SimpleScheduler, 'AvailabilityZoneFilter',
'CapacityFilter' and 'CapabilitiesFilter' are chosen to filter
out hosts that isn't in the target AZ, doesn't have sufficient
capacity and doesn't support needed capabilities. And newly
added 'ChanceWeigher' will randomly pick a host from hosts
that passes above filters - just like ChanceScheduler does;
for SimpleScheduler, 'AllocatedCapacityWeigher' will sort hosts
with their 'allocated_capacity' - the one allocates the least
is the winner by default.

So the two new weigher, 'ChanceWeigher' and 'AllocatedCapacityWeigher'
are the key FilterScheduler to act identical when choosing
back-ends to serve requests. The 3 filters on the other hand,
are essential to make sure this 'new' Simple/Chance Scheduler can
support volume types, encryption and QoS.

Partially implements bp: deprecate-chance-and-simple-schedulers

Change-Id: I0538b9692a23af6457ed463447fea8e564570848
cinder/scheduler/host_manager.py
cinder/scheduler/manager.py
cinder/tests/conf_fixture.py
cinder/tests/scheduler/test_scheduler.py