Use balloon-aware total for Proxmox freemem fallback (#1319)

This commit is contained in:
rcourtman 2026-03-27 14:23:10 +00:00
parent 17bfec6d1d
commit be20b22047
2 changed files with 36 additions and 4 deletions

View file

@ -151,6 +151,27 @@ func TestSelectVMLowTrustUsedMemory(t *testing.T) {
wantUsed: 2 * giB,
wantSource: "status-freemem",
},
{
name: "uses balloon total when deriving used from status freemem",
memTotal: 8 * giB,
status: &proxmox.VMStatus{
Balloon: 4 * giB,
FreeMem: 1 * giB,
},
wantUsed: 3 * giB,
wantSource: "status-freemem",
},
{
name: "uses balloon total when status mem is falsely saturated against balloon",
memTotal: 8 * giB,
status: &proxmox.VMStatus{
Mem: 4 * giB,
Balloon: 4 * giB,
FreeMem: 1 * giB,
},
wantUsed: 3 * giB,
wantSource: "status-freemem",
},
{
name: "returns empty selection without usable fields",
memTotal: 8 * giB,