Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Templates · Automation

Direct answer

Automation templates are reusable definitions — a VM template, a Terraform module, a cloud-init or Ansible role — with parameters for name, size and network, so many VMs can be produced from one tested pattern.

When to use this

Use this when creating reusable definitions — VM templates, Terraform modules, cloud-init or Ansible roles — that produce many consistent VMs.

First 30 seconds

1. Templates are the automation base.

2. Build with Packer.

3. Version and test.

4. Include cloud-init/agents.

5. Rebuild regularly.

Operational verification

Packer → template → clones

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
virtualization
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
Scope / prerequisiteUse this when creating reusable definitions — VM templates, Terraform modules, cloud-init or Ansible roles — that produ…
What next?3 suggested next steps
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.

2 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 Checks Verify boundary
  • Template version recorded in the VM's notes/tags.
  • Template patched within the last month.
  • Test deployment from the template succeeds.
Step 2 Common mistakes Narrow the fault
  • Templates built by hand and impossible to reproduce.
  • No version or changelog.
  • Secrets embedded in templates.
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
Key points
  • Parameters, not copies.
  • Version templates and modules.
  • Test a template before others depend on it.
Key checks
  • qm list — templates (Proxmox)
  • packer build . — image build
  • Get-VM -Name tpl-* — Hyper-V templates
ReferenceWhy it matters1 section · depth on demand

Packer example

packer init .
packer validate .
packer build -var 'version=2026.11' debian12.pkr.hcl

Documented example, not captured output.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Templates are golden images to clone from. Keep them small and generic:

  • Latest patches; guest tools/agents installed; cloud-init or sysprep prepared.
  • No unique identity: no machine IDs (/etc/machine-id emptied), SSH host keys removed, no domain join.
  • Hardened baseline (CIS level 1), logging and monitoring agents pre-installed but unconfigured.
  • Documented version and build date; rebuilt monthly by automation.
truncate -s 0 /etc/machine-id; rm -f /etc/ssh/ssh_host_*; cloud-init clean --logs
qm template 9000

Template types

TypeExample
VM templatevSphere template, Proxmox template VM
ImagePacker-built qcow2/VMDK/VHDX, cloud images
Code moduleTerraform module, Ansible role
Guest configcloud-init user-data, Sysprep answer file
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 current

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

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

Confirm action

Continue?