diff --git a/manifests/cinder.pp b/manifests/cinder.pp index 320693246..135165b97 100644 --- a/manifests/cinder.pp +++ b/manifests/cinder.pp @@ -48,6 +48,24 @@ # admin context through the OpenStack Identity service. # Defaults to 'Default' # +# [*os_region_name*] +# (optional) Sets the os_region_name flag. For environments with +# more than one endpoint per service, this is required to make +# things such as cinder volume attach work. If you don't set this +# and you have multiple endpoints, you will get AmbiguousEndpoint +# exceptions in the nova API service. +# Defaults to $::os_service_default +# +# [*catalog_info*] +# (optional) Info to match when looking for cinder in the service +# catalog. Format is: separated values of the form: +# :: +# Defaults to $::os_service_default +# +# [*cross_az_attach*] +# (optional) Allow attach between instance and volume in different availability zones. +# Defaults to $::os_service_default +# class nova::cinder ( $password = $::os_service_default, $auth_type = $::os_service_default, @@ -58,11 +76,17 @@ class nova::cinder ( $project_domain_name = 'Default', $username = 'cinder', $user_domain_name = 'Default', - + $os_region_name = $::os_service_default, + $catalog_info = $::os_service_default, + $cross_az_attach = $::os_service_default, ) { include nova::deps + $os_region_name_real = pick($::nova::os_region_name, $os_region_name) + $catalog_info_real = pick($::nova::cinder_catalog_info, $catalog_info) + $cross_az_attach_real = pick($::nova::cross_az_attach, $cross_az_attach) + nova_config { 'cinder/password': value => $password, secret => true; 'cinder/auth_type': value => $auth_type; @@ -73,6 +97,8 @@ class nova::cinder ( 'cinder/project_domain_name': value => $project_domain_name; 'cinder/username': value => $username; 'cinder/user_domain_name': value => $user_domain_name; - + 'cinder/os_region_name': value => $os_region_name_real; + 'cinder/catalog_info': value => $catalog_info_real; + 'cinder/cross_az_attach': value => $cross_az_attach; } } diff --git a/manifests/init.pp b/manifests/init.pp index 02ace3978..21ea1ea02 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -316,25 +316,11 @@ # for notifications on VM and task state changes. # Defaults to undef # -# [*os_region_name*] -# (optional) Sets the os_region_name flag. For environments with -# more than one endpoint per service, this is required to make -# things such as cinder volume attach work. If you don't set this -# and you have multiple endpoints, you will get AmbiguousEndpoint -# exceptions in the nova API service. -# Defaults to $::os_service_default -# # [*ovsdb_connection*] # (optional) Sets the ovsdb connection string. This is used by os-vif # to interact with openvswitch on the host. # Defaults to $::os_service_default # -# [*cinder_catalog_info*] -# (optional) Info to match when looking for cinder in the service -# catalog. Format is: separated values of the form: -# :: -# Defaults to $::os_service_default -# # [*upgrade_level_cells*] # (optional) Sets a version cap for messages sent to local cells services # Defaults to $::os_service_default @@ -405,10 +391,6 @@ # If unable to do so, will use "127.0.0.1". # Defaults to $::os_service_default. # -# [*cross_az_attach*] -# (optional) Allow attach between instance and volume in different availability zones. -# Defaults to $::os_service_default -# # DEPRECATED PARAMETERS # # [*notify_api_faults*] @@ -436,6 +418,24 @@ # (optional) Minimum number of SQL connections to keep open in a pool. # Defaults to undef. # +# [*os_region_name*] +# (optional) Sets the os_region_name flag. For environments with +# more than one endpoint per service, this is required to make +# things such as cinder volume attach work. If you don't set this +# and you have multiple endpoints, you will get AmbiguousEndpoint +# exceptions in the nova API service. +# Defaults to undef +# +# [*cinder_catalog_info*] +# (optional) Info to match when looking for cinder in the service +# catalog. Format is: separated values of the form: +# :: +# Defaults to undef +# +# [*cross_az_attach*] +# (optional) Allow attach between instance and volume in different availability zones. +# Defaults to undef +# class nova( $ensure_package = 'present', $database_connection = undef, @@ -506,9 +506,7 @@ class nova( $notification_topics = $::os_service_default, $notification_format = $::os_service_default, $notify_on_state_change = undef, - $os_region_name = $::os_service_default, $ovsdb_connection = $::os_service_default, - $cinder_catalog_info = $::os_service_default, $upgrade_level_cells = $::os_service_default, $upgrade_level_cert = $::os_service_default, $upgrade_level_compute = $::os_service_default, @@ -522,7 +520,6 @@ class nova( $disk_allocation_ratio = $::os_service_default, $purge_config = false, $my_ip = $::os_service_default, - $cross_az_attach = $::os_service_default, # DEPRECATED PARAMETERS $notify_api_faults = undef, $image_service = undef, @@ -530,6 +527,9 @@ class nova( $auth_strategy = undef, $glance_api_servers = undef, $database_min_pool_size = undef, + $os_region_name = undef, + $cinder_catalog_info = undef, + $cross_az_attach = undef, ) inherits nova::params { include nova::deps @@ -550,6 +550,21 @@ class nova( warning('The notify_on_api_faults parameter is deprecated.') } + if $os_region_name != undef { + warning('The os_region_name parameter is deprecated and will be removed \ +in a future release. Use nova::cinder::os_region_name instead') + } + + if $cinder_catalog_info != undef { + warning('The catalog_info parameter is deprecated and will be removed \ +in a future release. Use nova::cinder::catalog_info instead') + } + + if $cross_az_attach != undef { + warning('The cross_az_attach parameter is deprecated and will be removed \ +in a future release. Use nova::cinder::cross_az_attach instead') + } + if $image_service { warning('The unused image_service parameter is deprecated, as we are \ already using python-glanceclient instead of old glance client.') @@ -742,7 +757,6 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.") } nova_config { - 'cinder/catalog_info': value => $cinder_catalog_info; 'DEFAULT/ovsdb_connection': value => $ovsdb_connection; 'notifications/notification_format': value => $notification_format; # Following may need to be broken out to different nova services @@ -765,8 +779,6 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.") } nova_config { - 'cinder/os_region_name': value => $os_region_name; - 'cinder/cross_az_attach': value => $cross_az_attach; 'upgrade_levels/cells': value => $upgrade_level_cells; 'upgrade_levels/cert': value => $upgrade_level_cert; 'upgrade_levels/compute': value => $upgrade_level_compute; diff --git a/releasenotes/notes/cinder-parameters-62b1a4f2a3a8e4b8.yaml b/releasenotes/notes/cinder-parameters-62b1a4f2a3a8e4b8.yaml new file mode 100644 index 000000000..c12eacce6 --- /dev/null +++ b/releasenotes/notes/cinder-parameters-62b1a4f2a3a8e4b8.yaml @@ -0,0 +1,10 @@ +--- +deprecations: + - | + The following parameters in nova class has been deprecated and will be + removed in a future release. Use the new parameters in nova::cinder class + instead. + + - ``nova::os_region_name`` ( now ``nova::cinder::os_region_name``) + - ``nova::cinder_catalog_info`` ( now ``nova::cinder::catalog_info``) + - ``nova::cross_az_attach`` ( now ``nova::cinder::cross_az_attach``) diff --git a/spec/classes/nova_cinder_spec.rb b/spec/classes/nova_cinder_spec.rb index 4dde4d4dc..6b939aa5f 100644 --- a/spec/classes/nova_cinder_spec.rb +++ b/spec/classes/nova_cinder_spec.rb @@ -15,6 +15,9 @@ describe 'nova::cinder' do should contain_nova_config('cinder/project_domain_name').with_value('Default') should contain_nova_config('cinder/username').with_value('cinder') should contain_nova_config('cinder/user_domain_name').with_value('Default') + should contain_nova_config('cinder/os_region_name').with_value('') + should contain_nova_config('cinder/catalog_info').with_value('') + should contain_nova_config('cinder/cross_az_attach').with_value('') end end @@ -27,6 +30,9 @@ describe 'nova::cinder' do :auth_url => 'http://10.0.0.10:5000/v3', :timeout => 60, :region_name => 'RegionOne', + :os_region_name => 'RegionOne', + :catalog_info => 'volumev3:cinderv3:publicURL', + :cross_az_attach => true, } end @@ -40,6 +46,9 @@ describe 'nova::cinder' do should contain_nova_config('cinder/project_domain_name').with_value('Default') should contain_nova_config('cinder/username').with_value('cinder') should contain_nova_config('cinder/user_domain_name').with_value('Default') + should contain_nova_config('cinder/os_region_name').with_value('RegionOne') + should contain_nova_config('cinder/catalog_info').with_value('volumev3:cinderv3:publicURL') + should contain_nova_config('cinder/cross_az_attach').with_value(true) end end diff --git a/spec/classes/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index 49bd4c21d..30c48829d 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -52,9 +52,6 @@ describe 'nova' do is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('') is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('') is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('') - is_expected.to contain_nova_config('cinder/os_region_name').with_value('') - is_expected.to contain_nova_config('cinder/cross_az_attach').with_value('') - is_expected.to contain_nova_config('cinder/catalog_info').with_value('') is_expected.to contain_nova_config('DEFAULT/cpu_allocation_ratio').with_value('') is_expected.to contain_nova_config('DEFAULT/ram_allocation_ratio').with_value('') is_expected.to contain_nova_config('DEFAULT/disk_allocation_ratio').with_value('') @@ -94,8 +91,6 @@ describe 'nova' do :notification_topics => 'openstack', :notification_format => 'unversioned', :report_interval => '60', - :os_region_name => 'MyRegion', - :cross_az_attach => 'MyAZ', :ovsdb_connection => 'tcp:127.0.0.1:6640', :upgrade_level_cells => '1.0.0', :upgrade_level_cert => '1.0.0', @@ -179,8 +174,6 @@ describe 'nova' do is_expected.to contain_nova_config('notifications/notification_format').with_value('unversioned') is_expected.to contain_nova_config('DEFAULT/report_interval').with_value('60') is_expected.to contain_nova_config('DEFAULT/ovsdb_connection').with_value('tcp:127.0.0.1:6640') - is_expected.to contain_nova_config('cinder/os_region_name').with_value('MyRegion') - is_expected.to contain_nova_config('cinder/cross_az_attach').with_value('MyAZ') is_expected.to contain_nova_config('DEFAULT/ssl_only').with_value(true) is_expected.to contain_nova_config('DEFAULT/cert').with_value('/etc/ssl/private/snakeoil.pem') is_expected.to contain_nova_config('DEFAULT/key').with_value('/etc/ssl/certs/snakeoil.pem')