Skip to content

fix: ensure boot order is properly set before deployment reboot (#567) - #620

Open
skatsaounis wants to merge 1 commit into
canonical:3.8from
skatsaounis:auto-backport-2158318-3.8
Open

skatsaounis wants to merge 1 commit into
canonical:3.8from
skatsaounis:auto-backport-2158318-3.8

Conversation

@skatsaounis

Copy link
Copy Markdown
Contributor

On BMCs where MAAS controls the boot order (can_set_boot_order, notably IBM Z DPM), deployment could fail two ways:

  • The firmware can't fall through from netboot to local disk. If the guest rebooted before MAAS flipped the boot device, it network-IPLed into an empty config and hung (No value found for kernel, IPL failed 110).

  • IBM Z rejects writes with 409,2 busy while another partition op is in flight (fire-and-forget start/stop settling, post-install re-IPL), causing power/boot activities to fail intermittently.

  • deploy.py: MAAS-driven boot switch. For can_set_boot_order machines, replace the bare "set boot order + rely on installer reboot" with an explicit sequence in _switch_to_local_boot: power off → set boot order to disk → power on → _confirm_powered_on. The confirm step polls power state (bounded) and persists it, de-bouncing transient BMC/HMC readings (state must repeat on two consecutive polls before it's persisted).

  • hmcz.py: busy handling. New _retry_on_busy helper wraps all HMC writes (power on/off, boot-order updates), retrying only on 409,2 and re-raising everything else. set_boot_order also waits out transitional states before writing and now accepts paused/terminated/degraded (not just stopped/active) so it doesn't hang the full 120s. Retry budget is deliberately capped (8×15s ≈ 105s) to stay well under the 300s Temporal activity timeout it shares with wait_for_status.

Resolves: LP:2158318


(cherry picked from commit d6747ef)

…nical#567)

On BMCs where MAAS controls the boot order (`can_set_boot_order`,
notably IBM Z DPM), deployment could fail two ways:

- The firmware can't fall through from netboot to local disk. If the
guest rebooted before MAAS flipped the boot device, it network-IPLed
into an empty config and hung (No value found for kernel, IPL failed
110).
- IBM Z rejects writes with 409,2 busy while another partition op is in
flight (fire-and-forget start/stop settling, post-install re-IPL),
causing power/boot activities to fail intermittently.

- `deploy.py`: MAAS-driven boot switch. For `can_set_boot_order`
machines, replace the bare "set boot order + rely on installer reboot"
with an explicit sequence in `_switch_to_local_boot`: power off → set
boot order to disk → power on → _confirm_powered_on. The confirm step
polls power state (bounded) and persists it, de-bouncing transient
BMC/HMC readings (state must repeat on two consecutive polls before it's
persisted).
- `hmcz.py`: busy handling. New `_retry_on_busy` helper wraps all HMC
writes (power on/off, boot-order updates), retrying only on 409,2 and
re-raising everything else. `set_boot_order` also waits out transitional
states before writing and now accepts `paused`/`terminated`/`degraded`
(not just `stopped`/`active`) so it doesn't hang the full 120s. Retry
budget is deliberately capped (8×15s ≈ 105s) to stay well under the 300s
Temporal activity timeout it shares with `wait_for_status`.

Resolves: LP:2158318

---------

Co-authored-by: fheimes <frank.heimes@canonical.com>
(cherry picked from commit d6747ef)
@skatsaounis skatsaounis added bug 3.8 blocked do not merge this labels Sep 7, 2026
@skatsaounis

Copy link
Copy Markdown
Contributor Author

Merge after #601 is merged

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

Labels

3.8 blocked do not merge this bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant