]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Downgrade 'infinite' and 'unknown' capacity in weigher
authorZhiteng Huang <zhithuang@ebaysf.com>
Thu, 18 Sep 2014 22:02:55 +0000 (15:02 -0700)
committerZhiteng Huang <zhithuang@ebaysf.com>
Tue, 23 Sep 2014 04:49:58 +0000 (12:49 +0800)
commitdcdce8782230c1e679165d16c2e064405b724227
tree4b2309000dd9f7f0ef8ae3e517240e33090bf518
parentdb2c817fc7adef98b6770d9dba12c698d6d5ad46
Downgrade 'infinite' and 'unknown' capacity in weigher

When FilterScheduler was first introduced into Cinder, drivers were
required for the first time to report capacity. Some drivers preferred
to report 'infinite' or 'unknown' capacity because they were doing
thin-provisioning or the total capacity kept increasing. Now that we
have better support for thin-provisioning and we do find unrealistic
capacity couldn't do us any good in making optimal scheduling decision,
because 'infinite' and 'unknown' would always have the highest weight
when the weight multiplier is positive, which in most cases it is.

Drivers are expected to avoid sending 'infinite' 'unknown' capacity
anymore, instead, should report an actual real number for total/free
capacity.

This fix doesn't fix the driver, instead a small tweak is added to
CapacityWeigher in order to downgrade those drivers who report
'infinite' or 'unknown' as free capacity.  In particular, those who
report 'infinite'/'unknown' free capacity will be adjusted to be the
one has lowest weight, no matter in 'spreading' (weight multiplier>0)
or 'stacking' (weight multiplier<0) mode.

DocImpact

Change-Id: Ied087386a1a2f43e6a77499a817d5c637ef448f6
Partial-bug: #1350638
cinder/scheduler/weights/capacity.py
cinder/tests/scheduler/fakes.py
cinder/tests/scheduler/test_capacity_weigher.py