]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: handle exceptions applying secondary services during bootstrap 50904/head
authorAdam King <adking@redhat.com>
Wed, 15 Mar 2023 17:55:26 +0000 (13:55 -0400)
committerAdam King <adking@redhat.com>
Wed, 5 Apr 2023 19:52:01 +0000 (15:52 -0400)
Otherwise we risk hitting a mismatch between the cephadm binary version
and the container image version we're bootstrapping on, resulting in
bootstrap failing. Example in the tracker.

Fixes: https://tracker.ceph.com/issues/59082
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit a57fc000cc40066dff8692f489e4942d5bda1f56)

src/cephadm/cephadm

index dbe2e639b661455d16e4dcd0a1bb5695d64d2876..f6ef534dc8dc950b30fffd9dd805ee6df2bf94ee 100755 (executable)
@@ -5272,12 +5272,22 @@ def prepare_ssh(
     if not ctx.skip_monitoring_stack:
         for t in ['ceph-exporter', 'prometheus', 'grafana', 'node-exporter', 'alertmanager']:
             logger.info('Deploying %s service with default placement...' % t)
-            cli(['orch', 'apply', t])
+            try:
+                cli(['orch', 'apply', t])
+            except RuntimeError:
+                ctx.error_code = -errno.EINVAL
+                logger.error(f'Failed to apply service type {t}. '
+                             'Perhaps the ceph version being bootstrapped does not support it')
 
     if ctx.with_centralized_logging:
         for t in ['loki', 'promtail']:
             logger.info('Deploying %s service with default placement...' % t)
-            cli(['orch', 'apply', t])
+            try:
+                cli(['orch', 'apply', t])
+            except RuntimeError:
+                ctx.error_code = -errno.EINVAL
+                logger.error(f'Failed to apply service type {t}. '
+                             'Perhaps the ceph version being bootstrapped does not support it')
 
 
 def enable_cephadm_mgr_module(