Repository navigation
feat(site): Run power operations at the site - #190
Conversation
c036142 to
f93a539
Compare
f18100d to
a8501b6
Compare
f93a539 to
c6dcaa8
Compare
38d73b3 to
acdab22
Compare
c6dcaa8 to
b403325
Compare
acdab22 to
7bd9f3f
Compare
b403325 to
6762ac0
Compare
7bd9f3f to
32d8ced
Compare
ecv
left a comment
There was a problem hiding this comment.
Approve.
The worker only ever runs an admitted assignment, sends at most one reset, and its restart behaviour is tested. Whether a forced power-off can hit a server mid-wipe or mid-commissioning is decided by custody in #179, not here.
- Admission: the runner works from a custody
Assignmentand refuses a late start with Stale when nothing was sent (runner.go). Once a command is sent, a failure ends as OutcomeUnknown rather than Failed, so a hold follows. - Idempotency: the reset payload (send time, the power read before it, the reset-time baseline) is journaled by
work.Stepbefore the send. A resumed worker observes instead of resending.TestAResumedWorkerNeverSendsASecondReset,TestALostResponseIsObservedAndNeverResentandTestTwoWorkersForOneAssignmentSendOneResetcover it. A journal from another fence is not reused (TestAResetJournaledUnderAnotherFenceIsNotReused). - Timeouts: 2 minutes to start, 3 minutes of observation after the command, 1 minute of BMC outage tolerance, inside the 8-minute
PowerDeadline. If the observation window has already closed when a resumed worker looks, the result is a ReasonStep failure after a send, which becomes a hold. That is the safe outcome. - Registration: the kind is registered only in the Redfish site (
cmd/fleet-multiplane/site.go). The local VM site has none, so it refuses an unsupported kind with nothing sent.
Follow-ups:
- The worker has no wipe or commissioning guard of its own. Mutual exclusion is custody's single active operation plus holder rules. Add a worker-level test or note saying so, so a later change to the queue rules cannot silently allow a ForceOff during a wipe.
- A re-admission under a new fence that finds the server already Off reports success with no command (
evidence.RequestSentAtnil). That is correct, but the earlier attempt's unconfirmed send leaves no trace in the result.
kevwilliams
left a comment
There was a problem hiding this comment.
Power runs through the shared fenced framework, an already-reached state sends nothing, the result is read back from the BMC, and any unproven send ends OutcomeUnknown.
6762ac0 to
f016150
Compare
32d8ced to
c4fc2ce
Compare
f016150 to
4c48d63
Compare
c4fc2ce to
9f489d5
Compare
ecv
left a comment
There was a problem hiding this comment.
Approve.
The delta is a test plus the lab seed. The worker's Check reads conn.System.ResetTypes live at the BMC and refuses ResetTypeNotOffered before any step, so the snapshot's empty list never decides anything there. Prior #181 follow-up "consumers should read the live list at action time": resolved.
TestALiveReadDecidesWhenDiscoveryRecordedNoResetTypescovers both branches. An offered action runs with exactly one reset and valid evidence; an unoffered one endsFailed ResetTypeNotOfferedwith zero sent.- Sending at most one reset and never re-sending after restart are unchanged and stay covered by the existing journal tests (
TestAResumedWorkerNeverSendsASecondReset,TestALostResponseIsObservedAndNeverResent,TestTwoWorkersForOneAssignmentSendOneReset). The new test does not exercise resume. - Lab seed:
last_reset.setdefault(sid, now())thenatomic_write, so a persisted time wins and a restart of the adapter never moves a baseline forward.test_5achecks every target is seeded and persisted.
Follow-ups:
- The new test calls
Rundirectly with a hand-built snapshot. It does not show the framework runningCheckfirst for a worker started from an admitted operation. One case throughsite.Runnerwould close that.
4c48d63 to
4b0e723
Compare
9f489d5 to
4f64ad7
Compare
A power worker proves a restart only when the BMC reports a reset after the command, or when it sees the server off. Observe now returns the System's LastResetTime, and leaves it zero when the BMC reports none or a time it cannot parse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The power worker reads the server's power before it sends anything and sends at most one ComputerSystem.Reset. On and ForceOff send nothing when the server is already in the requested state. A restart or power cycle of a server that is off refuses with NotPoweredOn, a transition state with PowerStateNotSettled, and a late start with Stale, each with nothing sent. The reset is one journaled step whose payload records when it was sent, the power before it, and the BMC's reset-time baseline. Success needs the requested state within three minutes; a restart also needs the reset time to move past the baseline, or the server seen off, and then the server on again. After a crash or a lost response the worker watches for the effect and never sends a second reset. Anything it cannot prove ends OutcomeUnknown. The power kind declares NotPoweredOn for the worker and PowerStateNotSettled for both sides. No site registers the worker until the cutover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Power operations need a BMC that reports when a reset happened, and faults that withhold a request, hide the reset time, or report another server. The lab adapter now persists LastResetTime and moves it forward each time a reset starts the domain. New faults: drop-request withholds the response and never applies the reset; hide-reset-time and swap-identity hold until cleared. A withheld response now follows any applied reset, such as a ForceOff, not only a power-on. The adapter self-test covers each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The custody guide's power section records what the worker checks before the command, how it proves each action, how it resumes after a crash, and three places where the site framework or the coordinator still does not fit #173. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cutover runs the site worker framework in each multi-plane cell. A Redfish cell now registers the power worker beside the install, wipe and commissioning workers, so an admitted power operation reaches its BMC. The local VM cell has no BMC and keeps refusing power as an unsupported kind, with nothing sent. No end-to-end run creates a power operation yet. The guide records that gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The coordinator now counts a power success only with the requested power state and, for a restart or power cycle, proof of the reset. Each worker test that checks evidence now also runs that proof on every success the worker reports, so the worker and the coordinator cannot drift apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When discovery recorded no reset types, the coordinator now admits a power operation and the worker's live read of the BMC decides. The new test admits a restart whose snapshot names no offered actions: it runs when the BMC offers the action, and ends Failed with nothing sent when it does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4b0e723 to
cf80de8
Compare
4f64ad7 to
66a9d31
Compare
Related to #173. Stacked on #179.
Redfish sites now run admitted power operations beside installs, wipes and commissioning. The worker sends at most one reset, never resends after a crash or lost response, and reports success only for what it then observes. When discovery did not observe the server's reset actions, its live read of the BMC decides whether the action is offered. The lab BMC gains a reset time from its first read, and faults for a withheld request, a hidden reset time and a swapped identity.
Test plan
Decisions for a person
🤖 Generated with Claude Code