Support retrieve pools filtered by volume-type¶
Add feature that administrators can get back-end storage pools filtered by volume-type, cinder will return the pools filtered by volume-type’s extra-specs.
get-pools API doesn’t support filtering pools by volume type,
and this is inconvenient when administrators want to know the specified pool’s
state which also can meet volume type’s requirements, the administrators also
can get all pools and filter them on their own, but it’s more complicated and
inefficient. This change intends to cover this situation and bring more
convenience to administrators.
In production environment, administrators often need to have an overall pool available statistics filtered by volume type, this will help them to make an adjustment before resources run out.
As we will introduce generalized resource filter in cinder, from the view of outside cinder, the only thing we should do is to advertise that we can support this filter now:
From the view of inside cinder. We will mark
volume-type recognizable, and
support for this filter in logic:
once the volume-type (name or id) is detected, the volume type object will be retrieved before scheduler api is called, and will be passed as a filter item.
scheduler.get_poolscalled, which will call the
host_manager.get_poolswill collect the pools information as normal, and before it returns, the result will be filtered by
the filter properties of
get_filtered_hostsonly consists of volume-type properties.
As already proposed by generalized resource filtering , the changes on cinder-client for this feature are not needed.
Administrators also can retrieve and filter on their own, but it’s more complicated and inefficient. This change can reduce the request amount and filter unnecessary data transmitted from server to client.
Data model impact¶
REST API impact¶
Get-Pool API will accept new query string parameter volume-type. Administrators can pass name or ID to retrieve pools filtered.
Other end user impact¶
Within generalized resource filtering, we would ultimately have a
get-pools command like this below:
cinder get-pools --filters volume-type='volume type'
Other deployer impact¶
- Primary assignee:
Add Get-Pools’s filter.
Add filter logic when retrieving pools.
Add related tests.
Depended on generalized resource filtering 
Unit test to test whether volume-type filter can be correctly applied.
Tempest test whether volume-type filter work correctly from API perspective.
The cinder API documentation will need to be updated to reflect the REST API changes.