-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ncm-openstack: add ceilometer service
Include ceilometer server Resolves: #1381
- Loading branch information
1 parent
2b74cfe
commit a79eef3
Showing
26 changed files
with
406 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
ncm-openstack/src/main/pan/components/openstack/identity/gather/metric/ceilometer.pan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
unique template components/openstack/identity/gather/metric/ceilometer; | ||
|
||
@{openstack_quattor_ceilometer default value until we can use the schema defaults from value} | ||
prefix "/software/components/openstack/metric/ceilometer/quattor"; | ||
prefix "service/internal"; | ||
'proto' ?= 'https'; | ||
'host' ?= OBJECT; | ||
'port' ?= 8041; | ||
'suffix' ?= ''; | ||
|
||
# Should be gnocchi user no ceilometer | ||
#prefix "services/gnocchi"; | ||
#"type" = "metric"; | ||
#"internal/port" ?= 8041; | ||
#"internal/suffix" ?= ''; |
14 changes: 14 additions & 0 deletions
14
ncm-openstack/src/main/pan/components/openstack/metric.pan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ${license-info} | ||
# ${developer-info} | ||
# ${author-info} | ||
|
||
declaration template components/openstack/metric; | ||
|
||
include 'components/openstack/metric/ceilometer'; | ||
|
||
@documentation{ | ||
Type to define OpenStack metric services | ||
} | ||
type openstack_metric_config = { | ||
'ceilometer' ? openstack_ceilometer_config | ||
} with openstack_oneof(SELF, 'ceilometer'); |
70 changes: 70 additions & 0 deletions
70
ncm-openstack/src/main/pan/components/openstack/metric/ceilometer.pan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# ${license-info} | ||
# ${developer-info} | ||
# ${author-info} | ||
|
||
|
||
declaration template components/openstack/metric/ceilometer; | ||
|
||
include 'components/openstack/identity'; | ||
|
||
|
||
|
||
@documentation{ | ||
list of Gnocchi api section | ||
} | ||
type openstack_ceilometer_gnocchi_api = { | ||
'auth_mode' : string = 'keystone' | ||
}; | ||
|
||
|
||
@documentation{ | ||
list of Gnocchi indexer section | ||
} | ||
type openstack_ceilometer_gnocchi_indexer = { | ||
@{The SQLAlchemy connection string to use to connect to the database} | ||
'url' : string | ||
}; | ||
|
||
@documentation{ | ||
list of Gnocchi storage section | ||
} | ||
type openstack_ceilometer_gnocchi_storage = { | ||
@{coordination_url is not required but specifying one will improve | ||
performance with better workload division across workers} | ||
'coordination_url' ? string | ||
'file_basepath' : absolute_file_path = '/var/lib/gnocchi' | ||
'driver' : string = 'file' | ||
}; | ||
|
||
|
||
@documentation{ | ||
list of Ceilometer Gnocchi service sections | ||
} | ||
type openstack_ceilometer_gnocchi_config = { | ||
'api' : openstack_ceilometer_gnocchi_api | ||
'indexer' : openstack_ceilometer_gnocchi_indexer | ||
'storage' : openstack_ceilometer_gnocchi_storage | ||
'keystone_authtoken' : openstack_domains_common | ||
}; | ||
|
||
@documentation{ | ||
list of Ceilometer service configuration sections | ||
} | ||
type openstack_ceilometer_service_config = { | ||
'DEFAULT' : openstack_DEFAULTS | ||
'service_credentials' : openstack_domains_common | ||
}; | ||
|
||
type openstack_quattor_ceilometer = openstack_quattor; | ||
|
||
@documentation{ | ||
list of Ceilometer service configuration sections | ||
} | ||
type openstack_ceilometer_config = { | ||
'service' ? openstack_ceilometer_service_config | ||
'gnocchi' ? openstack_ceilometer_gnocchi_config | ||
# pipeline in yaml format | ||
#'pipeline' ? openstack_ceilometer_pipeline_config | ||
# default empty dict for pure hypervisor | ||
'quattor' : openstack_quattor_ceilometer = dict() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#${PMpre} NCM::Component::OpenStack::Ceilometer${PMpost} | ||
|
||
use parent qw(NCM::Component::OpenStack::Service); | ||
|
||
use Readonly; | ||
use Data::Dumper; | ||
|
||
Readonly our $GNOCCHI_DB_MANAGE_COMMAND => "/usr/bin/gnocchi-upgrade"; | ||
Readonly our $CEILOMETER_DB_MANAGE_COMMAND => "/usr/bin/ceilometer-upgrade"; | ||
|
||
Readonly::Array my @CEILOMETER_DB_BOOTSTRAP => qw(--debug); | ||
Readonly::Array my @CEILOMETER_DB_VERSION => qw(--version); | ||
|
||
Readonly::Hash my %CONF_FILE => { | ||
service => "/etc/ceilometer/ceilometer.conf", | ||
gnocchi => "/etc/gnocchi/gnocchi.conf", | ||
#pipeline => "/etc/ceilometer/pipeline.yaml", | ||
#polling => "/etc/ceilometer/polling.yaml", | ||
}; | ||
|
||
Readonly::Hash my %DAEMON => { | ||
service => ['openstack-ceilometer-notification', 'openstack-ceilometer-central'], | ||
gnocchi => ['openstack-gnocchi-api', 'openstack-gnocchi-metricd'], | ||
}; | ||
|
||
Readonly::Hash my %DAEMON_HYPERVISOR => { | ||
service => ['openstack-ceilometer-compute', 'openstack-ceilometer-ipmi'], | ||
}; | ||
|
||
|
||
=head2 Methods | ||
=over | ||
=item _attrs | ||
Override C<manage>, C<db> and C<filename> attribute (and set C<daemon_map>) | ||
=cut | ||
|
||
sub _attrs | ||
{ | ||
my $self = shift; | ||
|
||
$self->{manage} = $self->{hypervisor} ? undef : $GNOCCHI_DB_MANAGE_COMMAND; | ||
# Ceilometer has no database parameters | ||
$self->{db_version} = [@CEILOMETER_DB_VERSION]; | ||
$self->{db_sync} = [@CEILOMETER_DB_BOOTSTRAP]; | ||
$self->{filename} = \%CONF_FILE; | ||
$self->{daemon_map} = $self->{hypervisor} ? \%DAEMON_HYPERVISOR : \%DAEMON; | ||
} | ||
|
||
|
||
=item post_populate_service_database | ||
Initializes Ceilometer database after Gnocchi setup | ||
for C<Ceilometer> metric service. | ||
=cut | ||
|
||
sub post_populate_service_database | ||
{ | ||
my ($self) = @_; | ||
|
||
my $cmd = [$CEILOMETER_DB_MANAGE_COMMAND]; | ||
$self->_do($cmd, "post-populate Ceilometer database", sensitive => 0) | ||
or return; | ||
|
||
return 1; | ||
} | ||
|
||
|
||
=pod | ||
=back | ||
=cut | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
ncm-openstack/src/main/resources/tests/profiles/ceilometer.pan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
object template ceilometer; | ||
|
||
include 'components/openstack/schema'; | ||
|
||
bind "/metaconfig/contents" = openstack_ceilometer_service_config; | ||
|
||
"/metaconfig/module" = "common"; | ||
|
||
variable OPENSTACK_HOST_SERVER ?= 'controller.mysite.com'; | ||
|
||
prefix "/metaconfig/contents"; | ||
|
||
"DEFAULT" = dict( | ||
"transport_url", format("rabbit://openstack:rabbit_pass@%s", OPENSTACK_HOST_SERVER), | ||
); | ||
"service_credentials" = dict( | ||
#"auth_uri", format('http://%s:5000', OPENSTACK_HOST_SERVER), | ||
"auth_url", format('http://%s:5000/v3', OPENSTACK_HOST_SERVER), | ||
"username", "ceilometer", | ||
"password", "ceilometer_good_password", | ||
"interface", "internalURL", | ||
); |
25 changes: 25 additions & 0 deletions
25
ncm-openstack/src/main/resources/tests/profiles/ceilometer_gnocchi.pan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
object template ceilometer_gnocchi; | ||
|
||
include 'components/openstack/schema'; | ||
|
||
bind "/metaconfig/contents" = openstack_ceilometer_gnocchi_config; | ||
|
||
"/metaconfig/module" = "common"; | ||
|
||
variable OPENSTACK_HOST_SERVER ?= 'controller.mysite.com'; | ||
|
||
prefix "/metaconfig/contents"; | ||
|
||
"api" = dict(); | ||
"storage" = dict( | ||
'coordination_url', format('redis://%s:6379', OPENSTACK_HOST_SERVER), | ||
); | ||
"keystone_authtoken" = dict( | ||
"auth_url", format('http://%s:5000/v3', OPENSTACK_HOST_SERVER), | ||
"username", "gnocchi", | ||
"password", "gnocchi_good_password", | ||
"interface", "internalURL", | ||
); | ||
"indexer" = dict( | ||
"url", format("mysql+pymysql://gnocchi:gnocchi_db_pass@%s/gnocchi", OPENSTACK_HOST_SERVER), | ||
); |
4 changes: 4 additions & 0 deletions
4
ncm-openstack/src/main/resources/tests/regexps/ceilometer/noquattor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
OpenStack test: do not render quattor section | ||
--- | ||
--- | ||
\[quattor\] ### COUNT 0 |
15 changes: 15 additions & 0 deletions
15
ncm-openstack/src/main/resources/tests/regexps/ceilometer/simple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
OpenStack Ceilometer test | ||
--- | ||
multiline | ||
--- | ||
^\[DEFAULT\]$ | ||
^transport_url\s?=\s*.+\s*$ | ||
|
||
^\[service_credentials\]\s*$ | ||
^auth_type\s?=\s*.+\s*$ | ||
^auth_url\s?=\s*.+\s*$ | ||
^password\s?=\s*.+\s*$ | ||
^project_domain_name\s?=\s*.+\s*$ | ||
^project_name\s?=\s*.+\s*$ | ||
^user_domain_name\s?=\s*.+\s*$ | ||
^username\s?=\s*.+\s*$ |
4 changes: 4 additions & 0 deletions
4
ncm-openstack/src/main/resources/tests/regexps/ceilometer_gnocchi/noquattor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
OpenStack test: do not render quattor section | ||
--- | ||
--- | ||
\[quattor\] ### COUNT 0 |
23 changes: 23 additions & 0 deletions
23
ncm-openstack/src/main/resources/tests/regexps/ceilometer_gnocchi/simple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
OpenStack Ceilometer Gnocchi test | ||
--- | ||
multiline | ||
--- | ||
^\[api\]\s*$ | ||
^auth_mode\s?=\s*.+\s*$ | ||
|
||
^\[indexer\]\s*$ | ||
^url\s?=\s*.+\s*$ | ||
|
||
^\[keystone_authtoken\]\s*$ | ||
^auth_type\s?=\s*.+\s*$ | ||
^auth_url\s?=\s*.+\s*$ | ||
^password\s?=\s*.+\s*$ | ||
^project_domain_name\s?=\s*.+\s*$ | ||
^project_name\s?=\s*.+\s*$ | ||
^user_domain_name\s?=\s*.+\s*$ | ||
^username\s?=\s*.+\s*$ | ||
|
||
^\[storage\]\s*$ | ||
^coordination_url\s?=\s*.+\s*$ | ||
^driver\s?=\s*.+\s*$ | ||
^file_basepath\s?=\s*.+\s*$ |
Oops, something went wrong.