# `Hyper.Node.Img.Publish`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/hyper/node/img/publish.ex#L1)

Materialize a running VM's disk divergence as a new immutable delta layer.

Pipeline: take a temp thin snapshot of the VM's mutable volume (instant;
parent resumes immediately) → build a writable dm-snapshot over the VM's
composed RO image device, backed by a fresh sparse COW file → copy the
snapshot's provisioned ranges (read from the pool metadata — with an
external origin they are exactly the divergence) into it, so exactly the
divergent chunks land in the COW exception store → tear the devices down
(flushing the store) → ingest the COW file via `Hyper.Img.create_derived/3`.

The result is a `kind: :delta` blob any node can stack with
`Dmsetup.create_snapshot/4` — the same format `Img.Server.build_chain/2`
already composes.

# `fork_image`

```elixir
@spec fork_image(Hyper.Vm.Id.t(), Hyper.Img.id()) ::
  {:ok, Hyper.Img.id()} | {:error, term()}
```

Publish `parent_vm_id`'s current rootfs divergence over `parent_img_id`.
Returns the derived image id. The parent VM keeps running; its I/O pauses
only for the instant of the thin snapshot.

---

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