Migrate back cross_az_attach

The previous change[1] migrated some parameters related cinder
from nova to nova::cinder, but cross_az_attach shouldn't be migrate
because the parameter is used in nova-api and nova-compute and in some
cases nova::cinder class is not actually loaded in api side.
(We actually don't include nova::cinder for controllers in TripleO)

This patch partially reverts the change by [1], so that we keep
cross_az_attach in more common place, which is surely loaded in
both control plane and hypervisor.

[1] 72103db985

Change-Id: I2e07e29740cf0398b4f34457b53d54890b4aa843
This commit is contained in:
Takashi Kajinami 2020-04-28 07:26:12 +09:00
parent 293f1b5e8e
commit d0aee23dae
5 changed files with 9 additions and 21 deletions

View File

@ -62,10 +62,6 @@
# <service_type>:<service_name>:<endpoint_type> # <service_type>:<service_name>:<endpoint_type>
# Defaults to $::os_service_default # 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 ( class nova::cinder (
$password = $::os_service_default, $password = $::os_service_default,
$auth_type = $::os_service_default, $auth_type = $::os_service_default,
@ -78,14 +74,12 @@ class nova::cinder (
$user_domain_name = 'Default', $user_domain_name = 'Default',
$os_region_name = $::os_service_default, $os_region_name = $::os_service_default,
$catalog_info = $::os_service_default, $catalog_info = $::os_service_default,
$cross_az_attach = $::os_service_default,
) { ) {
include nova::deps include nova::deps
$os_region_name_real = pick($::nova::os_region_name, $os_region_name) $os_region_name_real = pick($::nova::os_region_name, $os_region_name)
$catalog_info_real = pick($::nova::cinder_catalog_info, $catalog_info) $catalog_info_real = pick($::nova::cinder_catalog_info, $catalog_info)
$cross_az_attach_real = pick($::nova::cross_az_attach, $cross_az_attach)
nova_config { nova_config {
'cinder/password': value => $password, secret => true; 'cinder/password': value => $password, secret => true;
@ -99,6 +93,5 @@ class nova::cinder (
'cinder/user_domain_name': value => $user_domain_name; 'cinder/user_domain_name': value => $user_domain_name;
'cinder/os_region_name': value => $os_region_name_real; 'cinder/os_region_name': value => $os_region_name_real;
'cinder/catalog_info': value => $catalog_info_real; 'cinder/catalog_info': value => $catalog_info_real;
'cinder/cross_az_attach': value => $cross_az_attach;
} }
} }

View File

@ -391,6 +391,10 @@
# If unable to do so, will use "127.0.0.1". # If unable to do so, will use "127.0.0.1".
# Defaults to $::os_service_default. # 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 # DEPRECATED PARAMETERS
# #
# [*notify_api_faults*] # [*notify_api_faults*]
@ -432,10 +436,6 @@
# <service_type>:<service_name>:<endpoint_type> # <service_type>:<service_name>:<endpoint_type>
# Defaults to undef # Defaults to undef
# #
# [*cross_az_attach*]
# (optional) Allow attach between instance and volume in different availability zones.
# Defaults to undef
#
class nova( class nova(
$ensure_package = 'present', $ensure_package = 'present',
$database_connection = undef, $database_connection = undef,
@ -520,6 +520,7 @@ class nova(
$disk_allocation_ratio = $::os_service_default, $disk_allocation_ratio = $::os_service_default,
$purge_config = false, $purge_config = false,
$my_ip = $::os_service_default, $my_ip = $::os_service_default,
$cross_az_attach = $::os_service_default,
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$notify_api_faults = undef, $notify_api_faults = undef,
$image_service = undef, $image_service = undef,
@ -529,7 +530,6 @@ class nova(
$database_min_pool_size = undef, $database_min_pool_size = undef,
$os_region_name = undef, $os_region_name = undef,
$cinder_catalog_info = undef, $cinder_catalog_info = undef,
$cross_az_attach = undef,
) inherits nova::params { ) inherits nova::params {
include nova::deps include nova::deps
@ -560,11 +560,6 @@ in a future release. Use nova::cinder::os_region_name instead')
in a future release. Use nova::cinder::catalog_info instead') 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 { if $image_service {
warning('The unused image_service parameter is deprecated, as we are \ warning('The unused image_service parameter is deprecated, as we are \
already using python-glanceclient instead of old glance client.') already using python-glanceclient instead of old glance client.')
@ -779,6 +774,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
} }
nova_config { nova_config {
'cinder/cross_az_attach': value => $cross_az_attach;
'upgrade_levels/cells': value => $upgrade_level_cells; 'upgrade_levels/cells': value => $upgrade_level_cells;
'upgrade_levels/cert': value => $upgrade_level_cert; 'upgrade_levels/cert': value => $upgrade_level_cert;
'upgrade_levels/compute': value => $upgrade_level_compute; 'upgrade_levels/compute': value => $upgrade_level_compute;

View File

@ -7,4 +7,3 @@ deprecations:
- ``nova::os_region_name`` ( now ``nova::cinder::os_region_name``) - ``nova::os_region_name`` ( now ``nova::cinder::os_region_name``)
- ``nova::cinder_catalog_info`` ( now ``nova::cinder::catalog_info``) - ``nova::cinder_catalog_info`` ( now ``nova::cinder::catalog_info``)
- ``nova::cross_az_attach`` ( now ``nova::cinder::cross_az_attach``)

View File

@ -17,7 +17,6 @@ describe 'nova::cinder' do
should contain_nova_config('cinder/user_domain_name').with_value('Default') should contain_nova_config('cinder/user_domain_name').with_value('Default')
should contain_nova_config('cinder/os_region_name').with_value('<SERVICE DEFAULT>') should contain_nova_config('cinder/os_region_name').with_value('<SERVICE DEFAULT>')
should contain_nova_config('cinder/catalog_info').with_value('<SERVICE DEFAULT>') should contain_nova_config('cinder/catalog_info').with_value('<SERVICE DEFAULT>')
should contain_nova_config('cinder/cross_az_attach').with_value('<SERVICE DEFAULT>')
end end
end end
@ -32,7 +31,6 @@ describe 'nova::cinder' do
:region_name => 'RegionOne', :region_name => 'RegionOne',
:os_region_name => 'RegionOne', :os_region_name => 'RegionOne',
:catalog_info => 'volumev3:cinderv3:publicURL', :catalog_info => 'volumev3:cinderv3:publicURL',
:cross_az_attach => true,
} }
end end
@ -48,7 +46,6 @@ describe 'nova::cinder' do
should contain_nova_config('cinder/user_domain_name').with_value('Default') 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/os_region_name').with_value('RegionOne')
should contain_nova_config('cinder/catalog_info').with_value('volumev3:cinderv3:publicURL') 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
end end

View File

@ -52,6 +52,7 @@ describe 'nova' do
is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('cinder/cross_az_attach').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/cpu_allocation_ratio').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/cpu_allocation_ratio').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/ram_allocation_ratio').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/ram_allocation_ratio').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/disk_allocation_ratio').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/disk_allocation_ratio').with_value('<SERVICE DEFAULT>')
@ -91,6 +92,7 @@ describe 'nova' do
:notification_topics => 'openstack', :notification_topics => 'openstack',
:notification_format => 'unversioned', :notification_format => 'unversioned',
:report_interval => '60', :report_interval => '60',
:cross_az_attach => true,
:ovsdb_connection => 'tcp:127.0.0.1:6640', :ovsdb_connection => 'tcp:127.0.0.1:6640',
:upgrade_level_cells => '1.0.0', :upgrade_level_cells => '1.0.0',
:upgrade_level_cert => '1.0.0', :upgrade_level_cert => '1.0.0',
@ -139,6 +141,7 @@ describe 'nova' do
is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('30') is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('30')
is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('nova') is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('nova')
is_expected.to contain_nova_config('cinder/cross_az_attach').with_value(true)
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60')
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10')
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value(true) is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value(true)