]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Allow scheduler pool information to be retrieved
authorZhiteng Huang <zhithuang@ebaysf.com>
Mon, 8 Sep 2014 21:42:39 +0000 (14:42 -0700)
committerZhiteng Huang <zhithuang@ebaysf.com>
Sat, 20 Sep 2014 18:04:12 +0000 (11:04 -0700)
commit80b14a54710dad659fde3e319f8b0cf0e673acdd
tree9fdc426dcb777cc7bd2ef6d434609fa79831a92d
parentb35c97cd25e34873e9e91367f054dc904456f7de
Allow scheduler pool information to be retrieved

With pool support added to Cinder, now we are kind of in an awkward
situation where we require admin to input exact location for volumes
to-be managed (imported) or migrated, which must have pool info, but
there is no way to find out what pools are there for backends except
looking at the scheduler log.  That causes bad user experience, and
thus is a bug from UX POV.

This change simply adds a new admin-api extension to allow admin to
fetch all the pool information from scheduler cache (memory), which
closes the gap for end users.

This extension provides two level of pool information: names only or
detailed information:

Pool name only:
GET http://CINDER_API_ENDPOINT/v2/TENANT_ID/scheduler-stats/get_pools

Detailed Pool info:
GET http://CINDER_API_ENDPOINT/v2/TENANT_ID/scheduler-stats/get_pools
\?detail\=True

Closes-bug: #1364279

Change-Id: I445d4e472c83db2f2d8db414de139c87d09f8fda
12 files changed:
cinder/api/contrib/scheduler_stats.py [new file with mode: 0644]
cinder/api/views/scheduler_stats.py [new file with mode: 0644]
cinder/scheduler/driver.py
cinder/scheduler/filter_scheduler.py
cinder/scheduler/host_manager.py
cinder/scheduler/manager.py
cinder/scheduler/rpcapi.py
cinder/tests/api/contrib/test_scheduler_stats.py [new file with mode: 0644]
cinder/tests/policy.json
cinder/tests/scheduler/test_host_manager.py
cinder/tests/scheduler/test_rpcapi.py
etc/cinder/policy.json