Browse Source

Handle image_volume_cache_enabled for PureStorage backend

Allows image_volume_cache_enabled to be set in the PureStorage
backend. This parameter will default to true if not set explicitly.

Change-Id: I9302dfde055c2e53bdb83bab4a873e00468e7ce1
Closes-bug: 1819055
(cherry picked from commit 14a59fe665)
changes/83/642883/3
Andrew Austin 3 years ago
parent
commit
9cb0c8d9fa
  1. 18
      manifests/backend/pure.pp
  2. 6
      releasenotes/notes/purestorage-handle-imagecache-6c2d78f91746bdbf.yaml
  3. 20
      spec/defines/cinder_backend_pure_spec.rb

18
manifests/backend/pure.pp

@ -20,20 +20,24 @@
# which Volume Driver will be configured; PureISCSIDriver or PureFCDriver.
# Defaults to 'iSCSI'
#
# [*use_multipath_for_image_xfer*]
# (optional) .
# Defaults to True
#
# [*use_chap_auth*]
# (optional) Only affects the PureISCSIDriver.
# (optional) Use authentication for iSCSI. Only affects the PureISCSIDriver.
# Defaults to False
#
# [*use_multipath_for_image_xfer*]
# (optional) Use multipath when attaching the volume for image transfer.
# Defaults to True
#
# [*manage_volume_type*]
# (Optional) Whether or not manage Cinder Volume type.
# If set to true, a Cinder Volume type will be created
# with volume_backend_name=$volume_backend_name key/value.
# Defaults to false.
#
# [*image_volume_cache_enabled*]
# (Optional) Enable Cinder's image cache function for the PureStorage
# backend.
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza.
# Defaults to: {}
@ -48,6 +52,7 @@ define cinder::backend::pure(
$use_chap_auth = false,
$use_multipath_for_image_xfer = true,
$manage_volume_type = false,
$image_volume_cache_enabled = $::os_service_default,
$extra_options = {},
) {
@ -64,7 +69,8 @@ define cinder::backend::pure(
"${name}/san_ip": value => $san_ip;
"${name}/pure_api_token": value => $pure_api_token, secret => true;
"${name}/use_chap_auth": value => $use_chap_auth;
"${name}/use_multipath_for_image_xfer": value => $use_multipath_for_image_xfer ;
"${name}/use_multipath_for_image_xfer": value => $use_multipath_for_image_xfer;
"${name}/image_volume_cache_enabled": value => $image_volume_cache_enabled;
}
if $manage_volume_type {

6
releasenotes/notes/purestorage-handle-imagecache-6c2d78f91746bdbf.yaml

@ -0,0 +1,6 @@
---
features:
- |
Add new parameter cinder::backend::pure::image_volume_cache_enabled
Allows setting of the image_volume_cache_enabled option on the managed
Cinder backend for PureStorage. The option defaults to True if unset.

20
spec/defines/cinder_backend_pure_spec.rb

@ -76,4 +76,24 @@ describe 'cinder::backend::pure' do
end
end
describe 'pure volume driver with image_volume_cache_enabled disabled' do
let :params do
req_params.merge({'image_volume_cache_enabled' => false})
end
it 'confiugre pure backend without image_volume_cache_enabled' do
is_expected.to contain_cinder_config('pure/image_volume_cache_enabled').with_value('false')
end
end
describe 'pure volume driver with image_volume_cache_enabled enabled' do
let :params do
req_params.merge({'image_volume_cache_enabled' => true})
end
it 'confiugre pure backend with image_volume_cache_enabled' do
is_expected.to contain_cinder_config('pure/image_volume_cache_enabled').with_value('true')
end
end
end
Loading…
Cancel
Save