@finalclass SizeClassOne of the five documented size classes.
minimumMemoryInMiB selects a class; it does not size a VM. Both numbers are on the
class or neither, because naming only the peak invites budgeting for memory nobody is
billed for and naming only the baseline invites a pressure test against a ceiling four
times too low.
Constructor
Section titled “Constructor”SizeClass declares no __new__ or __init__, so it is not constructed directly: an instance comes back from another call in this package.
Properties
Section titled “Properties”baseline_gb
Section titled “baseline_gb”baseline_gb: floatThe figure a GB-second rate multiplies. Always the baseline, never the peak.
baseline_mib
Section titled “baseline_mib”baseline_mib: intbaseline_vcpu
Section titled “baseline_vcpu”baseline_vcpu: floatpeak_gb
Section titled “peak_gb”peak_gb: floatThe peak in GB, which is what the guest reports as MemTotal.
peak_mib
Section titled “peak_mib”peak_mib: intpeak_vcpu
Section titled “peak_vcpu”peak_vcpu: floatMethods
Section titled “Methods”@staticmethoddef all() -> list[SizeClass]Every class, smallest first.
default_class
Section titled “default_class”@staticmethoddef default_class() -> SizeClassThe platform’s default, 2048 MiB. Not the smallest — a 0.5 GB baseline fixes the guest’s always-present ceiling at 2 GB, which OOM-kills a real test suite, and the guest has no swap.
describe
Section titled “describe”def describe() -> strOne line naming both numbers. cli.py calls this describe().
from_baseline_mib
Section titled “from_baseline_mib”@staticmethoddef from_baseline_mib(mib: SupportsIndex) -> SizeClassThe class minimumMemoryInMiB = mib selects, or a refusal (TRAP-10).
Off-table figures are refused rather than snapped to a neighbour: the two plausible readings differ in both memory and rate, and neither has been measured.
from_request
Section titled “from_request”@staticmethoddef from_request( cpus: SupportsFloat | SupportsIndex | None = None, memory_mib: SupportsIndex | None = None,) -> SizeClassThe smallest class whose baseline covers a resource request (BIND-14).
cpus in vCPUs and memory_mib in MiB, each a request; None or zero is no
requirement on that axis, and with none on either the answer is default_class().
Chosen by baseline, the billed and always-present figure. Raises InvalidArgError
naming the largest class when no class covers the request, or for a CPU figure that is
not a finite non-negative number.
Special methods
Section titled “Special methods”__repr__
Section titled “__repr__”def __repr__() -> str__str__
Section titled “__str__”def __str__() -> strProvenance
Section titled “Provenance”This page is generated from bindings/microvms-py/microvms.pyi by Griffe 2.3.0, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.
To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run stubs. mise run stubs:check fails when the committed file no longer matches the source.