Commit Graph

149 Commits

Author SHA1 Message Date
Corey Bryant 9bf04a8517 Handle openstack comparison after the z-wrap
CompareOpenStackReleases is used to handle openstack comparison
after the z-wrap, now that we are at antelope.

Change-Id: I31254f50d9befdfc3a54c2ee305cb06e7d19cce3
2023-03-20 19:34:33 +00:00
Aurelien Lourot 43a2312794 Remove pause/resume logic
This is a subordinate charm and since a recent
commit [1] it shares a list of its services with
the principal charm nova-compute, which has now
the responsibility to pause and resume services. [2]

The ceilometer-agent-compute service has a
dependency to the nova-compute service anyway, so
it is impossible for this charm to resume its
service if its principal charm nova-compute is
paused. This is what also led to errors in
ceilometer-agent's post-series-upgrade hook. This
hook attempted to resume its service although
the principal service was still paused. Removing
this logic entirely solves this issue.

Validated by running openstack-upgrade and
series-upgrade tests. [3]

[1]: https://opendev.org/openstack/charm-ceilometer-agent/commit/be45f779
[2]: https://opendev.org/openstack/charm-nova-compute/commit/8fb37dc0
[3]: https://github.com/openstack-charmers/charmed-openstack-tester

Closes-Bug: #1952882
Change-Id: Ia22b53b52b541250f7f803c6708968d75e64475c
2021-12-13 16:21:15 +01:00
Aurelien Lourot be45f77945 Publish releases packages map to principal charm
For principal - subordinate plugin type relations where the
principal Python payload imports code from packages managed by a
subordinate, upgrades can be problematic.

This change will allow a subordinate charm that have opted into the
feature to inform its principal about all implemented release -
packages combinations ahead of time. With this information in place
the principal can do the upgrade in one operation without risk of
charm relation RPC type processing at a critical moment.

This is similar to
https://review.opendev.org/c/openstack/charm-interface-keystone-domain-backend/+/781658
https://review.opendev.org/c/openstack/charm-layer-openstack/+/781624

Change-Id: Ibd5bdcb141fc3103ee97123ff284fb2957802eba
Closes-Bug: #1927277
2021-10-04 14:36:24 +02:00
Aurelien Lourot b80626deac Remove do_openstack_upgrade()
This is a subordinate charm and doesn't have an
openstack-origin config option.

Change-Id: Id10069c55e49926cf38439a9a3b0dbede7d1e994
2021-09-24 17:35:01 +02:00
Cornellius Metto 9fd4ea0a39 Add configurability to polling.yaml.
The ceilometer compute agent uses the default polling.yaml
from the installed packages without the ability to configure its contents.

This change adds two configuration options: 'polling-interval' and
'enable-all-pollsters', borrowing from the implementation in
charm-ceilometer. We start off with a limited set of meters as before
and if these are not enough, the user can set 'enable-all-pollsters' to
'true' to collect all available 'Pollster' metrics as listed in the
documentation [1].

Verification:
I tested this change on a cluster built from the OpenStack base bundle
and the ceilometer and gnocchi charms. I confirmed that extra metrics
that originate from the Compute Agent pollster (e.g. disk.device.read.latency)
are available in gnocchi after setting 'enable-all-pollsters' to true.

[1] https://docs.openstack.org/ceilometer/latest/admin/telemetry-measurements.html

Closes-Bug: #1914442
Change-Id: I21c9a93e7dd91bced9365e44f3e6a5315976c3bb
2021-05-12 17:30:00 +03:00
Rodrigo Barbieri 2aace2fb69 Receive polling-batch-size config
Samples collected can be batched together,
consequently increasing or reducing the
amount of API calls and body data
sent to the configured publisher.

This config is available since Rocky,
receiving the value from ceilometer-charm
to allow its tuning.

Change-Id: I986073fdacd750cf96d662abf1d58844479c25ba
Closes-bug: #1885190
2020-09-17 15:35:49 -03:00
Alex Kavanagh dec4b04716 Fix log update-status error
This patch adds a dummy update_status function so that the update-status
hook 'has' a function to run and thus silence the log error.

Change-Id: I96dfba233b98da60d8c138b84e8249cdda109563
Closes-bug: #1837639
2019-07-24 10:36:28 +01:00
Alex Kavanagh 994179cd40 Fix py3 issue with writing a file from base64 output
Change-Id: Ifcfbce588f077f2664400b9f3e27c7b42176ca24
2019-03-27 15:33:41 +00:00
Alex Kavanagh 7ea0be57de Convert the charm to Python 3
Change-Id: I8c8df27be189098be363d0ea125f86e59fdbb020
2019-03-13 12:29:49 +00:00
James Page 54530ab595 Refactor RabbitMQ integration
Prior to this change, the ceilometer-agent charm receives RMQ
configuration details via the ceilometer charm.  This makes it
a bit of a snowflake.

