Add ceilometer messaging_url for each service...

Without specifying messaging_urls, ceilometer only listens on the vhost
specified in the rabbit configuration directives.
To align with the the default OSA architecture, which isolates each service
into it's own respective rabbitmq vhost, this patchset has added jinja code
in the ceilometer.conf.j2 template to specifiy a messaging_url for each service,
 and for each service, each rabbitmq host. This ensures ceilometer is spawning
the correct number of listeners on the correct vhost and consuming notifications
correctly.

In addition, a few small changes were made in the patch set:

* store_events is now True by default
* rabbitmq_userid and rabbitmq_vhost service variables have been moved to group_vars.

Backports included:

* https://review.openstack.org/#/c/267112/5

Change-Id: I2bd9cf0ac7ca0492f6b2c56897f77117d2ae730b
Closes-Bug: #1526457
(cherry picked from commit f4757d6574)
This commit is contained in:
Miguel Alex Cantu 2016-01-05 15:24:09 +00:00
parent c8d429b5b4
commit 210012da41
3 changed files with 63 additions and 0 deletions

View File

@ -128,6 +128,8 @@ nova_ceph_client: '{{ cinder_ceph_client }}'
nova_ceph_client_uuid: '{{ cinder_ceph_client_uuid | default() }}'
nova_dhcp_domain: "{{ dhcp_domain }}"
nova_service_in_ldap: "{{ service_ldap_backend_enabled }}"
nova_rabbitmq_userid: nova
nova_rabbitmq_vhost: /nova
## Neutron
@ -143,6 +145,8 @@ neutron_service_adminurl: "{{ neutron_service_adminuri }}"
neutron_service_region: "{{ service_region }}"
neutron_dhcp_domain: "{{ dhcp_domain }}"
neutron_service_in_ldap: "{{ service_ldap_backend_enabled }}"
neutron_rabbitmq_userid: neutron
neutron_rabbitmq_vhost: /neutron
## Glance
@ -158,6 +162,8 @@ glance_service_region: "{{ service_region }}"
glance_service_in_ldap: "{{ service_ldap_backend_enabled }}"
# Only specify this if you want to list the servers - by default LB host/port will be used
#glance_api_servers: "{% for host in groups['glance_all'] %}{{ hostvars[host]['container_address'] }}:{{ glance_service_port }}{% if not loop.last %},{% endif %}{% endfor %}"
glance_rabbitmq_userid: glance
glance_rabbitmq_vhost: /glance
## Keystone
@ -172,6 +178,8 @@ keystone_service_publicuri_proto: "{{ openstack_service_publicuri_proto | defaul
keystone_service_user_name: keystone
keystone_service_tenant_name: service
keystone_service_region: "{{ service_region }}"
keystone_rabbitmq_userid: keystone
keystone_rabbitmq_vhost: /keystone
keystone_service_internaluri_insecure: false
keystone_service_adminuri_insecure: false
@ -193,11 +201,15 @@ keystone_service_in_ldap: "{{ service_ldap_backend_enabled }}"
horizon_service_region: "{{ service_region }}"
horizon_enable_cinder_backup: "{% if cinder_service_backup_program_enabled is defined and cinder_service_backup_program_enabled | bool %}True{% else %}False{% endif %}"
horizon_enable_neutron_lbaas: "{% if neutron_plugin_base is defined and 'neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPlugin' in neutron_plugin_base %}True{% else %}False{% endif %}"
horizon_rabbitmq_userid: horizon
horizon_rabbitmq_vhost: /horizon
## Heat
heat_service_region: "{{ service_region }}"
heat_service_in_ldap: "{{ service_ldap_backend_enabled }}"
heat_rabbitmq_userid: heat
heat_rabbitmq_vhost: /heat
## Cinder
@ -220,6 +232,8 @@ cinder_ceph_client: cinder
cinder_backend_lvm_inuse: '{{ (cinder_backends|default("")|to_json).find("cinder.volume.drivers.lvm.LVMVolumeDriver") != -1 }}'
cinder_service_region: "{{ service_region }}"
cinder_service_in_ldap: "{{ service_ldap_backend_enabled }}"
cinder_rabbitmq_userid: cinder
cinder_rabbitmq_vhost: /cinder
## Swift
@ -230,6 +244,8 @@ swift_system_comment: swift system user
swift_system_home_folder: "/var/lib/{{ swift_system_user_name }}"
swift_service_region: "{{ service_region }}"
swift_service_in_ldap: "{{ service_ldap_backend_enabled }}"
swift_rabbitmq_userid: swift
swift_rabbitmq_vhost: /swift
## OpenStack Openrc

