Commit Graph

79 Commits

Author SHA1 Message Date
Peter Sabaini 9c7101f573 Implement prometheus alert rules
Alert rules can be attached as a resource and will be transmitted via
the metrics-endpoint relation. Default alert rules taken from upstream
ceph have been added for reference.

Change-Id: I6a3c6f06e9b9d911b35c8ced1968becc6471b362
2022-09-23 14:22:06 +02:00
Zuul 6a95045932 Merge "Migrate install handling to operator native" 2022-09-09 14:41:00 +00:00
Peter Sabaini 24dfc7440d Add support for prometheus-k8s
Add support for the metrics-endpoint relation. This allows relating
ceph-mon to prometheus-k8s which is being used in the COS Lite
observability stack. Upon relation, the ceph prometheus module will be
enabled and a corresponding scrape job configured for prometheus-k8s.

Drive-by test improvement for the utils module

Change-Id: Iaeee57aaa6f3678fdaef35f2582b4b4c974acb2a
2022-09-06 10:14:37 +02:00
Chris MacNaughton 3959512fb3 Migrate install handling to operator native
Change-Id: I0d06db0c8ac15b3a1fd3e9c4b4f0d2243fb1875e
2022-09-01 14:34:40 -04:00
Luciano Lo Giudice 1ee3d04fda First rewrite of ceph-mon with operator framework
This patchset implements the first rewrite of the charm using the
operator framework by simply calling into the hooks.

This change also includes functional validation about charm upgrades
from the previous stable to the locally built charm.

Fix tempest breakage for python < 3.8

Co-authored-by: Chris MacNaughton <chris.macnaughton@canonical.com>

Change-Id: I61308bb2900134ea163d9e92444066a3cb0de43d
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/849
2022-08-19 19:00:56 -03:00
James Page ed7b94b135 Resync charms.ceph
Pickup changes for cephx key permissions for rbd-mirror
charm.

Change-Id: I01a878f7bbf244d1db79991382a18dc23176d9b6
Closes-Bug: 1879749
2022-04-21 07:53:35 +01:00
Luciano Lo Giudice 444f91f559 Update the charm to use the latest changes in charms.ceph
Change-Id: I7aee1d27021e259367d6fe88002f996ab62a61c3
Closes-Bug: #1968369
2022-04-13 10:29:26 -03:00
Chris MacNaughton 5ee54cff97 Ensure we restart the correct systemd unit on upgrade.
Closes-Bug: #1962296
Depends-On: I7acabfcb28b5faee3d4a6018595d24914db552b2
Change-Id: I8dbd66981f6f668db67454315036ad5557c14c81
2022-02-25 11:10:15 +01:00
Chris MacNaughton 04a9c98dfa Stop setting default capabilities in get_named_key.
When get_named_key is called on a keyring that
has customised capabilities, it overwrites the
capabilities to the default capabilities.

Depends-On: I777650ae2194609a95e5cfb101e343824b3d0a34
Change-Id: I2930b32943fb75778cf3b56bb7f1d2a9f9c7c454
2021-12-10 15:03:39 +01:00
Corey Bryant 7cd789601d Add yoga bundles and release-tool syncs
* charm-helpers sync for classic charms
* sync from release-tools
* switch to release-specific zosci functional tests
* run focal-ussuri as smoke tests
* remove trusty, xenial, and groovy metadata/tests
* drop py35 and add py39
* charms.ceph sync

Change-Id: I214c0517b223da5fce9e942269fd8703422d1a2b
2021-11-17 13:46:05 -05:00
Alex Kavanagh cb580a0b91 Add xena bundles
- add non-voting focal-xena bundle
- add non-voting impish-xena bundle
- charm-helpers sync for new charm-helpers changes
- update tox/pip.sh to ensure setuptools<50.0.0

