Hyper.Vm.Instance (Hyper v0.1.0)

Copy Markdown View Source

Named instance types - fixed (vCPU, memory) sizes, like cloud instance classes.

The caller picks a type instead of juggling raw numbers; this module turns it into host-side resource caps expressed as firecracker jailer flags.

We run firecracker under the jailer, which creates the cgroup (+ chroot, namespaces, privilege drop) and applies --cgroup <file>=<value> settings before exec'ing firecracker. cgroup/1 returns those --cgroup args (cgroup v2 only) ready to splice into the jailer command.

Summary

Types

The CPU architecture an instance's guest runs on.

t()

An instance size.

Functions

All supported instance architectures.

The full resource bundle for a type. vcpus and mem feed both the cgroup caps and firecracker's machine-config; disk sizes the rootfs image; the disk_bw/net_bw throughputs feed firecracker's drive/NIC rate limiters.

All known instance types.

Types

arch()

@type arch() :: Sys.Arch.t()

The CPU architecture an instance's guest runs on.

t()

@type t() ::
  :micro
  | :milli
  | :centi
  | :deci
  | :base
  | :deca
  | :hecto
  | :kilo
  | :mega
  | :giga
  | :tera

An instance size.

Functions

arches()

@spec arches() :: [arch()]

All supported instance architectures.

spec(type)

@spec spec(t()) :: Hyper.Vm.Instance.Spec.t()

The full resource bundle for a type. vcpus and mem feed both the cgroup caps and firecracker's machine-config; disk sizes the rootfs image; the disk_bw/net_bw throughputs feed firecracker's drive/NIC rate limiters.

types()

@spec types() :: [t()]

All known instance types.