Patrick East e980ccfb40 Add support for Pure Volume Drivers
This allows for someone to configure Cinder to use the PureISCSIDriver
or PureFCDriver. This can be done either in the default section of the
volume config or as a backend definition.

For example:

class { ‘cinder::volume::pure’:
  ‘san_ip’ => ‘1.2.3.4’,
  ‘pure_api_token’ => ‘abcdef123456789,
  ‘pure_storage_protocol’ => ‘iSCSI’,
}

or

cinder::backend::pure {‘pure-iscsi’,
  ‘san_ip’ => ‘1.2.3.4’,
  ‘pure_api_token’ => ‘abcdef123457890’,
  ‘pure_storage_protocol’ => ‘iSCSI’,
}

Change-Id: If5aebb1f19f666eb158e337f7609e2503f6eb967
2015-09-24 10:37:36 -07:00

63 lines
1.9 KiB
Puppet

# == Class: cinder::backend::pure
#
# Configures Cinder volume PureStorage driver.
# Parameters are particular to each volume driver.
#
# === Parameters
#
# [*san_ip*]
# (required) IP address of PureStorage management VIP.
#
# [*pure_api_token*]
# (required) API token for management of PureStorage array.
#
# [*volume_backend_name*]
# (optional) Allows for the volume_backend_name to be separate of $name.
# Defaults to: $name
#
# [*pure_storage_protocol*]
# (optional) Must be either 'iSCSI' or 'FC'. This will determine
# 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.
# Defaults to False
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza.
# Defaults to: {}
# Example :
# { 'pure_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::pure(
$san_ip,
$pure_api_token,
$volume_backend_name = $name,
$pure_storage_protocol = 'iSCSI',
$use_chap_auth = false,
$use_multipath_for_image_xfer = true,
$extra_options = {},
) {
$volume_driver = $pure_storage_protocol ? {
'FC' => 'cinder.volume.drivers.pure.PureFCDriver',
'iSCSI' => 'cinder.volume.drivers.pure.PureISCSIDriver'
}
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/volume_driver": value => $volume_driver;
"${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 ;
}
create_resources('cinder_config', $extra_options)
}