Template build flow
Generated Markdown for references/concept_template_builds.md.
Open book page Back to the skill graph
# Template build flow
_A build resolves the source, boots a synthesised one-VM lab, runs the provisions, then flattens and seals into the store; a failed build leaves nothing behind._
`vmlab template build` resolves the source (URL downloads are cached and
content-addressed under `~/.cache/vmlab/artefacts/`), creates a working qcow2,
synthesises a one-VM lab from the template definition, boots it per the hardware
profile, runs the provision scripts (full wscript API — keystrokes, screen matching,
exec), shuts down gracefully,
flattens and seals into the store. **A failed build leaves nothing behind.** The
sealed result is `~/.local/share/vmlab/templates/<arch>/<name>/<version>/`
(`disk.qcow2` + `template.wcl`). The step-by-step runbook is
[Build a disk template](../references/process_build_template.md).
The build auto-attaches a **VMLAB bootstrap ISO** carrying the vmlab-agent
binaries plus an install script; the template's own unattended-install hook
(cloud-init runcmd, installer late-commands, autounattend first-logon) runs
it, and the build verifies the agent's handshake before sealing — recording
the version in the sealed meta as `agent_version`. That is what enables
readiness, `vmlab shell`, agent file transfer, `tail`, `eventlog` and wscript
`terminal()`/`stats()` on VMs cloned from the template. Installers that power
off from a live session (Ubuntu's subiquity) get one extra verification boot
of the installed system before sealing.
## Related
- [Templates](../references/concept_templates.md)
- [template {} block](../references/entity_template_block.md)
- [source {} build source](../references/entity_template_sources.md)
- [Build a disk template](../references/process_build_template.md)
- [media {} block](../references/entity_media.md)
[← Back to SKILL.md](../SKILL.md)