John Mulligan [Mon, 9 Mar 2026 23:03:46 +0000 (19:03 -0400)]
mgr/cephadm: move ceph specific action checks to function
Move core ceph type services next action check to the
_ceph_service_needs_reconfig helper function. This is a private helper
that does not use choose_next_action because of the additional needs for
the last_config and monmap/extra conf that no other service needed to
care about. Moving the logic to a function shrinks the already-long
_check_daemons a bit and makes it possible to stop checking for
services that don't use choose_next_action in a future commit.
Plus cephadm always treats core ceph services a bit special anyway,
right? :-)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 21:14:50 +0000 (17:14 -0400)]
mgr/cephadm: add custom choose_next_action to ingress service
The haproxy component of the ingress service performs additional
checks to determine in the service needs to be redployed in the
case it is fronting nfs and the placement has changed.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 20:49:26 +0000 (16:49 -0400)]
mgr/cephadm: add custom choose_next_action to monitoring services
Like the previous commit, update the prometheus, node-exporter, and
alertmanager services to use choose_next_action and share the
logic of that function via next_action_for_mgmt_stack_service.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 20:48:53 +0000 (16:48 -0400)]
mgr/cephadm: add custom choose_next_action to ceph exporter service
The ceph exporter service (and similar monitoring stack services)
need to detect if andy dependencies in the mgmt stack support services have
changed and be redeployed if so.
Update the ceph exporter service that makes use of a common function
for checking for this need. A common function will be used instead of
messing around with inheritance because I'm simply not brave enough
to look at doing that and I know a function provides common
implementation without side-effecting the class hierarchy.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 20:03:48 +0000 (16:03 -0400)]
mgr/cephadm: add custom choose_next_action to nfs service
The nfs service needs to use the deps difference to detect
if any non-kmip related dependencies changed and force a
redeploy instead of a reconfig when so.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 20:03:28 +0000 (16:03 -0400)]
mgr/cephadm: use new choose_next_action when so configured
Use the newly added choose_next_action when a CephadmService subclasss
sets the manages_own_next_action class attribute to true.
This allows us to incrementally "opt in" classes to use
the choose_next_action method until all classes have been updated
to use that instead of code directly in _check_daemons.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 20:02:53 +0000 (16:02 -0400)]
mgr/cephadm: add new choose_next_action method to CephadmService
Add a new method to the CephadmService ABC. This method allows
service types to customize behavior when determining what
action needs to be taken if dependencies are changed, etc.
The server.py method _check_daemons uses cascading if-statements
that would look for differences between old and new dependencies
and check various properties to customize the type of action
cephadm is to take next. For example:
the nfs service must be *redeploy*ed instead of *reconfig*ured
when a dependency other than a kmip configuration has been
changed. The new choose_next_action method will be added
to _check_daemons to eventually replace these special cases here
and associate them with the various CephadmService subclasses.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 10 Mar 2026 13:44:44 +0000 (09:44 -0400)]
mgr/cephadm: add a new Action enum class
Currently, the code base mostly uses strings to represent actions
(like 'start', 'redeploy, 'reconfig', ...). Add a new Action class
to utils.py to have a crisper typing-friendly representation for
actions.
This is added to support net new code. While I'd like to see this
used more the goal is to prevent errors in the new approach and I
don't plan on immediately going back through all of cephadm
and finding and replacing all action strings right away.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 19:08:44 +0000 (15:08 -0400)]
mgr/cephadm: avoid redundant call to cache.get_scheduled_daemon_action
Avoid a redundant call to cache.get_scheduled_daemon_action by
saving the call result in two variables at the first call site.
One var may be changed but the other will retain the original
value until it is checked again later.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 18:59:14 +0000 (14:59 -0400)]
mgr/cephadm: replace _calc_daemon_deps in serve.py
Replace the use of _calc_daemon_deps in serve.py with a direct call to
the method that _calc_daemon_deps uses. This avoids a bunch of redundant
calls just to get the service class since we just make the same set of
calls just above the call to _calc_daemon_deps . It removes the final
use of a rarely used "helper" function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 18:57:05 +0000 (14:57 -0400)]
mgr/cephadm: replace _calc_daemon_deps call in agent.py
Replace the use of _calc_daemon_deps in agent.py with direct call to the
method that _calc_daemon_deps uses. This avoids a bunch of redundant
calls just to get the service class (that we already have) and removes a
use of a rarely used "helper" function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Mon, 9 Mar 2026 18:54:51 +0000 (14:54 -0400)]
mgr/cephadm: add sorted_dependencies function
Add `sorted_dependencies` a light wrapper around get_dependencies that
enforces the invariant of returning a sorted list of dependencies.
In the future we may want to simply replace get_dependencies if
there's no place we don't want sorted dependencies but this keeps
the changes to a minimum for now.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 11 Mar 2026 21:58:18 +0000 (17:58 -0400)]
mgr/cephadm: add test coverage for action chosen in _check_daemons
Add a test that verifies that the special cases for the
extra_entrypoint_args and extra_container_args are handled. While all
containers take these params we test them for the custom container as
this is where they'd be most commonly used.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 11 Mar 2026 19:44:39 +0000 (15:44 -0400)]
mgr/cephadm: add test coverage for action chosen in _check_daemons
Add a test that verifies that the special cases for the ingress daemon
when fronting nfs choice of action is handled.
Fix the error in the current code block so that the test passes. I have
discussed this with Shweta, the author of this code block, and we
agree it should have been `last_deps`.
NOTE: While this test tries to assert the correct action is chosen via a
mock, I have also examined that it takes the correct code path when by
viewing coverage results locally.
Co-authored-by: Shweta Bhosale <Shweta.Bhosale1@ibm.com> Signed-off-by: John Mulligan <jmulligan@redhat.com>
Adam Kupczyk [Thu, 25 Sep 2025 07:03:12 +0000 (03:03 -0400)]
extblkdev/fcm: Refuse to operate on multimedia lvm block devices
BlueStore is selecting were data is put to the device.
Merging 2 FCM devices together means that BlueStore will see free space
on one of the devices, but not know the other is full and asking to put
data there. It will cause -ENOSPC while free space is reported.
John Mulligan [Mon, 10 Nov 2025 21:15:29 +0000 (16:15 -0500)]
cephadm: add pid file directory option to cfg watch sidecar
This will enable the config watch sidecar to signal processes
with a SIGHUP to tell them to reload configuration when config
watch has detected a configuration change. Currently only used
by keybridge.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 22 Jul 2025 23:24:11 +0000 (19:24 -0400)]
mgr/smb: add new cephfs parameter for getting fscrypt keys
Add a new field to the cephfs configuration section for shares. This
section selects the keybridge scope and key name to use when acquiring
the key to use for fscrypt.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 22 Jul 2025 23:22:15 +0000 (19:22 -0400)]
mgr/smb: add keybridge configuration to cluster resource
Add keybridge service configuration classes and parameters to the
resources module. This supports enabling the keybridge, setting up
scopes for the keybridge and it's access control.
A helper class is added that parses and helps validate the scope names.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 16 Jul 2025 21:55:44 +0000 (17:55 -0400)]
mgr/smb: add enums that will be used for configuring keybridge
Add a pair of enum types that will be used for configuring the
keybridge. The scope type identifies what kind of scope is being
used. The peer policy can be used to allow a dev or other user
more access to the keybridge api for development purposes.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 18 Jul 2025 14:23:31 +0000 (10:23 -0400)]
mgr/smb: fix a resource error unpacking str instead of list
Add special handling for the case where a string is passed instead of a
list. Without this fix a string will be converted into a list of single
letter items, something pretty much no one ever wants. Raise an
exception instead.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Fri, 18 Jul 2025 16:20:17 +0000 (12:20 -0400)]
cephadm: add keybridge sidecar to smb daemon module
The keybridge uses the sambacc configuration but can also be passed
CLI options. Since cephadm writes the cert files, cephadm must also
pass the file names to use to the container args.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Wed, 16 Jul 2025 21:08:49 +0000 (17:08 -0400)]
python-common/deployment: add keybridge feature to smb service spec
The keybridge sidecar is enabled by the keybridge feature flag.
This sidecar will be used to help fetch keys over various protocols
for the ceph module to use to set up fs encryption.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Adam Kupczyk [Thu, 22 Jan 2026 15:23:56 +0000 (15:23 +0000)]
os/bluestore: Add config bluestore_use_ebd
When EBD(extblkdev) plugin is in use usually it needs to present all the time.
For bluestore deployed with EBD plugin it makes it an error if bluestore tries
to mount and EBD plugin is not present.
Preload of extblkdev plugins was misplaced.
Moved loading plugins into BlueStore.
This way both OSD and tools can load plugins.
Plugins are now loaded only:
- before mkfs
- when extblkdev plugin is signalled in label meta