Repository navigation
fix(deploy/sbx): refuse a workspace image larger than the snapshot's 2 GiB drive (#907) - #915
Merged
pdettori merged 1 commit intoNov 19, 2026
Conversation
…2 GiB drive (rossoctl#907) A Firecracker guest restored from the golden snapshot keeps the workspace drive size its vmstate recorded (deploy/microvm/build-snapshot.sh WORKSPACE_IMAGE_BYTES, 2 GiB), so a larger workspace image cannot be mounted: the worker's startup probe fails ('mount /workspace exited 32') and the worker never attaches. setup.sh refuses SBX_WORKSPACE_IMAGE_MB and install-host.sh refuses SH_WORKSPACE_IMAGE_MB above SNAPSHOT_WORKSPACE_MB (2048), naming the cause; a test pins both to build-snapshot.sh's value. The install test's py312 bundle moves from 4096 to 1536 MiB. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
ingpaolodettori-dev
approved these changes
Nov 19, 2026
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Review — fix(deploy/sbx): refuse a workspace image larger than the snapshot's drive (#907)
Caps the operator's workspace image size at the golden snapshot's workspace drive, in both places that accept it.
Verified
- The constant is the snapshot's:
deploy/microvm/build-snapshot.sh:1483isWORKSPACE_IMAGE_BYTES=$((2 * 1024 * 1024 * 1024)), i.e. 2048 MiB, which is exactlySNAPSHOT_WORKSPACE_MBinsetup.sh:180andinstall-host.sh:146. - Both refusals sit after the numeric check and before anything is applied:
setup.sh:284-288validates the COUNT6_RE set first, then the cap, then the disk-budget check at :293;install-host.sh:723-725does the value check first, then the cap, invalidate_worker. So a malformed value still gets its own message,2049gets the cap message, and the existing999999999cases still hit the six-digit error. - Defaults still pass: the shipped default is 2048 and
((2048 <= 2048))is true, so no existing valid configuration is refused; nothing in the tree configures a larger value (the only >2048 numbers left are the deliberate test inputs). - The arithmetic is safe: both regexes forbid a leading zero, so
((…))cannot read the value as octal, and the|| dieform keepsset -efrom exiting without the message. - Tests: both scripts get a
2049refusal case (setup.test.sh:236,install-host.test.sh:91), andsetup.test.sh:268-277pins bothSNAPSHOT_WORKSPACE_MBconstants tobuild-snapshot.sh'sWORKSPACE_IMAGE_BYTESby parsing it (the sed matches line 1483's exact form), so bumping one without the others fails. The py312 bundle dropping 4096 → 1536 is what makes that fixture legal. - Docs: the
SBX_WORKSPACE_IMAGE_MBrow indeploy/sbx/README.mdstates the 2048 maximum and why.
CI: 16/16 green. No inline comments.
Author: pdettori (MEMBER — maintainer). Agent/IDE config: none. Commits: 1, signed off.
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.
Summary
Refuses a workspace image larger than the golden snapshot's 2 GiB workspace drive, before anything is applied or installed. Refs #907 (this is the guard; building the snapshot's drive at the configured size stays open there).
Why: a Firecracker guest restored from the golden snapshot keeps the workspace drive size recorded in its vmstate. That size is
deploy/microvm/build-snapshot.sh'sWORKSPACE_IMAGE_BYTES, fixed at 2 GiB. A larger workspace image cannot be mounted: the worker's startup probe fails (mount /workspace exited 32) and the worker never attaches. E17b hit this with a 4096 MiB workspace.Changes
deploy/sbx/setup.sh:SNAPSHOT_WORKSPACE_MB=2048.SBX_WORKSPACE_IMAGE_MBabove it is refused with an error that names the drive, the script it comes from and microvm-worker: SH_WORKSPACE_IMAGE_MB above the snapshot's 2 GiB workspace drive leaves the worker unattached (mount /workspace exited 32) #907.deploy/sbx/install-host.sh: the same cap on the bundle'sSH_WORKSPACE_IMAGE_MB.deploy/sbx/README.md: theSBX_WORKSPACE_IMAGE_MBrow says "at most 2048".setup.test.shrefuses 2049.install-host.test.shrefuses 2049.SNAPSHOT_WORKSPACE_MBto build-snapshot.sh'sWORKSPACE_IMAGE_BYTES, so changing one without the others fails.Defaults are unchanged (2048), so no deployed host is affected.
Tests
deploy/sbx/tests/setup.test.shanddeploy/sbx/tests/install-host.test.sh: pass under bash 5 and macOS bash 3.2 (71 checks each under 3.2).shellcheck -x -S warning(the repo gate) is clean on the four changed scripts.--checkis clean on the README.Assisted-By: Claude Code