[WIP] configure ceilometer to dispatch to gnocchi

This commit is contained in:
Steve Lewis 2016-01-25 11:59:22 -08:00
parent efa95700bb
commit 308678b57a
4 changed files with 106 additions and 16 deletions

View File

@ -1,8 +1,14 @@
OpenStack Ansible Gnocchi
OpenStack-Ansible Gnocchi
=========================
A simple role to deploy `OpenStack Gnocchi <http://gnocchi.xyz/>`_
from source in a manner similar to the OpenStack Ansible project.
from source in a manner similar to the OpenStack-Ansible project.
Project Status
--------------
Currently the role is expected to deploy and run a gnocchi service
appropriately. Integration with Ceilometer is in development and should be
considered experimental at this time.
Requirements
------------
@ -10,16 +16,17 @@ Requirements
Index
^^^^^
You will need to have an appropriate SQLAlchemy-supported database for the
index. OpenStack Ansible provides roles to deploy a Galera cluster, and
index. OpenStack-Ansible provides roles to deploy a Galera cluster, and
this role is presumed by the default indexer url but you can override that
using the config template library if you wish to use PostgreSQL.
Storage
^^^^^^^
You will need to have an appropriate set of data stores. Filesystem storage
is the default and is NOT an H.A. solution and will not work properly if there
is an option but is NOT an H.A. solution and will not work properly if there
are multiple Gnocchi instances in your OpenStack cluster. First-class support
is planned for Swift and Ceph.
is planned for Swift is in testing and is the current default. support for
Ceph as a storage engine is theoretically possible but has not been tested yet.
Coordination
^^^^^^^^^^^^
@ -41,15 +48,19 @@ found in the openstack-ansible project: ``scripts/pw-token-gen.py``
TODO
^^^^
- Switch to Mysql as default coordinator ala
- Switch to Swift as default storage
- Work out the ceilometer config to send metrics to gnocchi for storage.
"memcached://localhost:11211?timeout=5" or MySQL as default coordinator
- Future support in Ceilometer conf: https://review.openstack.org/#/c/253635
- Switch to Mysql as default coordinator (example: gnocchi_tooz_url =
"mysql://gnocchi@localhost:${PORT}/gnocchi?timeout=5")
Role Variables
--------------
The variables which need to be provided will vary based on the storage chosen.
The default storage is Swift. If you wish to use another storage option you
will need to provide the appropriate overrides (specified in
gnocchi_conf_overrides found defaults/main.yml and see also
ext/openstack_deploy/openstack_gnocchi_overrides.yml.example for how to use
this).
Other variables expected for this role include:
- keystone_auth_admin_token
@ -71,7 +82,7 @@ create service users/roles/endpoints as needed within Keystone.
Each of the ``keystone_service_*uri`` variables is expected to include
protocol, host, and port for the keystone service. Do not specify a path, to
include keystone protocol version. See also the OpenStack Ansible project and
include keystone protocol version. See also the OpenStack-Ansible project and
the os_keystone role for more details on these variables.
Each ``keystone_*_insecure`` variable is expected to indicate whether or not
@ -79,11 +90,11 @@ Keystone is using the http protocol or not, and should evaluate to a boolean.
The ``galera_address`` is expected to direct to the your MySQL server or a load
balancer host which sits in front of your Galera cluster. This may be See also
the OpenStack Ansible project for more details. The ``galera_root_*`` variables
the OpenStack-Ansible project for more details. The ``galera_root_*`` variables
should contain the credentials used to create the Gnocchi index database.
The ``memcached_*`` variables are expected for caching Keystone auth. See also
the OpenStack Ansible project and the os_keystone role for more details on
the OpenStack-Ansible project and the os_keystone role for more details on
these variables.
Each of the ``*_lb_vip_address`` variables is expected to contain the host
@ -120,7 +131,7 @@ Credits
-------
The ``config_template`` library module was developed by Kevin Carter for the
OpenStack Ansible and is vendored in ``library``.
OpenStack-Ansible and is vendored in ``library``.
The role layout and documentation was cribbed from the Openstack Searchlight
role by Ian Cordasco.

