feat: Phase 2 — suspend-on-idle for ImpVM - #24
Merged
Conversation
Additive API for suspend-on-idle: VMPhaseSuspending/Suspended/Resuming, spec.desiredState (Running|Suspended, default Running), and status fields suspendSnapshotPath + suspendedAt. No behavior change; agent state machine and driver restore path land in follow-up tasks.
Agent drives ImpVM through Suspending -> Suspended -> Resuming when spec.desiredState flips. handleSuspending snapshots to node-local storage then stops the runtime to free memory (snapshot MUST succeed before stop); handleResuming restores via Start and re-establishes VTEP/FDB. Driver Start now prefers status.suspendSnapshotPath (resume) over spec.snapshotRef, via a shared configureSnapshotBoot helper. Operator clears status.suspendSnapshotPath when rescheduling a VM off a lost node so it cold-boots instead of failing to resume from a vanished snapshot. Tests cover suspend, resume, and the no-free-without-snapshot guarantee.
This was referenced Jul 5, 2026
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.
Implements the density multiplier from the substrate comparison: idle ImpVMs snapshot to node-local storage and free their RAM, resuming on demand. Driven declaratively by
spec.desiredState(Running|Suspended); Phase 3 (wake-on-traffic) will add the auto-trigger.What's here
VMPhaseSuspending/Suspended/Resuming,spec.desiredState(enum, default Running), statussuspendSnapshotPath/suspendedAt; CRD + deepcopy regenerated.reconciler.go):handleRunningtransitions to Suspending when suspend is requested;handleSuspendingsnapshots node-local then stops the runtime to free memory (snapshot must succeed first);handleSuspendedwaits;handleResumingrestores via Start and re-establishes VTEP/FDB.firecracker_driver.go):Startprefersstatus.suspendSnapshotPath(resume) overspec.snapshotRef, via a sharedconfigureSnapshotBoothelper.suspendSnapshotPathwhen rescheduling a VM off a lost node, so it cold-boots instead of failing to resume from a vanished node-local snapshot.Design (node-local "Pause" tier)
Node-local snapshot only (no ImpVMSnapshot object / object storage); eager restore (userfaultfd is Phase 4, gated on an SDK spike); suspended VM keeps its NodeName. Deferred: overcommit scheduler accounting (#4) folds in next now that Suspended exists.
Full design:
syscode-ai-internal-plans/projects/imp/docs/plans/2026-07-04-phase2-suspend-on-idle-plan.md.