Refactor RMQ integration to require a direct relation to the
rabbitmq-server charm; information provided on this relation
will superceed any information currently provided via the
charms relation with ceilometer, ensuring that there is no
disruption to service during a charm upgrade before the new
relation is added.

Switch to using [DEFAULT]transport_url for RMQ configuration,
making use of the new ch template for SSL and HA configuration
in [oslo_messaging_rabbit].

Change-Id: Ie637ec5162461826505cea39bde6829e036fa1f2
Closes-Bug: 1817672
2019-02-26 15:11:23 +01:00
David Ames d2fd2ef626 Update charm-helpers-hooks.yaml and sync ch
Using the new version of the sync tool which removes the charmhelpers
directory before syncing, run charm helpers sync to find any unexpected
missing dependencies.

Change-Id: I648a2830c593de64b3d8a9e72845331089d3e6c4
2019-02-12 15:55:26 -08:00
Ryan Beisner 058cd81d40 Update pre-install hooks to fail on error
The pre-install operations may fail, yet that failure is not
elevated to the user. This masks the failure and makes early
package install issues difficult to troubleshoot.

If the basic pre-install script fails, the charm should not
proceed to later hooks as the requirements may not be met.

Hashbangs for bash should specify -e (errexit) on all of the
pre-install bash scripts.

Change-Id: I40fedc011933cbce6215dd124019d251b6dafd61
Closes-bug: #1815243
Partial-bug: #1815231
2019-02-08 16:25:12 -08:00
Corey Bryant b20b74c5ce Sync charm-helpers
Change-Id: I9bd2c858e6b08fd2e4ce52d8fb2cf615e6260769
2019-01-11 14:34:21 +00:00
Zuul 2c4296e41f Merge "fix typos in the docstring" 2019-01-09 09:34:17 +00:00
Corey Bryant f7a3eda1c7 Sync charm-helpers
Change-Id: I1738eec9b6ce1c9b5f5db8e1fdb9b89a60fe1938
2019-01-08 15:15:07 +00:00
melissaml 2c8d30b7be fix typos in the docstring
Change-Id: Ida31a3700547321f82567ee40d5edc333fc4e7a6
2018-12-22 03:50:05 +08:00
Corey Bryant d9430f9bd2 py3: handle shared subordinate dependencies on upgrade
Switch to marking non-leaf python-* packages as automatically
installed so that they will be purged once the last remaining
package that depends on them that was manually installed is
removed.

Change-Id: If821cb511a2fdb65ac3e8ad8db88a00770864d42
Closes-Bug: 1802400
2018-11-15 18:18:31 +00:00
Liam Young ff96014044 Purge old packages on upgrade-charm
On charm upgrade the charm may switch to py3 packages. If so, ensure
the old py2 packages are purged. If the purge occurs then restart
services.

Change-Id: I215223b41fb2ab6a31df101b5314e6b0859d8322
Closes-Bug: 1803451
2018-11-15 14:12:22 +00:00
Zuul 604d3a18c8 Merge "Remove independent OpenStack upgrade" 2018-11-12 16:49:12 +00:00
Liam Young 1a40c275d5 Remove independent OpenStack upgrade
Ceilometer has had an openstack-origin and supported upgrading
the Ceilometer version independently of the principle that it is
associated with. This can cause issues with clashes in package
dependencies between the two. This change makes the
ability for the agent to be upgraded independently of the principle
and instead has the upgrade triggered by the principle. This brings
this charm inline with the other OpenStack subordinate charms.

Change-Id: I641ac2168ac705191d916eaa0624214791e1745d
Closes-Bug: #1802400
2018-11-11 18:44:29 +00:00
Ryan Beisner 177fadae35 Sync charm-helpers
Change-Id: I9e89e737555e6107c783019ee30ca8e1080e18ac
2018-11-09 11:19:54 -08:00
James Page 628a2cda97 py3: improve release determination
Inline with the neutron-openvswitch charm approach, install
ceilometer-common before determining which packages to install.

This will ensure that the charm then installs the right package
set for the remaining packages including the switch to py3
for rocky.

Fixup functional tests to include nova-cloud-controller.

Change-Id: I42be224113a599c0a07aa61a06e23911b8ff51fe
2018-10-17 15:33:42 +01:00
David Ames 3ad4317244 Series Upgrade
Implement the series-upgrade feature allowing to move between Ubuntu
series.

