Conversation
✱ Stainless preview buildsThis PR will update the
|
hiroTamada
left a comment
There was a problem hiding this comment.
Solid implementation of VM forking. Good separation of concerns between filesystem copy (forkvm), hypervisor-specific snapshot rewrites (CH/QEMU), and orchestration logic. Network identity handling for forked standby instances is well thought out - fresh allocation + guest reconfiguration addresses the IP conflict issue properly.
Test coverage is comprehensive, including integration tests for the full running→fork→both-running flow.
LGTM.
|
pulling in support for firecracker and vz if I can |
sjmiller609
left a comment
There was a problem hiding this comment.
Submitting pending review so I can reply directly on the thread.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
rgarcia
left a comment
There was a problem hiding this comment.
looks great! have you tested with kernel-images image? i'm fine leaving vz as a separate PR
I haven't checked that yet. Will follow up if there are issues, I expect to use this feature as part of cpu based pooling |
Summary
Testing
Note
High Risk
High risk because it introduces a new instance lifecycle operation that manipulates VM disk/snapshot state and network identity across multiple hypervisors, and it changes the standby restore networking flow (including in-guest reconfiguration).
Overview
Adds a new
POST /instances/{id}/forkAPI and OpenAPI client/server bindings, allowing creation of a new instance cloned from a source in Stopped/Standby (and Running whenfrom_running=true), with request validation and conflict/state error mapping.Implements
instances.Manager.ForkInstancewith directory cloning, metadata deep-copying, optional post-fork state transitions, safety checks (e.g., writable volumes rejected), and hypervisor-specific fork preparation via a newhypervisor.VMStarter.PrepareForkhook (implemented for Cloud Hypervisor, QEMU, and Firecracker; explicitly unsupported for VZ).Updates standby
RestoreInstanceto support forked snapshots by allocating a fresh network identity when needed, rewriting snapshot network config before restore, and reconfiguring guest networking after resume; Firecracker restore also adds a temporary source->target data-dir alias mechanism for snapshot path compatibility. CI test timeout is increased to 20m and new unit/integration tests + fork documentation are added.Written by Cursor Bugbot for commit 9f362af. This will update automatically on new commits. Configure here.