It seems that packer errors out when trying to deploy a template and it complains about qcow2 being unsupported. So I thought I would start here rather than on the hashicorp forum, as I'm not really sure where the problem lies.
Running packer build on a proxmox server generates this error. This isn't happening with packer 1.8.0
.
{
"builders": [
{
"type": "proxmox",
"proxmox_url": "https://{{ user `proxmox_host` }}:8006/api2/json",
"username": "{{ user `proxmox_username` }}",
"token": "{{ user `proxmox_token` }}",
"node": "{{ user `proxmox_node_name` }}",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_timeout": "30m",
"ssh_username": "{{ user `ssh_username` }}",
"template_name": "{{ user `template_name` }}",
"template_description": "{{ user `template_description` }}",
"sockets": 1,
"cores": 4,
"memory": 6144,
"disks": [
{
"type": "scsi",
"disk_size": "10G",
"format": "qcow2",
"storage_pool": "local-lvm",
"storage_pool_type": "lvm-thin",
"cache_mode": "none",
"io_thread": "false"
}
],
"network_adapters": [
{
"bridge": "vmbr0",
"model": "virtio"
}
],
"os": "l26",
"unmount_iso": true,
"cloud_init": true,
"cloud_init_storage_pool": "cloudinit",
"http_directory": "http",
"http_interface": "ens160",
"http_port_max": 8039,
"http_port_min": 8039,
"insecure_skip_tls_verify": false,
"iso_checksum": "f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98",
"iso_file": "nfs:iso/ubuntu-22.04-live-server-amd64.iso",
"boot_wait": "4s",
"boot_command": [
"<e><bs><down><down><down>",
"<right><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right><right>",
"<spacebar>",
"ip={{ user `vm_ip` }}::{{ user `vm_gateway` }}:{{ user `vm_netmask` }}::::{{ user `vm_dns` }} ",
"autoinstall 'ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/' ",
"<F10>"
]
},
[...]
"variables": {
"vm_ip": "10.88.88.157",
"vm_netmask": "255.255.255.0",
"vm_gateway": "10.88.88.126",
"vm_dns": "10.88.88.126",
"search_domain:": "mydomain.com",
"dns_server:": "10.88.88.126",
"template_name": "packer-template",
"template_description": "Ubuntu 22.04, generated by packer on {{ isotime }}",
"playbook": "setup/work.yml",
"ssh_password": "",
"ssh_username": "",
"vmware_build": "no",
"vsphere_build_host": "",
"vsphere_datastore": "",
"vsphere_folder": "",
"vsphere_cluster": "",
"vsphere_network": "",
"vsphere_password": "",
"vsphere_username": ""
}
2022/06/05 16:16:55 [INFO] Packer version: 1.8.1 [go1.17.8 linux amd64]
2022/06/05 16:16:55 [TRACE] discovering plugins in /usr/bin
2022/06/05 16:16:55 [TRACE] discovering plugins in /root/.config/packer/plugins
2022/06/05 16:16:55 [TRACE] discovering plugins in .
2022/06/05 16:16:55 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/06/05 16:16:55 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/06/05 16:16:55 [WARN] Config file doesn't exist: /root/.packerconfig
2022/06/05 16:16:55 [INFO] Setting cache directory: /root/.cache/packer
2022/06/05 16:16:55 [TRACE] Starting internal plugin packer-builder-proxmox
2022/06/05 16:16:55 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-builder-proxmox"}
2022/06/05 16:16:55 Waiting for RPC address for: /usr/bin/packer
2022/06/05 16:16:55 packer-builder-proxmox plugin: [INFO] Packer version: 1.8.1 [go1.17.8 linux amd64]
2022/06/05 16:16:55 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin2630202321
2022/06/05 16:16:55 packer-builder-proxmox plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/06/05 16:16:55 packer-builder-proxmox plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/06/05 16:16:55 packer-builder-proxmox plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/06/05 16:16:55 packer-builder-proxmox plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/06/05 16:16:55 packer-builder-proxmox plugin: args: []string{"packer-builder-proxmox"}
2022/06/05 16:16:55 [TRACE] Starting internal plugin packer-provisioner-ansible
2022/06/05 16:16:55 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-provisioner-ansible"}
2022/06/05 16:16:55 Waiting for RPC address for: /usr/bin/packer
2022/06/05 16:16:55 packer-builder-proxmox plugin: Plugin address: unix /tmp/packer-plugin2630202321
2022/06/05 16:16:55 packer-builder-proxmox plugin: Waiting for connection...
2022/06/05 16:16:55 packer-builder-proxmox plugin: Serving a plugin connection...
2022/06/05 16:16:55 packer-provisioner-ansible plugin: [INFO] Packer version: 1.8.1 [go1.17.8 linux amd64]
2022/06/05 16:16:55 packer-provisioner-ansible plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/06/05 16:16:55 packer-provisioner-ansible plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/06/05 16:16:55 packer-provisioner-ansible plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/06/05 16:16:55 packer-provisioner-ansible plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/06/05 16:16:55 packer-provisioner-ansible plugin: args: []string{"packer-provisioner-ansible"}
2022/06/05 16:16:55 packer-provisioner-ansible plugin: Plugin address: unix /tmp/packer-plugin3530321557
2022/06/05 16:16:55 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin3530321557
2022/06/05 16:16:55 packer-provisioner-ansible plugin: Waiting for connection...
2022/06/05 16:16:55 packer-provisioner-ansible plugin: Serving a plugin connection...
2022/06/05 16:16:55 Preparing build: proxmox
2022/06/05 16:16:55 packer-builder-proxmox plugin: CPU type not set, using default 'kvm64'
2022/06/05 16:16:55 packer-builder-proxmox plugin: SCSI controller not set, using default 'lsi'
proxmox: output will be in this color.
2022/06/05 16:16:56 Build debug mode: false
2022/06/05 16:16:56 Force build: false
2022/06/05 16:16:56 On error: abort
2022/06/05 16:16:56 Waiting on builds to complete...
2022/06/05 16:16:56 Starting build run: proxmox
2022/06/05 16:16:56 Running builder: proxmox
2022/06/05 16:16:56 [INFO] (telemetry) Starting builder proxmox
2022/06/05 16:16:56 packer-provisioner-ansible plugin: ansible-playbook version: 2.12.6
==> proxmox: Creating VM
2022/06/05 16:16:56 packer-builder-proxmox plugin: using token auth
2022/06/05 16:16:56 packer-builder-proxmox plugin: No URLs were provided to Step Download. Continuing...
==> proxmox: No VM ID given, getting next free from Proxmox
==> proxmox: Error creating VM: error creating VM: unable to create VM 112 - unsupported format 'qcow2' at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87., error status: (params: map[agent:1 args: boot: cores:4 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:nfs:iso/ubuntu-22.04-live-server-amd64.iso,media=cdrom kvm:true machine: memory:6144 name:packer-629cd6f7-1a53-e158-3fa1-9631569995bb net0:virtio=FA:1A:ED:20:9B:76,bridge=vmbr0,firewall=false numa:false onboot:false ostype:l26 scsi0:local-lvm:10,format=qcow2,iothread=false scsihw:lsi sockets:1 tablet:false tags: vmid:112])
==> proxmox: Error creating VM: error creating VM: unable to create VM 112 - unsupported format 'qcow2' at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87., error status: (params: map[agent:1 args: boot: cores:4 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:nfs:iso/ubuntu-22.04-live-server-amd64.iso,media=cdrom kvm:true machine: memory:6144 name:packer-629cd6f7-1a53-e158-3fa1-9631569995bb net0:virtio=FA:1A:ED:20:9B:76,bridge=vmbr0,firewall=false numa:false onboot:false ostype:l26 scsi0:local-lvm:10,format=qcow2,iothread=false scsihw:lsi sockets:1 tablet:false tags: vmid:112])
==> proxmox: Step "stepStartVM" failed, aborting...
2022/06/05 16:16:58 [INFO] (telemetry) ending proxmox
==> Wait completed after 2 seconds 111 milliseconds
==> proxmox: aborted: skipping cleanup of step "stepUploadISO"
==> proxmox: aborted: skipping cleanup of step "StepDownload"
2022/06/05 16:16:58 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/06/05 16:16:58 machine readable: proxmox,error []string{"Error creating VM: error creating VM: unable to create VM 112 - unsupported format 'qcow2' at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87., error status: (params: map[agent:1 args: boot: cores:4 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:nfs:iso/ubuntu-22.04-live-server-amd64.iso,media=cdrom kvm:true machine: memory:6144 name:packer-629cd6f7-1a53-e158-3fa1-9631569995bb net0:virtio=FA:1A:ED:20:9B:76,bridge=vmbr0,firewall=false numa:false onboot:false ostype:l26 scsi0:local-lvm:10,format=qcow2,iothread=false scsihw:lsi sockets:1 tablet:false tags: vmid:112])"}
==> Builds finished but no artifacts were created.
2022/06/05 16:16:58 [INFO] (telemetry) Finalizing.
Build 'proxmox' errored after 2 seconds 111 milliseconds: Error creating VM: error creating VM: unable to create VM 112 - unsupported format 'qcow2' at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87., error status: (params: map[agent:1 args: boot: cores:4 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:nfs:iso/ubuntu-22.04-live-server-amd64.iso,media=cdrom kvm:true machine: memory:6144 name:packer-629cd6f7-1a53-e158-3fa1-9631569995bb net0:virtio=FA:1A:ED:20:9B:76,bridge=vmbr0,firewall=false numa:false onboot:false ostype:l26 scsi0:local-lvm:10,format=qcow2,iothread=false scsihw:lsi sockets:1 tablet:false tags: vmid:112])
==> Wait completed after 2 seconds 111 milliseconds
==> Some builds didn't complete successfully and had errors:
--> proxmox: Error creating VM: error creating VM: unable to create VM 112 - unsupported format 'qcow2' at /usr/share/perl5/PVE/Storage/LvmThinPlugin.pm line 87., error status: (params: map[agent:1 args: boot: cores:4 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:nfs:iso/ubuntu-22.04-live-server-amd64.iso,media=cdrom kvm:true machine: memory:6144 name:packer-629cd6f7-1a53-e158-3fa1-9631569995bb net0:virtio=FA:1A:ED:20:9B:76,bridge=vmbr0,firewall=false numa:false onboot:false ostype:l26 scsi0:local-lvm:10,format=qcow2,iothread=false scsihw:lsi sockets:1 tablet:false tags: vmid:112])
==> Builds finished but no artifacts were created.
2022/06/05 16:16:59 waiting for all plugin processes to complete...
2022/06/05 16:16:59 /usr/bin/packer: plugin process exited
2022/06/05 16:16:59 /usr/bin/packer: plugin process exited
I've tested this on both proxmox 6.4-14 and 7.2-4.