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 <tee.ngo@windriver.com>
This commit is contained in:
Tee Ngo 2024-03-11 00:34:30 -04:00
parent 5f132a43ab
commit 05e06bb9ec
1 changed files with 2 additions and 0 deletions

View File

@ -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