Nexenta: Update parameters

- Add REST port with default 8457.
- Add volume driver.
- Update volume driver to iSCSI driver.
- Blocksize should be an integer.

Change-Id: Ib8ece62f9fb5ff38ccdcf1e19fd84375b8595234
This commit is contained in:
Dimitri Savineau
2016-09-14 11:03:22 -04:00
parent 2e600672c3
commit 724cbdf27f
5 changed files with 60 additions and 19 deletions

View File

@@ -18,19 +18,32 @@
# Defaults to: $name # Defaults to: $name
# #
# [*nexenta_volume*] # [*nexenta_volume*]
# (optional) Pool on SA that will hold all volumes. Defaults to 'cinder'. # (optional) Pool on SA that will hold all volumes.
# Defaults to 'cinder'.
# #
# [*nexenta_target_prefix*] # [*nexenta_target_prefix*]
# (optional) IQN prefix for iSCSI targets. Defaults to 'iqn:'. # (optional) IQN prefix for iSCSI targets.
# Defaults to 'iqn:'.
# #
# [*nexenta_target_group_prefix*] # [*nexenta_target_group_prefix*]
# (optional) Prefix for iSCSI target groups on SA. Defaults to 'cinder/'. # (optional) Prefix for iSCSI target groups on SA.
# Defaults to 'cinder/'.
# #
# [*nexenta_blocksize*] # [*nexenta_blocksize*]
# (optional) Block size for volumes. Defaults to '8k'. # (optional) Block size for volumes.
# Defaults to '8192'.
# #
# [*nexenta_sparse*] # [*nexenta_sparse*]
# (optional) Flag to create sparse volumes. Defaults to true. # (optional) Flag to create sparse volumes.
# Defaults to true.
#
# [*nexenta_rest_port*]
# (optional) HTTP port for REST API.
# Defaults to '8457'.
#
# [*volume_driver*]
# (required) Nexenta driver to use.
# Defaults to: 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver'.
# #
# [*manage_volume_type*] # [*manage_volume_type*]
# (Optional) Whether or not manage Cinder Volume type. # (Optional) Whether or not manage Cinder Volume type.
@@ -52,8 +65,10 @@ define cinder::backend::nexenta (
$nexenta_volume = 'cinder', $nexenta_volume = 'cinder',
$nexenta_target_prefix = 'iqn:', $nexenta_target_prefix = 'iqn:',
$nexenta_target_group_prefix = 'cinder/', $nexenta_target_group_prefix = 'cinder/',
$nexenta_blocksize = '8k', $nexenta_blocksize = '8192',
$nexenta_sparse = true, $nexenta_sparse = true,
$nexenta_rest_port = '8457',
$volume_driver = 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver',
$manage_volume_type = false, $manage_volume_type = false,
$extra_options = {}, $extra_options = {},
) { ) {
@@ -70,7 +85,8 @@ define cinder::backend::nexenta (
"${name}/nexenta_target_group_prefix": value => $nexenta_target_group_prefix; "${name}/nexenta_target_group_prefix": value => $nexenta_target_group_prefix;
"${name}/nexenta_blocksize": value => $nexenta_blocksize; "${name}/nexenta_blocksize": value => $nexenta_blocksize;
"${name}/nexenta_sparse": value => $nexenta_sparse; "${name}/nexenta_sparse": value => $nexenta_sparse;
"${name}/volume_driver": value => 'cinder.volume.drivers.nexenta.volume.NexentaDriver'; "${name}/nexenta_rest_port": value => $nexenta_rest_port;
"${name}/volume_driver": value => $volume_driver;
} }
if $manage_volume_type { if $manage_volume_type {

View File

@@ -14,19 +14,32 @@
# (required) IP address of Nexenta SA. # (required) IP address of Nexenta SA.
# #
# [*nexenta_volume*] # [*nexenta_volume*]
# (optional) Pool on SA that will hold all volumes. Defaults to 'cinder'. # (optional) Pool on SA that will hold all volumes.
# Defaults to 'cinder'.
# #
# [*nexenta_target_prefix*] # [*nexenta_target_prefix*]
# (optional) IQN prefix for iSCSI targets. Defaults to 'iqn:'. # (optional) IQN prefix for iSCSI targets.
# Defaults to 'iqn:'.
# #
# [*nexenta_target_group_prefix*] # [*nexenta_target_group_prefix*]
# (optional) Prefix for iSCSI target groups on SA. Defaults to 'cinder/'. # (optional) Prefix for iSCSI target groups on SA.
# Defaults to 'cinder/'.
# #
# [*nexenta_blocksize*] # [*nexenta_blocksize*]
# (optional) Block size for volumes. Defaults to '8k'. # (optional) Block size for volumes.
# Defaults to '8k'.
# #
# [*nexenta_sparse*] # [*nexenta_sparse*]
# (optional) Flag to create sparse volumes. Defaults to true. # (optional) Flag to create sparse volumes.
# Defaults to true.
#
# [*nexenta_rest_port*]
# (optional) HTTP port for REST API.
# Defaults to '8457'.
#
# [*volume_driver*]
# (required) Nexenta driver to use.
# Defaults to: 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver'.
# #
# [*extra_options*] # [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza # (optional) Hash of extra options to pass to the backend stanza
@@ -41,8 +54,10 @@ class cinder::volume::nexenta (
$nexenta_volume = 'cinder', $nexenta_volume = 'cinder',
$nexenta_target_prefix = 'iqn:', $nexenta_target_prefix = 'iqn:',
$nexenta_target_group_prefix = 'cinder/', $nexenta_target_group_prefix = 'cinder/',
$nexenta_blocksize = '8k', $nexenta_blocksize = '8192',
$nexenta_sparse = true, $nexenta_sparse = true,
$nexenta_rest_port = '8457',
$volume_driver = 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver',
$extra_options = {}, $extra_options = {},
) { ) {
@@ -60,6 +75,8 @@ cinder::backend::nexenta instead.')
nexenta_target_group_prefix => $nexenta_target_group_prefix, nexenta_target_group_prefix => $nexenta_target_group_prefix,
nexenta_blocksize => $nexenta_blocksize, nexenta_blocksize => $nexenta_blocksize,
nexenta_sparse => $nexenta_sparse, nexenta_sparse => $nexenta_sparse,
nexenta_rest_port => $nexenta_rest_port,
volume_driver => $volume_driver,
extra_options => $extra_options, extra_options => $extra_options,
} }
} }

