Support Cinder API version 2

Support Cinder API version 2

This specification proposes to add support for the second version of the Cinder API, which brings useful improvements and will soon replace version one.

Problem description

Currently Sahara uses only version 1 of Cinder API to create volumes. Version two, however, brings useful features such as scheduler hints, more consistent responses, caching, filtering, etc.

Also, Cinder is deprecating version 1 in favor of 2, so supporting both would make switching easier for users.

Use cases:

  • As a developer I want to be able to pass scheduler hints to Cinder when creating clusters, in order to choose volumes more precisely and achieve improved performance.
  • As a developer I want filtering into my requests to Cinder to make queries lighter.
  • As a deployer I want to be able to choose between legacy Cinder API v1 and newer v2 API.

Proposed change

The implementation will add a configuration option, cinder_api_version, that will be defaulted to:


but can be changed to


by modifying sahara.conf.

The client() method in sahara/utils/openstack/ will either return clientv1() or clientv2() depending on the configuration.


Wait for Cinder API v1 to be deprecated and switch abruptly to v2.

Data model impact


REST API impact


Other end user impact


Deployer impact

  • If the deployer wants to keep using Cinder API version 1, nothing has to be done.
  • If the deployer wants to upgrade to version 2, the cinder_api_version option in sahara.conf should be overwritten.

Developer impact

Developers can read CONF.cinder_api_version to know what API version is being used.

Sahara-image-elements impact


Sahara-dashboard / Horizon impact




Primary assignee:

Work Items

  • Add a configuration option: cinder_api_version.
  • Put some magic in sahara/utils/openstack/ to pick the correct Cinder client depending on the configuration.




Same as for v1 API.

Documentation Impact


Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.