-
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.
Merge pull request #1383 from alvarosimon/os_ceilometer
ncm-openstack: add ceilometer service
- Loading branch information
Showing
32 changed files
with
519 additions
and
52 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
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
10 changes: 10 additions & 0 deletions
10
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,10 @@ | ||
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"; | ||
'service/name' = 'gnocchi'; | ||
prefix "service/internal"; | ||
'proto' ?= 'https'; | ||
'host' ?= OBJECT; | ||
'port' ?= 8041; | ||
'suffix' ?= ''; |
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
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'); |
72 changes: 72 additions & 0 deletions
72
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,72 @@ | ||
# ${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 = { | ||
'file_basepath' ? absolute_file_path = '/var/lib/gnocchi' | ||
'driver' : choice ('file', 'ceph') = 'file' | ||
@{Ceph pool name to use} | ||
'ceph_pool' ? string | ||
@{Ceph username (ie: admin without "client." prefix)} | ||
'ceph_username' ? string | ||
@{Ceph keyring path} | ||
'ceph_keyring' ? absolute_file_path | ||
@{Ceph configuration file} | ||
'ceph_conffile' ? absolute_file_path | ||
} = dict(); | ||
|
||
|
||
@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 | ||
'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
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,80 @@ | ||
#${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", | ||
}; | ||
|
||
Readonly::Hash my %DAEMON => { | ||
service => ['openstack-ceilometer-notification', 'openstack-ceilometer-central'], | ||
gnocchi => ['openstack-gnocchi-metricd', 'httpd'], | ||
}; | ||
|
||
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 : $CEILOMETER_DB_MANAGE_COMMAND; | ||
#delete $self->{manage}; | ||
# Ceilometer has no database parameters | ||
$self->{db_version} = [@CEILOMETER_DB_VERSION]; | ||
$self->{db_sync} = [@CEILOMETER_DB_BOOTSTRAP]; | ||
$self->{filename} = \%CONF_FILE; | ||
$self->{fileownergroup}->{$CONF_FILE{gnocchi}} = { | ||
user => 'gnocchi', | ||
group => 'gnocchi', | ||
}; | ||
$self->{daemon_map} = $self->{hypervisor} ? \%DAEMON_HYPERVISOR : \%DAEMON; | ||
} | ||
|
||
=item pre_populate_service_database | ||
Initializes C<Gnocchi> database for C<Ceilometer> metric service. | ||
This should be done before C<Ceilometer> database bootstrap. | ||
=cut | ||
|
||
sub pre_populate_service_database | ||
{ | ||
my ($self) = @_; | ||
|
||
my $cmd = [$GNOCCHI_DB_MANAGE_COMMAND]; | ||
$self->_do($cmd, "pre-populate Gnocchi database", sensitive => 0, user => 'gnocchi') | ||
or return; | ||
|
||
return 1; | ||
} | ||
|
||
=pod | ||
=back | ||
=cut | ||
|
||
1; |
Oops, something went wrong.