Add support for reserved_percentage option

Some of the volume drivers support the reserved_percentage option which
determines the minimum free percentage kept. This introduces support
for this option.

Although the option is defined in the base volume driver class, it has
effect only in drivers with appropriate implementations.

Change-Id: I6060daab9fd72f96084b3d0c5cc5783da7f5c64c
This commit is contained in:
Takashi Kajinami 2023-10-19 23:02:25 +09:00
parent d4112d8a79
commit 5451b7135b
25 changed files with 136 additions and 31 deletions

View File

@ -40,6 +40,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*manage_volume_type*]
# (Optional) Whether or not manage Cinder Volume type.
# If set to true, a Cinder Volume type will be created
@ -62,6 +66,7 @@ define cinder::backend::dellemc_powermax (
Enum['iSCSI', 'FC'] $powermax_storage_protocol = 'iSCSI',
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
Hash $extra_options = {},
Boolean $manage_volume_type = false,
) {
@ -83,6 +88,7 @@ define cinder::backend::dellemc_powermax (
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => $volume_driver;
"${name}/san_ip": value => $san_ip;
"${name}/san_login": value => $san_login;

View File

@ -26,6 +26,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*unity_io_ports*]
# (optional) A list of iSCSI or FC ports to be used. Each port can be
# Unix-style glob expressions. The Unity Unisphere API port.
@ -54,6 +58,7 @@ define cinder::backend::dellemc_unity (
$storage_protocol,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
$unity_io_ports = $facts['os_service_default'],
$unity_storage_pool_names = $facts['os_service_default'],
Boolean $manage_volume_type = false,
@ -66,6 +71,7 @@ define cinder::backend::dellemc_unity (
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => "cinder.volume.drivers.${driver}";
"${name}/san_ip": value => $san_ip;
"${name}/san_login": value => $san_login;

View File

@ -26,6 +26,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*xtremio_array_busy_retry_count*]
# (optional) Number of retries in case array is busy.
# Defaults to $facts['os_service_default']
@ -69,6 +73,7 @@ define cinder::backend::dellemc_xtremio (
$xtremio_cluster_name,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
$xtremio_array_busy_retry_count = $facts['os_service_default'],
$xtremio_array_busy_retry_interval = $facts['os_service_default'],
$xtremio_volumes_per_glance_cache = $facts['os_service_default'],
@ -88,6 +93,7 @@ define cinder::backend::dellemc_xtremio (
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => "cinder.volume.drivers.${driver}";
"${name}/san_ip": value => $san_ip;
"${name}/san_login": value => $san_login;

View File

@ -16,6 +16,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*san_ip*]
# (required) IP address of SAN controller.
#
@ -121,6 +125,7 @@ define cinder::backend::emc_vnx (
$san_login = 'admin',
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
Hash $extra_options = {},
$volume_driver = 'cinder.volume.drivers.dell_emc.vnx.driver.VNXDriver',
$storage_protocol = 'iscsi',
@ -151,6 +156,7 @@ define cinder::backend::emc_vnx (
"${name}/storage_vnx_pool_names": value => join(any2array($storage_vnx_pool_names), ',');
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => $volume_driver;
"${name}/storage_protocol": value => $storage_protocol;
"${name}/destroy_empty_storage_group": value => $destroy_empty_storage_group;

View File

@ -37,6 +37,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*volume_driver*]
# (optional) Setup cinder-volume to use HPE 3par volume driver.
# Defaults to 'cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver'.
@ -81,6 +85,7 @@ define cinder::backend::hpe3par_iscsi(
$hpe3par_iscsi_ips,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
$volume_driver = 'cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver',
$hpe3par_iscsi_chap_enabled = false,
$hpe3par_cpg_snap = 'userCPG',
@ -99,6 +104,7 @@ define cinder::backend::hpe3par_iscsi(
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => $volume_driver;
"${name}/hpe3par_username": value => $hpe3par_username;
"${name}/hpe3par_password": value => $hpe3par_password, secret => true;

View File

@ -53,6 +53,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*manage_volume_type*]
# (Optional) Whether or not manage Cinder Volume type.
# If set to true, a Cinder Volume type will be created
@ -77,6 +81,7 @@ define cinder::backend::ibm_svf (
$storwize_portset = $facts['os_service_default'],
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
Hash $extra_options = {},
Boolean $manage_volume_type = false,
) {
@ -93,6 +98,7 @@ define cinder::backend::ibm_svf (
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => $volume_driver;
"${name}/san_ip": value => $san_ip;
"${name}/san_login": value => $san_login;

View File

@ -17,6 +17,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*volume_driver*]
# (Optional) Driver to use for volume creation
# Defaults to 'cinder.volume.drivers.lvm.LVMVolumeDriver'.
@ -53,6 +57,7 @@ define cinder::backend::iscsi (
$target_ip_address = $facts['os_service_default'],
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
$volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver',
$volume_group = $facts['os_service_default'],
$volumes_dir = '/var/lib/cinder/volumes',
@ -82,6 +87,7 @@ define cinder::backend::iscsi (
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => $volume_driver;
"${name}/target_ip_address": value => $target_ip_address;
"${name}/target_helper": value => $target_helper_real;

View File

@ -27,6 +27,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*netapp_server_port*]
# (optional) The TCP port to use for communication with the storage
# system or proxy. If not specified, Data ONTAP drivers will use 80
@ -172,6 +176,7 @@ define cinder::backend::netapp (
$netapp_server_hostname,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
$netapp_server_port = $facts['os_service_default'],
$netapp_size_multiplier = $facts['os_service_default'],
$netapp_storage_family = $facts['os_service_default'],
@ -213,6 +218,7 @@ and will be removed in a future release.")
"${name}/nfs_mount_options": value => $nfs_mount_options;
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => 'cinder.volume.drivers.netapp.common.NetAppDriver';
"${name}/netapp_login": value => $netapp_login;
"${name}/netapp_password": value => $netapp_password, secret => true;

View File

@ -23,6 +23,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*nexenta_volume*]
# (optional) Pool on SA that will hold all volumes.
# Defaults to 'cinder'.
@ -69,6 +73,7 @@ define cinder::backend::nexenta (
$nexenta_host,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
$nexenta_volume = 'cinder',
$nexenta_target_prefix = 'iqn:',
$nexenta_target_group_prefix = 'cinder/',
@ -85,6 +90,7 @@ define cinder::backend::nexenta (
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/nexenta_user": value => $nexenta_user;
"${name}/nexenta_password": value => $nexenta_password, secret => true;
"${name}/nexenta_host": value => $nexenta_host;

View File

@ -21,6 +21,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*pure_storage_protocol*]
# (optional) Must be either 'iSCSI', 'FC' or 'NVMe'. This will determine
# which Volume Driver will be configured; PureISCSIDriver, PureFCDriver
@ -97,6 +101,7 @@ define cinder::backend::pure(
$pure_api_token,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
Enum['iSCSI', 'FC', 'NVMe'] $pure_storage_protocol = 'iSCSI',
$use_chap_auth = false,
$use_multipath_for_image_xfer = true,
@ -123,6 +128,7 @@ define cinder::backend::pure(
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => $volume_driver;
"${name}/san_ip": value => $san_ip;
"${name}/pure_api_token": value => $pure_api_token, secret => true;

View File

@ -27,6 +27,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*rbd_ceph_conf*]
# (optional) Path to the ceph configuration file to use
# Defaults to '/etc/ceph/ceph.conf'
@ -90,6 +94,7 @@ define cinder::backend::rbd (
$backend_host = undef,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
$rbd_ceph_conf = '/etc/ceph/ceph.conf',
$rbd_flatten_volume_from_snapshot = $facts['os_service_default'],
$rbd_secret_uuid = $facts['os_service_default'],
@ -118,6 +123,7 @@ define cinder::backend::rbd (
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => 'cinder.volume.drivers.rbd.RBDDriver';
"${name}/rbd_ceph_conf": value => $rbd_ceph_conf;
"${name}/rbd_user": value => $rbd_user;

View File

@ -15,6 +15,10 @@
# is used as the default for all backends.
# Defaults to $facts['os_service_default'].
#
# [*reserved_percentage*]
# (Optional) The percentage of backend capacity is reserved.
# Defaults to $facts['os_service_default'].
#
# [*volume_driver*]
# (optional) Setup cinder-volume to use SolidFire volume driver.
# Defaults to 'cinder.volume.drivers.solidfire.SolidFireDriver'
@ -105,6 +109,7 @@ define cinder::backend::solidfire(
$san_password,
$volume_backend_name = $name,
$backend_availability_zone = $facts['os_service_default'],
$reserved_percentage = $facts['os_service_default'],
$volume_driver = 'cinder.volume.drivers.solidfire.SolidFireDriver',
$sf_emulate_512 = $facts['os_service_default'],
$sf_allow_tenant_qos = $facts['os_service_default'],
@ -128,6 +133,7 @@ define cinder::backend::solidfire(
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/reserved_percentage": value => $reserved_percentage;
"${name}/volume_driver": value => $volume_driver;
"${name}/san_ip": value => $san_ip;
"${name}/san_login": value => $san_login;

View File

@ -0,0 +1,6 @@
---
features:
- |
The ``reserved_percentage`` parameter has been added. Note that
the parameter is available in the defined resource types for the volume
drivers which actually uses the option.

View File

@ -30,6 +30,7 @@ describe 'cinder::backend::dellemc_powermax' do
is_expected.to contain_cinder_config("#{title}/powermax_srp").with_value('SRP_1')
is_expected.to contain_cinder_config("#{title}/powermax_port_groups").with_value('[OS-ISCSI-PG]')
is_expected.to contain_cinder_config("#{title}/backend_availability_zone").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{title}/reserved_percentage").with_value('<SERVICE DEFAULT>')
is_expected.to contain_package('pywbem').with(
:ensure => 'installed',
@ -79,13 +80,17 @@ describe 'cinder::backend::dellemc_powermax' do
end
end
context 'with custom backend_availability_zone' do
context 'with parameters' do
before do
params.merge!(:backend_availability_zone => 'my_zone')
params.merge!({
:backend_availability_zone => 'my_zone',
:reserved_percentage => 10,
})
end
it 'should configure the backend_availability_zone' do
it 'should configure the customized values' do
is_expected.to contain_cinder_config("#{title}/backend_availability_zone").with_value('my_zone')
is_expected.to contain_cinder_config("#{title}/reserved_percentage").with_value(10)
end
end

View File

@ -17,6 +17,7 @@ describe 'cinder::backend::dellemc_unity' do
let :default_params do
{
:backend_availability_zone => '<SERVICE DEFAULT>',
:reserved_percentage => '<SERVICE DEFAULT>',
:unity_io_ports => '<SERVICE DEFAULT>',
:unity_storage_pool_names => '<SERVICE DEFAULT>',
}
@ -25,6 +26,7 @@ describe 'cinder::backend::dellemc_unity' do
let :custom_params do
{
:backend_availability_zone => 'my_zone',
:reserved_percentage => 10,
:unity_io_ports => '1,42,66',
:unity_storage_pool_names => 'pool_1,pool_2',
}

View File

@ -17,6 +17,7 @@ describe 'cinder::backend::dellemc_xtremio' do
let :default_params do
{
:backend_availability_zone => '<SERVICE DEFAULT>',
:reserved_percentage => '<SERVICE DEFAULT>',
:xtremio_array_busy_retry_count => '<SERVICE DEFAULT>',
:xtremio_array_busy_retry_interval => '<SERVICE DEFAULT>',
:xtremio_volumes_per_glance_cache => '<SERVICE DEFAULT>',
@ -27,6 +28,7 @@ describe 'cinder::backend::dellemc_xtremio' do
let :custom_params do
{
:backend_availability_zone => 'my_zone',
:reserved_percentage => 10,
:xtremio_array_busy_retry_count => 15,
:xtremio_array_busy_retry_interval => 6,
:xtremio_volumes_per_glance_cache => 100,

View File

@ -37,6 +37,7 @@ describe 'cinder::backend::emc_vnx' do
is_expected.to contain_cinder_config('emc/storage_vnx_security_file_dir').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('emc/naviseccli_path').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('emc/backend_availability_zone').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('emc/reserved_percentage').with_value('<SERVICE DEFAULT>')
}
end
@ -58,6 +59,7 @@ describe 'cinder::backend::emc_vnx' do
:manage_volume_type => true,
:storage_protocol => 'fc',
:backend_availability_zone => 'my_zone',
:reserved_percentage => 10,
})
end
@ -76,6 +78,7 @@ describe 'cinder::backend::emc_vnx' do
is_expected.to contain_cinder_config('emc/naviseccli_path').with_value(params[:naviseccli_path])
is_expected.to contain_cinder_config('emc/storage_protocol').with_value(params[:storage_protocol])
is_expected.to contain_cinder_config('emc/backend_availability_zone').with_value(params[:backend_availability_zone])
is_expected.to contain_cinder_config('emc/reserved_percentage').with_value(params[:reserved_percentage])
}
it { is_expected.to contain_cinder_type('emc').with(

View File

@ -5,7 +5,6 @@ describe 'cinder::backend::hpe3par_iscsi' do
let :req_params do
{
:backend_availability_zone => 'my_zone',
:hpe3par_api_url => 'https://172.0.0.2:8080/api/v1',
:hpe3par_username => '3paradm',
:hpe3par_password => 'password',
@ -21,10 +20,11 @@ describe 'cinder::backend::hpe3par_iscsi' do
end
shared_examples 'cinder::backend::hpe3par_iscsi' do
context 'hpe3par_iscsi volume driver' do
context 'with default parameters' do
it {
is_expected.to contain_cinder_config('hpe3par_iscsi/volume_driver').with_value('cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver')
is_expected.to contain_cinder_config('hpe3par_iscsi/backend_availability_zone').with_value('my_zone')
is_expected.to contain_cinder_config('hpe3par_iscsi/backend_availability_zone').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('hpe3par_iscsi/reserved_percentage').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_api_url').with_value('https://172.0.0.2:8080/api/v1')
is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_username').with_value('3paradm')
is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_password').with_value('password')
@ -35,6 +35,19 @@ describe 'cinder::backend::hpe3par_iscsi' do
}
end
context 'with parameters' do
before :each do
params.merge!({
:backend_availability_zone => 'my_zone',
:reserved_percentage => 10,
})
end
it {
is_expected.to contain_cinder_config('hpe3par_iscsi/backend_availability_zone').with_value('my_zone')
is_expected.to contain_cinder_config('hpe3par_iscsi/reserved_percentage').with_value(10)
}
end
context 'hpe3par_iscsi backend with additional configuration' do
before :each do
params.merge!( :extra_options => {'hpe3par_iscsi/param1' => {'value' => 'value1'}} )

View File

@ -30,6 +30,7 @@ describe 'cinder::backend::ibm_svf' do
is_expected.to contain_cinder_config("#{title}/storwize_svc_retain_aux_volume").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{title}/storwize_portset").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{title}/backend_availability_zone").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{title}/reserved_percentage").with_value('<SERVICE DEFAULT>')
end
end
@ -55,13 +56,17 @@ describe 'cinder::backend::ibm_svf' do
end
end
context 'with custom backend_availability_zone' do
context 'with parameters' do
before do
params.merge!(:backend_availability_zone => 'my_zone')
params.merge!(
:backend_availability_zone => 'my_zone',
:reserved_percentage => 10,
)
end
it 'should configure the backend_availability_zone' do
it 'should configure the customized values' do
is_expected.to contain_cinder_config("#{title}/backend_availability_zone").with_value('my_zone')
is_expected.to contain_cinder_config("#{title}/reserved_percentage").with_value(10)
end
end

View File

@ -8,6 +8,7 @@ describe 'cinder::backend::iscsi' do
it {
is_expected.to contain_cinder_config('hippo/volume_backend_name').with_value('hippo')
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('hippo/reserved_percentage').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('hippo/volume_driver').with_value('cinder.volume.drivers.lvm.LVMVolumeDriver')
is_expected.to contain_cinder_config('hippo/target_ip_address').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('hippo/target_helper').with_value(platform_params[:target_helper])
@ -21,6 +22,7 @@ describe 'cinder::backend::iscsi' do
let :params do
{
:backend_availability_zone => 'nova',
:reserved_percentage => 10,
:target_ip_address => '192.0.2.1',
:volume_group => 'volumegroup',
:volumes_dir => '/etc/cinder/volumes',
@ -29,6 +31,7 @@ describe 'cinder::backend::iscsi' do
end
it {
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('nova')
is_expected.to contain_cinder_config('hippo/reserved_percentage').with_value(10)
is_expected.to contain_cinder_config('hippo/target_ip_address').with_value('192.0.2.1')
is_expected.to contain_cinder_config('hippo/volume_group').with_value('volumegroup')
is_expected.to contain_cinder_config('hippo/volumes_dir').with_value('/etc/cinder/volumes')

View File

@ -6,7 +6,6 @@ describe 'cinder::backend::netapp' do
let :params do
{
:volume_backend_name => 'netapp-cdot-nfs',
:backend_availability_zone => 'my_zone',
:netapp_login => 'netapp',
:netapp_password => 'password',
:netapp_server_hostname => '127.0.0.2',
@ -18,6 +17,7 @@ describe 'cinder::backend::netapp' do
let :default_params do
{
:backend_availability_zone => '<SERVICE DEFAULT>',
:reserved_percentage => '<SERVICE DEFAULT>',
:netapp_server_port => '<SERVICE DEFAULT>',
:netapp_size_multiplier => '<SERVICE DEFAULT>',
:netapp_storage_family => '<SERVICE DEFAULT>',
@ -55,14 +55,6 @@ describe 'cinder::backend::netapp' do
shared_examples 'cinder::backend::netapp' do
context 'with default parameters' do
before do
params = {}
end
it_behaves_like 'netapp volume driver'
end
context 'with provided parameters' do
it_behaves_like 'netapp volume driver'
end

View File

@ -24,6 +24,7 @@ describe 'cinder::backend::nexenta' do
:nexenta_rest_port => '8457',
:volume_driver => 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver',
:backend_availability_zone => '<SERVICE DEFAULT>',
:reserved_percentage => '<SERVICE DEFAULT>',
}
end

View File

@ -18,6 +18,8 @@ describe 'cinder::backend::pure' do
it {
is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver')
is_expected.to contain_cinder_config('pure/backend_availability_zone').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('pure/reserved_percentage').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
@ -34,6 +36,7 @@ describe 'cinder::backend::pure' do
let :params do
req_params.merge({
:backend_availability_zone => 'my_zone',
:reserved_percentage => 10,
:pure_storage_protocol => 'iSCSI',
:use_chap_auth => 'true',
})
@ -42,6 +45,7 @@ describe 'cinder::backend::pure' do
it {
is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver')
is_expected.to contain_cinder_config('pure/backend_availability_zone').with_value('my_zone')
is_expected.to contain_cinder_config('pure/reserved_percentage').with_value(10)
is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')

View File

@ -30,6 +30,8 @@ describe 'cinder::backend::rbd' do
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_user").with_value(req_params[:rbd_user])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_secret_uuid").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/backend_host").with_value('rbd:'"#{req_params[:rbd_pool]}")
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/backend_availability_zone").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/reserved_percentage").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connect_timeout").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_interval").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_retries").with_value('<SERVICE DEFAULT>')
@ -42,6 +44,9 @@ describe 'cinder::backend::rbd' do
context 'with parameters' do
let :params do
req_params.merge!({
:backend_host => 'test_host.fqdn.com',
:backend_availability_zone => 'my_zone',
:reserved_percentage => 10,
:rbd_ceph_conf => '/opt/ceph.conf',
:rbd_flatten_volume_from_snapshot => true,
:rbd_secret_uuid => 'b129523a-61a5-4653-86d1-2b055f970801',
@ -65,7 +70,9 @@ describe 'cinder::backend::rbd' do
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_pool").with_value(req_params[:rbd_pool])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_user").with_value(req_params[:rbd_user])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_secret_uuid").with_value(params[:rbd_secret_uuid])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/backend_host").with_value('rbd:'"#{req_params[:rbd_pool]}")
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/backend_host").with_value('test_host.fqdn.com')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/backend_availability_zone").with_value('my_zone')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/reserved_percentage").with_value(10)
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connect_timeout").with_value(params[:rados_connect_timeout])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_interval").with_value(params[:rados_connection_interval])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_retries").with_value(params[:rados_connection_retries])
@ -103,18 +110,6 @@ describe 'cinder::backend::rbd' do
it { is_expected.to contain_cinder_config('rbd-ssd/param1').with_value('value1') }
end
context 'override backend_host and backend_availability_zone parameters' do
before do
params.merge!({
:backend_host => 'test_host.fqdn.com',
:backend_availability_zone => 'my_zone',
})
end
it { is_expected.to contain_cinder_config('rbd-ssd/backend_host').with_value('test_host.fqdn.com') }
it { is_expected.to contain_cinder_config('rbd-ssd/backend_availability_zone').with_value('my_zone') }
end
context 'rbd backend with cinder type' do
before do
params.merge!( :manage_volume_type => true )

View File

@ -16,6 +16,7 @@ describe 'cinder::backend::solidfire' do
let :default_params do
{
:backend_availability_zone => '<SERVICE DEFAULT>',
:reserved_percentage => '<SERVICE DEFAULT>',
:sf_emulate_512 => '<SERVICE DEFAULT>',
:sf_allow_tenant_qos => '<SERVICE DEFAULT>',
:sf_account_prefix => '<SERVICE DEFAULT>',
@ -35,6 +36,7 @@ describe 'cinder::backend::solidfire' do
let :other_params do
{
:backend_availability_zone => 'az1',
:reserved_percentage => 10,
:sf_emulate_512 => true,
:sf_allow_tenant_qos => false,
:sf_account_prefix => 'acc_prefix',