]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: call prepare_create before redeploy
authorAdam King <adking@redhat.com>
Thu, 28 Jan 2021 18:32:01 +0000 (13:32 -0500)
committerAdam King <adking@redhat.com>
Tue, 9 Feb 2021 02:53:34 +0000 (21:53 -0500)
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 <adking@redhat.com>
src/pybind/mgr/cephadm/module.py

index ae79d89e3784033538f55bd591dfe977ca7ab82d..147694656f61c20ca6080617f0c1aead32006ea2 100644 (file)
@@ -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'],