Skip to content

Add --cpus and --disk-size to vm.py start - #9

Open
pnc wants to merge 1 commit into
fix-docker-blob-cdn-allowlistfrom
todo-11-cpus-disk-size
Open

Add --cpus and --disk-size to vm.py start#9
pnc wants to merge 1 commit into
fix-docker-blob-cdn-allowlistfrom
todo-11-cpus-disk-size

Conversation

@pnc

@pnc pnc commented Aug 5, 2026

Copy link
Copy Markdown
Member

Slop description:


-smp was hardcoded to 1 and the qcow2 overlay to 20G, so the only tunable was --memory. Both are now flags with module-level defaults (MEMORY/CPUS/DISK_SIZE) that the help text interpolates, so the documented default cannot drift from the real one.

--cpus defaults to 4 now, 1 is just so pokey.

The disk is only sized at creation time, so passing --disk-size against an existing .vm/disk.qcow2 compares the request to the overlay's real virtual size (qemu-img info) and prints a note naming both sizes and what vm.py reset costs. It does not resize, recreate, or reset anything.

The e2e fixture now passes --cpus/--disk-size explicitly and asserts the guest's nproc and /dev/vda size match, so a regression that drops either flag fails a test instead of going unnoticed. TEST_DISK_SIZE is deliberately not the default for the same reason.

`-smp` was hardcoded to 1 and the qcow2 overlay to 20G, so the only
tunable was --memory. Both are now flags with module-level defaults
(MEMORY/CPUS/DISK_SIZE) that the help text interpolates, so the
documented default cannot drift from the real one.

--cpus defaults to 4, superseding a hand-edit of `-smp 1` to `-smp 4`
in the working tree; that is the value we actually want to boot with.

The disk is only sized at creation time, so passing --disk-size against
an existing .vm/disk.qcow2 compares the request to the overlay's real
virtual size (qemu-img info) and prints a note naming both sizes and
what `vm.py reset` costs. It does not resize, recreate, or reset
anything — silently ignoring the flag was the bug, not the disk.

The e2e fixture now passes --cpus/--disk-size explicitly and asserts the
guest's nproc and /dev/vda size match, so a regression that drops either
flag fails a test instead of going unnoticed. TEST_DISK_SIZE is
deliberately not the default for the same reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pnc
pnc requested review from ddellacosta and jeffreleos August 5, 2026 15:02
@pnc

pnc commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Updated slop description, please refresh.

@pnc

pnc commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Depends on #10

@pnc
pnc changed the base branch from todo-6-bridge-self-serve to fix-docker-blob-cdn-allowlist August 5, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants