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
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>