From 4e38b2834469e170c4cbb0706091eda79822bd15 Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Mon, 12 Jun 2017 12:58:19 -0400 Subject: [PATCH] Define default Image and Volume API versions in overcloudrc Define the default API versions for the Image and Volume services in overcloudrc. The default Image API version (2) is the latest major version supported by Glance, and matches the version Glance implements when the version is unspecified. The default Volume API version (3) is the latest major version supported by Cinder. Cinder supports higher microversions, but the Cinder project recommends a lower default value in order prevent breaking legacy applications (e.g. scripts). Change-Id: I306fc90b0adcc001aae5bfbe83685b27371c80c8 --- .../cinder-and-glance-api-version-bca6acd809d4151c.yaml | 7 +++++++ tripleo_common/constants.py | 6 ++++++ tripleo_common/utils/overcloudrc.py | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/cinder-and-glance-api-version-bca6acd809d4151c.yaml diff --git a/releasenotes/notes/cinder-and-glance-api-version-bca6acd809d4151c.yaml b/releasenotes/notes/cinder-and-glance-api-version-bca6acd809d4151c.yaml new file mode 100644 index 000000000..510a6cec8 --- /dev/null +++ b/releasenotes/notes/cinder-and-glance-api-version-bca6acd809d4151c.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Set ``OS_VOLUME_API_VERSION`` and ``OS_IMAGE_API_VERSION`` in + ``overcloudrc`` in order to establish the default API versions for + the Volume and Image services. The values match the default major API + versions for Cinder (3) and Glance (2). diff --git a/tripleo_common/constants.py b/tripleo_common/constants.py index 23d4ff9b5..51af64b39 100644 --- a/tripleo_common/constants.py +++ b/tripleo_common/constants.py @@ -110,6 +110,12 @@ PLAN_NAME_PATTERN = '^[a-zA-Z0-9-]+$' # 1.29 is the latest API version in Ironic Ocata supported by ironicclient. DEFAULT_BAREMETAL_API_VERSION = '1.29' +# The default version of the Image API to set in overcloudrc. +DEFAULT_IMAGE_API_VERSION = '2' + +# The default version of the Volume API to set in overcloudrc. +DEFAULT_VOLUME_API_VERSION = '3' + # The name of the file which holds the Mistral environment contents for plan # import/export PLAN_ENVIRONMENT = 'plan-environment.yaml' diff --git a/tripleo_common/utils/overcloudrc.py b/tripleo_common/utils/overcloudrc.py index 2f9d41d70..369d69298 100644 --- a/tripleo_common/utils/overcloudrc.py +++ b/tripleo_common/utils/overcloudrc.py @@ -101,6 +101,8 @@ def create_overcloudrc(stack, no_proxy, admin_password): 'OS_AUTH_URL': overcloud_endpoint, 'OS_BAREMETAL_API_VERSION': constants.DEFAULT_BAREMETAL_API_VERSION, 'IRONIC_API_VERSION': constants.DEFAULT_BAREMETAL_API_VERSION, + 'OS_IMAGE_API_VERSION': constants.DEFAULT_IMAGE_API_VERSION, + 'OS_VOLUME_API_VERSION': constants.DEFAULT_VOLUME_API_VERSION, } overcloudrc = CLEAR_ENV