Tested with Packer 1.10 and with Proxmox 8.1.4
Build VM Templates with Packer for Proxmox. The generated templates are meant to be used with cloud-init, they come without a User or root login.
Only the Windows Server Template has a Administrator user by default (Password packer
). It's ready for Ansible setup via winrm.
All templates are made for my personal environment and may need adjustments for yours!
OS | Status |
---|---|
Ubnuntu 22.04 | |
Ubnuntu 20.04 | |
Ubnuntu 18.04 | |
Debian 12 | |
Debian 11 | |
Debian 10 | |
AlmaLinux 9 | |
Rocky 9 | |
Alpine 3.15 | |
Alpine 3.19 | |
Windows Server 2019 | |
Windows Server 2022 |
First initialize the proxmox packer plugin:
packer init config.pkr.hcl
The templates all use a generic source builder (generic.pkr.hcl) that's driven by variables. The OS specific settings are only variables and preseed files.
To build packer templates you need to set some variables via file (-var-file=my.pkrvars.hcl
), cli (-var variablename=value
), or environment (PKR_VAR_variablename=value
):
- proxmox_host
- proxmox_user
- proxmox_password
- node
- vmid
Other interesting variables are:
- pool
- proxmox_insecure_tls
- disk_storage_pool
- iso_storage_pool
- cloud_init_storage_pool
- iso_download
See variables.pkr.hcl for all varaibles.
To build a template (e.g. debian-11
) run:
packer build -var-file="debian-11.pkrvars.hcl" -only="linux.*" .
For windows:
packer build -var-file="windows-server-2019.pkrvars.hcl" -only="windows.*" .