From 1433d5819f01631314dd3ea93f02583d7d5ae3eb Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Tue, 17 Jul 2018 14:44:26 -0400 Subject: [PATCH] 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 --- docker/services/cinder-api.yaml | 13 ++++++++++++- puppet/services/cinder-api.yaml | 5 +++++ ...cinder-default-volume-type-cc21a256202eb476.yaml | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/cinder-default-volume-type-cc21a256202eb476.yaml diff --git a/docker/services/cinder-api.yaml b/docker/services/cinder-api.yaml index 5d4dde5529..f335579242 100644 --- a/docker/services/cinder-api.yaml +++ b/docker/services/cinder-api.yaml @@ -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] diff --git a/puppet/services/cinder-api.yaml b/puppet/services/cinder-api.yaml index 5c31ef6a7f..98ce7b4820 100644 --- a/puppet/services/cinder-api.yaml +++ b/puppet/services/cinder-api.yaml @@ -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' diff --git a/releasenotes/notes/cinder-default-volume-type-cc21a256202eb476.yaml b/releasenotes/notes/cinder-default-volume-type-cc21a256202eb476.yaml new file mode 100644 index 0000000000..18dcf289ec --- /dev/null +++ b/releasenotes/notes/cinder-default-volume-type-cc21a256202eb476.yaml @@ -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 `__.