View File

@ -82,12 +82,20 @@ ceilometer_service_adminurl: "{{ ceilometer_service_adminuri }}"
ceilometer_service_in_ldap: false
## Ceilometer config
# If the following variables are unset in user_variables, the value set will be half the number of available VCPUs
# ceilometer_api_workers: 1
# ceilometer_collector_workers: 1
# ceilometer_notification_workers: 1
# Enabled/Disable Ceilometer per service
glance_ceilometer_enabled: false
nova_ceilometer_enabled: false
cinder_ceilometer_enabled: false
neutron_ceilometer_enabled: false
heat_ceilometer_enabled: false
## Keystone authentication middleware
ceilometer_keystone_auth_plugin: password

View File

@ -4,6 +4,7 @@
{% set workers = _workers if _workers > 0 else 1 %}
[DEFAULT]
debug = {{ debug }}
auth_strategy = keystone
notification_topics = notifications
rpc_backend = rabbit
@ -29,6 +30,44 @@ workers = {{ ceilometer_collector_workers | default(workers) }}
[notification]
workers = {{ ceilometer_notification_workers | default(workers) }}
store_events = True
# Configuring the notification queue listeners
# Ceilometer needs to connect to it's own rabbitmq vhost
{% for host in groups['rabbitmq_all'] %}
messaging_urls = rabbit://{{ ceilometer_rabbitmq_userid }}:{{ ceilometer_rabbitmq_password }}@{{ hostvars[host]['ansible_ssh_host'] }}:{{ rabbitmq_port }}/{{ ceilometer_rabbitmq_vhost }}
{% endfor %}
{% if glance_ceilometer_enabled %}
# Glance
{% for host in groups['rabbitmq_all'] %}
messaging_urls = rabbit://{{ glance_rabbitmq_userid }}:{{ glance_rabbitmq_password }}@{{ hostvars[host]['ansible_ssh_host'] }}:{{ rabbitmq_port }}/{{ glance_rabbitmq_vhost }}
{% endfor %}
{% endif %}
{% if nova_ceilometer_enabled %}
# Nova
{% for host in groups['rabbitmq_all'] %}
messaging_urls = rabbit://{{ nova_rabbitmq_userid }}:{{ nova_rabbitmq_password }}@{{ hostvars[host]['ansible_ssh_host'] }}:{{ rabbitmq_port }}/{{ nova_rabbitmq_vhost }}
{% endfor %}
{% endif %}
{% if cinder_ceilometer_enabled %}
# Cinder
{% for host in groups['rabbitmq_all'] %}
messaging_urls = rabbit://{{ cinder_rabbitmq_userid }}:{{ cinder_rabbitmq_password }}@{{ hostvars[host]['ansible_ssh_host'] }}:{{ rabbitmq_port }}/{{ cinder_rabbitmq_vhost }}
{% endfor %}
{% endif %}
{% if neutron_ceilometer_enabled %}
# Neutron
{% for host in groups['rabbitmq_all'] %}
messaging_urls = rabbit://{{ neutron_rabbitmq_userid }}:{{ neutron_rabbitmq_password }}@{{ hostvars[host]['ansible_ssh_host'] }}:{{ rabbitmq_port }}/{{ neutron_rabbitmq_vhost }}
{% endfor %}
{% endif %}
{% if heat_ceilometer_enabled %}
# Heat
{% for host in groups['rabbitmq_all'] %}
messaging_urls = rabbit://{{ heat_rabbitmq_userid }}:{{ heat_rabbitmq_password }}@{{ hostvars[host]['ansible_ssh_host'] }}:{{ rabbitmq_port }}/{{ heat_rabbitmq_vhost }}
{% endfor %}
{% endif %}
# TODO: Keystone
# TODO: Swift
[database]
metering_connection = {{ ceilometer_connection_string }}