Make ceilometer metering backend configurable

By default let it default to database. Optionally
user could use gnocchi. Since Gnocchi natively supports
default archive policy, we dont need to manually create
the default policy any more.

Change-Id: I3b8922276ad0c8aab60a8cc9c0434c60ca6a98d9
This commit is contained in:
Pradeep Kilambi 2016-02-17 16:17:33 -05:00
parent 9fd26e890a
commit 5ff4326cfd
4 changed files with 36 additions and 1 deletions

View File

@ -1031,6 +1031,9 @@ Ceilometer Config parameters
**CONFIG_CEILOMETER_SERVICE_NAME**
Ceilometer service name. ['httpd', 'ceilometer']
**CONFIG_CEILOMETER_METERING_BACKEND**
Backend driver for Telemetry's metering backend configuration. ['database', 'gnocchi']
MONGODB Config parameters
-------------------------

View File

@ -87,6 +87,17 @@ def initConfig(controller):
"USE_DEFAULT": True,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CONF_NAME": "CONFIG_CEILOMETER_METERING_BACKEND",
"CMD_OPTION": "ceilometer-metering-backend",
"PROMPT": "Enter the metering backend to use",
"OPTION_LIST": ['database', 'gnocchi'],
"VALIDATORS": [validators.validate_options],
"DEFAULT_VALUE": 'database',
"MASK_INPUT": False,
"USE_DEFAULT": True,
"NEED_CONFIRM": False,
"CONDITION": False},
],
"MONGODB": [

View File

@ -3,6 +3,10 @@ $config_mongodb_host = hiera('CONFIG_MONGODB_HOST_URL')
$config_ceilometer_coordination_backend = hiera('CONFIG_CEILOMETER_COORDINATION_BACKEND')
$config_ceilometer_metering_backend = hiera('CONFIG_CEILOMETER_METERING_BACKEND')
$config_gnocchi_host = hiera('CONFIG_KEYSTONE_HOST_URL')
if $config_ceilometer_coordination_backend == 'redis' {
$redis_ha = hiera('CONFIG_REDIS_HA')
$redis_host = hiera('CONFIG_REDIS_MASTER_HOST_URL')
@ -39,7 +43,20 @@ class { '::ceilometer::db':
database_connection => "mongodb://${config_mongodb_host}:27017/ceilometer",
}
class { '::ceilometer::collector': }
class { '::ceilometer::collector':
meter_dispatcher => $config_ceilometer_metering_backend,
}
if $config_ceilometer_metering_backend == 'gnocchi' {
include ::gnocchi::client
class { '::ceilometer::dispatcher::gnocchi':
filter_service_activity => false,
url => "http://${config_gnocchi_host}:8041",
archive_policy => 'high',
resources_definition_file => 'gnocchi_resources.yaml',
}
}
class { '::ceilometer::agent::notification': }
@ -77,6 +94,10 @@ if $ceilometer_service_name == 'httpd' {
ssl => false,
}
if hiera('CONFIG_GNOCCHI_INSTALL') == 'y' {
apache::listen { '8041': }
}
if hiera('CONFIG_KEYSTONE_SERVICE_NAME') == 'httpd' {
apache::listen { '5000': }
apache::listen { '35357': }