# `Hyper.Node.FireVMM.State`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/hyper/node/fire_vmm/state.ex#L1)

`:gen_statem` controller for one microVM. It drives the boot protocol against a
daemon whose lifecycle is owned by the supervisor (`Hyper.Node.FireVMM.Core`,
`:one_for_all`): the controller does not launch, monitor, or kill the daemon -
if firecracker dies, `Core` restarts the daemon and this controller together,
and `init` simply cold-boots again.

    :awaiting_api --> :configuring --> :running --> :stopping

States:

  * `:awaiting_api` - poll the (already-launched) daemon's API socket until it
                      answers, or fail the boot if the readiness deadline lapses.
  * `:configuring`  - stage the kernel + rootfs device into the jail chroot
                      (rewriting the spec to in-jail paths), then push
                      machine-config, boot-source, drives, NICs, and
                      `InstanceStart`.
  * `:running`      - guest is live; handles `stop`.
  * `:stopping`     - teardown requested in-band; reject further calls.

The gen_statem *data* (this struct) holds the start `Opts`, the resolved boot
spec, and the readiness deadline; the *state* is the lifecycle atom above.

# `t`

```elixir
@type t() :: %Hyper.Node.FireVMM.State{
  api_granted: boolean(),
  boot_deadline: integer() | nil,
  opts: Hyper.Node.FireVMM.Opts.t(),
  spec: Hyper.Node.FireVMM.BootSpec.Cold.t() | nil
}
```

# `child_spec`

# `describe`

```elixir
@spec describe(Hyper.Vm.Id.t()) :: Hyper.Node.FireVMM.Opts.t()
```

The start `Opts` of the running VM `id` — how a fork recovers the parent's
`img_id`/`type`/`arch`/`boot_args` from just a vm_id. Exits if the VM is gone;
callers translate that to `{:error, :not_found}`.

# `start_link`

# `stop`

```elixir
@spec stop(Hyper.Vm.Id.t()) :: :ok
```

---

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