From 2ce1ddfd83361d51228720ff1116020a98b5e949 Mon Sep 17 00:00:00 2001 From: Arnaud Morin Date: Wed, 18 Oct 2017 16:45:50 +0200 Subject: [PATCH] Add swift_store_large_object_chunk_size parameter Add a new parameter to swift backend to let user set the chunk size when glance will start chunking the images before uploading. Change-Id: I9984bdb416ec9d874345b410557ef42c360232fb Signed-off-by: Arnaud Morin --- manifests/backend/swift.pp | 13 ++++++++++++- ...bject_chunk_size_parameter-98f34404c5a61843.yaml | 8 ++++++++ spec/classes/glance_backend_swift_spec.rb | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/add_swift_store_large_object_chunk_size_parameter-98f34404c5a61843.yaml diff --git a/manifests/backend/swift.pp b/manifests/backend/swift.pp index 516d5515..c24c8dcd 100644 --- a/manifests/backend/swift.pp +++ b/manifests/backend/swift.pp @@ -27,7 +27,15 @@ # Optional. Default: '2' # # [*swift_store_large_object_size*] -# Optional. Default: $::os_service_default. +# Optional. What size, in MB, should Glance start chunking image files +# and do a large object manifest in Swift? +# Default: $::os_service_default. +# +# [*swift_store_large_object_chunk_size*] +# Optional. When doing a large object manifest, what size, in MB, should +# Glance write chunks to Swift? This amount of data is written +# to a temporary disk buffer during the process of chunking. +# Default: $::os_service_default. # # [*swift_store_create_container_on_put*] # Optional. Default: $::os_service_default. @@ -63,6 +71,7 @@ class glance::backend::swift( $swift_store_auth_project_domain_id = 'default', $swift_store_auth_user_domain_id = 'default', $swift_store_large_object_size = $::os_service_default, + $swift_store_large_object_chunk_size = $::os_service_default, $swift_store_create_container_on_put = $::os_service_default, $swift_store_endpoint_type = 'internalURL', $swift_store_region = $::os_service_default, @@ -89,6 +98,8 @@ you should use puppet-glare module for configuring Glare service.") value => $swift_store_create_container_on_put; 'glance_store/swift_store_large_object_size': value => $swift_store_large_object_size; + 'glance_store/swift_store_large_object_chunk_size': + value => $swift_store_large_object_chunk_size; 'glance_store/swift_store_endpoint_type': value => $swift_store_endpoint_type; diff --git a/releasenotes/notes/add_swift_store_large_object_chunk_size_parameter-98f34404c5a61843.yaml b/releasenotes/notes/add_swift_store_large_object_chunk_size_parameter-98f34404c5a61843.yaml new file mode 100644 index 00000000..da721934 --- /dev/null +++ b/releasenotes/notes/add_swift_store_large_object_chunk_size_parameter-98f34404c5a61843.yaml @@ -0,0 +1,8 @@ +--- +features: + - Add new option glance::backend::swift::swift_store_large_object_chunk_size + The swift_store_large_object_chunk_size is to be used in conjunction with + swift_store_large_object_size. + While swift_store_large_object_size is the trigger for glance to start + chunking images, swift_store_large_object_chunk_size is the size of the + chunks. diff --git a/spec/classes/glance_backend_swift_spec.rb b/spec/classes/glance_backend_swift_spec.rb index e1d8ac42..796807d8 100644 --- a/spec/classes/glance_backend_swift_spec.rb +++ b/spec/classes/glance_backend_swift_spec.rb @@ -21,6 +21,7 @@ describe 'glance::backend::swift' do it 'configures glance-api.conf' do is_expected.to contain_glance_api_config('glance_store/default_store').with_value('swift') is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('') + is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_chunk_size').with_value('') is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('') is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value('') is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('internalURL') @@ -45,6 +46,7 @@ describe 'glance::backend::swift' do :swift_store_auth_project_domain_id => 'proj_domain', :swift_store_auth_user_domain_id => 'user_domain', :swift_store_large_object_size => '100', + :swift_store_large_object_chunk_size => '50', :swift_store_auth_address => '127.0.0.2:8080/v1.0/', :swift_store_container => 'swift', :swift_store_create_container_on_put => true, @@ -58,6 +60,7 @@ describe 'glance::backend::swift' do is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('swift') is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value(true) is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_size').with_value('100') + is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_chunk_size').with_value('50') is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('publicURL') is_expected.to contain_glance_api_config('glance_store/swift_store_region').with_value('RegionTwo') is_expected.to contain_glance_api_config('glance_store/default_swift_reference').with_value('swift_creds')