Change-Id: If511b7fee8cf676b6ba7017aa60fe916ac9a26d9
2021-09-21 14:11:55 +01:00
Alex Kavanagh f180a2e729 21.04 libraries freeze for charms on master branch
* charm-helpers sync for classic charms
* build.lock file for reactive charms
* ensure tox.ini is from release-tools
* ensure requirements.txt files are from release-tools
* On reactive charms:
  - ensure stable/21.04 branch for charms.openstack
  - ensure stable/21.04 branch for charm-helpers

Change-Id: I7de7b61d63aef57c3242631b969d5bb54fe76ab1
2021-04-03 20:21:50 +01:00
Aurelien Lourot e87ef6ec00 Add Groovy to the test gate
Also sync libraries

Change-Id: I4e9d276edde7fb46ebf6b641edb3ad5df86cd040
2020-11-12 11:23:01 +01:00
James Page 56946244f9 Make EC profiles immutable
Changing an existing EC profile can have some nasty side effects
including crashing OSD's (which is why its guarded with a --force).

Update the ceph helper to log a warning and return if an EC profile
already exists, effectively making them immutable and avoiding
any related issues.

Reconfiguration of a pool would be undertaking using actions:

  - create new EC profile
  - create new pool using new EC profile
  - copy data from old pool to new pool
  - rename old pool
  - rename new pool to original pool name

this obviously requires an outage in the consuming application.

Change-Id: Ifb3825750f0299589f404e06103d79e393d608f3
Closes-Bug: 1897517
2020-09-28 11:46:51 +01:00
Zuul ea5452686b Merge "Sync charms.ceph to pick up EC fix for Ceph-fs" 2020-09-18 10:03:30 +00:00
Ponnuvel Palaniyappan 60a9a4f27a Remove chrony if inside a container
When running ceph-mon in containers, best practice is
to have chrony/ntp configured and installed on the bare
metal and then have the container trust the system
clock, as the container should not manage the system
clock.

The chrony package get installed automatically as
part of the dependencies of other packages, which
gets removed in this change.

Also contains related changes for charms.ceph.

Change-Id: If8beb28ea5b5e6317180e52c3e32463e472276f4
Closes-Bug: #1852441
Depends-On: Ie3c9c5899c1d46edd21c32868938d3290db321e7
2020-09-15 09:11:47 +01:00
Liam Young c358440c40 Sync charms.ceph to pick up EC fix for Ceph-fs
Sync charms.ceph to pick up EC fix for Ceph-fs. This patch enables
clients on the mds relation to request additional data pools to be
added.

Depends-On: I80b7a5cc87d7d53bb55d4d65999a0f9b3cdcb77d
Change-Id: I48348ab2b6c8952c5e22008a074a60c1f35be952
2020-09-10 14:40:08 +00:00
Frode Nordahl 210493277e
Add BlueStore Compression support
Sync in updates from charm-helpers and charms.ceph.

Remove unit tests that belong to charms.ceph.

Depends-On: Ibec4e3221387199adbc1a920e130975d7b25343c
Change-Id: I153c22efb952fc38c5e3d36eed5d85c953e695f7
2020-08-26 15:33:27 +02:00
James Page 4fd788d3a2 Updates for improved EC support
Sync charmhelpers and charms.openstack to pickup changes for
improved Erasure Coded pool support.

Update action code for EC profile creation for extended
option support and other charmhelpers changes.

Depends-On: I2547933964849f7af1c623b2fbc014fb332839ef
Change-Id: Iec4de19f7b39f0b08158d96c5cc1561b40aefa10
2020-08-07 15:24:59 +01:00
Alex Kavanagh e60d30630f Release sync for 20.08
- Classic charms: sync charm-helpers.
- Classic ceph based charms:  also sync charms.ceph
- Reactive charms: trigger a rebuild
- sync tox.ini
- sync requirements.txt and test-requirements.txt

Change-Id: Ifd8c81255770f95980c7fd4117e6f07e44eea2ee
2020-07-27 20:49:41 +01:00
Zuul 87292b1e60 Merge "Enable passing of integer value for pool-set action" 2020-07-14 15:01:56 +00:00
Alex Kavanagh 5ea8db66c8 Fix upgrade bug (luminous) where mgr is not restarted
From luminous to mimic, the ceph-mgr isn't restarted, leaving it at
luminous, rather than mimic.  This change ensures that the ceph-mgr is
restarted when the version is luminous or later.