Change-Id: I1f0e4bc958ca1a4716fbbeea033ef43e984b3fd8
2018-09-26 23:06:51 +00:00
Corey Bryant fde3d76e3e py3: Switch to using Python 3 for rocky or later
Switch package install to Python 3 for OpenStack Rocky or later.

When upgrading, remove any python-* packages that where explicitly
installated and then autoremove --purge any dependencies that are
no longer required.

Change-Id: If189859cbc98f326adb5b1da8d31e9a20da95af9
2018-09-19 11:13:53 +00:00
Ryan Beisner 4b8f25d04a Update functional test definitions
Change-Id: If885fd99813e0205849cf3d4d3e5e16c7edb73eb
2018-08-27 18:12:08 -05:00
Chris MacNaughton 09deeec8a4 Sync charm-helpers to ensure Rocky support
Change-Id: I4cbe7e9661d432b262cba98c26ccbb4ff9ba1406
2018-07-13 15:51:16 +02:00
Corey Bryant 75bcf76671 Sync charm-helpers for Rocky series support
Change-Id: I8b59971f5173ad8b7d0a66bd0eca03a5a847532e
2018-06-21 19:12:07 +00:00
Chris MacNaughton d30975beee Update tests to use Juju storage
Due to changes to the ceph-osd charm, it is
suggested to use Juju storage for testing.

Change-Id: If7bef11c272eb0d00f21678540491ee1621ccc5a
Related-Bug: #1698154
2018-06-04 17:30:51 +02:00
David Ames 5060f7b9c2 Enable Bionic as a gate test
Change bionic test from dev to gate for 18.05.

Change-Id: I77b578bec509ddbf99b10067ba9509f501f34470
2018-05-15 13:39:39 -07:00
Ryan Beisner a38b758a46 Sync charm-helpers
Change-Id: I51e661cc54b10e05d3bff9c3b303f521351a0eee
2018-02-21 14:07:08 -06:00
Billy Olsen 6034ca406a Sync charm-helpers
Sync charm-helpers to pick up the updated InternalEndpointsContext
which removes the need to provide a package.

This essentially reverts commit 005c548a in favor of an alternative
approach to selecting volume catalog endpoint information.

Change-Id: I18183908e9ca54b7ea0a1d309bb7f02d96d3edc0
Related-Bug: #1733566
2018-02-08 18:28:30 -07:00
Ryan Beisner 6577c50185 Sync charm-helpers
Notable issues resolved:

openstack_upgrade_available() broken for swift
https://bugs.launchpad.net/charm-swift-proxy/+bug/1743847

haproxy context doesn't consider bindings
https://bugs.launchpad.net/charm-helpers/+bug/1735421

regression in haproxy check
https://bugs.launchpad.net/charm-helpers/+bug/1743287

Change-Id: Ic9ca0350a238cb0c8f23f4335c7ea487a6662b20
2018-01-19 16:48:05 +02:00
Edward Hope-Morley 005c548af9 Sync ch and update InternalEndpointContext
Change-Id: I3184a8fb66496bf5b2697bc71d8d7c1fae94c3e0
Partial-Bug: 1733566
2017-12-08 10:17:08 +00:00
Ryan Beisner 73509a9f5d Sync charm-helpers
Change-Id: I5cb6fef9e2c11946ba4b1c656334fd8ca107ad65
2017-11-27 14:24:33 +00:00
Liam Young d73568eb13 Install python-apt before hooks run
Previously this charm had relied on python-apt being installed by
the principle. As charms migrate to py3 this is no longer a safe
assumption and actually never was. This change ensures that
python-apt is installed before immediatly. This follows the same
pattern as other charms by adding an install and install.real
files.

Change-Id: I9fe2a031df736b867d4f277448a4d8649fa8de64
2017-11-24 09:21:44 +00:00
Andrew McLeod c744a97fb4 Enable xenial-pike amulet test
Make default func27-smoke xenial-pike
Charm-helpers sync

Change-Id: I58bd0b7d6c92a784b38b2abc17f6c739c067c8c9
2017-11-21 11:59:21 +13:00
Liam Young 958dfc3e2f Address all rabbit units in clustered deploy
If rabbitmq is deployed in a cluster then the ceilometer charm will
pass rabbitmq_hosts and rabbitmq_host to ceilometer-agent. This charm
was ignoring the rabbitmq_hosts key and thus always talking to a
single rabbit even if there were multiple.

Change-Id: I42c2e3ee4ee2bd1feb9815a4d9895a7121801995
Closes-Bug: #1670273
2017-11-06 10:20:55 +00:00
Corey Bryant 2c47665758 Reset os_release cached value after upgrade
In enable_memcache, ensure that the os_release cache is reset
after upgrade.

