Skip to content

Commit 2552777

Browse files
committed
Clear any pending BIOS jobs before continuing with enrolment
1 parent 1a722f1 commit 2552777

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

python/understack-workflows/understack_workflows/ironic_node.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ def create_ironic_node(
162162
return client.create_node(node_data)
163163

164164

165+
def clear_pending_idrac_jobs(node: Node):
166+
logger.info("%s performing clear_job_queue clean step", node.uuid)
167+
transition(
168+
node,
169+
target_state="clean",
170+
expected_state="manageable",
171+
clean_steps=[{"interface": "management", "step": "clear_job_queue"}],
172+
disable_ramdisk=True,
173+
)
174+
175+
165176
def _driver_for(manufacturer: str) -> tuple[str, str]:
166177
"""Answer the (driver, inspect_interface) for this server."""
167178
if manufacturer.startswith("Dell"):

python/understack-workflows/understack_workflows/main/enroll_server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def enroll(
109109
# Therefore, we only use virtual media during our "enroll" phase, when the
110110
# port data is set up in a manner that suits the Neutron algorithm. If a
111111
# normal PXE/HTTP port is available then we use it instead:
112-
113112
virtual_media = not bool(ironic_node.pxe_enabled_bios_name(node))
114113
agent_inspection(node, virtual_media=virtual_media)
115114

@@ -121,6 +120,9 @@ def enroll(
121120
)
122121
logger.info("[node:%s] Selected PXE interface %s", node.uuid, pxe_interface)
123122

123+
# Clear the job queue - stale jobs can conflict with the ones we create:
124+
ironic_node.clear_pending_idrac_jobs(node)
125+
124126
# This sets the boot device to use for all future HTTP boots:
125127
if update_dell_bios_settings(bmc, pxe_interface=pxe_interface):
126128
logger.info("%s performing second inspection write BIOS settings", node.uuid)

0 commit comments

Comments
 (0)