Cinder Client V2 Support¶
Cinder has a new API version 2 . This version has existed since Grizzly  and has been available in devstack since Havana .
The API provides:
More consistent responses like name, description instead of ‘display_name’, etc.
Caching data between controllers instead of multiple database hits.
Filtering when listing information on volumes, snapshots and backups. This would be great support to have in Nova so the full listing of resources doesn’t have to be given over the network for Nova to sort through. 
Cinder is also deprecating version 1 in favor of 2, so it would be great to give users a transition period in other projects.
Nova currently has a wrapper to the Cinder client in nova.volumes.cinder which supports version 1 and expects a variety of response keys like ‘display_name’ and ‘display_description’ which aren’t available in version 2. These were changed to be consistent with other projects that just use ‘name’ and ‘description’.
Nova should use Cinder v2 client  which understands how to talk to the Cinder v2 API. Since v1 is deprecated, we can leave Cinder client v1 support in.
cinder_catalog_info option in nova.conf should also be set to volumev2:cinder:publicURL which would default new users the v2 API which is on by default in Cinder since Grizzly.
Making these changes to the wrapper won’t require any change to its interface or changes to how it returns information. This is done by the wrapper doing the translation and still giving back the expected data structure as it would with v1.
Data model impact¶
REST API impact¶
Other end user impact¶
Other deployer impact¶
Existing deployments will not need to make any changes to nova.conf in the Juno release. Cinder will just be deprecating v1 support, so they’ll receive a warning on start up in the cinder-api service. If the deployer wants Nova to use Cinder v2, they’ll need to change cinder_catalog_info to use the appropriate service_type they have Cinder v2 endpoint setup in the service catalog. It is acceptable to have a mix of Nova hosts talking to different versions of the Cinder API, assuming both v1 and v2 are enabled in Cinder.
- Primary assignee:
- Other contributors:
Write changes in nova.volumes.cinder to support Cinder client v2, while keeping support for v1. 
Add Cinder filtering support in Nova.
Tempest gate tests for compute will test against Cinder v2. Tempest has both versions available, so Nova’s config option of cinder_catalog_info will be updated to the appropriate service_type of v2. If resources allow, we can also test against v1.
Unit tests will test against Nova’s wrapper which talks to Cinder client. This will specifically verify usage between v1 and v2 is handled on this layer and is transparent to the rest of Nova.
 - http://docs.openstack.org/api/openstack-block-storage/2.0/content/  - https://review.openstack.org/#/q/status:merged+project:openstack/cinder+branch:master+topic:bp/bp,n,z  - https://review.openstack.org/#/c/22489/  - https://github.com/openstack/cinder/commit/88e688317dc4066f2f0b4dfc454a3f049da4d0e3  - https://github.com/openstack/python-cinderclient/tree/master/cinderclient/v2  - https://review.openstack.org/#/c/43986/