From 2938addac69e638a1068c6cd542586f7f685fa91 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Tue, 25 Oct 2016 09:18:08 +0800 Subject: [PATCH] Remove deprecated hp3par_iscsi The define cinder::backend::hp3par_iscsi and cinder::backend::hp3par_iscsi are deprecated and are now being removed in Ocata cycle, pleasse use the new define cinder::backend::hpe3par_iscsi. Also remove all tests releated to hp3par. Change-Id: I63d5349480021e363d7c12ac3c260935c1a2272a --- manifests/backend/hp3par_iscsi.pp | 120 ------------------ manifests/volume/hp3par_iscsi.pp | 87 ------------- .../remove_all_hp3par-1e928df13471cf13.yaml | 5 + .../cinder_volume_hp3par_iscsi_spec.rb | 45 ------- .../cinder_backend_hp3par_iscsi_spec.rb | 56 -------- 5 files changed, 5 insertions(+), 308 deletions(-) delete mode 100644 manifests/backend/hp3par_iscsi.pp delete mode 100644 manifests/volume/hp3par_iscsi.pp create mode 100644 releasenotes/notes/remove_all_hp3par-1e928df13471cf13.yaml delete mode 100644 spec/classes/cinder_volume_hp3par_iscsi_spec.rb delete mode 100644 spec/defines/cinder_backend_hp3par_iscsi_spec.rb diff --git a/manifests/backend/hp3par_iscsi.pp b/manifests/backend/hp3par_iscsi.pp deleted file mode 100644 index ff25ac0c..00000000 --- a/manifests/backend/hp3par_iscsi.pp +++ /dev/null @@ -1,120 +0,0 @@ -# Configures Cinder volume HP 3par ISCSI driver. -# Parameters are particular to each volume driver. -# -# === Parameters -# -# [*hp3par_api_url*] -# (required) url for api access to 3par - example https://10.x.x.x:8080/api/v1 -# -# [*hp3par_username*] -# (required) Username for HP3par admin user -# -# [*hp3par_password*] -# (required) Password for hp3par_username -# -# [*san_ip*] -# (required) IP address of HP 3par service processor. -# -# [*san_login*] -# (required) Username for HP 3par account. -# -# [*san_password*] -# (required) Password for HP 3par account. -# -# [*hp3par_iscsi_ips*] -# (required) iscsi IP addresses for the HP 3par array -# This is a list of IPs with ports in a string, for example: -# '1.2.3.4:3261, 5.6.7.8:3261' -# -# [*volume_backend_name*] -# (optional) Allows for the volume_backend_name to be separate of $name. -# Defaults to: $name -# -# [*volume_driver*] -# (optional) Setup cinder-volume to use HP 3par volume driver. -# Defaults to 'cinder.volume.drivers.san.hp.hp_3par_iscsi.HP3PARISCSIDriver' -# -# [*hp3par_iscsi_chap_enabled*] -# (required) setting to false by default -# -# [*hp3par_iscsi_chap_enabled -# (required) setting to false by default -# -# [*hp3par_snap_cpg*] -# (optional) set to hp3par_cfg by default in the cinder driver -# -# [*hp3par_snapshot_retention*] -# (required) Time in hours for snapshot retention. Must be less -# than hp3par_snapshot_expiration. -# Defaults to 48. -# -# [*hp3par_snapshot_expiration*] -# (required) Time in hours until a snapshot expires. Must be more -# 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: {} -# Example : -# { 'h3par_iscsi_backend/param1' => { 'value' => value1 } } -# -define cinder::backend::hp3par_iscsi( - $hp3par_api_url, - $hp3par_username, - $hp3par_password, - $san_ip, - $san_login, - $san_password, - $hp3par_iscsi_ips, - $volume_backend_name = $name, - $volume_driver = 'cinder.volume.drivers.san.hp.hp_3par_iscsi.HP3PARISCSIDriver', - $hp3par_iscsi_chap_enabled = false, - $hp3par_snap_cpg = 'OpenstackCPG', - $hp3par_snapshot_retention = 48, - $hp3par_snapshot_expiration = 72, - $manage_volume_type = false, - $extra_options = {}, -) { - - include ::cinder::deps - - if ($hp3par_snapshot_expiration <= $hp3par_snapshot_retention) { - fail ('hp3par_snapshot_expiration must be greater than hp3par_snapshot_retention') - } - - warning("The define cinder::backend::hp3par_iscsi is deprecated and will be \ -removed after Newton cycle, pleasse use the new define cinder::backend::hpe3par_iscsi.") - - cinder_config { - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/volume_driver": value => $volume_driver; - "${name}/hpe3par_username": value => $hp3par_username; - "${name}/hpe3par_password": value => $hp3par_password, secret => true; - "${name}/san_ip": value => $san_ip; - "${name}/san_login": value => $san_login; - "${name}/san_password": value => $san_password, secret => true; - "${name}/hpe3par_iscsi_ips": value => $hp3par_iscsi_ips; - "${name}/hpe3par_api_url": value => $hp3par_api_url; - "${name}/hpe3par_iscsi_chap_enabled": value => $hp3par_iscsi_chap_enabled; - "${name}/hpe3par_cpg_snap": value => $hp3par_snap_cpg; - "${name}/hpe3par_snapshot_retention": value => $hp3par_snapshot_retention; - "${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) - -} diff --git a/manifests/volume/hp3par_iscsi.pp b/manifests/volume/hp3par_iscsi.pp deleted file mode 100644 index f9c76aae..00000000 --- a/manifests/volume/hp3par_iscsi.pp +++ /dev/null @@ -1,87 +0,0 @@ -# == Deprecated Class: cinder::volume::hp3par -# -# Configures Cinder volume HP 3par driver. -# Parameters are particular to each volume driver. -# -# === Parameters -# -# [*volume_driver*] -# (optional) Setup cinder-volume to use HP 3par volume driver. -# Defaults to 'cinder.volume.drivers.san.hp.hp_3par_iscsi.HP3PARISCSIDriver' -# -# [*san_ip*] -# (required) IP address of HP 3par service processor. -# -# [*san_login*] -# (required) Username for HP 3par account. -# -# [*san_password*] -# (required) Password for HP 3par account. -# -# [*hp3par_api_url*] -# (required) url for api access to 3par - expample https://10.x.x.x:8080/api/v1 -# -# [*hp3par_username*] -# (required) Username for HP3par admin user -# -# [*hp3par_password*] -# (required) Password for hp3par_username -# -# [*hp3par_iscsi_ips*] -# (required) iscsi ip addresses for the HP 3par array -# -# [*hp3par_iscsi_chap_enabled*] -# (required) setting to false by default -# -# [*hp3par_snap_cpg*] -# (optional) set to hp3par_cfg by default in the cinder driver -# -# [*hp3par_snapshot_retention*] -# (required) setting to 48 hours as default expiration - ensures snapshot cannot be deleted prior to expiration -# -# [*hp3par_snapshot_expiration*] -# (required) setting to 72 hours as default (must be larger than retention) -# -# [*extra_options*] -# (optional) Hash of extra options to pass to the backend stanza -# Defaults to: {} -# Example : -# { 'h3par_iscsi_backend/param1' => { 'value' => value1 } } -# -class cinder::volume::hp3par_iscsi( - $hp3par_api_url, - $hp3par_username, - $hp3par_password, - $hp3par_iscsi_ips, - $san_ip, - $san_login, - $san_password, - $volume_driver = 'cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver', - $hp3par_iscsi_chap_enabled = false, - $hp3par_snap_cpg = 'OpenstackCPG', - $hp3par_snapshot_retention = 48, - $hp3par_snapshot_expiration = 72, - $extra_options = {}, -) { - - include ::cinder::deps - - warning("The class cinder::volume::hp3par_iscsi is deprecated and will be removed \ -after Newton cycle, pleasse use the new class cinder::volume::hpe3par_iscsi.") - - cinder::backend::hpe3par_iscsi { 'DEFAULT': - volume_driver => $volume_driver, - hpe3par_username => $hp3par_username, - hpe3par_password => $hp3par_password, - san_ip => $san_ip, - san_login => $san_login, - san_password => $san_password, - hpe3par_iscsi_ips => $hp3par_iscsi_ips, - hpe3par_api_url => $hp3par_api_url, - hpe3par_cpg_snap => $hp3par_snap_cpg, - hpe3par_snapshot_retention => $hp3par_snapshot_retention, - hpe3par_snapshot_expiration => $hp3par_snapshot_expiration, - extra_options => $extra_options, - } - -} diff --git a/releasenotes/notes/remove_all_hp3par-1e928df13471cf13.yaml b/releasenotes/notes/remove_all_hp3par-1e928df13471cf13.yaml new file mode 100644 index 00000000..cafc998b --- /dev/null +++ b/releasenotes/notes/remove_all_hp3par-1e928df13471cf13.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - Remove hp3par_iscsi define and class. + - Remove all hp3par parameters in define and class. + - Remove all tests related to hp3par. diff --git a/spec/classes/cinder_volume_hp3par_iscsi_spec.rb b/spec/classes/cinder_volume_hp3par_iscsi_spec.rb deleted file mode 100644 index 581fb05a..00000000 --- a/spec/classes/cinder_volume_hp3par_iscsi_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -require 'spec_helper' - -describe 'cinder::volume::hp3par_iscsi' do - let :req_params do - { - :hp3par_api_url => 'https://172.0.0.2:8080/api/v1', - :hp3par_username => '3paradm', - :hp3par_password => 'password', - :hp3par_iscsi_ips => '172.0.0.3', - :san_ip => '172.0.0.2', - :san_login => '3paradm', - :san_password => 'password', - } - end - - let :params do - req_params - end - - describe 'hp3par_iscsi volume driver' do - it 'configure hp3par_iscsi volume driver' do - is_expected.to contain_cinder_config('DEFAULT/volume_driver').with_value('cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver') - is_expected.to contain_cinder_config('DEFAULT/hpe3par_api_url').with_value('https://172.0.0.2:8080/api/v1') - is_expected.to contain_cinder_config('DEFAULT/hpe3par_username').with_value('3paradm') - is_expected.to contain_cinder_config('DEFAULT/hpe3par_password').with_value('password') - is_expected.to contain_cinder_config('DEFAULT/hpe3par_iscsi_ips').with_value('172.0.0.3') - is_expected.to contain_cinder_config('DEFAULT/san_ip').with_value('172.0.0.2') - is_expected.to contain_cinder_config('DEFAULT/san_login').with_value('3paradm') - is_expected.to contain_cinder_config('DEFAULT/san_password').with_value('password') - end - end - - describe 'hp3par_iscsi volume driver with additional configuration' do - before :each do - params.merge!({:extra_options => {'hpe3par_iscsi_backend/param1' => {'value' => 'value1'}}}) - end - - it 'configure hp3par_iscsi volume with additional configuration' do - is_expected.to contain_cinder__backend__hpe3par_iscsi('DEFAULT').with({ - :extra_options => {'hpe3par_iscsi_backend/param1' => {'value' => 'value1'}} - }) - end - end - -end diff --git a/spec/defines/cinder_backend_hp3par_iscsi_spec.rb b/spec/defines/cinder_backend_hp3par_iscsi_spec.rb deleted file mode 100644 index 48ed709c..00000000 --- a/spec/defines/cinder_backend_hp3par_iscsi_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -require 'spec_helper' - -describe 'cinder::backend::hp3par_iscsi' do - let (:title) { 'hp3par_iscsi' } - - let :req_params do - { - :hp3par_api_url => 'https://172.0.0.2:8080/api/v1', - :hp3par_username => '3paradm', - :hp3par_password => 'password', - :hp3par_iscsi_ips => '172.0.0.3', - :san_ip => '172.0.0.2', - :san_login => '3paradm', - :san_password => 'password', - } - end - - let :params do - req_params - end - - describe 'hp3par_iscsi volume driver' do - it 'configure hp3par_iscsi volume driver' do - is_expected.to contain_cinder_config('hp3par_iscsi/volume_driver').with_value('cinder.volume.drivers.san.hp.hp_3par_iscsi.HP3PARISCSIDriver') - is_expected.to contain_cinder_config('hp3par_iscsi/hpe3par_api_url').with_value('https://172.0.0.2:8080/api/v1') - is_expected.to contain_cinder_config('hp3par_iscsi/hpe3par_username').with_value('3paradm') - is_expected.to contain_cinder_config('hp3par_iscsi/hpe3par_password').with_value('password') - is_expected.to contain_cinder_config('hp3par_iscsi/hpe3par_iscsi_ips').with_value('172.0.0.3') - is_expected.to contain_cinder_config('hp3par_iscsi/san_ip').with_value('172.0.0.2') - is_expected.to contain_cinder_config('hp3par_iscsi/san_login').with_value('3paradm') - is_expected.to contain_cinder_config('hp3par_iscsi/san_password').with_value('password') - end - end - - describe 'hp3par_iscsi backend with additional configuration' do - before :each do - params.merge!({:extra_options => {'hpe3par_iscsi/param1' => {'value' => 'value1'}}}) - end - - it 'configure hp3par_iscsi backend with additional configuration' do - is_expected.to contain_cinder_config('hpe3par_iscsi/param1').with({ - :value => 'value1', - }) - 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