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

The lifecycle-coupled core of one microVM: the jailed firecracker daemon and
its controller, restarted as a pair. Isolated from the API client
(`Hyper.Node.FireVMM.Client`) so the *only* order-sensitive relationship in the
VM tree lives in this two-child supervisor.

  1. `Hyper.Node.FireVMM.Daemon` - the jailer OS process (under `MuonTrap`).
     MUST be the first child: it must be (re)started before the controller so
     the API socket is coming up by the time the controller probes.
  2. `Hyper.Node.FireVMM.State` - the `:gen_statem` controller; drives the boot
     protocol (await API -> stage -> configure -> run) against that daemon.

`:one_for_all`, daemon first: a crash of *either* child takes both down and
restarts the pair. So:

  * controller crash -> daemon also discarded; no orphaned VM, fresh cold boot.
  * firecracker crash -> the `Daemon` child exits; both restart; `Daemon`
    resets the stale jail and relaunches, and the fresh controller cold-boots.

`Daemon` guarantees firecracker is dead on teardown via the helper's
`cgroup.kill` (MuonTrap's port-close kill misses the setsid'd firecracker), so
no firecracker process outlives a graceful supervisor shutdown.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(Hyper.Node.FireVMM.Opts.t()) :: Supervisor.on_start()
```

---

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