Related charms.ceph change: I2844736af2de27ce071db859311ac99b9b3057ad
Closes-Bug: #1849874

Change-Id: Id059fbfd46bed4b9f96e85251fa83067696857d5
2020-07-08 15:43:33 +01:00
Alex Kavanagh b34d85ee81 Enable passing of integer value for pool-set action
Enable passing of an integer to the pool-set function.  Due to how juju
appears to parse things on the command line, setting type to string
causes it to fail to accept '3', "3" or 3 as a string.  Only "'3'"
works.  However, if we remove the type from actions.yaml and do the
validation in the charm, any value can be passed.

Depends-On: I6081c23af61fd5e872982ff477b0a5cb27141d11

Change-Id: Idf3468d9ae28dafc09c86f08b7f8c6470a665b7a
Closes-Bug: #1838650
2020-07-02 14:56:41 +01:00
Liam Young 59160b0815 Sync charms.ceph
Sync charms.ceph to pick up fix for LP #1851869

Change-Id: Ie3027d030c71faec0108fcde7fdd624b29623d49
Closes-Bug: #1851869
Partial-Bug: #1879464
2020-05-19 10:13:25 +00:00
Aurelien Lourot f02caf0743 Pre-freeze 'make *-sync'
Change-Id: I7f029e37e4743587912c3264a38556caf8e00b3a
2020-05-06 18:35:22 +02:00
Chris MacNaughton 3f62d00316 Ensure that the admin keyring has mgr capabilities
Change-Id: Icd30d464f3a6c52990c29f595d3e801e23c3c55c
Closes-Bug: #1867795
Depends-On: I5412fa1cd40a27213296532fd160012ec5299b3e
2020-03-20 10:18:18 +01:00
Ryan Beisner 734f3fcdd5
Sync charm-helpers for py38, distro, and other updates
Change-Id: I0a21ed8ad4bf740308bd822c9fe36872e78c9ee5
2020-03-05 13:30:31 +01:00
Frode Nordahl 478b98ac41
Add newline at end of file when writing keyring
Change-Id: I6682803c3dc67fd07f9db0073fe8eaa0de29c6d6
Closes-Bug: #1864706
Depends-On: If79977c2ec7588b09ca2e118141c7f3d9cf61767
2020-02-26 12:25:47 +01:00
Corey Bryant 415b795127 Rename lib/ceph to lib/charms_ceph
The new python3-ceph-common deb package (introduced in ceph octopus)
adds a new ceph directory (a parent package in python terms) in
/usr/lib/python3/dist-packages/ceph/. This results in a conflict with
charm-ceph-osd/lib/ceph/. For example, with the current import of
ceph.utils in hooks/ceph_hooks.py, Python finds no utils.py in
/usr/lib/python3/dist-packages/ceph/ and then stops searching.
Therefore, rename lib/ceph to lib/charms_ceph to avoid the conflict.

Depends-On: https://review.opendev.org/#/c/709226
Change-Id: Id5bdff991c1e6c196c09ba5a2241ebd5ebe6da91
2020-02-24 15:07:44 +00:00
Liam Young 3906f21dbe Charmhelper sync for 20.02
Change-Id: Ic31214ea1126edfa0d75967c03fdd5f979c3f6c1
2020-02-04 16:38:18 +00:00
Corey Bryant 2b97ebeeea Sync charm-helpers for Ussuri/Focal release and version details
Also add placement service/relations to bionic-train-with-fsid.yaml
test bundle.

Change-Id: If3741ef2d579219fe938c30b8c7c890f4ce7eae9
2020-01-21 11:58:27 -05:00
Zuul 490e409b7b Merge "Sync charms.ceph to add new permission request to broker" 2019-11-08 03:22:36 +00:00
Andrew McLeod 40e1ce044c Sync charms.ceph
use btrfs-progs instead of btrfs-tools for eoan and later
update bionic-train zaza test bundle to include placement

