Set cinder default_volume_type via service parameters

Service Parameter support added for setting cinder.conf parameter
DEFAULT/default_volume_type.

Changes include:
 - Added service parameter cinder/DEFAULT/default_volume_type with
   checks to verify that the provided value is a currently defined
   volume type and multiple values are not provided. The cinder API is
   queried to get a list of acceptable values.
 - The service parameter is not required to be present. It is optional,
   but we maintain behavior from past releases which sets the default
   volume type to 'ceph' if the ceph backend in present.
 - If the ceph backend is present and the service parameter is present,
   the service parameter takes precedence.
 - The cinder.pp manifest is updated to provide a service_parameter
   runtime class that applies the cinder.conf changes for SAN backend
   sections and the DEFAULT section.
 - puppet-cinder is updated to remove the default_volume_type from the
   cinder::api class. This allows us to set the parameter as part of a
   targeted runtime class and during the ::openstack::cinder main class.
   To upstream this we should create cinder::default_volume_type
   class (like the cinder::backends class) to enable setting this as
   needed.

Change-Id: I139ecc12e0226e56267a3a526e6574931e7fa4bb
Signed-off-by: Jack Ding <jack.ding@windriver.com>
This commit is contained in:
Robert Church 2018-04-09 19:45:24 -05:00 committed by Jack Ding
parent e3f356e98e
commit e3e3d029e9
4 changed files with 83 additions and 1 deletions

View File

@ -1 +1 @@
TIS_PATCH_VER=6
TIS_PATCH_VER=7

View File

@ -0,0 +1,32 @@
From 7fcdc8a940ce9b074f2c47e0ba683b457f2f93df Mon Sep 17 00:00:00 2001
From: Robert Church <robert.church@windriver.com>
Date: Mon, 9 Apr 2018 11:14:52 -0500
Subject: [PATCH] Patch for removal of default_volume_type from API
---
SPECS/puppet-cinder.spec | 2 ++
1 file changed, 2 insertions(+)
diff --git a/SPECS/puppet-cinder.spec b/SPECS/puppet-cinder.spec
index 7c428d3..8cd53c4 100644
--- a/SPECS/puppet-cinder.spec
+++ b/SPECS/puppet-cinder.spec
@@ -13,6 +13,7 @@ Source0: https://tarballs.openstack.org/%{name}/%{name}-%{upstream_versio
Patch0001: 0001-Roll-up-TIS-patches.patch
Patch0002: 0002-CGTS-8837-cinder-volume-cannot-be-deleted-after-swact.patch
Patch0003: 0003-CGTS-9191-Add-nova-interface-config-option.patch
+Patch0004: 0004-CGTS-9219-Remove-default_volume_type-from-api-class.patch
BuildArch: noarch
@@ -32,6 +33,7 @@ Puppet module for OpenStack Cinder
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
+%patch0004 -p1
find . -type f -name ".*" -exec rm {} +
find . -size 0 -exec rm {} +
--
1.8.3.1

View File

@ -2,3 +2,4 @@
0002-Add-TIS-patches.patch
0003-CGTS-8837-cinder-volume-cannot-be-deleted-after-swact.patch
0004-CGTS-9191-Fix-cinder-calling-nova-over-public-ip.patch
0005-Patch-for-removal-of-default_volume_type-from-API.patch

View File

@ -0,0 +1,49 @@
From b9aee291c5e6219423f53ec7d1a1b97213d7641d Mon Sep 17 00:00:00 2001
From: Robert Church <robert.church@windriver.com>
Date: Mon, 9 Apr 2018 10:01:28 -0500
Subject: [PATCH] CGTS-9219: Remove default_volume_type from api class
Allow setting the default_volume type independent of the API as we have
scenarios where we simply want to add/remove the value and restart the API. This
optimizes runtime dependencies.
---
BUILD/openstack-cinder-11.3.0/manifests/api.pp | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/manifests/api.pp b/manifests/api.pp
index 7a35c8a..ffc498b 100644
--- a/manifests/api.pp
+++ b/manifests/api.pp
@@ -75,13 +75,6 @@
# (optional) Factory to use for ratelimiting
# Defaults to 'cinder.api.v1.limits:RateLimitingMiddleware.factory'
#
-# [*default_volume_type*]
-# (optional) default volume type to use.
-# This should contain the name of the default volume type to use.
-# If not configured, it produces an error when creating a volume
-# without specifying a type.
-# Defaults to $::os_service_default.
-#
# [*validate*]
# (optional) Whether to validate the service is working after any service refreshes
# Defaults to false
@@ -191,7 +184,6 @@ class cinder::api (
$enabled = true,
$manage_service = true,
$ratelimits = $::os_service_default,
- $default_volume_type = $::os_service_default,
$ratelimits_factory =
'cinder.api.v1.limits:RateLimitingMiddleware.factory',
$validate = false,
@@ -287,7 +279,6 @@ running as a standalone service, or httpd for being run by a httpd server")
'DEFAULT/osapi_volume_listen': value => $bind_host;
'DEFAULT/osapi_volume_workers': value => $service_workers;
'DEFAULT/os_region_name': value => $os_region_name;
- 'DEFAULT/default_volume_type': value => $default_volume_type;
'DEFAULT/public_endpoint': value => $public_endpoint;
'DEFAULT/osapi_volume_base_URL': value => $osapi_volume_base_url;
'DEFAULT/osapi_max_limit': value => $osapi_max_limit;
--
1.8.3.1