-
Notifications
You must be signed in to change notification settings - Fork 0
PackerProxmoxTemplates
title: Packer Proxmox Templates type: technique created: 2026-05-21 last_updated: 2026-05-21 related: ["radar/techniques/DockerSecuritySelfHosting"] sources: ["https://aaron-kt-berry.medium.com/creating-proxmox-templates-with-packer-7ada62474c44"] radar_quadrant: Techniques radar_ring: Assess radar_position: center
A technique for building repeatable, version-controlled Proxmox VM templates using HashiCorp Packer, applying the immutable infrastructure pattern to home lab and self-hosted environments.
Manually configured Proxmox VMs accumulate undocumented changes over time. Reinstalling or cloning a VM reproduces the initial state but not the accumulated configuration. The result is snowflake VMs: unique machines that cannot be reliably reproduced. When a VM fails or needs scaling, the rebuild process is manual and error-prone.
Packer connects to the Proxmox API, boots an ISO-based VM, runs an automated OS installation via a preseed or cloud-init file, executes provisioning scripts (shell, Ansible), and converts the resulting VM into a Proxmox template. The template is then available for instant cloning.
The workflow:
- Write a Packer HCL configuration referencing the Proxmox API endpoint, ISO URL, and VM hardware specs.
- Define a preseed file for unattended OS installation (Debian/Ubuntu) or an Autounattend.xml for Windows.
- Add shell or Ansible provisioners for post-install configuration (packages, users, SSH keys, agents).
- Run
packer build. Packer creates the VM, installs the OS, provisions, and converts to a template. - Store the Packer configuration in version control. Rebuilding the template from scratch is a single command.
The pattern treats VM templates as build artifacts, not as hand-crafted machines. Each template version corresponds to a commit in the Packer configuration repository. Rolling back to a previous template version is equivalent to reverting a code change.
Combined with cloud-init for per-instance configuration (hostname, IP, SSH keys), clones from a Packer template boot with known state. Instance-specific configuration is injected at first boot; the template itself is generic and reusable.
| Approach | Reproducibility | Documentation | Rebuild time |
|---|---|---|---|
| Manual Proxmox template | Low (drift accumulates) | None | Hours |
| Packer-built template | High (code-defined) | Full (HCL file) | 10-20 min automated |
Packer Proxmox Templates sit in the Assess ring of the Techniques quadrant, at center position. First studied via Aaron Berry's Medium article (2023-11-04). Packer is a mature HashiCorp tool (widely used in cloud infrastructure); the Proxmox builder plugin extends it to home lab hardware. Center position reflects clear applicability to any Proxmox home lab but a non-trivial setup investment: preseed files and cloud-init configuration require OS-level knowledge. Remaining gate is a completed Packer build producing at least one reusable Proxmox template.