Repository navigation
Spec/restart stopped vm - #9
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d delete stop now releases runtime resources but keeps the disk, configuration and network slot. start <id> boots a stopped or crashed VM from its preserved disk with its saved configuration; restart and delete are new; list reports running, stopped, crashed and legacy. Records are split into config.json, state.json and stopped.json. See docs/adr/0001-stop-preserves-the-vm.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Start fell through to the creation path on any Inspect error, so a corrupt config.json or state.json made the creation failure path delete the VM directory and its disk. It now creates only on "does not exist". Index allocation fails while any VM's records are unreadable instead of freeing its index, and a failed allocation no longer leaves an empty directory. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…a racing start Wait for the VM process to be gone after SIGKILL and leave the VM untouched if it is not. Copy a crashed VM's block images back to the host only when e2fsck passes, since the copy deletes host files missing from the image. Take the state lock in stop, delete, cleanup and the stop half of restart so they cannot release the shared host network under a start in progress. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Firecracker's stdout and stderr defaulted to fcvm's own, so the guest's serial console printed into the user's shell and, under sudo's pty, was written to a terminal that goes away when fcvm exits. Point them at vms/<id>/console.log, opened for append so earlier boots stay readable. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The SDK stops the VM, and exec.CommandContext kills it, when the context it was started with is cancelled. fcvm passed the command's context, which is cancelled as the command returns, so a VM could be stopped moments after start depending on a race with process exit. Launch with a context that is not cancelled, and handle Ctrl+C during boot explicitly: remove a VM being created, return a VM being restarted to stopped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A failed restart of a crashed VM now leaves it stopped with a stop time. A stop interrupted after its record is written is finished by the next stop. A VM with only a configuration record is incomplete and is never booted. An unreadable stop record is an error. shapeFrom now treats unlisted config fields as shape. Use VM, not microVM, in help text, name the state.json constant and share the record-removal helper. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
No description provided.