Skip to content

Scheduler: place resumes on workers matching the snapshot's Hardware, cold boot otherwise #2250

Closed

Description

@shrutiyam-glitch

With Hardware stamps on both workers and snapshots, the scheduler can avoid placing a memory restore on hardware that cannot load it.

Proposal

  • Add a Hardware requirement to scheduling.Constraints and evaluate it in Applies, so Schedule, the BindActorToWorker admit re-check, and validateAssignedWorker all honor it.
  • schedulingConstraints in workflow_resume.go derives it from the actor's latest snapshot when restoring memory (FULL / MEMORY scope). A snapshot without a stamp imposes no hardware constraint.
  • Match on architecture, cpu_vendor, and cpu_model.
  • When no compatible worker exists for a memory restore and the template's minimum scope allows it (ActorTemplate: replace on_pause/on_commit/on_resume with capture_scope and minimum_scope #2102), schedule with only the architecture constraint and restore at the lower scope (or cold-boot via atelet.Run if the actor only held a borrowed golden snapshot with no durable volumes). Otherwise fail as today.
  • Emit a metric for fallback resumes so fleet operators see hardware fragmentation.

** Open question** - Exact cpu_model equality may be too strict: same instance type can differ in stepping. Proposal is to record full family/model/stepping in cpu_model (so no information is lost in stored snapshots) while matching on family/model until data says otherwise. ?

Activity

  1. added this to the M3 milestone on Oct 6, 2026
  2. shrutiyam-glitch commented on Oct 14, 2026

    @shrutiyam-glitch
    CollaboratorAuthor

    Updating the issue after the recent API changes (#2289) and re-design in #2348

    Part of #2246 (and #2069). Depends on #2247 and #2249.

    When resuming an actor from a SNAPSHOT_FIDELITY_MEMORY checkpoint, placing the actor onto a worker with an incompatible CPU microarchitecture or sandbox runtime version causes the guest memory restore (runsc restore or microVM snapshot load) to fail and crash the actor. Conversely, if all workers advertising the snapshot's exact runtime are at capacity or have been drained after a runtime rollout, failing the resume outright prevents the actor from making progress even though its durable volume state can still be restored on a newer worker.

    Proposal

    Make ResumeActor placement and restore fidelity aware of Snapshot.sandbox_runtime:

    1. When runtime matching applies:
      • Only SNAPSHOT_FIDELITY_MEMORY snapshots restored under the actor's current template require runtime compatibility (RequiredRuntime = snapshot.sandbox_runtime).
      • Cold boots (no snapshot), non-memory snapshots (SNAPSHOT_FIDELITY_VOLUMES and SNAPSHOT_FIDELITY_ROOTFS), and actors whose template has been updated since the snapshot was taken do not restore guest memory and may be placed on any worker matching the template's SandboxClass, selectors, and resource limits.
    2. Preferred placement on runtime-compatible workers:
      • During scheduling, prefer workers where either default_runtime or an entry in restorable_runtimes matches the snapshot's sandbox_runtime (exact match on sandbox_class, version.schema_version, and all version.attributes key-value pairs; the informational name field is ignored).
      • When placed on a compatible worker, restore the actor at full SNAPSHOT_FIDELITY_MEMORY and record the matched runtime entry on WorkerAssignment.sandbox_runtime.
    3. Graceful fallback when no compatible worker has capacity:
      • Durable snapshots: If no worker with a matching runtime has capacity, relax the runtime constraint and schedule the actor onto any eligible worker for its SandboxClass and selectors. At restore time, when the assigned worker's runtime does not match the snapshot's sandbox_runtime, discard the incompatible memory image and downgrade the restore to SNAPSHOT_FIDELITY_VOLUMES under the new worker's default_runtime. When the actor next suspends, its new snapshot is stamped with the new worker's runtime.
      • Node-local pause checkpoints: Because a PAUSED actor's checkpoint resides on its pinned node (AssignedNode), do not relax the runtime constraint while a local checkpoint is held; if no compatible worker is available on that node, surface ResourceExhausted.

    cc: Zoe Zhao (@zoez7)

  3. shrutiyam-glitch commented on Oct 20, 2026

    @shrutiyam-glitch
    CollaboratorAuthor

    #2536 closes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions