From 05e06bb9ec0c250105b2dd9833b1b987d37322d6 Mon Sep 17 00:00:00 2001 From: Tee Ngo Date: Mon, 11 Mar 2024 00:34:30 -0400 Subject: [PATCH] Log subcloud health output upon failed health check Log subcloud health output for quick diagnosis. With this change, the user would not need to log into the subcloud to check health output. Sometimes, the health condition is resolved by the time the user runs the system health-query command in the subcloud. As the result, more time would be required to determine what caused the failed health check in the first place. Test Plan: - Verify successful subcloud backup with the change. - Induce a health condition (e.g. management affecting alarm). Verify that subcloud backup request is rejected and the subcloud health output is captured in dcmanager-api.log Closes-Bug: 2056721 Change-Id: I32fea354f9cf594ea45d412359a9090e7b1bfb83 Signed-off-by: Tee Ngo --- distributedcloud/dcmanager/common/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/distributedcloud/dcmanager/common/utils.py b/distributedcloud/dcmanager/common/utils.py index 1685c8f78..1c681ceea 100644 --- a/distributedcloud/dcmanager/common/utils.py +++ b/distributedcloud/dcmanager/common/utils.py @@ -1044,6 +1044,8 @@ def is_subcloud_healthy(subcloud_region): (len(fails) == 1 and failed_alarm_check and no_mgmt_alarms)): return True + LOG.error(f"Subcloud {subcloud_region} failed health check. Health output: " + f"\n{system_health}\n") return False