Closes-Bug: #1850181
Change-Id: Ic8e46dda154c19edadf0e6810701233c3db88e04
2019-10-31 19:37:52 +01:00
Sahid Orentino Ferdjaoui 2e3631c6c8 sync with last charms.ceph
* 7839ca3 put create_keyrings as a public method

Change-Id: Ia090d4c37e19016a8468ce62113b2531c69de0e5
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-10-24 09:57:32 +00:00
Chris MacNaughton b72936d727 Sync charms.ceph to add new permission request to broker
Change-Id: Id5023785fc748e44978b669db5b79c6c40e88de5
Depends-On: Ifd341bd80833d4a7fd62e89e3c0e2b7fd64fafba
2019-10-22 18:16:27 +02:00
Ryan Beisner 05a9dc6309 Sync charm/ceph helpers, tox, and requirements
Also fix for bug where the mgr daemon is not ready.  A wait is
introduced if it is not ready before trying to assert pg-autotune.

Closes-Bug: #1848576
Change-Id: Ic3c1e1f7902f7e2052dc4cf432303f874369238d
2019-10-17 22:37:39 +01:00
James Page 872c670ed6 Add support for Nautilus release
Resync charms.ceph to pickup changes to support new approach to
admin and bootstrap key generation with in the ceph-mon cluster.

Update get_mon_hosts to avoid specifying the port number for the
MON daemons; we use the default so this is not required, and at
Nautilus the MON daemons run both v1 and v2 messenger ports.

Specifying the port in the ceph.conf file disables the v2
messenger port which is not the desired behaviour on upgrade
or new installation.

Drop start hook; this has been present in the charm since its
inception as 'ceph' but is really not needed - re-deploying the
charm to units which previous hosted ceph-mon is dangerous
and the ceph-* daemons should still be running anyway.

Depends-On: I2dfab7404b72e314625ea554ee64595c5e26f3c6
Change-Id: I340dbf427551e6f9f8cd4ca89128627e497d6097
2019-05-31 15:11:59 +01:00
Frode Nordahl 06af59f022 Add setting ``max_objects`` quota and retrieving erasure code profile
Also fix a few missing redirects of STDERR.

Depends-On: I243328af5db202f092c53b4d48e0d293378d2ca0
Change-Id: Ia204468ecf5de6bb4d74ec9fcb68393d5b18b4f1
2019-03-04 11:14:50 +01:00
Frode Nordahl 677dc1806a
Add ``rbd-mirror`` relation
Reactive interface counterpart is here:
https://github.com/openstack-charmers/charm-interface-ceph-rbd-mirror

Sync charms.ceph.

Depends-On: I1bad5311ed034188a78dc67b493c22bff7ce4f7d
Change-Id: I509793e6c5aad9ea41fa4904c83b58e7477770e8
2019-02-25 00:34:07 +03:00
James Page 203947623f action: Misc tidyup and improvements
General tidy of actions codebase including sorting out
some minor bugs.

Added new copy-pool action.

Added support for CRUSH device classes when creating
erasure coding profiles.

Removed need for use of rados python module by switching
to using the ceph command line tool for all operations.

Add new action for creation of new CRUSH rules using
device classes.

Resync charms.ceph to support switching the crush_rule
key on a pool.

Resync charmhelpers for support for device classing.

Rename all action py files to by standards compliant.

Change-Id: I1f7d95b1637f2064bd11a5d5336764b2946428ac
Depends-On: I2c405f9a4956ff1ccf1edb7372a9bb11e1e591a4
2019-02-19 14:54:41 +00:00
Felipe Reyes 5ed4956f2b Update cloud-archive.list when upgrading from Pike to Queens
ceph-mon charm only upgrades when the ceph version changes, for the
case of upgrading from Pike to Queens the charm is skipping any
upgrades, because the Cloud Archive has Luminous for those 2 releases.

