From: Adam King Date: Thu, 28 Jan 2021 18:32:01 +0000 (-0500) Subject: mgr/cephadm: call prepare_create before redeploy X-Git-Tag: v17.1.0~2990^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6fc6db23bf72d5d488fa983a7fd2491c5a9805d3;p=ceph.git mgr/cephadm: call prepare_create before redeploy some services (notably iscsi and ha-rgw currently) rely on actions in prepare_create to setup their configuration even when being redeployed. This change makes sure prepare_create is called before redeploys and reconfigurations the same way it is done during initial deployment to avoid disrepencies. OSDs are skipped as they do not have a normal prepare_create Fixes: https://tracker.ceph.com/issues/48373 Signed-off-by: Adam King --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index ae79d89e3784..147694656f61 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1599,14 +1599,15 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, self._daemon_action_set_image(action, image, daemon_type, daemon_id) - if action == 'redeploy': - if self.daemon_is_self(daemon_type, daemon_id): - self.mgr_service.fail_over() - return '' # unreachable - # stop, recreate the container+unit, then restart - return CephadmServe(self)._create_daemon(daemon_spec) - elif action == 'reconfig': - return CephadmServe(self)._create_daemon(daemon_spec, reconfig=True) + if action == 'redeploy' and self.daemon_is_self(daemon_type, daemon_id): + self.mgr_service.fail_over() + return '' # unreachable + + if action == 'redeploy' or action == 'reconfig': + if daemon_type != 'osd': + daemon_spec = self.cephadm_services[daemon_type_to_service( + daemon_type)].prepare_create(daemon_spec) + return CephadmServe(self)._create_daemon(daemon_spec, reconfig=(action == 'reconfig')) actions = { 'start': ['reset-failed', 'start'],