Skip to content

Commit a79eef3

Browse files
committed
ncm-openstack: add ceilometer service
Include ceilometer server Resolves: #1381
1 parent 2b74cfe commit a79eef3

File tree

26 files changed

+406
-5
lines changed

26 files changed

+406
-5
lines changed

ncm-openstack/src/main/pan/components/openstack/common.pan

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ type openstack_neutron_service_plugins = choice('router', 'port_forwarding')[];
3030

3131
type openstack_neutron_agent_extensions = choice('port_forwarding')[];
3232

33+
type openstack_keystone_endpoint_type = choice('internalURL', 'publicURL');
34+
3335
@documentation{
3436
OpenStack common domains section
3537
}
@@ -49,6 +51,9 @@ type openstack_domains_common = {
4951
'username' : string
5052
@{OpenStack service user password}
5153
'password' : string
54+
@{Type of endpoint in Identity service catalog to use for communication with
55+
OpenStack services}
56+
'interface' ? openstack_keystone_endpoint_type = 'internalURL'
5257
};
5358

5459
@documentation{

ncm-openstack/src/main/pan/components/openstack/dashboard/horizon.pan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ type openstack_horizon_config_identity_keystone = {
250250
@{the endpoint type to use for the endpoints in the Keystone service catalog.
251251
The default value for all services except for identity is "publicURL".
252252
The default value for the identity service is "internalURL".}
253-
'openstack_endpoint_type' ? choice('internalURL', 'publicURL')
253+
'openstack_endpoint_type' ? openstack_keystone_endpoint_type
254254
@{Configure the default role for users that you create via the dashboard}
255255
'openstack_keystone_default_role' : string = 'user'
256256
'openstack_keystone_backend' : openstack_horizon_keystone_backend
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
unique template components/openstack/identity/gather/metric/ceilometer;
2+
3+
@{openstack_quattor_ceilometer default value until we can use the schema defaults from value}
4+
prefix "/software/components/openstack/metric/ceilometer/quattor";
5+
prefix "service/internal";
6+
'proto' ?= 'https';
7+
'host' ?= OBJECT;
8+
'port' ?= 8041;
9+
'suffix' ?= '';
10+
11+
# Should be gnocchi user no ceilometer
12+
#prefix "services/gnocchi";
13+
#"type" = "metric";
14+
#"internal/port" ?= 8041;
15+
#"internal/suffix" ?= '';
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ${license-info}
2+
# ${developer-info}
3+
# ${author-info}
4+
5+
declaration template components/openstack/metric;
6+
7+
include 'components/openstack/metric/ceilometer';
8+
9+
@documentation{
10+
Type to define OpenStack metric services
11+
}
12+
type openstack_metric_config = {
13+
'ceilometer' ? openstack_ceilometer_config
14+
} with openstack_oneof(SELF, 'ceilometer');
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# ${license-info}
2+
# ${developer-info}
3+
# ${author-info}
4+
5+
6+
declaration template components/openstack/metric/ceilometer;
7+
8+
include 'components/openstack/identity';
9+
10+
11+
12+
@documentation{
13+
list of Gnocchi api section
14+
}
15+
type openstack_ceilometer_gnocchi_api = {
16+
'auth_mode' : string = 'keystone'
17+
};
18+
19+
20+
@documentation{
21+
list of Gnocchi indexer section
22+
}
23+
type openstack_ceilometer_gnocchi_indexer = {
24+
@{The SQLAlchemy connection string to use to connect to the database}
25+
'url' : string
26+
};
27+
28+
@documentation{
29+
list of Gnocchi storage section
30+
}
31+
type openstack_ceilometer_gnocchi_storage = {
32+
@{coordination_url is not required but specifying one will improve
33+
performance with better workload division across workers}
34+
'coordination_url' ? string
35+
'file_basepath' : absolute_file_path = '/var/lib/gnocchi'
36+
'driver' : string = 'file'
37+
};
38+
39+
40+
@documentation{
41+
list of Ceilometer Gnocchi service sections
42+
}
43+
type openstack_ceilometer_gnocchi_config = {
44+
'api' : openstack_ceilometer_gnocchi_api
45+
'indexer' : openstack_ceilometer_gnocchi_indexer
46+
'storage' : openstack_ceilometer_gnocchi_storage
47+
'keystone_authtoken' : openstack_domains_common
48+
};
49+
50+
@documentation{
51+
list of Ceilometer service configuration sections
52+
}
53+
type openstack_ceilometer_service_config = {
54+
'DEFAULT' : openstack_DEFAULTS
55+
'service_credentials' : openstack_domains_common
56+
};
57+
58+
type openstack_quattor_ceilometer = openstack_quattor;
59+
60+
@documentation{
61+
list of Ceilometer service configuration sections
62+
}
63+
type openstack_ceilometer_config = {
64+
'service' ? openstack_ceilometer_service_config
65+
'gnocchi' ? openstack_ceilometer_gnocchi_config
66+
# pipeline in yaml format
67+
#'pipeline' ? openstack_ceilometer_pipeline_config
68+
# default empty dict for pure hypervisor
69+
'quattor' : openstack_quattor_ceilometer = dict()
70+
};

ncm-openstack/src/main/pan/components/openstack/orchestration/heat.pan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type openstack_heat_clients_keystone = {
4242
type openstack_heat_clients = {
4343
@{Type of endpoint in Identity service catalog to use for communication with
4444
the OpenStack service}
45-
'endpoint_type' : choice('internalURL', 'publicURL') = 'internalURL'
45+
'endpoint_type' : openstack_keystone_endpoint_type = 'internalURL'
4646
} = dict();
4747

4848
type openstack_quattor_heat = openstack_quattor;

ncm-openstack/src/main/pan/components/openstack/rootwrap.pan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ unique template components/${project.artifactId}/rootwrap;
1515

1616
include 'components/sudo/config';
1717

18-
variable ROOTWRAP_SERVICES = list('nova', 'neutron', 'cinder', 'manila');
18+
variable ROOTWRAP_SERVICES = list('nova', 'neutron', 'cinder', 'manila', 'ceilometer');
1919

2020
"/software/components/sudo/privilege_lines" = {
2121

ncm-openstack/src/main/pan/components/openstack/schema.pan

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ include 'components/openstack/dashboard';
1414
include 'components/openstack/orchestration';
1515
include 'components/openstack/catalog';
1616
include 'components/openstack/messaging';
17+
include 'components/openstack/metric';
1718

1819
@documentation{
1920
Hypervisor configuration.
@@ -57,6 +58,7 @@ type openstack_component = {
5758
'messaging' ? openstack_messaging_config
5859
'orchestration' ? openstack_orchestration_config
5960
'catalog' ? openstack_catalog_config
61+
'metric' ? openstack_metric_config
6062
'openrc' ? openstack_openrc_config
6163
@{Hypervisor configuration. Host is a hypervisor when this attribute exists}
6264
'hypervisor' ? openstack_hypervisor_config
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#${PMpre} NCM::Component::OpenStack::Ceilometer${PMpost}
2+
3+
use parent qw(NCM::Component::OpenStack::Service);
4+
5+
use Readonly;
6+
use Data::Dumper;
7+
8+
Readonly our $GNOCCHI_DB_MANAGE_COMMAND => "/usr/bin/gnocchi-upgrade";
9+
Readonly our $CEILOMETER_DB_MANAGE_COMMAND => "/usr/bin/ceilometer-upgrade";
10+
11+
Readonly::Array my @CEILOMETER_DB_BOOTSTRAP => qw(--debug);
12+
Readonly::Array my @CEILOMETER_DB_VERSION => qw(--version);
13+
14+
Readonly::Hash my %CONF_FILE => {
15+
service => "/etc/ceilometer/ceilometer.conf",
16+
gnocchi => "/etc/gnocchi/gnocchi.conf",
17+
#pipeline => "/etc/ceilometer/pipeline.yaml",
18+
#polling => "/etc/ceilometer/polling.yaml",
19+
};
20+
21+
Readonly::Hash my %DAEMON => {
22+
service => ['openstack-ceilometer-notification', 'openstack-ceilometer-central'],
23+
gnocchi => ['openstack-gnocchi-api', 'openstack-gnocchi-metricd'],
24+
};
25+
26+
Readonly::Hash my %DAEMON_HYPERVISOR => {
27+
service => ['openstack-ceilometer-compute', 'openstack-ceilometer-ipmi'],
28+
};
29+
30+
31+
=head2 Methods
32+
33+
=over
34+
35+
=item _attrs
36+
37+
Override C<manage>, C<db> and C<filename> attribute (and set C<daemon_map>)
38+
39+
=cut
40+
41+
sub _attrs
42+
{
43+
my $self = shift;
44+
45+
$self->{manage} = $self->{hypervisor} ? undef : $GNOCCHI_DB_MANAGE_COMMAND;
46+
# Ceilometer has no database parameters
47+
$self->{db_version} = [@CEILOMETER_DB_VERSION];
48+
$self->{db_sync} = [@CEILOMETER_DB_BOOTSTRAP];
49+
$self->{filename} = \%CONF_FILE;
50+
$self->{daemon_map} = $self->{hypervisor} ? \%DAEMON_HYPERVISOR : \%DAEMON;
51+
}
52+
53+
54+
=item post_populate_service_database
55+
56+
Initializes Ceilometer database after Gnocchi setup
57+
for C<Ceilometer> metric service.
58+
59+
=cut
60+
61+
sub post_populate_service_database
62+
{
63+
my ($self) = @_;
64+
65+
my $cmd = [$CEILOMETER_DB_MANAGE_COMMAND];
66+
$self->_do($cmd, "post-populate Ceilometer database", sensitive => 0)
67+
or return;
68+
69+
return 1;
70+
}
71+
72+
73+
=pod
74+
75+
=back
76+
77+
=cut
78+
79+
1;

ncm-openstack/src/main/perl/openstack.pm

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ ncm-openstack provides support for OpenStack configuration for:
3838
3939
=back
4040
41+
=head2 Volume
42+
43+
=over
44+
45+
=item * Cinder
46+
47+
=back
48+
4149
=head2 Network
4250
4351
=over
@@ -62,6 +70,30 @@ ncm-openstack provides support for OpenStack configuration for:
6270
6371
=back
6472
73+
=head2 Metric
74+
75+
=over
76+
77+
=item * Ceilometer
78+
79+
=back
80+
81+
=head2 Orchestration
82+
83+
=over
84+
85+
=item * Heat
86+
87+
=back
88+
89+
=head2 Share
90+
91+
=over
92+
93+
=item * Manila
94+
95+
=back
96+
6597
=head2 Messaging
6698
6799
=over
@@ -127,6 +159,7 @@ sub Configure
127159
'network',
128160
'orchestration',
129161
'catalog',
162+
'metric',
130163
'dashboard',
131164
];
132165

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
object template ceilometer;
2+
3+
include 'components/openstack/schema';
4+
5+
bind "/metaconfig/contents" = openstack_ceilometer_service_config;
6+
7+
"/metaconfig/module" = "common";
8+
9+
variable OPENSTACK_HOST_SERVER ?= 'controller.mysite.com';
10+
11+
prefix "/metaconfig/contents";
12+
13+
"DEFAULT" = dict(
14+
"transport_url", format("rabbit://openstack:rabbit_pass@%s", OPENSTACK_HOST_SERVER),
15+
);
16+
"service_credentials" = dict(
17+
#"auth_uri", format('http://%s:5000', OPENSTACK_HOST_SERVER),
18+
"auth_url", format('http://%s:5000/v3', OPENSTACK_HOST_SERVER),
19+
"username", "ceilometer",
20+
"password", "ceilometer_good_password",
21+
"interface", "internalURL",
22+
);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
object template ceilometer_gnocchi;
2+
3+
include 'components/openstack/schema';
4+
5+
bind "/metaconfig/contents" = openstack_ceilometer_gnocchi_config;
6+
7+
"/metaconfig/module" = "common";
8+
9+
variable OPENSTACK_HOST_SERVER ?= 'controller.mysite.com';
10+
11+
prefix "/metaconfig/contents";
12+
13+
"api" = dict();
14+
"storage" = dict(
15+
'coordination_url', format('redis://%s:6379', OPENSTACK_HOST_SERVER),
16+
);
17+
"keystone_authtoken" = dict(
18+
"auth_url", format('http://%s:5000/v3', OPENSTACK_HOST_SERVER),
19+
"username", "gnocchi",
20+
"password", "gnocchi_good_password",
21+
"interface", "internalURL",
22+
);
23+
"indexer" = dict(
24+
"url", format("mysql+pymysql://gnocchi:gnocchi_db_pass@%s/gnocchi", OPENSTACK_HOST_SERVER),
25+
);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
OpenStack test: do not render quattor section
2+
---
3+
---
4+
\[quattor\] ### COUNT 0
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
OpenStack Ceilometer test
2+
---
3+
multiline
4+
---
5+
^\[DEFAULT\]$
6+
^transport_url\s?=\s*.+\s*$
7+
8+
^\[service_credentials\]\s*$
9+
^auth_type\s?=\s*.+\s*$
10+
^auth_url\s?=\s*.+\s*$
11+
^password\s?=\s*.+\s*$
12+
^project_domain_name\s?=\s*.+\s*$
13+
^project_name\s?=\s*.+\s*$
14+
^user_domain_name\s?=\s*.+\s*$
15+
^username\s?=\s*.+\s*$
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
OpenStack test: do not render quattor section
2+
---
3+
---
4+
\[quattor\] ### COUNT 0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
OpenStack Ceilometer Gnocchi test
2+
---
3+
multiline
4+
---
5+
^\[api\]\s*$
6+
^auth_mode\s?=\s*.+\s*$
7+
8+
^\[indexer\]\s*$
9+
^url\s?=\s*.+\s*$
10+
11+
^\[keystone_authtoken\]\s*$
12+
^auth_type\s?=\s*.+\s*$
13+
^auth_url\s?=\s*.+\s*$
14+
^password\s?=\s*.+\s*$
15+
^project_domain_name\s?=\s*.+\s*$
16+
^project_name\s?=\s*.+\s*$
17+
^user_domain_name\s?=\s*.+\s*$
18+
^username\s?=\s*.+\s*$
19+
20+
^\[storage\]\s*$
21+
^coordination_url\s?=\s*.+\s*$
22+
^driver\s?=\s*.+\s*$
23+
^file_basepath\s?=\s*.+\s*$

0 commit comments

Comments
 (0)