Repository navigation
Conversation
Power operations must refuse an action the server does not offer before anything is sent. Discovery now records the ComputerSystem.Reset types each System advertises, inline or from its own ActionInfo, in status.discovery.inventory.systems[].resetTypes. It reads them with GETs and never invokes the action. The Redfish client also gains the read side a power worker needs: find the one System carrying a UUID across every collection page, re-read its power state and LastResetTime with an identity check, and send one reset. Discover now shares the reset-type reader, so the executor and discovery parse ActionInfo the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
force-pushed
the
feat/device-power-operations
branch
from
November 24, 2026 22:42
4745cc9 to
294c5c8
Compare
Staff power servers on and off by hand through each BMC today, with no record, none of discovery's credential and TLS checks, and nothing to stop a reset of a server that backs customer capacity. DevicePowerOperation asks for one action on one Device. A dispatcher in the site accepts or refuses it, starts one worker Job, and is the only writer of its status. It holds no BMC credential. The worker mounts one credential, re-checks the TLS key, the server's UUID and the offered actions, sends at most one ComputerSystem.Reset, and reports Succeeded only when it observes the result. Anything it cannot prove is Unknown, and nothing retries. The worker cannot reach Milo. It records its progress in a site stage record. Claiming the record and writing it before the command are optimistic updates, so a second worker, a second dispatcher or a fenced lost worker sends nothing. A site Lease admits one running operation per Device. Site admission policies pin every dispatcher write to the worker shape: one approved image, one credential named after the Device, no privilege, and a Role limited to the worker's own record. The bindings select a labelled namespace, because the policy parameter is looked up before match conditions and an unscoped binding would deny writes cluster-wide. The Milo component ships the CRD, roles and a requester policy, and is in no root. Milo v0.32.5 does not enforce that policy in a project; see docs/operations/device-power.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The design needs proof against emulated BMCs and the real control plane, not unit tests alone. task device-power:acceptance builds a kind cluster with a Milo project API, BMC discovery, the dispatcher and two lab BMCs serving TLS, and drives every operation as a staff identity through Milo. Each scenario records the result staff see and the number of resets in the BMC's own audit log: success, refusals, a lost response with and without effect, a cloned worker, a deleted worker, two dispatchers, and a restart that cannot be proven. The lab adapter gains what these scenarios need: TLS from a mounted certificate, LastResetTime, and drop-request, swap-identity and hide-reset-time faults. The docs record what is implemented and verified, the choices made where the proposal left a question open, and where the prototype differs from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
force-pushed
the
feat/device-power-operations
branch
from
November 24, 2026 22:44
294c5c8 to
1b402b3
Compare
scotwells
added a commit
that referenced
this pull request
Nov 25, 2026
Power admission must refuse an action the server does not offer before anything is sent. Discovery now records the ComputerSystem.Reset types each System advertises, inline or from the System's own ActionInfo, in status.discovery.inventory.systems[].resetTypes. It reads them with GETs and never invokes the action. A reset target or ActionInfo off the System records none. Discover and Inventory share one reset-type reader, so both parse ActionInfo the same way. An ActionInfo that cannot be read records no reset types and keeps the rest of the inventory, so one broken link never costs a Device its discovery. Ported from the power prototype in #175, without its worker client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
added a commit
that referenced
this pull request
Nov 25, 2026
Power admission must refuse an action the server does not offer before anything is sent. Discovery now records the ComputerSystem.Reset types each System advertises, inline or from the System's own ActionInfo, in status.discovery.inventory.systems[].resetTypes. It reads them with GETs and never invokes the action. A reset target or ActionInfo off the System records none. Discover and Inventory share one reset-type reader, so both parse ActionInfo the same way. An ActionInfo that cannot be read records no reset types and keeps the rest of the inventory, so one broken link never costs a Device its discovery. Ported from the power prototype in #175, without its worker client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
added a commit
that referenced
this pull request
Nov 28, 2026
Power admission must refuse an action the server does not offer before anything is sent. Discovery now records the ComputerSystem.Reset types each System advertises, inline or from the System's own ActionInfo, in status.discovery.inventory.systems[].resetTypes. It reads them with GETs and never invokes the action. A reset target or ActionInfo off the System records none. Discover and Inventory share one reset-type reader, so both parse ActionInfo the same way. An ActionInfo that cannot be read records no reset types and keeps the rest of the inventory, so one broken link never costs a Device its discovery. Ported from the power prototype in #175, without its worker client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Staff power servers on and off by hand through each BMC today, with no record and nothing to stop a reset of a server that backs customer capacity.
This is a working prototype of the device power proposal: staff create a power operation, a site dispatcher checks it, and one short-lived worker sends at most one reset to the exact server named. Anything the worker cannot prove ends as Unknown, and nothing retries.
It ran end to end against a Milo project API and two TLS lab BMCs with simulated power. The power API and dispatcher are in no deployment root, but the Milo root picks up one new Device status field, the reset types discovery records.
Decisions for a person
Important
Milo v0.32.5 does not enforce the admission policy that ties the requester to the creating user, so a staff user can name someone else as requester. Building a root webhook, or taking the requester from Milo's audit record, is a choice for you.
End-to-end run
One command builds a kind cluster with the Milo API, discovery, the dispatcher and the lab BMCs, then drives every operation as a staff user. It exited 0 on a fresh cluster in 541 seconds.
Resets are counted from each lab BMC's own audit log. The run also found a site policy binding that denied every leader-election update in the cluster, which is fixed and covered by a test.
Test plan
Related to #173
🤖 Generated with Claude Code