This patch checks if the requested ceph version is luminous and if the
'source' changed from pike to queens to then upgrade
/etc/apt/sources.list.d/cloud-archive.list via add_source()

Change-Id: I05b7d722e45d3a02a97866903a67bd9b16d4f552
Closes-Bug: 1778823
2019-01-25 18:13:02 -03:00
Zuul 21528b7c71 Merge "Resync charms.ceph and charmhelpers" 2019-01-09 08:39:33 +00:00
James Page d05704b05f Add support for RADOS gateway per unit cephx keys
If ceph-radosgw units present a key_name attribute, then generate
a cephx key using the key name and present back with the key_name
as the prefix for the key.

This switches radosgw units to having per-unit keys, rather than
sharing a global key (required as part of the pre-work to support
RADOS gateway federation).

Change-Id: I289b75a2935184817b424c5eceead16235c3f53b
Depends-On: I7ac4d23a91fa654b62afb62c389a8f9823ef2e05
Closes-Bug: 1808140
2019-01-08 12:12:30 +00:00
James Page aaecef4596 Resync charms.ceph and charmhelpers
Resync the latest charms.ceph to avoid direct installation
of Python 2 modules which are not available in the latest
Ceph packaging which no longer provides Python 2 support.

This commit also updates two action which still used Python
to use Python 3 (inline with the rest of the charm).

Change-Id: I8fc2a1aa17e48ef5dac9b9974c33b9620fcb7c70
2018-12-11 13:27:13 +00:00
James Page 61e20c2be3 Resync ceph helpers
Resync ceph helpers, picking up fixes for:

 - Upgrades from Luminous to Mimic.
 - Correct build of OSD list in more complex CRUSH
   configurations, resolving upgrade issues.

Add nova-cloud-controller to amulet tests to achieve a complete
deployment post landing of changes for Nova Cells v2 support.

Closes-Bug: 1788722

Change-Id: I7a5c53c792ab958d94301de62cdd4d804f8a54f7
2018-10-17 14:55:21 +01:00
dongdong tao af6478c4b4 Fix ceph-mon can not print log due to incorrect permission on log file
Change-Id: I34cd8ba1e45b90e60bd9c49d7d3973008bd95559
Signed-off-by: dongdong tao <dongdong.tao@canonical.com>
Closes-Bug: #1783526
2018-07-31 20:06:47 +08:00
Nicolas Pochet 37fbda6bd8 Remove reference to ntp package
This is motivated by the fact that:
* the ntp/chrony package is already a dependency of the ceph-mon/osd
package
* NTP will be managed by operators through the NTP charm
It is thus useless to keep that package mentioned here.

Change-Id: If6ecfc6f515bec4f955a5b52df8f0fbfafd29008
Closes-Bug: #1780690
Depends-on: Iddb7ffcc7ab7a74700855b950f619208511c2fab
2018-07-20 16:06:41 +02:00
James Page e071486acf Add 'osd blacklist' to default mon perms
Ensure that the default permissions for clients include the
'osd blacklist' command;  This ensures that in the event of
a client crashing (due to power outage or segfault), the
client and re-connect and write to any devices on reboot.

This is a safe permission for all supported Ceph releases.

Depends-On: I0b43dece4e1c56fb838b0147bfb75fb9906e6657
Change-Id: Ib1f1e8d7ed54528603b8b08051dafeec075a3232
Closes-Bug: 1773449
2018-06-11 09:11:45 +01:00
Zuul cd835e1a07 Merge "Add broker support for passing app_name" 2018-05-09 12:04:57 +00:00
Frode Nordahl e7d1e7e4f2 Improve Bootstrap resilience
Sync relevant changes from charms.ceph

Disable `ceph-create-keys` in init system and explicitly
run it in the charms ceph-mon bootstrap process.

Change-Id: I03cd596e6e336b75d7d108ed0acde15d9940913f
Depends-On: I3d3c7298076730c423ca5cc059316619f415b885
Closes-Bug: #1719436
2018-05-09 09:56:04 +00:00