From f312713b40955f266489524905e70ddc57d5a30b Mon Sep 17 00:00:00 2001 From: Maris Fogels Date: Fri, 16 Aug 2013 19:10:26 -0400 Subject: [PATCH] baremetal: Log IPMI power on/off timeouts Added log messages for cloud operators so that they can tell when an attempt to turn a device on or off via IPMI has failed after the configured number of attempts. This should help operators diagnose issues on devices that respond slowly to IPMI commands. The failure to repeatedly change the device power state is now logged precisely along with the cause, where before operators had to diagnose the issue through trace log captures. Partial-Bug: #1177584 Change-Id: Iecd6fadb2b653f4ccbe75882c2ef85812b334e8d --- nova/virt/baremetal/ipmi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/virt/baremetal/ipmi.py b/nova/virt/baremetal/ipmi.py index 49bcfcc98c71..301c628db348 100644 --- a/nova/virt/baremetal/ipmi.py +++ b/nova/virt/baremetal/ipmi.py @@ -148,6 +148,8 @@ class IPMI(base.PowerManager): self.state = baremetal_states.ACTIVE raise loopingcall.LoopingCallDone() if self.retries > CONF.baremetal.ipmi_power_retry: + LOG.error(_("IPMI power on failed after %d tries") % ( + CONF.baremetal.ipmi_power_retry)) self.state = baremetal_states.ERROR raise loopingcall.LoopingCallDone() try: @@ -170,6 +172,8 @@ class IPMI(base.PowerManager): self.state = baremetal_states.DELETED raise loopingcall.LoopingCallDone() if self.retries > CONF.baremetal.ipmi_power_retry: + LOG.error(_("IPMI power off failed after %d tries") % ( + CONF.baremetal.ipmi_power_retry)) self.state = baremetal_states.ERROR raise loopingcall.LoopingCallDone() try: