Skip to content

feat: If enrolment fails, set node maintenanace mode and populate the reason - #2837

Open
stevekeay wants to merge 4 commits into
mainfrom
enrol-set-maint-reason
Open

stevekeay wants to merge 4 commits into
mainfrom
enrol-set-maint-reason

Conversation

@stevekeay

@stevekeay stevekeay commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The enrol workflow now puts the Ironic node into maintenance mode when enrolment fails. The failure goes into the maintenance reason with an "enroll: " prefix, cut to 200 characters.

I tried not to change the existing behaviour, although I did deliberately change the "success" message which now reads "Enroll successful for node {uuid} {name} {ip_address}"

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Python test results

2 582 tests  +45   2 577 ✅ +45   1m 49s ⏱️ -7s
    7 suites ± 0       5 💤 ± 0 
    7 files   ± 0       0 ❌ ± 0 

Results for commit 6103f17. ± Comparison against base commit 7f3639a.

This pull request removes 2 and adds 47 tests. Note that renamed tests count towards both.
tests.test_enroll_server ‑ test_post_inspection_runbook_order[None]
tests.test_enroll_server ‑ test_post_inspection_runbook_order[runbooks2]
tests.test_enroll_server ‑ test_enroll_clears_maintenance_before_touching_node[clean failed]
tests.test_enroll_server ‑ test_enroll_clears_maintenance_before_touching_node[enroll]
tests.test_enroll_server ‑ test_enroll_clears_maintenance_before_touching_node[manageable]
tests.test_enroll_server ‑ test_enroll_does_not_clear_maintenance_when_not_set
tests.test_enroll_server ‑ test_enroll_orders_update_and_manage_by_state[clean failed-expected_order2]
tests.test_enroll_server ‑ test_enroll_orders_update_and_manage_by_state[enroll-expected_order0]
tests.test_enroll_server ‑ test_enroll_orders_update_and_manage_by_state[inspect failed-expected_order1]
tests.test_enroll_server ‑ test_enroll_orders_update_and_manage_by_state[manageable-expected_order3]
tests.test_enroll_server ‑ test_enroll_refuses_ineligible_node_without_maintenance[active]
tests.test_enroll_server ‑ test_enroll_refuses_ineligible_node_without_maintenance[available]
…

♻️ This comment has been updated with latest results.

@stevekeay stevekeay changed the title If enrolment fails, set node maintenanace mode and populate the reason feat: If enrolment fails, set node maintenanace mode and populate the reason Dec 2, 2026
@stevekeay
stevekeay force-pushed the enrol-set-maint-reason branch 2 times, most recently from f998723 to ab8ff17 Compare December 2, 2026 12:15
@stevekeay
stevekeay force-pushed the enrol-set-maint-reason branch from ab8ff17 to d8e3b9e Compare December 2, 2026 12:59
@stevekeay
stevekeay requested a review from a team December 2, 2026 12:59
If cleaning after provide runs past NODE_STATE_TIMEOUT_SECS,
wait_for_provision_state raises while the node is still in clean wait/

Ironic doesn't act on agent heartbeats from a node in
maintenance (_heartbeat_in_maintenance either logs "not taking any
action" or, with allow_provisioning_in_maintenance=False, aborts
cleaning), so the node never reaches available.

The more reasonable behaviour is to ignore errors while ironic is still
working, and only record maintenance reasons for an Ironic node in a
"terminal" state.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants