microvm: DataOnGolden snapshot scope - commit Data, resume on the golden snapshot (#451, phase 1) - #683
Open
Dmitry Berkovich (dberkov) wants to merge 2 commits into
Open
Conversation
Dmitry Berkovich (dberkov)
force-pushed
the
data_on_golden_resume
branch
from
August 1, 2026 01:55
596492d to
0057ba4
Compare
DataOnGolden is a restore-time behavior: at commit the actor captures the same content as Data, and at resume the ActorTemplate's golden snapshot (memory + full fs delta) is combined with the actor's captured data. This change adds the CRD enum value with CEL validation (onCommit-only, sandboxClass microvm only), plumbs the restore-only DATA_ON_GOLDEN scope through the atelet/ateom APIs, and threads the golden snapshot location through the Restore path as golden_snapshot_uri_prefix on ExternalCheckpointConfiguration. The snapshot record stays truthful about content: a DataOnGolden commit is captured and recorded as plain Data, and resume derives the golden-combine from the template's onCommit. Golden actors always commit with Full scope regardless of onCommit — the golden snapshot is the base a DataOnGolden restore combines into — and resume validates the golden's recorded scope, failing with an actionable error on a non-Full golden. Combining the two sources is not implemented yet: ateom-microvm rejects DataOnGolden restores with Unimplemented, and atelet only validates and forwards the golden location without downloading from it.
atelet stages the combined restore set into a single folder: every file of the actor's own snapshot (the durable-dir tar) plus the golden snapshot's files the actor's set does not shadow (guest memory + VM state), downloaded concurrently from both URI prefixes. The golden manifest's pinned sandbox binaries run the restored guest — the golden memory image must be resumed by the binaries that created it — and are recorded on-node for later checkpoints. ateom-microvm drops the Unimplemented stub: DATA_ON_GOLDEN now flows through the Full restore path, so the golden guest resumes over the actor's durable-dir data through the durable virtio-fs share. The counter-microvm demo commits with DataOnGolden to exercise the combined restore, and the demo e2e suite covers the lifecycle (plus a two-durable-volume variant), asserting the counters across pause and suspend and that the suspend recorded plain Data content.
Dmitry Berkovich (dberkov)
force-pushed
the
data_on_golden_resume
branch
from
August 1, 2026 01:59
0057ba4 to
b78c80b
Compare
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.
Phase 1 of #451, micro-VM only. gVisor support will follow in a separate PR.
What
Adds a new ActorTemplate snapshot scope,
DataOnGolden, valid foronCommitonly and gated tosandboxClass: microvmby CRD CEL validation.Semantics: DataOnGolden is a restore-time behavior. At suspend the actor captures exactly what
Datacaptures (durable-dir volumes only), and theActorSnapshotrecords plainData/Fullcontent — nothing new is stored on the snapshot. At resume, the control plane derives the behavior from the template'sonCommit: a Data snapshot under a DataOnGolden template restores by combining the template's golden snapshot (guest memory + full fs delta) with the actor's captured data.How
pkg/api/v1alpha1):DataOnGoldenenum value; CEL rules forbid it ononPauseand on gVisor templates; the existing onCommit-subset-of-onPause rule already yields the right semantics.ateapi): suspend maps the commit scope to its capture scope (DataOnGolden→Data) before calling atelet and before stampingContentScope. Resume resolves the golden snapshot's location whenonCommitis DataOnGolden and the snapshot holds Data, failing early (with an actionable error) if the golden snapshot is missing or not Full. Golden actors themselves always commitFullregardless ofonCommit— their snapshot is the base the combine needs.ateletpb/ateompb): a restore-onlySNAPSHOT_SCOPE_DATA_ON_GOLDENplusgolden_snapshot_uri_prefixonExternalCheckpointConfiguration; atelet rejects both on checkpoint requests.DATA_ON_GOLDENrestores through the existing Full path — cloud-hypervisor relaunches from the golden's guest files while the durable virtio-fs share serves the actor's re-materialized data. gVisor rejects the scope (defense-in-depth behind the CRD gate).Testing
suites/demo): DataOnGolden lifecycle cases (single and two durable volumes, micro-VM lane only) asserting counters across pause/suspend and that the suspend recorded plain Data content.🤖 Generated with Claude Code