Add support for [oslo_messaging_rabbit] enable_cancel_on_failover

Depends-on: https://review.opendev.org/928440
Change-Id: I784b70703aef13470d53efcd15c2bbf5089da945
This commit is contained in:
Takashi Kajinami 2024-09-25 21:53:40 +09:00
parent 3f705c3921
commit f1fa5f5537
3 changed files with 129 additions and 114 deletions

View File

@ -93,6 +93,11 @@
# (Optional) Limit the number of memory bytes used by the quorum queue.
# Defaults to $facts['os_service_default']
#
# [*rabbit_enable_cancel_on_failover*]
# (Optional) Enable x-cancel-on-ha-failover flag so that rabbitmq server will
# cancel and notify consumers when queue is down.
# Defaults to $facts['os_service_default']
#
# [*rabbit_retry_interval*]
# (Optional) How frequently to retry connecting with RabbitMQ.
# (integer value)
@ -325,72 +330,73 @@
# Defaults to undef
#
class nova(
$ensure_package = 'present',
$default_transport_url = $facts['os_service_default'],
$rpc_response_timeout = $facts['os_service_default'],
$long_rpc_timeout = $facts['os_service_default'],
$control_exchange = $facts['os_service_default'],
$executor_thread_pool_size = $facts['os_service_default'],
$rabbit_use_ssl = $facts['os_service_default'],
$rabbit_heartbeat_timeout_threshold = $facts['os_service_default'],
$rabbit_heartbeat_rate = $facts['os_service_default'],
$rabbit_heartbeat_in_pthread = $facts['os_service_default'],
$rabbit_qos_prefetch_count = $facts['os_service_default'],
$rabbit_ha_queues = $facts['os_service_default'],
$rabbit_quorum_queue = $facts['os_service_default'],
$rabbit_transient_quorum_queue = $facts['os_service_default'],
$rabbit_quorum_delivery_limit = $facts['os_service_default'],
$rabbit_quorum_max_memory_length = $facts['os_service_default'],
$rabbit_quorum_max_memory_bytes = $facts['os_service_default'],
$rabbit_retry_interval = $facts['os_service_default'],
$kombu_ssl_ca_certs = $facts['os_service_default'],
$kombu_ssl_certfile = $facts['os_service_default'],
$kombu_ssl_keyfile = $facts['os_service_default'],
$kombu_ssl_version = $facts['os_service_default'],
$kombu_reconnect_delay = $facts['os_service_default'],
$kombu_failover_strategy = $facts['os_service_default'],
$kombu_compression = $facts['os_service_default'],
$amqp_durable_queues = $facts['os_service_default'],
$host = $facts['os_service_default'],
$service_down_time = $facts['os_service_default'],
$state_path = '/var/lib/nova',
$lock_path = $::nova::params::lock_path,
$report_interval = $facts['os_service_default'],
$periodic_fuzzy_delay = $facts['os_service_default'],
$rootwrap_config = '/etc/nova/rootwrap.conf',
Boolean $use_ssl = false,
Array[String[1]] $enabled_ssl_apis = ['metadata', 'osapi_compute'],
$ca_file = undef,
$cert_file = undef,
$key_file = undef,
Nova::SshKey $nova_public_key = undef,
Nova::SshKey $nova_private_key = undef,
$ssl_only = $facts['os_service_default'],
$cert = $facts['os_service_default'],
$key = $facts['os_service_default'],
$console_ssl_ciphers = $facts['os_service_default'],
$console_ssl_minimum_version = $facts['os_service_default'],
$notification_transport_url = $facts['os_service_default'],
$notification_driver = $facts['os_service_default'],
$notification_topics = $facts['os_service_default'],
$notification_format = $facts['os_service_default'],
$notify_on_state_change = $facts['os_service_default'],
$ovsdb_connection = $facts['os_service_default'],
$upgrade_level_compute = $facts['os_service_default'],
$upgrade_level_conductor = $facts['os_service_default'],
$upgrade_level_scheduler = $facts['os_service_default'],
$cpu_allocation_ratio = $facts['os_service_default'],
$ram_allocation_ratio = $facts['os_service_default'],
$disk_allocation_ratio = $facts['os_service_default'],
$initial_cpu_allocation_ratio = $facts['os_service_default'],
$initial_ram_allocation_ratio = $facts['os_service_default'],
$initial_disk_allocation_ratio = $facts['os_service_default'],
Boolean $purge_config = false,
$my_ip = $facts['os_service_default'],
$dhcp_domain = $facts['os_service_default'],
$instance_name_template = $facts['os_service_default'],
$ensure_package = 'present',
$default_transport_url = $facts['os_service_default'],
$rpc_response_timeout = $facts['os_service_default'],
$long_rpc_timeout = $facts['os_service_default'],
$control_exchange = $facts['os_service_default'],
$executor_thread_pool_size = $facts['os_service_default'],
$rabbit_use_ssl = $facts['os_service_default'],
$rabbit_heartbeat_timeout_threshold = $facts['os_service_default'],
$rabbit_heartbeat_rate = $facts['os_service_default'],
$rabbit_heartbeat_in_pthread = $facts['os_service_default'],
$rabbit_qos_prefetch_count = $facts['os_service_default'],
$rabbit_ha_queues = $facts['os_service_default'],
$rabbit_quorum_queue = $facts['os_service_default'],
$rabbit_transient_quorum_queue = $facts['os_service_default'],
$rabbit_quorum_delivery_limit = $facts['os_service_default'],
$rabbit_quorum_max_memory_length = $facts['os_service_default'],
$rabbit_quorum_max_memory_bytes = $facts['os_service_default'],
$rabbit_enable_cancel_on_failover = $facts['os_service_default'],
$rabbit_retry_interval = $facts['os_service_default'],
$kombu_ssl_ca_certs = $facts['os_service_default'],
$kombu_ssl_certfile = $facts['os_service_default'],
$kombu_ssl_keyfile = $facts['os_service_default'],
$kombu_ssl_version = $facts['os_service_default'],
$kombu_reconnect_delay = $facts['os_service_default'],
$kombu_failover_strategy = $facts['os_service_default'],
$kombu_compression = $facts['os_service_default'],
$amqp_durable_queues = $facts['os_service_default'],
$host = $facts['os_service_default'],
$service_down_time = $facts['os_service_default'],
$state_path = '/var/lib/nova',
$lock_path = $::nova::params::lock_path,
$report_interval = $facts['os_service_default'],
$periodic_fuzzy_delay = $facts['os_service_default'],
$rootwrap_config = '/etc/nova/rootwrap.conf',
Boolean $use_ssl = false,
Array[String[1]] $enabled_ssl_apis = ['metadata', 'osapi_compute'],
$ca_file = undef,
$cert_file = undef,
$key_file = undef,
Nova::SshKey $nova_public_key = undef,
Nova::SshKey $nova_private_key = undef,
$ssl_only = $facts['os_service_default'],
$cert = $facts['os_service_default'],
$key = $facts['os_service_default'],
$console_ssl_ciphers = $facts['os_service_default'],
$console_ssl_minimum_version = $facts['os_service_default'],
$notification_transport_url = $facts['os_service_default'],
$notification_driver = $facts['os_service_default'],
$notification_topics = $facts['os_service_default'],
$notification_format = $facts['os_service_default'],
$notify_on_state_change = $facts['os_service_default'],
$ovsdb_connection = $facts['os_service_default'],
$upgrade_level_compute = $facts['os_service_default'],
$upgrade_level_conductor = $facts['os_service_default'],
$upgrade_level_scheduler = $facts['os_service_default'],
$cpu_allocation_ratio = $facts['os_service_default'],
$ram_allocation_ratio = $facts['os_service_default'],
$disk_allocation_ratio = $facts['os_service_default'],
$initial_cpu_allocation_ratio = $facts['os_service_default'],
$initial_ram_allocation_ratio = $facts['os_service_default'],
$initial_disk_allocation_ratio = $facts['os_service_default'],
Boolean $purge_config = false,
$my_ip = $facts['os_service_default'],
$dhcp_domain = $facts['os_service_default'],
$instance_name_template = $facts['os_service_default'],
# DEPRECATED PARAMETERS
$auth_strategy = undef,
$auth_strategy = undef,
) inherits nova::params {
include nova::deps
@ -524,6 +530,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa, ssh-ed25519.")
rabbit_quorum_delivery_limit => $rabbit_quorum_delivery_limit,
rabbit_quorum_max_memory_length => $rabbit_quorum_max_memory_length,
rabbit_quorum_max_memory_bytes => $rabbit_quorum_max_memory_bytes,
enable_cancel_on_failover => $rabbit_enable_cancel_on_failover,
rabbit_retry_interval => $rabbit_retry_interval,
}

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``nova::rabbit_enable_cancel_on_failover`` parameter has been
added.

