From e23f8bdc1ff186b4e1137b8ed4e1577def437878 Mon Sep 17 00:00:00 2001 From: Sachi King Date: Tue, 4 Nov 2014 16:28:17 +0100 Subject: [PATCH] Add glance_api_version to cinder config This allows the administrator of the cloud the ability to specify the glance API version. This is required for features such as Copy on Write (CoW) as Glance's v1 API does not expose enough information to allow Cinder to CoW the image. Change-Id: I3ba80207c22916629d210a23aad94bd143d2b00e Co-Authored-By: Craige McWhirter Closes-bug: #1390345 --- CHANGELOG.md | 1 + attributes/default.rb | 3 +++ spec/cinder_common_spec.rb | 4 ++++ templates/default/cinder.conf.erb | 3 +++ 4 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f418ba1..30f3eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This file is used to list changes made in each version of the openstack-block-st * Update gpfs volume driver path and fix gpfs_images_share_mode initialization * Change to cinder v2 service and endpoint * Add support for san_password with ibm.storwize_svc.StorwizeSVCDriver +* Add glance_api_version config option ## 10.0.0 * Upgrading to Juno diff --git a/attributes/default.rb b/attributes/default.rb index 0c86973..54965bf 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -97,6 +97,9 @@ default['openstack']['block-storage']['image']['glance_api_insecure'] = false # Location of ca certificates file to use for glance client requests default['openstack']['block-storage']['image']['glance_ca_certificates_file'] = nil +# Which version of the glance API cinder should use when talking to glance. +default['openstack']['block-storage']['image']['glance_api_version'] = 1 + # Maximum allocatable gigabytes # Should equal total backend storage, default is 10TB default['openstack']['block-storage']['max_gigabytes'] = '10000' diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 54af4c6..fdebf90 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -266,6 +266,10 @@ describe 'openstack-block-storage::cinder-common' do expect(chef_run).to render_file(file.name).with_content(%r{^glance_api_servers=scheme://host:port$}) end + it 'has glance_api_version attribute' do + expect(chef_run).to render_file(file.name).with_content(/^glance_api_version=1$/) + end + it 'has a glance_api_insecure attribute' do expect(chef_run).to render_file(file.name).with_content(/^glance_api_insecure=false$/) end diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index 9531946..a7ce154 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -94,6 +94,9 @@ glance_ca_certificates_file=<%= node['openstack']['block-storage']['image']['gla # glance_num_retries=0 #### (IntOpt) Number retries when downloading an image from glance +glance_api_version=<%= node['openstack']['block-storage']['image']['glance_api_version'] %> +#### (IntOpt) Version of the glance API to use + # scheduler_topic=cinder-scheduler #### (StrOpt) the topic scheduler nodes listen on