]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm/services/osd: skip found osds that already have daemons
authorSage Weil <sage@newdream.net>
Mon, 6 Dec 2021 15:19:57 +0000 (10:19 -0500)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 18 Jan 2022 10:54:49 +0000 (11:54 +0100)
If we are trying to deploy new or newly-found osds, we can skip the ones
that already have cephadm daemons deployed.

Fixes: https://tracker.ceph.com/issues/53491
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit dc3d45bbe8c3bfedee57da619616c0be489cd233)

Conflicts:
src/pybind/mgr/cephadm/services/osd.py

src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/services/osd.py

index f6920764fcb947317b4ebd1e4ba16467cad8edd3..3edf93f8745ef36ee3a8ee94c7d4fe6690635675 100644 (file)
@@ -743,9 +743,9 @@ class HostCache():
 
         raise orchestrator.OrchestratorError(f'Unable to find {daemon_name} daemon(s)')
 
-    def has_daemon(self, daemon_name: str) -> bool:
+    def has_daemon(self, daemon_name: str, host: Optional[str] = None) -> bool:
         try:
-            self.get_daemon(daemon_name)
+            self.get_daemon(daemon_name, host)
         except orchestrator.OrchestratorError:
             return False
         return True
index dc4476b709a1cd0ab498450ec39fc299aca9eed8..5344b47a1a3fe0d686643e840ed344bbfcc630f0 100644 (file)
@@ -120,6 +120,10 @@ class OSDService(CephService):
                 if osd_id in before_osd_uuid_map and osd_id not in replace_osd_ids:
                     # if it exists but is part of the replacement operation, don't skip
                     continue
+                if self.mgr.cache.has_daemon(f'osd.{osd_id}', host):
+                    # cephadm daemon instance already exists
+                    logger.debug(f'osd id {osd_id} daemon already exists')
+                    continue
                 if osd_id not in osd_uuid_map:
                     logger.debug('osd id {} does not exist in cluster'.format(osd_id))
                     continue