View File

@ -56,6 +56,7 @@ describe 'nova' do
:rabbit_quorum_delivery_limit => '<SERVICE DEFAULT>',
:rabbit_quorum_max_memory_length => '<SERVICE DEFAULT>',
:rabbit_quorum_max_memory_bytes => '<SERVICE DEFAULT>',
:enable_cancel_on_failover => '<SERVICE DEFAULT>',
:rabbit_retry_interval => '<SERVICE DEFAULT>',
)
is_expected.to contain_oslo__messaging__notifications('nova_config').with(
@ -99,55 +100,56 @@ describe 'nova' do
let :params do
{
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:rpc_response_timeout => '30',
:long_rpc_timeout => '1800',
:control_exchange => 'nova',
:executor_thread_pool_size => 64,
:rabbit_use_ssl => true,
:rabbit_heartbeat_timeout_threshold => '60',
:rabbit_heartbeat_rate => '10',
:rabbit_heartbeat_in_pthread => true,
:rabbit_qos_prefetch_count => 0,
:kombu_reconnect_delay => '5.0',
:amqp_durable_queues => true,
:kombu_compression => 'gzip',
:kombu_ssl_ca_certs => '/etc/ca.cert',
:kombu_ssl_certfile => '/etc/certfile',
:kombu_ssl_keyfile => '/etc/key',
:kombu_ssl_version => 'TLSv1',
:rabbit_ha_queues => true,
:rabbit_quorum_queue => true,
:rabbit_transient_quorum_queue => true,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
:rabbit_retry_interval => '1',
:lock_path => '/var/locky/path',
:state_path => '/var/lib/nova2',
:service_down_time => '60',
:auth_strategy => 'foo',
:ensure_package => '2012.1.1-15.el6',
:host => 'test-001.example.org',
:notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:notification_driver => 'ceilometer.compute.nova_notifier',
:notification_topics => 'openstack',
:notification_format => 'unversioned',
:report_interval => '10',
:periodic_fuzzy_delay => '61',
:ovsdb_connection => 'tcp:127.0.0.1:6640',
:upgrade_level_compute => '1.0.0',
:upgrade_level_conductor => '1.0.0',
:upgrade_level_scheduler => '1.0.0',
:purge_config => false,
:my_ip => '192.0.2.1',
:ssl_only => true,
:cert => '/etc/ssl/private/snakeoil.pem',
:key => '/etc/ssl/certs/snakeoil.pem',
:console_ssl_ciphers => 'kEECDH+aECDSA+AES:kEECDH+AES+aRSA:kEDH+aRSA+AES',
:console_ssl_minimum_version => 'tlsv1_2',
:dhcp_domain => 'foo',
:instance_name_template => 'instance-%08x',
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:rpc_response_timeout => '30',
:long_rpc_timeout => '1800',
:control_exchange => 'nova',
:executor_thread_pool_size => 64,
:rabbit_use_ssl => true,
:rabbit_heartbeat_timeout_threshold => '60',
:rabbit_heartbeat_rate => '10',
:rabbit_heartbeat_in_pthread => true,
:rabbit_qos_prefetch_count => 0,
:kombu_reconnect_delay => '5.0',
:amqp_durable_queues => true,
:kombu_compression => 'gzip',
:kombu_ssl_ca_certs => '/etc/ca.cert',
:kombu_ssl_certfile => '/etc/certfile',
:kombu_ssl_keyfile => '/etc/key',
:kombu_ssl_version => 'TLSv1',
:rabbit_ha_queues => true,
:rabbit_quorum_queue => true,
:rabbit_transient_quorum_queue => true,
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
:rabbit_enable_cancel_on_failover => false,
:rabbit_retry_interval => '1',
:lock_path => '/var/locky/path',
:state_path => '/var/lib/nova2',
:service_down_time => '60',
:auth_strategy => 'foo',
:ensure_package => '2012.1.1-15.el6',
:host => 'test-001.example.org',
:notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:notification_driver => 'ceilometer.compute.nova_notifier',
:notification_topics => 'openstack',
:notification_format => 'unversioned',
:report_interval => '10',
:periodic_fuzzy_delay => '61',
:ovsdb_connection => 'tcp:127.0.0.1:6640',
:upgrade_level_compute => '1.0.0',
:upgrade_level_conductor => '1.0.0',
:upgrade_level_scheduler => '1.0.0',
:purge_config => false,
:my_ip => '192.0.2.1',
:ssl_only => true,
:cert => '/etc/ssl/private/snakeoil.pem',
:key => '/etc/ssl/certs/snakeoil.pem',
:console_ssl_ciphers => 'kEECDH+aECDSA+AES:kEECDH+AES+aRSA:kEDH+aRSA+AES',
:console_ssl_minimum_version => 'tlsv1_2',
:dhcp_domain => 'foo',
:instance_name_template => 'instance-%08x',
}
end
@ -195,6 +197,7 @@ describe 'nova' do
:rabbit_quorum_delivery_limit => 3,
:rabbit_quorum_max_memory_length => 5,
:rabbit_quorum_max_memory_bytes => 1073741824,
:enable_cancel_on_failover => false,
:rabbit_retry_interval => '1',
)
is_expected.to contain_oslo__messaging__notifications('nova_config').with(