Supervisor for this node's active images, and the entry point for image operations. Owns:
- a unique
Registry(img_id -> Img.Server), and - a
DynamicSupervisorholding the (shared, read-only) image servers, and - a separate
DynamicSupervisorholding the per-VM mutable layers (Img.Mutable), so the writable layers form their own process tree. - a
ThinPool, per node, which manages eachdm-thininstance on this machine.
On top of that tree it leases an image for the lifetime of a VM
(with_image/3).
Summary
Functions
Activate img_id on this node: start (or reuse) its image server.
Every image id currently active on this node.
Returns a specification to start this module under a supervisor.
Create child_vm_id's mutable layer as a thin snapshot of parent_vm_id's
live volume — same img_id lineage, blocks shared COW-style in the node pool.
Create a per-VM mutable layer for vm_id over img_id.
Serve img to vm_id for the duration of callable, holding a DB lease on the
image (and transitively its whole blob chain) the whole time.
Functions
@spec activate(Hyper.Img.id()) :: {:ok, pid()} | {:error, term()}
Activate img_id on this node: start (or reuse) its image server.
@spec active() :: [Hyper.Img.id()]
Every image id currently active on this node.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec create_fork(Hyper.Img.id(), Hyper.Vm.Id.t(), Hyper.Vm.Id.t()) :: {:ok, pid()} | {:error, term()}
Create child_vm_id's mutable layer as a thin snapshot of parent_vm_id's
live volume — same img_id lineage, blocks shared COW-style in the node pool.
@spec create_mutable(Hyper.Img.id(), Hyper.Vm.Id.t()) :: {:ok, pid()} | {:error, term()}
Create a per-VM mutable layer for vm_id over img_id.
@spec with_image(Hyper.Img.id(), Hyper.Vm.Id.t(), (-> result)) :: result | {:error, term()} when result: var
Serve img to vm_id for the duration of callable, holding a DB lease on the
image (and transitively its whole blob chain) the whole time.