From 6dc3d7beaf9a41be766a2e6787593ef6a5644097 Mon Sep 17 00:00:00 2001 From: Ildiko Vancsa Date: Mon, 6 Mar 2017 23:17:24 +0100 Subject: [PATCH] Use Cinder API v3 as default This patch sets Nova to use the Cinder v3 API as the default option. This change uses the base '3.0' version, which is identical to v2. Leveraging microversions that were introduced in v3 and switching to a newer microversion will be added in a follow up patch. Change-Id: Ibcc8eefcc5011ad5002d608a3c253f1e9b68416f --- nova/conf/cinder.py | 2 +- nova/volume/cinder.py | 5 +++++ .../switch-to-cinder-v3-00bdf83e0937dbe5.yaml | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/switch-to-cinder-v3-00bdf83e0937dbe5.yaml diff --git a/nova/conf/cinder.py b/nova/conf/cinder.py index 27346a9f07..4e2b02549f 100644 --- a/nova/conf/cinder.py +++ b/nova/conf/cinder.py @@ -23,7 +23,7 @@ cinder_group = cfg.OptGroup( cinder_opts = [ cfg.StrOpt('catalog_info', - default='volumev2:cinderv2:publicURL', + default='volumev3:cinderv3:publicURL', regex='(\w+):(\w+):(.*?)', help=""" Info to match when looking for cinder in the service catalog. diff --git a/nova/volume/cinder.py b/nova/volume/cinder.py index 449f700dfe..531e32d07d 100644 --- a/nova/volume/cinder.py +++ b/nova/volume/cinder.py @@ -88,6 +88,11 @@ def cinderclient(context): if version == '1': raise exception.UnsupportedCinderAPIVersion(version=version) + if version == '3': + # TODO(ildikov): Add microversion support for picking up the new + # attach/detach API that was added in 3.27. + version = '3.0' + return cinder_client.Client(version, session=_SESSION, auth=auth, diff --git a/releasenotes/notes/switch-to-cinder-v3-00bdf83e0937dbe5.yaml b/releasenotes/notes/switch-to-cinder-v3-00bdf83e0937dbe5.yaml new file mode 100644 index 0000000000..9033a0b965 --- /dev/null +++ b/releasenotes/notes/switch-to-cinder-v3-00bdf83e0937dbe5.yaml @@ -0,0 +1,14 @@ +--- +upgrade: + - | + Nova is now configured to use the v3 version of the Cinder API. You need to + ensure that the v3 version of the Cinder API is available and listed in the + service catalog in order to use Nova with the default configuration option. + + The base ``3.0`` version is identical to v2 and it was introduced in the + Newton release of OpenStack. In case you need Nova to continue using the v2 + version you can point it towards that by setting the ``catalog_info`` + option in the ``nova.conf`` file under the ``cinder`` section, like:: + + [cinder] + catalog_info = volumev2:cinderv2:publicURL