Use this when creating a master VM used only for cloning.
VM Template
A VM template is a read-only master VM used only for cloning. It holds the configured OS, virtual hardware and agents, and new VMs are deployed from it with guest customization for name, network and identity.
1. A VM template is a protected VM used only for cloning.
2. Cannot be started (Proxmox/vSphere).
3. Include guest agent and PV drivers.
4. Document version and date.
5. Rebuild monthly.
VM → template flag → clone source
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
- Template converts back to VM only for maintenance.
- Last patch date recorded.
- Test deployment works.
Step 2 Common mistakes Narrow the fault
- Templates never patched, so new VMs start months behind.
- Not generalized (duplicate SIDs, machine IDs, SSH host keys).
- Hard-coded IPs or hostnames inside the template.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- A template is a read-only master; never run it as a VM.
- Generalize before converting to a template.
- Keep guest agents current in the template.
qm template <vmid>— convert to template (Proxmox)qm config <vmid> | grep template— template flagGet-VMTemplate (SCVMM)— SCVMM templates
ReferenceWhy it matters1 section · depth on demand
How it works
A VM template is a read-only master VM (OS installed, patched and generalised) used to create new VMs quickly and consistently by cloning.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Turn a prepared VM into a template (Proxmox VE)
qm shutdown 9000
qm template 9000
qm config 9000 | grep -E 'template|scsi0|ide2'
The Proxmox VM chapter describes templates as read-only sources: once converted, the VM cannot be started, and its disks become base images that clones can share.
What belongs in a template
| Include | Leave out |
|---|---|
Patched OS, guest agent (qemu-guest-agent), VirtIO drivers on Windows | Host name, static IP, SSH host keys, machine-id |
| Cloud-init (Linux) or sysprep-ready Windows | Application data, user accounts with passwords |
| Small root disk (grow per clone) | Swap files sized for one workload |
| Correct firmware (OVMF + EFI disk or SeaBIOS) and machine type (q35) | Passthrough devices, ISO media left attached |
| CPU type that matches the cluster's migration plan | Host-specific network bridges that do not exist on other nodes |
Storage decides what cloning can do
| Storage | Linked clones |
|---|---|
| ZFS, LVM-thin, Ceph RBD, qcow2 on directory/NFS | Supported |
| Plain (thick) LVM | Full clones only |
Naming and versioning
Use names that carry OS and build date (tpl-debian12-202611) and keep the template's notes with the build steps. A template is a deployment artefact — you will want to know exactly what is in it when a vulnerability report arrives.
Checks before first use
1. Clone once, boot it, verify host name, network and SSH keys are new.
2. qm agent <vmid> ping — the guest agent answers (needed for clean shutdown, fs-freeze during backup and IP reporting).
3. Destroy the test clone; only then hand the template to automation.
Reference
| Platform | Create template |
|---|---|
| vSphere | Right-click VM → Convert to Template |
| Proxmox | qm template 9000 |
| Hyper-V | Sysprep VM, export or keep VHDX as base |
| KVM | Keep a generalized base image; clone with virt-clone |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in VM Templates → VM Template. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%