Merge "Allow to manage Cinder Volume types from backends"
This commit is contained in:
commit
a97128fb2b
@ -40,6 +40,12 @@
|
||||
# (Optional) Method used to wipe old volumes
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend
|
||||
# Defaults to: {}
|
||||
@ -67,6 +73,7 @@ define cinder::backend::bdd (
|
||||
$iscsi_helper = 'tgtadm',
|
||||
$iscsi_protocol = $::os_service_default,
|
||||
$volume_clear = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -84,6 +91,13 @@ define cinder::backend::bdd (
|
||||
"${name}/volume_clear": value => $volume_clear;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
case $iscsi_helper {
|
||||
|
@ -49,6 +49,12 @@
|
||||
# Example:
|
||||
# { 'dellsc_iscsi_backend/param1' => { 'value' => value1 } }
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
define cinder::backend::dellsc_iscsi (
|
||||
$san_ip,
|
||||
$san_login,
|
||||
@ -61,6 +67,7 @@ define cinder::backend::dellsc_iscsi (
|
||||
$dell_sc_verify_cert = $::os_service_default,
|
||||
$dell_sc_volume_folder = 'vol',
|
||||
$iscsi_port = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -88,6 +95,13 @@ define cinder::backend::dellsc_iscsi (
|
||||
"${name}/iscsi_port": value => $iscsi_port;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -66,6 +66,12 @@
|
||||
# (optional) Naviseccli Path.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
define cinder::backend::emc_vnx (
|
||||
$iscsi_ip_address,
|
||||
$san_ip,
|
||||
@ -82,6 +88,7 @@ define cinder::backend::emc_vnx (
|
||||
$storage_vnx_auth_type = $::os_service_default,
|
||||
$storage_vnx_security_file_dir = $::os_service_default,
|
||||
$naviseccli_path = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
) {
|
||||
|
||||
include ::cinder::params
|
||||
@ -102,6 +109,13 @@ define cinder::backend::emc_vnx (
|
||||
"${name}/storage_vnx_security_file_dir": value => $storage_vnx_security_file_dir;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -55,6 +55,12 @@
|
||||
# (optional) The timeout for the Group Manager cli command execution.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# === DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*eqlx_use_chap*]
|
||||
@ -88,6 +94,7 @@ define cinder::backend::eqlx (
|
||||
$chap_password = $::os_service_default,
|
||||
$use_chap_auth = $::os_service_default,
|
||||
$ssh_conn_timeout = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
# Deprecated
|
||||
$eqlx_use_chap = undef,
|
||||
$eqlx_chap_login = undef,
|
||||
@ -145,6 +152,13 @@ define cinder::backend::eqlx (
|
||||
"${name}/eqlx_pool": value => $eqlx_pool;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${name}"],
|
||||
}
|
||||
}
|
||||
|
||||
# the default for this is false
|
||||
if !is_service_default($use_chap_auth_real) and $use_chap_auth_real == true {
|
||||
cinder_config {
|
||||
|
@ -41,6 +41,12 @@
|
||||
# Example :
|
||||
# { 'glusterfs_backend/param1' => { 'value' => value1 } }
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# === Examples
|
||||
#
|
||||
# cinder::backend::glusterfs { 'myGluster':
|
||||
@ -55,6 +61,7 @@ define cinder::backend::glusterfs (
|
||||
$glusterfs_sparsed_volumes = $::os_service_default,
|
||||
$glusterfs_mount_point_base = $::os_service_default,
|
||||
$glusterfs_shares_config = '/etc/cinder/shares.conf',
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -77,6 +84,13 @@ define cinder::backend::glusterfs (
|
||||
"${name}/glusterfs_mount_point_base": value => $glusterfs_mount_point_base;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -64,6 +64,12 @@
|
||||
# (optional) SSH port to use to connect to NAS system.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -90,6 +96,7 @@ define cinder::backend::gpfs (
|
||||
$nas_password = $::os_service_default,
|
||||
$nas_private_key = $::os_service_default,
|
||||
$nas_ssh_port = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -116,6 +123,13 @@ define cinder::backend::gpfs (
|
||||
"${name}/nas_ssh_port": value => $nas_ssh_port;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -53,6 +53,12 @@
|
||||
# than hp3par_snapshot_retention.
|
||||
# Defaults to 72.
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -73,6 +79,7 @@ define cinder::backend::hp3par_iscsi(
|
||||
$hp3par_snap_cpg = 'OpenstackCPG',
|
||||
$hp3par_snapshot_retention = 48,
|
||||
$hp3par_snapshot_expiration = 72,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -98,6 +105,13 @@ define cinder::backend::hp3par_iscsi(
|
||||
"${name}/hpe3par_snapshot_expiration": value => $hp3par_snapshot_expiration;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -54,6 +54,12 @@
|
||||
# than hpe3par_snapshot_retention.
|
||||
# Defaults to 72.
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -74,6 +80,7 @@ define cinder::backend::hpe3par_iscsi(
|
||||
$hpe3par_cpg_snap = 'userCPG',
|
||||
$hpe3par_snapshot_retention = 48,
|
||||
$hpe3par_snapshot_expiration = 72,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -97,6 +104,13 @@ define cinder::backend::hpe3par_iscsi(
|
||||
"${name}/hpe3par_snapshot_expiration": value => $hpe3par_snapshot_expiration;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -30,6 +30,12 @@
|
||||
# (Optional) Protocol to use as iSCSI driver
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -44,6 +50,7 @@ define cinder::backend::iscsi (
|
||||
$volumes_dir = '/var/lib/cinder/volumes',
|
||||
$iscsi_helper = $::cinder::params::iscsi_helper,
|
||||
$iscsi_protocol = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -59,6 +66,13 @@ define cinder::backend::iscsi (
|
||||
"${name}/iscsi_protocol": value => $iscsi_protocol;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
case $iscsi_helper {
|
||||
|
@ -152,6 +152,12 @@
|
||||
# application.
|
||||
# Defaults to '/devmgr/v2'
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -211,6 +217,7 @@ define cinder::backend::netapp (
|
||||
$netapp_storage_pools = undef,
|
||||
$netapp_host_type = $::os_service_default,
|
||||
$netapp_webservice_path = '/devmgr/v2',
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
# DEPRECATED PARAMETERS
|
||||
$netapp_eseries_host_type = undef,
|
||||
@ -260,6 +267,13 @@ define cinder::backend::netapp (
|
||||
"${name}/netapp_webservice_path": value => $netapp_webservice_path;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${name}"],
|
||||
}
|
||||
}
|
||||
|
||||
if $netapp_storage_family == 'eseries' {
|
||||
cinder_config {
|
||||
"${name}/use_multipath_for_image_xfer": value => true;
|
||||
|
@ -32,6 +32,12 @@
|
||||
# [*nexenta_sparse*]
|
||||
# (optional) Flag to create sparse volumes. Defaults to true.
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -48,6 +54,7 @@ define cinder::backend::nexenta (
|
||||
$nexenta_target_group_prefix = 'cinder/',
|
||||
$nexenta_blocksize = '8k',
|
||||
$nexenta_sparse = true,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -64,6 +71,13 @@ define cinder::backend::nexenta (
|
||||
"${name}/volume_driver": value => 'cinder.volume.drivers.nexenta.volume.NexentaDriver';
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -49,6 +49,12 @@
|
||||
# longer be valid.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -66,6 +72,7 @@ define cinder::backend::nfs (
|
||||
$nfs_shares_config = '/etc/cinder/shares.conf',
|
||||
$nfs_used_ratio = $::os_service_default,
|
||||
$nfs_oversub_ratio = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -89,6 +96,13 @@ define cinder::backend::nfs (
|
||||
"${name}/nfs_oversub_ratio": value => $nfs_oversub_ratio;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,12 @@
|
||||
# (optional) Only affects the PureISCSIDriver.
|
||||
# Defaults to False
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza.
|
||||
# Defaults to: {}
|
||||
@ -41,6 +47,7 @@ define cinder::backend::pure(
|
||||
$pure_storage_protocol = 'iSCSI',
|
||||
$use_chap_auth = false,
|
||||
$use_multipath_for_image_xfer = true,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -58,5 +65,12 @@ define cinder::backend::pure(
|
||||
"${name}/use_multipath_for_image_xfer": value => $use_multipath_for_image_xfer ;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
}
|
||||
|
@ -34,6 +34,12 @@
|
||||
# (optional) Allows for the volume_backend_name to be separate of $name.
|
||||
# Defaults to: $name
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# === Examples
|
||||
#
|
||||
# cinder::backend::quobyte { 'quobyte1':
|
||||
@ -47,6 +53,7 @@ define cinder::backend::quobyte (
|
||||
$quobyte_sparsed_volumes = undef,
|
||||
$quobyte_mount_point_base = undef,
|
||||
$volume_backend_name = $name,
|
||||
$manage_volume_type = false,
|
||||
) {
|
||||
|
||||
cinder_config {
|
||||
@ -60,4 +67,11 @@ define cinder::backend::quobyte (
|
||||
"${name}/quobyte_mount_point_base": value => $quobyte_mount_point_base;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -57,6 +57,12 @@
|
||||
# (optional) Volumes will be chunked into objects of this size (in megabytes).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -83,6 +89,7 @@ define cinder::backend::rbd (
|
||||
$rados_connection_interval = $::os_service_default,
|
||||
$rados_connection_retries = $::os_service_default,
|
||||
$rbd_store_chunk_size = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
# DEPRECATED PARAMETERS
|
||||
$volume_tmp_dir = false,
|
||||
@ -105,6 +112,13 @@ define cinder::backend::rbd (
|
||||
"${name}/rbd_store_chunk_size": value => $rbd_store_chunk_size;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
if $backend_host {
|
||||
cinder_config {
|
||||
"${name}/backend_host": value => $backend_host;
|
||||
|
@ -50,6 +50,12 @@
|
||||
# (Optional) Maximum ssh connections in the pool.
|
||||
# Defaults to '5'.
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -70,6 +76,7 @@ define cinder::backend::san (
|
||||
$ssh_conn_timeout = 30,
|
||||
$ssh_min_pool_conn = 1,
|
||||
$ssh_max_pool_conn = 5,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -89,6 +96,13 @@ define cinder::backend::san (
|
||||
"${name}/ssh_max_pool_conn": value => $ssh_max_pool_conn;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -70,6 +70,12 @@
|
||||
# (optional) Utilize volume access groups on a per-tenant basis.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -92,6 +98,7 @@ define cinder::backend::solidfire(
|
||||
$sf_svip = $::os_service_default,
|
||||
$sf_enable_volume_mapping = $::os_service_default,
|
||||
$sf_enable_vag = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -113,6 +120,13 @@ define cinder::backend::solidfire(
|
||||
"${name}/sf_enable_vag": value => $sf_enable_vag;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
|
||||
}
|
||||
|
@ -49,6 +49,12 @@
|
||||
# (optional) The name for the folder in the VC datacenter that will contain cinder volumes.
|
||||
# Defaults to 'cinder-volumes'.
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend stanza
|
||||
# Defaults to: {}
|
||||
@ -66,6 +72,7 @@ define cinder::backend::vmdk (
|
||||
$task_poll_interval = 5,
|
||||
$image_transfer_timeout_secs = $::os_service_default,
|
||||
$wsdl_location = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$extra_options = {},
|
||||
) {
|
||||
|
||||
@ -92,6 +99,13 @@ define cinder::backend::vmdk (
|
||||
"${name}/host": value => "vmdk:${host_ip}-${volume_folder}";
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $volume_backend_name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${volume_backend_name}"],
|
||||
}
|
||||
}
|
||||
|
||||
package { 'python-suds':
|
||||
ensure => present
|
||||
}
|
||||
|
5
releasenotes/notes/volume_type-125be2a2e5b466aa.yaml
Normal file
5
releasenotes/notes/volume_type-125be2a2e5b466aa.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- manage_volume_type is a new parameter present in every Cinder backend.
|
||||
When set to True, it will manage the Cinder Volume type for the backend.
|
||||
For backward compatibility, it is set to False by default.
|
@ -28,12 +28,13 @@ describe 'cinder::backend::bdd' do
|
||||
context 'with optional parameters' do
|
||||
before :each do
|
||||
params.merge!({
|
||||
:iscsi_ip_address => '10.20.0.2',
|
||||
:available_devices => '/dev/sdb,/dev/sdc',
|
||||
:volumes_dir => '/var/lib/cinder/bdd-volumes',
|
||||
:volume_clear => 'zero',
|
||||
:volume_group => 'cinder',
|
||||
:iscsi_helper => 'lioadm',
|
||||
:iscsi_ip_address => '10.20.0.2',
|
||||
:available_devices => '/dev/sdb,/dev/sdc',
|
||||
:volumes_dir => '/var/lib/cinder/bdd-volumes',
|
||||
:volume_clear => 'zero',
|
||||
:volume_group => 'cinder',
|
||||
:iscsi_helper => 'lioadm',
|
||||
:manage_volume_type => true,
|
||||
})
|
||||
end
|
||||
|
||||
@ -45,6 +46,9 @@ describe 'cinder::backend::bdd' do
|
||||
should contain_cinder_config('hippo/volume_group').with_value('cinder')
|
||||
should contain_cinder_config('hippo/volume_clear').with_value('zero')
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('hippo').with(:ensure => :present, :properties => ['volume_backend_name=hippo'])
|
||||
end
|
||||
end
|
||||
|
||||
context 'block device backend with additional configuration' do
|
||||
|
@ -60,4 +60,13 @@ describe 'cinder::backend::dellsc_iscsi' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'dellsc_iscsi backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('dellsc_iscsi').with(:ensure => :present, :properties => ['volume_backend_name=dellsc_iscsi'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -44,6 +44,7 @@ describe 'cinder::backend::emc_vnx' do
|
||||
:storage_vnx_auth_type => 'global',
|
||||
:storage_vnx_security_file_dir => '/etc/secfile/array1',
|
||||
:naviseccli_path => '/opt/Navisphere/bin/naviseccli',
|
||||
:manage_volume_type => true,
|
||||
})
|
||||
end
|
||||
|
||||
@ -53,6 +54,10 @@ describe 'cinder::backend::emc_vnx' do
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_security_file_dir').with_value(params[:storage_vnx_security_file_dir])
|
||||
is_expected.to contain_cinder_config('emc/naviseccli_path').with_value(params[:naviseccli_path])
|
||||
end
|
||||
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('emc').with(:ensure => :present, :properties => ['volume_backend_name=emc'])
|
||||
end
|
||||
end
|
||||
|
||||
describe 'emc vnx backend with additional configuration' do
|
||||
|
@ -47,6 +47,15 @@ describe 'cinder::backend::eqlx' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'eqlx backend with cinder type' do
|
||||
before :each do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('eqlx-1').with(:ensure => :present, :properties => ['volume_backend_name=eqlx-1'])
|
||||
end
|
||||
end
|
||||
|
||||
context 'eqlx backend with chap' do
|
||||
before :each do
|
||||
params.merge!({
|
||||
|
@ -50,6 +50,15 @@ describe 'cinder::backend::glusterfs' do
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'glusterfs backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('mygluster').with(:ensure => :present, :properties => ['volume_backend_name=mygluster'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
@ -95,6 +95,15 @@ describe 'cinder::backend::gpfs' do
|
||||
it_raises 'a Puppet::Error', /gpfs_images_share_mode only support `copy` or `copy_on_write`/
|
||||
end
|
||||
|
||||
context 'gpfs backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('gpfs').with(:ensure => :present, :properties => ['volume_backend_name=gpfs'])
|
||||
end
|
||||
end
|
||||
|
||||
context 'gpfs backend with additional configuration' do
|
||||
before do
|
||||
params.merge!({:extra_options => {'gpfs/param1' => { 'value' => 'value1' }}})
|
||||
|
@ -44,4 +44,13 @@ describe 'cinder::backend::hp3par_iscsi' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'hp3par_iscsi backend with cinder type' do
|
||||
before :each do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('hp3par_iscsi').with(:ensure => :present, :properties => ['volume_backend_name=hp3par_iscsi'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -44,4 +44,13 @@ describe 'cinder::backend::hpe3par_iscsi' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'hpe3par_iscsi backend with cinder type' do
|
||||
before :each do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('hpe3par_iscsi').with(:ensure => :present, :properties => ['volume_backend_name=hpe3par_iscsi'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -69,6 +69,15 @@ describe 'cinder::backend::iscsi' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'iscsi backend with cinder type' do
|
||||
before :each do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('hippo').with(:ensure => :present, :properties => ['volume_backend_name=hippo'])
|
||||
end
|
||||
end
|
||||
|
||||
describe 'iscsi backend with additional configuration' do
|
||||
before :each do
|
||||
params.merge!({:extra_options => {'hippo/param1' => {'value' => 'value1'}}})
|
||||
|
@ -99,6 +99,15 @@ describe 'cinder::backend::netapp' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'netapp backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('netapp').with(:ensure => :present, :properties => ['volume_backend_name=netapp'])
|
||||
end
|
||||
end
|
||||
|
||||
context 'netapp backend with additional configuration' do
|
||||
before do
|
||||
params.merge!({:extra_options => {'netapp/param1' => { 'value' => 'value1' }}})
|
||||
|
@ -49,4 +49,13 @@ describe 'cinder::backend::nexenta' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'nexenta backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('nexenta').with(:ensure => :present, :properties => ['volume_backend_name=nexenta'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -61,4 +61,13 @@ describe 'cinder::backend::nfs' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'nfs backend with cinder type' do
|
||||
before :each do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('hippo').with(:ensure => :present, :properties => ['volume_backend_name=hippo'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -67,4 +67,13 @@ describe 'cinder::backend::pure' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'pure backend with cinder type' do
|
||||
let :params do
|
||||
req_params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('pure').with(:ensure => :present, :properties => ['volume_backend_name=pure'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -24,6 +24,14 @@ describe 'cinder::backend::quobyte' do
|
||||
true)
|
||||
end
|
||||
|
||||
context 'quobyte backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('myquobyte').with(:ensure => :present, :properties => ['volume_backend_name=myquobyte'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
@ -97,6 +97,15 @@ describe 'cinder::backend::rbd' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'rbd backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('rbd-ssd').with(:ensure => :present, :properties => ['volume_backend_name=rbd-ssd'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'with RedHat' do
|
||||
|
@ -50,4 +50,13 @@ describe 'cinder::backend::san' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'san backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('mysan').with(:ensure => :present, :properties => ['volume_backend_name=mysan'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -94,6 +94,18 @@ describe 'cinder::backend::solidfire' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'solidfire backend with cinder type' do
|
||||
let :params do
|
||||
req_params
|
||||
end
|
||||
before :each do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('solidfire').with(:ensure => :present, :properties => ['volume_backend_name=solidfire'])
|
||||
end
|
||||
end
|
||||
|
||||
context 'without required parameters' do
|
||||
before do
|
||||
params = {}
|
||||
|
@ -77,4 +77,13 @@ describe 'cinder::backend::vmdk' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'vmdk backend with cinder type' do
|
||||
before do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type('hippo').with(:ensure => :present, :properties => ['volume_backend_name=hippo'])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user