View File

@ -51,9 +51,8 @@ gnocchi_galera_database: gnocchi
gnocchi_galera_user: gnocchi
gnocchi_galera_address: "{{ galera_address }}"
# TODO(stevelle) need to allow make it easier to use real storage options, default to Swift
#: Storage info
gnocchi_storage_driver: file
gnocchi_storage_driver: swift
gnocchi_coordination_url: "file://var/lib/gnocchi/locks"
#: Default Archive Policies

View File

@ -0,0 +1,70 @@
---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## This can be used as examples for use in hand-building the necessary overrides
## for now. An improved mechanism for this is pending.
## Demonstrating the expected configurations necessary to use gnocchi as the ceilometer dispatcher
gnocchi_ceilo_conf_overrides:
default:
meter_dispatchers: gnocchi
event_dispatchers: ""
collector:
batch_size: 10
batch_timeout: 5
# NOTE(stevelle) no support for storing events in gnocchi yet
notification:
store_events: false
storage:
max_retries: 80
dispatcher_gnocchi:
url: "{{ gnocchi_service_publicurl }}"
archive_policy: low
## Demonstrating the expected ceilometer configurations necessary to use swift for gnocchi storage under ceilometer
gnocchi_ceilo_swift_conf_overrides:
dispatcher_gnocchi:
filter_service_activity: true
filter_project: gnocchi_swift
## Demonstrating the expected configurations necessary to use swift for storage
gnocchi_swift_conf_overrides:
storage:
driver: swift
swift_auth_version: 3
swift_authurl: "{{ keystone_service_internaluri }}"
swift_user: "service:{{ gnocchi_service_user_name }}"
swift_key: "{{ gnocchi_service_password }}"
swift_region_name: "{{ glance_service_region }}"
swift_user_domain: default
swift_project_domain: default
swift_tenant_name: default
## Demonstrating the expected configurations necessary to use ceph for storage
gnocchi_ceph_conf_overrides:
storage:
driver: ceph
ceph_username: gnocci
ceph_keyring: "/etc/ceph/ceph.client.{{ gnocchi_service_user_name }}.keyring"
## Perform successive dict merges to apply all of these overrides
## FUTURE The following are all contingent on the combine filter introduced in Ansible 2.0
## Ceilometer overrides
#ceilometer_ceilometer_conf_overrides: {{ ceilometer_ceilometer_conf_overrides |combine(gnocchi_ceilo_conf_overrides, recursive=True) }}
#ceilometer_ceilometer_conf_overrides: {{ ceilometer_ceilometer_conf_overrides |combine(gnocchi_ceilo_swift_conf_overrides, recursive=True) }}
## Gnocchi overrides - Uncomment these only as appropriate
#gnocchi_conf_overrides: {{ gnocchi_conf_overrides |combine(gnocchi_swift_conf_overrides, recursive=True) }}
#gnocchi_conf_overrides: {{ gnocchi_conf_overrides |combine(gnocchi_ceph_conf_overrides, recursive=True) }}

View File

@ -1,4 +1,5 @@
# {{ ansible_managed }}
[DEFAULT]
debug = {{ debug }}
fatal_deprecations = {{ gnocchi_fatal_deprecations }}
@ -37,6 +38,15 @@ check_revocations_for_cached = False
[storage]
driver = {{ gnocchi_storage_driver }}
coordination_url = {{ gnocchi_coordination_url }}
{% if gnocchi_storage_driver == 'swift' %}
swift_auth_version = 3
swift_authurl = "{{ keystone_service_internaluri }}"
swift_user: = "service:{{ gnocchi_service_user_name }}"
swift_key: = "{{ gnocchi_service_password }}"
swift_user_domain = {{ gnocchi_service_user_domain_id }}
swift_project_domain = {{ gnocchi_service_project_domain_id }}
swift_tenant_name: = {{ gnocchi_service_project_name }}
{% endif %}
[metricd]
# Number of workers for Gnocchi metric daemons. By default the available number