-- What a node's memory looks like with NO phase VMs on it. -- -- `vm_placement::capacity_of` used to infer the host's own footprint by -- subtracting the VMs' full claim from observed usage. That is right only when -- the VMs have actually consumed what they claimed. A VM booted seconds ago -- holds ~1 GiB of its 8 GiB, so the subtraction goes negative, hits the 2 GiB -- floor, and hands back memory the host is really using. -- -- Measured on morpheus (31757 MiB total, 4314 MiB idle) with 2 VMs committed: -- the inferred baseline collapsed from 4314 to 2048, which freed 2266 MiB — -- just enough to fit a 3rd VM into a 2-slot node. The capacity harness caught -- it as "morpheus peaked at 3 concurrent VM(s) with only 2 slot(s)". -- -- So remember the baseline instead of re-deriving it: it is only honestly -- observable when the node has nothing committed, and that is exactly when it -- is recorded. ALTER TABLE nodes ADD COLUMN IF NOT EXISTS mem_baseline_mib BIGINT; COMMENT ON COLUMN nodes.mem_baseline_mib IS 'Memory in use with zero phase VMs committed, sampled by vm_placement::survey. NULL until first observed idle.';