Additionally, call apt_install(get_packages()) for upgrades
to ensure that release-specific packages (such as memcached)
are installed.

Change-Id: Ia3689d2d0c549fc55f1bd533654f80c98ce5462a
Partial-Bug: 1715624
2017-09-07 21:18:36 +00:00
Ryan Beisner 03bd32eb74 Sync charm-helpers
Change-Id: Ied9d6155e9b1dd71adea87f7cd3b840e75b8d8e4
2017-08-24 16:45:20 -05:00
James Page fb1836cbcf Update for newer OpenStack releases
Update configuration supplied to nova-compute charm to switch
to real notification drivers, rather than old/obsolete keys
which are not longer supported.

Change-Id: Ic58fa78ae80d88113abc5e2f8361a143ba380d01
2017-08-01 15:50:41 +01:00
David Ames fe4a370121 Update tests to use keystoneauth1
With keystoneauth1 sessions the service catalog search function,
url_for takes argument interface, no longer named endpoint_type.
This change updates tests to use this argument name.

Change-Id: I11d2862d6cbc7282b84fa1bddb64ef44bc2b788d
2017-07-24 15:47:34 -07:00
David Ames 36a4edff9c Decode subprocess output for python3 in ipv6 check
When using python3, the code encounters errors related to type
mismatch. subprocess requires an extra decode of return values
to address this.

CH Sync to get fix.

Change-Id: I141c0d4d1851012d5c0a5a606402c75211a323f5
Partial-Bug: #1691881
2017-05-31 15:29:55 -07:00
James Page 851b1812f5 Updates for pike b1
Resync charmhelpers for pike b1 version support.

Add tests for pike but leave disabled until all charms support pike.

Change-Id: I33e5ed1d5d62580a89ddc1a7436e630d2a60c6f4
2017-05-12 06:54:00 +02:00
David Ames 12bd55a008 Enable Zesty-Ocata Amulet Tests
- Turn on Zesty-Ocata Amulet test definitions.
- Standardize test-requirements.txt
- Sync charm helpers for various fixes

Change-Id: I412918c21c8de1afd998c6745ef0ad7b2e057250
2017-05-02 09:01:50 -07:00
David Ames 8b34c8fb53 Enable Ocata Amulet Tests
- Add Zesty as a supported series to metadata.yaml.
- Turn on Xenial-Ocata Amulet test definitions.
- Sync charm helpers to get Juju 2.x amulet compatibility.
- Keeping Zesty-Ocata Amulet test definitions turned off until the
  metadata.yaml changes propagate to the charm store.
- Resync tox.ini to resolve amulet test failures.

Change-Id: I1d7e78598b21f2dafa6a74a4dd455989d9bf1291
2017-03-24 13:30:51 +00:00
David Ames bde0fcef7e Charm needs to install memcached on upgrade-charm
The ceilometer-agent charm recognizes it needs memecached with
enable_memcached() but never installs the package when upgrading
from previous versions of the charm.

Add the call to install packages in upgrade_charm().

Change-Id: I393eb682e0a44b54712e2bb35fc983af16c0c379
Partial-bug: #1665392
2017-02-16 11:22:10 -08:00
David Ames 89893e2c5a Pre-release charm-helpers sync 17.02
Get each charm up to date with lp:charm-helpers for release testing.

Change-Id: If7b4c98a58b681af3233f55e1072dcb674459f29
2017-02-14 14:50:43 -08:00
Liam Young c775293654 Enable Memcache service for Token Caching
With the release of 4.2.0 of keystonemiddleware using the
in-process token cache is no longer recommended. It is recommended
that a memcache backend to store tokens is used instead,

This installs and configures memcache and configures ceilometer agent
to use memcache for token caching.

http://docs.openstack.org/releasenotes/keystonemiddleware/mitaka.html#id2

Change-Id: If7dd4c5472a7842f06d0fd44c1b2012c9c9d1075
2016-12-13 17:07:21 +00:00
Corey Bryant d760d20b86 Sync charm-helpers to pick up Ocata UCA support
Change-Id: I2ff95d26a490b56efb4c1ee681d6c41b729b76bc
2016-12-01 21:36:16 +00:00
Frode Nordahl a904456fe3 Fix support for Keystone v3 domain auth
When using v3 authentication and authorization Ceilometer must
authenticate to services project in service_domain.

Change-Id: Ibb19fa8476cf712ccb4bc524a48d3501f42fc62c
Closes-Bug: 1636098
2016-11-29 23:36:49 +01:00