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.