Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

VM Templates

Direct answer

VM templates are prepared, generalized master images that new VMs are cloned from, so every deployment starts from the same patched OS, agents and settings and is customized at first boot with Sysprep or cloud-init.

When to use this

Use this when building standard VMs from a master image, or when clones have duplicate identities or stale patches.

First 30 seconds

1. Templates are read-only base VMs for fast, consistent deployment.

2. Keep them patched.

3. Generalise before templating.

4. Use cloud-init or sysprep for customisation.

5. Version templates.

Operational verification

base VM → generalise → template → clone → customise

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
virtualization-image
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformvirtualization-image
Scope / prerequisiteUse this when building standard VMs from a master image, or when clones have duplicate identities or stale patches.
What next?3 suggested next steps
Child topics (this level)10
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

Exercise one safe negative or boundary case implied by unquiesced application, orphaned delta, long snapshot chain, consolidation failure, stale template, incompatible hardware profile or failed restore/clone.

Step 2 Known-good and broken paths Narrow the fault

Field map: Correlate VM UUID/name, guest device, virtual controller/vNIC/vDisk, hypervisor object/state, host resource/path/uplink/datastore identifier, queue/latency/contention counters and guest-visible result.

Step 3 Where it fails Narrow the fault

Walk guest/app quiescence → hypervisor snapshot/template task → metadata/backing chain → storage durability → restore/clone read-back and stop where observed state diverges.

Common failure classes are unquiesced application, orphaned delta, long snapshot chain, consolidation failure, stale template, incompatible hardware profile or failed restore/clone.

Evidence references

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.

observation · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic VM Template

A VM template is a read-only master VM used only for cloning.

Subtopic Golden Image

A golden image is the approved, patched and hardened master OS image that all VMs for a role are built from.

Subtopic Clone

A clone is a copy of an existing VM or template. Generalize it or customize identity (hostname, SID, MAC, IP) on first boot so the copy does not conflict with the original on the network or in the domain.

Subtopic Full Clone

A full clone is an independent copy of all the source VM's disks.

Subtopic Linked Clone

A linked clone shares the parent's base disk and writes only its changes to a delta disk.

Subtopic Cloud Image

A cloud image is a small, prebuilt OS disk (qcow2, VMDK or VHD) published by distributions for virtualization and cloud use.

Subtopic Cloud-init

Cloud-init in templates customizes each new clone from the same image: pass user-data with hostname, users, SSH keys, network and packages through a NoCloud drive or the hypervisor's cloud-init settings.

Subtopic Sysprep

Sysprep generalizes a Windows installation (sysprep /generalize /oobe /shutdown) so a template can be cloned with new SIDs and computer names.

Subtopic Generalization

Generalization removes machine-specific identity from a template — hostname, SIDs, machine-id, SSH host keys, logs and network config — so every clone gets new, unique identity on first boot.

Subtopic Template Lifecycle

Template lifecycle covers building, patching, testing, publishing, versioning and retiring templates.

Key points
  • A template must be generalized before cloning.
  • Template age = patch debt of every new VM.
  • Linked clones depend on their parent.
Key checks
  • qm list | awk '$3=="template"' — templates (Proxmox)
  • virsh list --all — libvirt templates by naming
  • Get-VM | ? Name -like 'tpl-*' — Hyper-V template VMs
ReferenceWhy it matters1 section · depth on demand

In depth

A VM template is a pre-configured, generalised VM image used to deploy new VMs quickly and consistently. It includes the OS, updates, agents and baseline settings, while machine-specific identity is removed so each clone becomes unique.

StepPurpose
Build and patch base VMConsistent starting point
Install guest tools and agentsDrivers, monitoring, backup
Generalise (sysprep, cloud-init clean, remove machine-id/SSH host keys)Unique identity per clone
Convert to templatePrevents accidental boot
Customise at deployHostname, IP, domain join via customisation specs or cloud-init
# Linux generalisation before templating
cloud-init clean --logs
truncate -s 0 /etc/machine-id
rm -f /etc/ssh/ssh_host_*
qm template 9000                  # Proxmox

Update templates regularly (monthly) so new VMs do not start months behind on patches, and version them so changes can be traced.

ReferenceHow it works1 section · depth on demand

How it works

How it works: Virtualization inserts management and device-emulation/synthetic layers between a guest and physical CPU, memory, network and storage.

ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

The responsible chain spans VM state, snapshot/template metadata, backing chain and guest/application consistency.

The bounded target is expected reversible state or reusable image without hidden chain debt.

Follow the path in order: guest/app quiescence → hypervisor snapshot/template task → metadata/backing chain → storage durability → restore/clone read-back.

The operating invariants are: snapshot/template metadata matches backing objects; chain is readable; consistency mode is explicit; restore/clone verifies independently.

Important negative cases include unquiesced application, orphaned delta, long snapshot chain, consolidation failure, stale template, incompatible hardware profile or failed restore/clone.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docvirtualization-image current

Authoritative/upstream documentation reviewed for bounded claims in VM Templates. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://libvirt.org/docs.html · confidence 94%
Confirmation

Confirm action

Continue?