From 1335402f42c174ad814601faae417d06e541ea12 Mon Sep 17 00:00:00 2001 From: Jay Faulkner Date: Wed, 7 Jun 2023 13:24:55 -0700 Subject: [PATCH] Add additional logging on iLO power failure Currently, there's no information printed about the style of failure when we cannot properly change the power status on an iLO server. Now, we ensure the actual server state and the expected server state at the BMC level is logged, helping with troubleshooting edge cases. Related-bug: 2021995 Change-Id: I77dc69ef4dd42e5ad674f5c00a4500027ef030ec --- ironic/drivers/modules/ilo/power.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ironic/drivers/modules/ilo/power.py b/ironic/drivers/modules/ilo/power.py index a1363fb52f..909fa5a8c6 100644 --- a/ironic/drivers/modules/ilo/power.py +++ b/ironic/drivers/modules/ilo/power.py @@ -174,9 +174,12 @@ def _wait_for_state_change(node, target_state, requested_state, else: timeout = int(max_retry * interval) LOG.error("iLO failed to change state to %(tstate)s " - "within %(timeout)s sec for node %(node)s", + "within %(timeout)s sec for node %(node)s. Reported " + "state from iLO is %(state)s, expected state from iLO " + "is %(expected)s.", {'tstate': target_state, 'node': node.uuid, - 'timeout': int(max_retry * interval)}) + 'timeout': int(max_retry * interval), 'state': state[0], + 'expected': state_to_check}) raise exception.PowerStateFailure(pstate=target_state)