From: Adam King Date: Fri, 21 Oct 2022 15:57:53 +0000 (-0400) Subject: mgr/cephadm: abort upgrade if there are offline hosts. X-Git-Tag: v17.2.6~71^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d54fc29ec8c3a373b25d8bea4906d0aebae1e092;p=ceph.git mgr/cephadm: abort upgrade if there are offline hosts. 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 (cherry picked from commit 3e35324dd70771d7f52d5e055d778069897f6b58) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index ec6f50c9f2c3..0d5e6edc91a1 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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: