diff --git a/manifests/backend/iscsi.pp b/manifests/backend/iscsi.pp index 86da186c..2d03fa5f 100644 --- a/manifests/backend/iscsi.pp +++ b/manifests/backend/iscsi.pp @@ -10,6 +10,7 @@ define cinder::backend::iscsi ( $iscsi_ip_address, $volume_backend_name = $name, + $volume_driver = 'cinder.volume.drivers.lvm.LVMISCSIDriver', $volume_group = 'cinder-volumes', $iscsi_helper = $::cinder::params::iscsi_helper, ) { @@ -18,6 +19,7 @@ define cinder::backend::iscsi ( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/volume_driver": value => $volume_driver; "${name}/iscsi_ip_address": value => $iscsi_ip_address; "${name}/iscsi_helper": value => $iscsi_helper; "${name}/volume_group": value => $volume_group; diff --git a/manifests/volume/iscsi.pp b/manifests/volume/iscsi.pp index cb518622..e9eb4dad 100644 --- a/manifests/volume/iscsi.pp +++ b/manifests/volume/iscsi.pp @@ -1,6 +1,7 @@ # class cinder::volume::iscsi ( $iscsi_ip_address, + $volume_driver = 'cinder.volume.drivers.lvm.LVMISCSIDriver', $volume_group = 'cinder-volumes', $iscsi_helper = $::cinder::params::iscsi_helper, ) { @@ -9,6 +10,7 @@ class cinder::volume::iscsi ( cinder::backend::iscsi { 'DEFAULT': iscsi_ip_address => $iscsi_ip_address, + volume_driver => $volume_driver, volume_group => $volume_group, iscsi_helper => $iscsi_helper } diff --git a/spec/classes/cinder_volume_iscsi_spec.rb b/spec/classes/cinder_volume_iscsi_spec.rb index 27a3c534..93e06224 100644 --- a/spec/classes/cinder_volume_iscsi_spec.rb +++ b/spec/classes/cinder_volume_iscsi_spec.rb @@ -16,12 +16,22 @@ describe 'cinder::volume::iscsi' do req_params end + it { should contain_cinder_config('DEFAULT/volume_driver').with( + :value => 'cinder.volume.drivers.lvm.LVMISCSIDriver')} it { should contain_cinder_config('DEFAULT/iscsi_ip_address').with(:value => '127.0.0.2')} it { should contain_cinder_config('DEFAULT/iscsi_helper').with(:value => 'tgtadm')} it { should contain_cinder_config('DEFAULT/volume_group').with(:value => 'cinder-volumes')} end + describe 'with iSER driver' do + let(:params) { req_params.merge( + :volume_driver => 'cinder.volume.drivers.lvm.LVMISERDriver')} + + it { should contain_cinder_config('DEFAULT/volume_driver').with( + :value => 'cinder.volume.drivers.lvm.LVMISERDriver')} + end + describe 'with a unsupported iscsi helper' do let(:params) { req_params.merge(:iscsi_helper => 'fooboozoo')} diff --git a/spec/defines/cinder_backend_iscsi_spec.rb b/spec/defines/cinder_backend_iscsi_spec.rb index 4e987648..1006d747 100644 --- a/spec/defines/cinder_backend_iscsi_spec.rb +++ b/spec/defines/cinder_backend_iscsi_spec.rb @@ -23,6 +23,8 @@ describe 'cinder::backend::iscsi' do it 'should configure iscsi driver' do should contain_cinder_config('hippo/volume_backend_name').with( :value => 'hippo') + should contain_cinder_config('hippo/volume_driver').with( + :value => 'cinder.volume.drivers.lvm.LVMISCSIDriver') should contain_cinder_config('hippo/iscsi_ip_address').with( :value => '127.0.0.2') should contain_cinder_config('hippo/iscsi_helper').with(