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 <arnaud.morin@corp.ovh.com>
(cherry picked from commit 2ce1ddfd83)
This commit is contained in:
Arnaud Morin 2017-10-18 16:45:50 +02:00 committed by Arnaud Morin
parent 689782710c
commit 965d33582f
3 changed files with 23 additions and 1 deletions

View File

@ -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.
@ -61,6 +69,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,
@ -81,6 +90,8 @@ class glance::backend::swift(
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;

View File

@ -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.

View File

@ -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('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/swift_store_large_object_chunk_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/swift_store_container').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/swift_store_create_container_on_put').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('internalURL')
@ -56,6 +57,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,
@ -70,6 +72,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')