]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/cephadm: set service name for DaemonDescription object used during daemon removal
authorAdam King <adking@redhat.com>
Thu, 14 Nov 2024 15:24:11 +0000 (10:24 -0500)
committerAdam King <adking@redhat.com>
Mon, 13 Jan 2025 20:09:35 +0000 (15:09 -0500)
commitd8dae2410401ecceae95e6f5f242be2f0429fe68
tree10ca4cc403e15a627814a37b70695f9bb67a05ef
parent71d50d80c9fff80026e3431e577476e4d099f0f1
mgr/cephadm: set service name for DaemonDescription object used during daemon removal

What this is specifically fixing is that the nvmeof post_remove function
needs the service spec of the daemon's service to get the pool and group
tied to the nvmeof daemon. We have been using the DaemonDescription
"service_name" property to get the service name in order to get the spec.
This works in a regular deployment. However, it is possible to make a placement
like

placement:
  hosts:
  - vm-00=nvmeof.a
  - vm-01=nvmeof.b

and one of the nvmeof CI tests was doing so, which is why we saw this.
That will cause the nvmeof daemon names to be nvmeof.nvmeof.a and
nvmeof.nvmeof.b and not include the service name at all. In this
case, the service_name property on the DaemonDescription class
will end up getting service names nvmeof.nvmeof.a and nvmeof.nvmeof.b
respectively from the nvmeof daemons, which will cause us to fail
to find the spec in post_remove. This change makes it so we manually set
the service name for the DaemonDescription object that gets passed
to post_remove based on the service name of the daemon object we
get from the host cache, which will still have the correct service
name even if the daemon has a custom name. Then the nvmeof post_remove
function will get the correct service name and be able to find the spec.

Additionally, we now take are technically taking the daemon type
and id from the DaemonDescription in our HostCache as well, but
this is mostly just for consistency and should have no real impact.

Fixes: https://tracker.ceph.com/issues/68962
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/serve.py