cinder/cinder
Zhiteng Huang 254e37ab3c Add AllocatedCapacityWeigher
AllocatedCapacityWeigher is a weigher that weigh hosts by their
allocated capacity. The main purpose of this weigher is to simulate
the SimpleScheduler's behavior, which sorts hosts by the size of
all volumes on them.  So by allocated capacity, it equals to the
sum of size of all volumes on target host.

In order to keep track of 'allocated' capacity, host state is updated
to add a 'allocated_capacity_gb' attribute to record the value, which
means each back-end must report one extra stats to scheduler.
Fortunately, the 'allocated' capacity we are interested in here is
pure Cinder level capacity, the volume manager can take all the burden
to calculate this value without having to query back-ends. The volume
manager does the initial calculation in init_host() by the time when it
has to query all existing volumes from DB for ensure_export(). After
initial calculation, volume manager/scheduler will keep track of every
new request that changes 'allocated_capacity' and make sure this value
is up to date.

!DriverImpact! Cinder driver developers, please read on:

This patch contains a change that might IMPACT volume drivers: volume
manager now uses 'stats' attribute to save 'allocated_capacity_gb'.
And this information will be merged with those stats drivers provide
as a whole for scheduler to consume.  If you plan to report any form
of allocated space other than the apparent Cinder level value, (e.g.
actual capacity allocated), Please choose a key name other than
'allocated_capacity_gb', otherwise it will *OVERWRITE* the value volume
manager has calculated and confuse scheduler.

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

Change-Id: I306230b8973c2d1ad77bcab14ccde68e997ea816
2013-12-30 17:06:12 +08:00
..
api Merge "Handle terminate_connection() exception in volume manager" 2013-12-29 09:38:37 +00:00
backup Fix spelling errors 2013-12-26 12:46:47 +02:00
brick make delete recovery messages debug level 2013-12-17 07:29:46 -05:00
common Provide gettext _ in missing locations 2013-10-16 13:53:22 -06:00
compute Fix spelling errors 2013-12-26 12:46:47 +02:00
db Bugfix missing foreign key removal for mysql 2013-12-26 11:29:39 -08:00
image Merge "Set volume_dd_blocksize configurable on per-driver basis" 2013-12-23 18:46:36 +00:00
keymgr Lazy log the fixed_key warnings 2013-12-10 14:51:32 -05:00
locale Imported Translations from Transifex 2013-12-28 06:14:19 +00:00
openstack Merge "Sync matchmaker_ring.py from oslo-incubator" 2013-12-10 04:23:57 +00:00
scheduler Add AllocatedCapacityWeigher 2013-12-30 17:06:12 +08:00
testing Use nose and openstack nose plugin. 2013-03-07 14:14:08 -05:00
tests Add AllocatedCapacityWeigher 2013-12-30 17:06:12 +08:00
transfer Fix all occurences of H404 Hacking warning 2013-10-13 10:36:27 +03:00
volume Add AllocatedCapacityWeigher 2013-12-30 17:06:12 +08:00
__init__.py Remove gettext.install() from cinder/__init__.py 2013-05-13 18:45:25 +08:00
context.py RequestContext initialization failed in cinder. 2013-11-07 10:33:09 +08:00
exception.py Fix and enable gating on F401 2013-12-20 15:01:23 +01:00
manager.py Replace FLAGS with cfg.CONF in other modules, unless tests 2013-06-13 13:11:36 +04:00
policy.py Provide gettext _ in missing locations 2013-10-16 13:53:22 -06:00
quota.py Fix all occurences of H404 Hacking warning 2013-10-13 10:36:27 +03:00
service.py Merge "Fix spelling errors" 2013-12-26 17:44:26 +00:00
test.py Fix and enable gating on F401 2013-12-20 15:01:23 +01:00
units.py Nexenta iSCSI driver: extend volume stats of _update_volume_stats 2013-11-12 09:57:26 -08:00
utils.py Fix and enable gating on F401 2013-12-20 15:01:23 +01:00
version.py Changed header from LLC to Foundation based on trademark policies 2013-09-10 17:26:42 +02:00
wsgi.py Changed header from LLC to Foundation based on trademark policies 2013-09-10 17:26:42 +02:00