]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: do not schedule on _no_schedule hosts
authorSage Weil <sage@newdream.net>
Tue, 20 Apr 2021 14:01:22 +0000 (10:01 -0400)
committerSage Weil <sage@newdream.net>
Tue, 4 May 2021 16:17:52 +0000 (11:17 -0500)
Reuse and rename existing helper to return schedulable hosts.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit f260c48f723641a5f82c64c0e31451199aa191f8)

src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/serve.py

index d06775e1023932c1cbf437b4e59e048b336f1865..04f857d3726540b84925876c097b29e4a86406cf 100644 (file)
@@ -1270,7 +1270,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
 
         return image
 
-    def _hosts_with_daemon_inventory(self) -> List[HostSpec]:
+    def _schedulable_hosts(self) -> List[HostSpec]:
         """
         Returns all usable hosts that went through _refresh_host_daemons().
 
@@ -1281,8 +1281,11 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
         """
         return [
             h for h in self.inventory.all_specs()
-            if self.cache.host_had_daemon_refresh(h.hostname)
-            and h.status.lower() not in ['maintenance', 'offline']
+            if (
+                self.cache.host_had_daemon_refresh(h.hostname)
+                and h.status.lower() not in ['maintenance', 'offline']
+                and '_no_schedule' not in h.labels
+            )
         ]
 
     def _add_host(self, spec):
@@ -2101,7 +2104,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
 
         ha = HostAssignment(
             spec=spec,
-            hosts=self._hosts_with_daemon_inventory(),
+            hosts=self._schedulable_hosts(),
             networks=self.cache.networks,
             daemons=self.cache.get_daemons_by_service(spec.service_name()),
             allow_colo=self.cephadm_services[spec.service_type].allow_colo(),
index 418cecf6078f2159a83781ebf077640d183555c9..f17219730c421cdd5dc873f033c1948a08261129 100644 (file)
@@ -546,7 +546,7 @@ class CephadmServe:
 
         ha = HostAssignment(
             spec=spec,
-            hosts=self.mgr._hosts_with_daemon_inventory(),
+            hosts=self.mgr._schedulable_hosts(),
             daemons=daemons,
             networks=self.mgr.cache.networks,
             filter_new_host=(