Skip to content

HOWTO: Build a Proxmox VM Template with Packer

Purpose: Build a cloud-init-compatible Proxmox VM template using the core/onprem/template-image module.

Difficulty: Intermediate

Track: Platform Foundations


Overview

The HybridOps template pipeline treats VM base image creation as a module run with structured inputs and a captured run record. Packer builds a cloud-init-compatible image, registers it as a Proxmox VM template, and assigns a VMID from the IPAM-allocated range — no hardcoded IDs. All downstream VM provisioning modules consume the registered template by reference, ensuring every VM traces back to a known, versioned base image.


1. Module Inputs

  • Template name, version tag, and target Proxmox node.
  • Cloud image source URL and checksum.
  • VMID assigned from IPAM allocation.

2. Packer Build

  • Run the core/onprem/template-image module.
  • Packer downloads the base image, provisions cloud-init config, and converts to a Proxmox template.
  • Build log captured under <runtime-root>/logs/platform/template-image/.

3. Template Registration

  • Confirm template appears in Proxmox with the expected VMID.
  • Validate cloud-init drive attachment and network config.

4. Run Record Review

  • Review the run record for template records path and VMID assignment.
  • Confirm the version tag is registered and available for downstream module consumption.

References


License: MIT-0 for code, CC-BY-4.0 for documentation unless otherwise stated.