Ensure Cinder has a default volume type

This patch adds a CinderDefaultVolumeType parameter, and does two
things:

1. Configures the default_volume_type in /etc/cinder/cinder.conf
2. Ensures the volume type exists

The cinder::api puppet module supports configuring the default_volume_type,
and this patch simply sets the corresponding hiera value.

The cinder::type puppet resource is used to ensure the default volume
type exists. This is done using docker_puppet_tasks so that it executes
after the Cinder services are running. This is necessary because the
cinder::type puppet provider executes osc commands.

Closes-Bug: #1782217
Depends-On: Ia23996abefdd1410fb86f04ed84a314f4364339c
Change-Id: I99496aa82bb66eccd86f0e482f1fbdc656c07c5d
This commit is contained in:
Alan Bishop 2018-07-17 14:44:26 -04:00
parent d8b7b192ae
commit 1433d5819f
3 changed files with 24 additions and 1 deletions

View File

@ -90,7 +90,7 @@ outputs:
# BEGIN DOCKER SETTINGS
puppet_config:
config_volume: cinder
puppet_tags: cinder_config,file,concat,file_line
puppet_tags: cinder_config,cinder_type,file,concat,file_line
step_config:
list_join:
- "\n"
@ -196,6 +196,17 @@ outputs:
- /var/log/containers/httpd/cinder-api:/var/log/httpd
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
docker_puppet_tasks:
# Create the default volume type after the cinder-api service is
# running. The puppet code will ensure this is only done once, on
# the bootstrap node.
step_4:
config_volume: 'cinder_init_tasks'
puppet_tags: cinder_config,cinder_type,file,concat,file_line
step_config: 'include ::tripleo::profile::base::cinder::api'
config_image: *cinder_api_image
volumes:
- /var/lib/config-data/cinder/etc/cinder/:/etc/cinder/:ro
metadata_settings:
get_attr: [CinderBase, role_data, metadata_settings]

View File

@ -4,6 +4,10 @@ description: >
OpenStack Cinder API service configured with Puppet
parameters:
CinderDefaultVolumeType:
default: tripleo
description: The name of Cinder's default volume type.
type: string
CinderEnableDBPurge:
default: true
description: |
@ -116,6 +120,7 @@ outputs:
cinder::keystone::authtoken::project_domain_name: 'Default'
cinder::policy::policies: {get_param: CinderApiPolicies}
cinder::ceilometer::notification_driver: {get_param: NotificationDriver}
cinder::api::default_volume_type: {get_param: CinderDefaultVolumeType}
cinder::api::enable_proxy_headers_parsing: true
cinder::api::nova_catalog_info: 'compute:nova:internalURL'

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Avoid life cycle issues with Cinder volumes by ensuring Cinder has a
default volume type. The name of the default volume type is controlled by
a new CinderDefaultVolumeType parameter, which defaults to "tripleo".
Fixes `bug 1782217 <https://bugs.launchpad.net/tripleo/+bug/1782217>`__.