Remove support for creating FileStore OSDs. Also prevent upgrade
attempts to Reef if a FileStore OSD is detected
Change-Id: I9609bc0222365cb1f4059312b466a12ef4e0397f
This is useful, because if an invalid value is set,
the value is ignored and not overridden,
and an error logged.
So now we warn about this in the status to be more obvious to the user.
Change-Id: Idc4a7706f30cbcea8aee83a1406fa84139fe510d
Read the key set on the mon relation,
and use ceph-authtool to save it to a keyring,
for use by the crash module for crash reporting.
When this auth key is set, the crash module (enabled by default)
will update ceph-mon with a report.
It also results in a neat summary of recent crashes
that can be viewed by `ceph health detail`.
For example:
```
$ juju ssh ceph-mon/leader -- sudo ceph health detail
HEALTH_WARN 1 daemons have recently crashed
[WRN] RECENT_CRASH: 1 daemons have recently crashed
osd.1 crashed on host node-3 at 2023-01-04T05:25:18.218628Z
```
ref. https://docs.ceph.com/en/latest/mgr/crash/
See also https://review.opendev.org/c/openstack/charm-ceph-mon/+/869138
for where the client_crash_key relation data set is implemented.
Depends-On: https://review.opendev.org/c/openstack/charm-ceph-mon/+/869138
Closes-Bug: #2000630
Change-Id: I77c84c368e6665e4988ebe9a735f000f99d0b78e
The charm attempts to bootstrap OSDs on both the mon-relation-changed
and the mon-relation-departed hooks. There is no logical reason that
the OSDs should be bootstrapped in the -departed hook.
Change-Id: I79a790291b0e361d2748d6bed8c989d16ad36daf
Closes-Bug: #1885195
This new action allows users to either purge an OSD, or remove it,
opening up the possibility of recycling the previous OSD id. In
addition, this action will clean up any bcache devices that were
created in previous steps.
Change-Id: If3566031ba3f02dac0bc86938dcf9e85a66a66f0
Depends-On: Ib959e81833eb2094d02c7bdd507b1c8b7fbcd3db
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/683
update-status needs to account for devices that
are used as bluestore devices where the device
is mapped to a luks dev.
Change-Id: I92e67a5d62eb50dbf5da430d03a6b7ff5485ce46
Closes-Bug: #1929417
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.
Change-Id: I5333cc85f755771733fe09e963d5523fd93c16d2
Closes-Bug: #1917742
The assess-status hook can error out if the vault unit is offline whilst
it is verifying the relation. This patchset ensures that it simply logs
the error and puts up a warning saying it can't verify the relation.
The state will 'fix itself' when vault comes back online.
Change-Id: I9cb50be5d9d317c48ec3e3ae3ea8fed0687832dd
Sync in updates from charm-helpers and charms.ceph.
Depends-On: I153c22efb952fc38c5e3d36eed5d85c953e695f7
Depends-On: Ibec4e3221387199adbc1a920e130975d7b25343c
Change-Id: I028440002cdd36be13aaee4a0f50c6a0bca7abda
Pass the unit name to the secrets provider via relation data. The
unit name is not available in CMRs so needs to be passes this way.
Change-Id: I9fa162bbf45144d0827c669fc9b37d7b336366cd
On charm upgrade ensure that the number of bootstrapped OSD's
is presented to the ceph-mon application.
This ensures that the ceph-mon application does not switch
into a 'waiting' state after upgrade from earlier versions
of the ceph-* charms.
Change-Id: If1425ef837a74212f002985f648ac1ecf9257201
Closes-Bug: 1861996
Apply OSD settings requested by the mons via the juju relation.
Add the OSD settings to config too. Before applying the settings
config-flags is checked to ensure there is no overlap.
Change-Id: Id69222217a1c99d0269831913abdf488791cb572
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: I13ae7c048d8f1eef2ea64b13ae14b51dbfaaf3cd
Also gate checking vault context completing on whether
dependencies are installed.
Change-Id: I6c89944960f592300921fbd455c6d1d8c4b9b2a2
Closes-Bug: #1849323
This change includes a charms.ceph sync.
The _upgrade_keyring function was removed from charms.ceph
so this charm needs to use the already-existing, charm-
internal version.
Change-Id: Ia7cf352a2456dc85aca6f61d2e88327cd0c15f7e
Closes-Bug: #1845975
As the OSD bootstrap code is unique to ceph-osd, the code
to check / setup the OSD bootstrap & upgrade keys can be
moved in-tree.
Change-Id: Ia1639c81238ca782b5600bbe445cf6ee105bfd37
When the user provides an unexpected value in this configuration option
a warning message is logged and the workload is set to blocked.
Closes-Bug: #1835145
Change-Id: I10cac1cf43c11cf11fde196244820ac28b5a47d0
This notification is added to allow ceph-mon to know
when ceph-osd units have upgraded in order to run
post-upgrade commands (required for certain upgrades).
- Add notify_mon_of_upgrade function that sets
ceph_release to release version.
- Refactor some hard coded strings to vars
- Set relation ceph_release when setting bootstrapped-osd
Change-Id: I708b33cafc8818af7e3c63a7fa80c02978e66f65
Partial-Bug: #1828630
Handling other functions of the charm upgrade before possible
new packages leads to breakages when dependencies are unmet
Change-Id: I0e4857d0d03c2d076290a4cc6a08dc1e6d5e1610
Closes-Bug: #1819669
Run udevadm settle before processing osd-devices as there may by
udev events that have been queued for processing on server startup.
Includes charms.ceph sync
Corresponding charms.ceph change is:
Iec5932a4d819ad87e54c2af391abe1befe84f164
Change-Id: Ia4210d6a5c2c8a0b0e2038b25f24d2d82600e10a
Closes-Bug: #1812925
This change implements a new option called 'bdev-enable-discard' to control
behaviour of issuing discards to SSDs on ceph bluestore. The new code tries
to autodetect cases where it should be enabled by default but will allow
forcing if desired.
Change-Id: I7b83605c827eb4058bc4b46c92eb114c11108c93
Closes-Bug: #1788433
The charm attempts to avoid restarts of the ceph-osd processes
by asssessing whether new or changed apparmor profiles have
been installed.
The charm always copies apparmor files from the charm to
/etc/apparmor.d which overwrites any local changes made to the
profile - specifically if the profile is in complain mode.
As the content of the profile then changes the restart_on_change
decorator then fires the aa_profile_changed function which
switches the profile back into enforce mode.
This change only overwrites apparmor profiles in the event
that the hash of the source file in the charm changes; if it
does then the current profile mode is re-asserted to ensure
that complain mode deployments don't switch to enforce by
mistake.
Change-Id: I8f8cbf17af6219bd9fbdcf71a7000cba4c63f3f3
Closes-Bug: 1783373
Co-Authored-By: James Page <james.page@ubuntu.com>
ceph-osd 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: I27c2d7648a1add6528924724a03682060d2d6007
Closes-Bug: 1778823
The referenced bug (below) was caused because the nrpe check needed to
access the ceph owned directories, and as the nagios user, nrpe can't.
This change splits the check into a 'collect' phase that runs as root
via a cronjob each minute and writes a file to the tmp directory, and a
nrpe check phase that then reads that file and reports back to nagios.
The 'check' part deletes the 'collect' file, so that fresh information
is available for each nrpe check. The cron task runs every minute (as
is lightweight), so the nrpe checks should not be sheduled more
frequently than 1 minute.
Change-Id: I4f4594a479eed47cc66643d0c6acece491ae854d
Closes-Bug: #1810749
We need to clear the blocked status "non-pristine device detected ..."
when there is no non-pristine device anymore
Change-Id: I2f31eb9c08be186c08554122c2a160bbcbf2c389
Signed-off-by: dongdong tao <dongdong.tao@canonical.com>
Closes-Bug: #1810508
ceph-osd<->nrpe relation adds a single check that parses the service
status of all the ceph-osd processes. The check supported sysv and
upstart environments, but not systemd, which has been added.
add_init_service_checks does support systemd but it would create a
nrpe check per OSD (vs a single check for all OSDs)
Change-Id: I34fc01365de6994c93a273f01a1e2278016d21ef
Closes-Bug: 1804247
Signed-off-by: Alvaro Uria <alvaro.uria@canonical.com>
Charm should avoid writing ceph.conf unless it absolutely needs
to since this can clash with other processes that might be
reading the file (such as ceph-disk called by udev).
Change-Id: I3790b5b16fa1473f1c3271b795b3d32c5e8d2fad
Closes-Bug: #1783113
To allow the ceph-mon charm to better assess when the Ceph cluster
is in a usable state, provide the number of OSD devices that where
bootstrapped into the Ceph cluster over the relation to ceph-mon.
This is used by the ceph-mon charm inconjunction with the
'expected-osd-count' configuration option to delay pool creation
and issue of keys for clients until the expected number of OSD's
have been bootstrapped into the cluster.
Change-Id: I1370524f0f31120e3cb7305c5bc509a6494c5586
Closes-Bug: 1794878
The previous commit to enable bluestore by default incorrectly
used the Jewel version series for the on by default check.
Update this to specify Luminous (12.2.0).
Change-Id: I8e69b171c67e7c0988c2b25f28fc5bac14de1c5e
For Ceph Lumimous (12.2.0) or later enable Bluestore block device
format as the default for Ceph OSD's. Bluestore can be disabled by
setting the bluestore config option to False.
For older releases, Bluestore cannot be enabled as its not
supported - setting the config option will have no effect.
Change-Id: I5ca657b9c4da055c4e0ff12e8b91b39d0964be8c
Ensure that device paths provided by end users are used for OSD's,
rather than the link target device as this may change between
reboots. The specific use case is bcache, where:
/dev/bcacheX:
changes between reboots
/dev/disk/by-dname/bcacheX:
udev managed and consistent
This change also ensures that any unit data is updated to switch
back to using the provided block device path, rather than the
actual target which may have been used in prior charm revisions.
Change-Id: If5e88d93b9323052ea762d3a4b66f2442d4a19be
Depends-On: If0e1fbc62bfe7d0f9e21db9bfdeee761060de846
Closes-Bug: 1782439
Similar to how osdize in charms.ceph checks for already processed
devices we need to avoid checking if they are pristine or not.
Additionally, mapped LUKS devices need to be filtered from being zapped
as they may hold valuable data. They are only used as underlying devices
for device mapper and dmcrypt to provide a decrypted block device
abstration so if they really need to be zapped a mapping needs to be
removed first.
This change also pulls charms.ceph modifications.
Change-Id: I96b3d40b3f9e56681be142377e454b15f9e22be3
Co-Authored-By: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
Co-Authored-By: Chris Procter <chris.procter@canonical.com>
Closes-Bug: 1781453
Ensure that udev rules are not installed and reloaded
when running in a container; this is not permitted and
the udev rules are used for block devices, which are
not supported within container based deployments.
Change-Id: I9a580172fcbbf8cec63af7adccb0808915184658
Closes-Bug: 1776713
Commit 352d699387 introduced a change
in assess_status to not update status as long as the previous status
was 'blocked'. This was done because the check for pristine block
devices is done elsewhere in the charm.
However there are other situations that might set the charm in
'blocked' state.
This commit addresses this error.
Change-Id: Icdc272dadd7f9ceb670d37238628d31f33d11770