[Medium] Lima resource floors not counted in provider capacity accounting; minimal leases bypass CPU/memory caps
Report
Summary
Lima VMs are provisioned with floored resources (minimum 1 vCPU / 512 MiB / 5 GiB), but the provider's capacity accounting records the requested resources — so a lease requesting 0 vCPU / 0 MB is accounted as consuming nothing while actually consuming a full floored VM. A consumer can drive a provider into CPU/memory oversubscription at trivial cost, because the capacity check is the only guard by default (max-concurrent-leases defaults to 0 = "bounded only by resource capacity").
Root Cause
renderLimaTemplate(vm/lima_template.go:58-69) floors resources:cpus < 1→ 1,memMB < 512→ 512,diskGB < 5→ 5.Provisionstores the requestedresin the map (vm/lima_manager.go:150,resources: res).- The auto-accept capacity check sums
List()resources +reservedRes— both requested values (node/node.go:1563-1571,exceedsCapacity:2420-2422). max-concurrent-leasesdefaults to 0 (cmd/xe/main.go:1311), so the capacity check is the only guard by default.- A (0 vCPU, 0 MB, 1 GB) lease is valid:
ValidateLeaseDimensionsonly requires one non-zero resource (core/ledger.go:128-131). - Inconsistent with QEMU, which applies defaults and stores the effective values in its map (
vm/qemu_manager.go:183-191,:255).
Impact
A minimal (0 vCPU, 0 MB, 1 GB, 60s) lease costs 17 µXCU yet actually consumes 1 vCPU + 512 MiB. Each such lease is accounted as 0/0, so the provider keeps auto-accepting: e.g. 30 one-hour minimal leases cost ~30,000 µXCU and demand 30 vCPUs on a 4-CPU host, all passing the capacity check. The provider ends up oversubscribed, degrading every tenant's VM.
Verification
Executed in-package test against the real template renderer and accounting logic:
minimal lease (0 vCPU, 0 MB, 1 GB, 60s, mult 1000) cost: 17 uXCU
template for (0,0,1GB) lease: cpus: 1
template for (0,0,1GB) lease: memory: "512MiB"
template for (0,0,1GB) lease: disk: "5GiB"
10 minimal leases: accounted usage = 0 vCPU / 0 MB / 10 GB
10 minimal leases: ACTUAL usage = 10 vCPU / 5120 MB / 50 GB (floors 1/512MiB/5GiB each)
provider cap 4 vCPU: accounted 0 <= 4, all 10 accepted; host actually needs 10 vCPUs
Note on related reports
Searched "zero resource minimal lease capacity bypass oversubscribe", "Lima minimum resources 1 CPU 512MB floor", "capacity accounting resources floor minimum VM" — no hits.
Suggested fix
Store the floored resources in the Lima map (as QEMU stores its effective values), or apply the floors in the capacity check in node/node.go.
Thread
Thanks. This is the same finding as https://bounty.xe.network/XE-0119, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-16872 and says what differs; it is read like any other.