feat: host memory preflight — refuse VMs the host cannot back - #22
Merged
raghavendra-talur merged 1 commit intoAug 26, 2026
Merged
Conversation
create-master-vms now checks that the new master's RAM plus the RAM of every other easyshift cluster whose master VM is live (probed, not the stale persisted state) fits within physical memory minus a 5120 MiB host reserve, and fails fast with the fix in the message: lower --master-ram, or easyshift stop <cluster>. Oversubscription never failed cleanly — it either thrashed the host into a swap spiral (measured: a 20480 MiB VM on a 24 GiB Mac hit load 300) or, past Virtualization.framework's cap, crash-looped vfkit at launch while the install watchdog corrupted the boot phase. The reserve is calibrated from hardware: 24576 - 5120 = 19456 MiB, exactly the largest VM that ran cleanly on the 24 GiB dev machine. Both roadmap items (memory preflight, VZ cap) close. HostInspector gains PhysicalMemoryBytes (sysctl hw.memsize / procfs MemTotal). A failed probe skips the check — it is a guard, not a gate. Assisted-by: Claude Code/claude-fable-5 Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
This was referenced Aug 26, 2026
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
createnow fails in one second — with the remedy in the message — instead of thrashing the host or crash-looping vfkit, whenever the requested master RAM plus every live easyshift VM (probed viaIsRunning, not the stale persisted state) exceeds physical memory minus a 5120 MiB host reserve.HostInspector.PhysicalMemoryBytes(sysctl hw.memsizeon macOS,/proc/meminfoMemTotal on Linux); a failed probe skips the check (guard, not gate).24576 − 5120 = 19456exactly. The same check subsumes the Virtualization.framework per-VM cap failure (default--master-ram 32768on small hosts used to crash-loop vfkit and corrupt the boot phase via the install watchdog).easyshift stop <name>.--master-ramvs VZ cap).Test plan
--master-ramhint; combined overflow with a running cluster blocked witheasyshift stop <name>hint; fits-after-stop passes.make checkgreen.easyshift create -n memtest(default 32768) now refuses instantly withmax usable: 19456 MiB;--odfon the same host likewise refuses cleanly, matching the documented 24 GB limitation.🤖 Generated with Claude Code