# `Hyper.Vm.Instance`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/hyper/vm/instance.ex#L1)

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](https://github.com/firecracker-microvm/firecracker/blob/main/docs/jailer.md),
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.

# `arch`

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

The CPU architecture an instance's guest runs on.

# `t`

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

An instance size.

# `arches`

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

All supported instance architectures.

# `spec`

```elixir
@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`

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

All known instance types.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
