Revamp fencing order

Prevents unnecessarily excessive timeouts if IPMI connections time out;
before, would have to go through 3 timed out commands at ~20s each
before failure was registered; reduced to 1 if the first times out.
This commit is contained in:
Joshua Boniface 2020-12-15 02:45:38 -05:00
parent 37c3b4ef80
commit ac3ef3d792
1 changed files with 13 additions and 8 deletions

View File

@ -124,6 +124,11 @@ def rebootViaIPMI(ipmi_hostname, ipmi_user, ipmi_password, logger):
)
ipmi_reset_retcode, ipmi_reset_stdout, ipmi_reset_stderr = common.run_os_command(ipmi_command_reset)
if ipmi_reset_retcode != 0:
logger.out('Failed to reboot dead node', state='e')
print(ipmi_reset_stderr)
return False
time.sleep(2)
# Ensure the node is powered on
@ -139,15 +144,15 @@ def rebootViaIPMI(ipmi_hostname, ipmi_user, ipmi_password, logger):
)
ipmi_start_retcode, ipmi_start_stdout, ipmi_start_stderr = common.run_os_command(ipmi_command_start)
# Declare success or failure
if ipmi_reset_retcode == 0:
logger.out('Successfully rebooted dead node', state='o')
return True
else:
logger.out('Failed to reboot dead node', state='e')
if ipmi_start_retcode != 0:
logger.out('Failed to start powered-off dead node', state='e')
print(ipmi_reset_stderr)
return False
# Declare success
logger.out('Successfully rebooted dead node', state='o')
return True
#
# Verify that IPMI connectivity to this host exists (used during node init)