View File

@@ -0,0 +1,4 @@
---
upgrade:
- allow to configure previously hardcoded parameter
and add more options in nexenta backend.

View File

@@ -16,13 +16,15 @@ describe 'cinder::volume::nexenta' do
{ :nexenta_volume => 'cinder', { :nexenta_volume => 'cinder',
:nexenta_target_prefix => 'iqn:', :nexenta_target_prefix => 'iqn:',
:nexenta_target_group_prefix => 'cinder/', :nexenta_target_group_prefix => 'cinder/',
:nexenta_blocksize => '8k', :nexenta_blocksize => '8192',
:nexenta_sparse => true } :nexenta_sparse => true,
:nexenta_rest_port => '8457',
:volume_driver => 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver' }
end end
let :facts do let :facts do
{ :osfamily => 'Debian' } OSDefaults.get_facts({})
end end

View File

@@ -16,12 +16,14 @@ describe 'cinder::backend::nexenta' do
{ :nexenta_volume => 'cinder', { :nexenta_volume => 'cinder',
:nexenta_target_prefix => 'iqn:', :nexenta_target_prefix => 'iqn:',
:nexenta_target_group_prefix => 'cinder/', :nexenta_target_group_prefix => 'cinder/',
:nexenta_blocksize => '8k', :nexenta_blocksize => '8192',
:nexenta_sparse => true } :nexenta_sparse => true,
:nexenta_rest_port => '8457',
:volume_driver => 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver' }
end end
let :facts do let :facts do
{ :osfamily => 'Debian' } OSDefaults.get_facts({})
end end