Wait for IOM to come back online after restart instead of fixed sleep

A fixed 30s sleep is not enough for a full BMC boot cycle. Add
_wait_for_iom_online() which polls GET /redfish/v1/ every 15s until the
IOM responds (up to 5 minutes), then call it after every IOM restart in
both _update_iom_fw and _update_fabric_fw. This ensures the fabric card
update (and post-update validation) don't run while the IOM is still
booting and unreachable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 13:17:53 -04:00
parent 3dc9a5538e
commit 278c0c03b3
2 changed files with 32 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ from redfish import (
_redfish_poll_tasks,
_redfish_restart_iom,
_redfish_reset_fabric,
_wait_for_iom_online,
_show_fw_versions,
)
from ui import (
@@ -161,8 +162,12 @@ def _update_iom_fw(password: str, ip: str, iom: str, fw_path: str) -> bool:
info(f"Restarting {iom}...")
_redfish_restart_iom(password, ip, iom) # connection drop on restart is normal
ok(f"{iom} restart initiated. Waiting 30s for reboot...")
time.sleep(30)
ok(f"{iom} restart initiated. Waiting for IOM to come back online...")
time.sleep(30) # allow time for the IOM to begin shutting down before polling
if _wait_for_iom_online(password, ip):
ok(f"{iom} is back online.")
else:
warn(f"{iom} did not respond within 5 minutes — proceeding anyway.")
return True
@@ -204,8 +209,12 @@ def _update_fabric_fw(password: str, ip: str, iom: str, fw_path: str) -> bool:
info(f"Restarting {iom} after Fabric Card update...")
_redfish_restart_iom(password, ip, iom)
ok(f"{iom} restart initiated. Waiting 30s for reboot...")
time.sleep(30)
ok(f"{iom} restart initiated. Waiting for IOM to come back online...")
time.sleep(30) # allow time for the IOM to begin shutting down before polling
if _wait_for_iom_online(password, ip):
ok(f"{iom} is back online.")
else:
warn(f"{iom} did not respond within 5 minutes — proceeding anyway.")
return True