docs: region HA operator steps after a fixed box leaves
Three operator jobs the platform leaves to a person on purpose: - a terminated fixed box's edges file is never deleted automatically (fixed refs can be reused, P1b-3b Ruling P18); the departure pages hourly (ha_departure_edges_retained) until an operator removes it; - a recreated fixed box needs its signed control/boxes record replaced by the operator (create-only publisher, Ruling P17), in an order that lets the old departure enroll before the new box publishes; - with SSM parameter scoping on a host role, a cross-region key copy through the box role needs a temporary, removed-after grant. Copy: one Luna pass, applied verbatim, approved by delegation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+39
−0
docs/region-ha-runbook.md+39 −0
diff --git a/docs/region-ha-runbook.md b/docs/region-ha-runbook.md| index 5611d44d0..e60d4e695 100644 |
| --- a/docs/region-ha-runbook.md |
| +++ b/docs/region-ha-runbook.md |
| @@ -20,3 +20,42 @@ CARLOS_HA_FIXED_BOX_IDENTITIES='{"box-a":"i-0123456789abcdef0","box-b":"i-0fedcb |
| - Without the setting, a box binds only itself. A peer then has no binding, and taking over its hosts after it is terminated falls back to asking EC2 directly. |
| To roll back, restore the previous host.env and restart `carlos-edge.service`. |
| + |
| +## A fixed box has been terminated: remove its edges file |
| + |
| +When a fixed box is terminated, a surviving box recovers its duties. It takes over the box's hosts, timers and due wakes. It does not delete the departed box's edges file (`control/edges/<box>.json`) because a fixed box's reference can be reused by its replacement, and the platform cannot tell which box an edges file belongs to. |
| + |
| +Until the old edges file is removed, the departure stays open and pages once an hour (`ha_departure_edges_retained`). |
| + |
| +1. Check that the box is terminated in EC2 and that its replacement, if any, has not started yet. |
| +2. Read the page or journal line. It names the edges file. |
| +3. Delete that one object from the deployment bucket. |
| +4. Within a few minutes, the surviving box sees that the file is gone, finishes the departure and stops paging. |
| + |
| +If a replacement box with the same reference is already running and has written a new edges file, do not delete it. The departure finishes on its own once the replacement's identity is verified (next section). |
| + |
| +## A fixed box has been recreated: replace its box record |
| + |
| +Every box publishes a signed identity record once, at `control/boxes/<box>.json`. The record is create-only. A box never replaces another box's record. When you recreate a fixed box under the same reference, its new instance ID does not match the old record. The new box refuses to publish, and the old box's departure stays open and pages hourly until you replace the record. |
| + |
| +Do these steps in order. If the new box publishes before the old box's departure is recorded, the departure cannot tell the two apart. |
| + |
| +1. Before you create the new box, check that the old box's termination has been seen. A surviving box logs the departure for the old instance ID. |
| +2. Create the new box. |
| +3. Update `CARLOS_HA_FIXED_BOX_IDENTITIES` on every fixed box in the region with the new instance ID. Restart `carlos-edge.service` on one box at a time. |
| +4. Read the old record and note its ETag. Check that it names the old instance ID. |
| +5. Delete the old record, on the condition that its ETag still matches (`aws s3api delete-object --if-match <etag>`). If the condition fails, stop and read it again. |
| +6. On the new box, as the agent user with host.env loaded, run `carlos system box publish-record`. It prints the record it published. |
| +7. Check that the old departure finishes and its page stops within the hour. |
| + |
| +## Copying a key from a box in another region |
| + |
| +A region-host role with SSM parameter scoping (`scope_ssm_parameter_reads`) can read only `/carlos/*` parameters in its own region. A box in one region can no longer read a parameter in another region, for example to copy the secrets key to a new region. |
| + |
| +To copy one: |
| + |
| +1. Add a temporary grant to that box's role for the one parameter ARN it needs, through the deployment's infrastructure root, with scoped approval. |
| +2. Copy the value. |
| +3. Remove the grant, and check with an IAM policy simulation that the read is denied again. |
| + |
| +Or copy the value with an operator credential instead of the box role. This needs no grant. |