|
| 1 | +# Agent Loader Bootstrap Plan |
| 2 | + |
| 3 | +## Why this plan exists |
| 4 | + |
| 5 | +Current VM bootstrap bundles include the full `vz-guest-agent` binary. That forces frequent patch/delta regeneration whenever the agent changes. |
| 6 | + |
| 7 | +We want a stable bootstrap layer that changes rarely, and a small swappable agent payload that can be updated independently. |
| 8 | + |
| 9 | +## Goals |
| 10 | + |
| 11 | +1. Install a tiny stage-0 loader once per base image line. |
| 12 | +2. Decouple guest-agent updates from image delta distribution. |
| 13 | +3. Make agent updates small, signed, atomic, and rollback-safe. |
| 14 | +4. Preserve unattended startup reliability (`launchd` + pre-login behavior). |
| 15 | +5. Keep `vz vm` UX simple for default users. |
| 16 | + |
| 17 | +## Non-goals |
| 18 | + |
| 19 | +1. Replace all patch infrastructure immediately. |
| 20 | +2. Support unsigned or best-effort agent updates. |
| 21 | +3. Ship a background privileged host daemon in v1. |
| 22 | + |
| 23 | +## Design summary |
| 24 | + |
| 25 | +- Bootstrap image contains: |
| 26 | + - `vz-agent-loader` (small static-ish binary, stable interface) |
| 27 | + - launchd plist pointing to loader path, not direct guest-agent path |
| 28 | + - trust root material for artifact signature verification |
| 29 | +- Loader resolves and executes the current agent from a versioned store. |
| 30 | +- New agent versions are delivered as signed artifacts and installed atomically. |
| 31 | +- No new `.img` delta is required for normal guest-agent releases. |
| 32 | + |
| 33 | +## Document map |
| 34 | + |
| 35 | +- `01-stage0-loader.md` — loader contract, file layout, startup lifecycle. |
| 36 | +- `02-agent-artifact-and-verification.md` — artifact format, signature and rollback rules. |
| 37 | +- `03-update-and-cli-ux.md` — one-command UX and command surface. |
| 38 | +- `04-rollout-risks.md` — rollout waves, validation, risks, and open questions. |
| 39 | + |
| 40 | +## Phase dependency graph |
| 41 | + |
| 42 | +``` |
| 43 | +Phase 1: stage-0 loader contract + filesystem layout |
| 44 | + -> Phase 2: signed agent artifact format + verifier |
| 45 | + -> Phase 3: update/install commands (offline + online) |
| 46 | + -> Phase 4: rollout and deprecate frequent image-delta agent updates |
| 47 | +``` |
| 48 | + |
| 49 | +## Acceptance criteria |
| 50 | + |
| 51 | +1. New guest-agent release does not require a new image delta in normal path. |
| 52 | +2. Loader starts agent at boot/login according to policy without host-side manual steps. |
| 53 | +3. Agent update is atomic (`current` pointer swap) and rollback-capable. |
| 54 | +4. Invalid signatures or hash mismatches fail closed. |
| 55 | +5. CLI exposes one primary bootstrap command and one primary update command. |
0 commit comments