]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: abort upgrade if there are offline hosts.
authorAdam King <adking@redhat.com>
Fri, 21 Oct 2022 15:57:53 +0000 (11:57 -0400)
committerAdam King <adking@redhat.com>
Fri, 17 Feb 2023 15:45:50 +0000 (10:45 -0500)
We won't be able to complete the upgrade if there are offline
hosts anyway so we might as well abort immediately.

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 3e35324dd70771d7f52d5e055d778069897f6b58)

src/pybind/mgr/cephadm/module.py

index ec6f50c9f2c3f19680ffe74610f81455d50f023f..0d5e6edc91a17ed004cdefff0c162e76cec0dc99 100644 (file)
@@ -2930,7 +2930,9 @@ Then run the following:
     def upgrade_start(self, image: str, version: str, daemon_types: Optional[List[str]] = None, host_placement: Optional[str] = None,
                       services: Optional[List[str]] = None, limit: Optional[int] = None) -> str:
         if self.inventory.get_host_with_state("maintenance"):
-            raise OrchestratorError("upgrade aborted - you have host(s) in maintenance state")
+            raise OrchestratorError("Upgrade aborted - you have host(s) in maintenance state")
+        if self.offline_hosts:
+            raise OrchestratorError(f"Upgrade aborted - Some host(s) are currently offline: {self.offline_hosts}")
         if daemon_types is not None and services is not None:
             raise OrchestratorError('--daemon-types and --services are mutually exclusive')
         if daemon_types is not None: