Add transport_url and rpc_response_timeout for oslo.messaging

This commit adds the transport_url parameters for oslo.messaging. The
url is of the form:

  transport://user:pass@host1:port[,hostN:portN]/virtual_host

Where the transport scheme specifies the rpc or notification backend
as one of rabbit, amqp, zmq, etc. Oslo.messaging is deprecating the
host, port, and auth configuration options [1]. All drivers will get
these options via the transport_url.

The rpc_response_timeout was also included because it is used
explicitly in oslo.messaging, and it's being set in some deployment
tools. So by using the oslo::messaging resource in nova, it will
break those deployment tools. So a commit to take this into use is
needed on that side.

This patch:
* use oslo::messaging::default resource
* use oslo::messaging::notifications resource
* add parameters for transport_url(s)
* add parameter for rpc_response_timeout
* update spec tests
* add feature release note

[1] https://review.openstack.org/#/c/317285/

Change-Id: I961e7b4f061efef3ee988e698b41a7241afb4053
This commit is contained in:
Andrew Smith 2016-05-26 15:24:28 -04:00 committed by Emilien Macchi
parent 068a87016e
commit cb3db69252
3 changed files with 38 additions and 2 deletions

View File

@ -49,6 +49,16 @@
# (optional) If set, use this value for max_overflow with sqlalchemy.
# Defaults to: undef.
#
# [*default_transport_url*]
# (optional) A URL representing the messaging driver to use and its full
# configuration. Transport URLs take the form:
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
# Defaults to $::os_service_default
#
# [*rpc_response_timeout*]
# (Optional) Seconds to wait for a response from a call. (integer value)
# Defaults to $::os_service_default.
#
# [*rpc_backend*]
# (optional) The rpc backend implementation to use, can be:
# rabbit (for rabbitmq)
@ -300,6 +310,12 @@
# 'key-data' }, where 'key-type' is one of (ssh-rsa, ssh-dsa, ssh-ecdsa) and
# 'key-data' is the contents of the private key file.
#
# [*notification_transport_url*]
# (optional) A URL representing the messaging driver to use for notifications
# and its full configuration. Transport URLs take the form:
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
# Defaults to $::os_service_default
#
# [*notification_driver*]
# (optional) Driver or drivers to handle sending notifications.
# Value can be a string or a list.
@ -398,6 +414,8 @@ class nova(
$database_max_retries = undef,
$database_retry_interval = undef,
$database_max_overflow = undef,
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$rpc_backend = $::os_service_default,
$image_service = 'nova.image.glance.GlanceImageService',
# these glance params should be optional
@ -457,6 +475,7 @@ class nova(
$use_syslog = undef,
$use_stderr = undef,
$log_facility = undef,
$notification_transport_url = $::os_service_default,
$notification_driver = $::os_service_default,
$notification_topics = $::os_service_default,
$notify_api_faults = false,
@ -663,9 +682,15 @@ class nova(
}
}
oslo::messaging::default { 'nova_config':
transport_url => $default_transport_url,
rpc_response_timeout => $rpc_response_timeout,
}
oslo::messaging::notifications { 'nova_config':
driver => $notification_driver,
topics => $notification_topics,
transport_url => $notification_transport_url,
driver => $notification_driver,
topics => $notification_topics,
}
nova_config {

View File

@ -0,0 +1,3 @@
---
features:
- Add oslo.messaging transport_url parameters via puppet-oslo resource

View File

@ -59,6 +59,8 @@ describe 'nova' do
is_expected.to contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf')
is_expected.to contain_nova_config('DEFAULT/report_interval').with_value('10')
is_expected.to contain_nova_config('DEFAULT/use_ipv6').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('cinder/os_region_name').with_ensure('absent')
is_expected.to contain_nova_config('cinder/catalog_info').with('value' => 'volumev2:cinderv2:publicURL')
end
@ -71,6 +73,8 @@ describe 'nova' do
{ :debug => true,
:log_dir => '/var/log/nova2',
:image_service => 'nova.image.local.LocalImageService',
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:rpc_response_timeout => '30',
:rpc_backend => 'rabbit',
:rabbit_host => 'rabbit',
:rabbit_userid => 'rabbit_user',
@ -85,6 +89,7 @@ describe 'nova' do
:ensure_package => '2012.1.1-15.el6',
:memcached_servers => ['memcached01:11211', 'memcached02:11211'],
:host => 'test-001.example.org',
:notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:notification_driver => 'ceilometer.compute.nova_notifier',
:notification_topics => 'openstack',
:notify_api_faults => true,
@ -126,6 +131,7 @@ describe 'nova' do
it 'configures rabbit' do
is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_host').with_value('rabbit')
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_password').with_value('password').with_secret(true)
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_port').with_value('5673')
@ -159,6 +165,8 @@ describe 'nova' do
is_expected.to contain_nova_config('DEFAULT/state_path').with_value('/var/lib/nova2')
is_expected.to contain_nova_config('oslo_concurrency/lock_path').with_value('/var/locky/path')
is_expected.to contain_nova_config('DEFAULT/service_down_time').with_value('120')
is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('30')
is_expected.to contain_nova_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_nova_config('oslo_messaging_notifications/driver').with_value('ceilometer.compute.nova_notifier')
is_expected.to contain_nova_config('oslo_messaging_notifications/topics').with_value('openstack')
is_expected.to contain_nova_config('DEFAULT/notify_api_faults').with_value(true)