diff --git a/elements/puppet-stack-config/puppet-stack-config.pp b/elements/puppet-stack-config/puppet-stack-config.pp index 8a5041a00..36cc30159 100644 --- a/elements/puppet-stack-config/puppet-stack-config.pp +++ b/elements/puppet-stack-config/puppet-stack-config.pp @@ -27,7 +27,6 @@ Exec<| title == 'nova-db-sync-api' |> { refreshonly => false } Exec<| title == 'nova-db-sync' |> { refreshonly => false } Exec<| title == 'nova-db-online-data-migrations' |> { refreshonly => false } Exec<| title == 'heat-dbsync' |> { refreshonly => false } -Exec<| title == 'ceilometer-dbsync' |> { refreshonly => false } Exec<| title == 'aodh-db-sync' |> { refreshonly => false } Exec<| title == 'ironic-dbsync' |> { refreshonly => false } Exec<| title == 'mistral-db-sync' |> { refreshonly => false } @@ -177,6 +176,30 @@ if str2bool(hiera('enable_telemetry', true)) { include ::ceilometer::agent::auth include ::ceilometer::dispatcher::gnocchi + # We need to use exec as the keystone dependency wouldnt allow + # us to wait until service is up before running upgrade. This + # is because both keystone, gnocchi and ceilometer run under apache. + exec { 'ceilo-gnocchi-upgrade': + command => 'ceilometer-upgrade --skip-metering-database', + path => ['/usr/bin', '/usr/sbin'], + } + + # This ensures we can do service validation on gnocchi api before + # running ceilometer-upgrade + $command = join(['curl -s', + hiera('gnocchi_healthcheck_url')], ' ') + + openstacklib::service_validation { 'gnocchi-status': + command => $command, + tries => 20, + refreshonly => true, + subscribe => Anchor['gnocchi::service::end'] + } + +# Ensure all endpoint exists and only then run the upgrade. + Keystone::Resource::Service_identity<||> -> + Openstacklib::Service_validation['gnocchi-status'] -> Exec['ceilo-gnocchi-upgrade'] + Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" } diff --git a/elements/puppet-stack-config/puppet-stack-config.yaml.template b/elements/puppet-stack-config/puppet-stack-config.yaml.template index 5ffd2c90a..410c34a6b 100644 --- a/elements/puppet-stack-config/puppet-stack-config.yaml.template +++ b/elements/puppet-stack-config/puppet-stack-config.yaml.template @@ -337,6 +337,7 @@ gnocchi::statsd::user_id: '27c0d3f8-e7ee-42f0-8317-72237d1c5ae3' gnocchi::statsd::project_id: '6c38cd8d-099a-4cb2-aecf-17be688e8616' gnocchi::statsd::flush_delay: 10 gnocchi::statsd::archive_policy_name: 'low' +gnocchi_healthcheck_url: {{UNDERCLOUD_ENDPOINT_GNOCCHI_PUBLIC}}/healthcheck # Panko panko::wsgi::apache::ssl: false diff --git a/releasenotes/notes/run-ceilometer-gnocchi-upgrade-215cb426d25d11e9.yaml b/releasenotes/notes/run-ceilometer-gnocchi-upgrade-215cb426d25d11e9.yaml new file mode 100644 index 000000000..954230501 --- /dev/null +++ b/releasenotes/notes/run-ceilometer-gnocchi-upgrade-215cb426d25d11e9.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - Run ceilometer-upgrade conditionally when gnocchi is running so that + gnocchi resource types are created.