[SOLVED] Packer upload iso: Error creating VM - 506 upload

syphon

New Member
Feb 16, 2023
4
0
1
Hi everyone,

here it is my first post on this forum. I'm playing with packer and proxmox everything seems fine until I got this error I can't explain.

I'm using Proxmox-ISO builder and everytime I try to create a template letting PACKER upload the iso image , i got this strange error:

Code:
Build 'proxmox-iso.appliance' errored after 824 milliseconds 172 microseconds: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=a5ad35ad5b6373f89e31c779d00246f15734e2476cfb6b034eace284cdda' not implemented, error status:  (params: map[agent:1 args: boot:c cores:4 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:storage:iso/ubuntu-22.04.1-live-server-amd64.iso,media=cdrom kvm:true machine: memory:16384 name:appliance net0:virtio=XX:XX:XX:XX,bridge=vmbr0,firewall=false onboot:false ostype:other scsihw:virtio-scsi-single sockets:1 startup: tags: virtio0:storage:50,format=qcow2,iothread=false vmid:998])

Everything run fine if I upload image previously on my proxmox-node.

Any clue about that?
I'm running Proxmox 7.1.3.
Packer authenticates through API token admin permission.

Thank you
Syphon
 
Hi Matthias, thank you for answering me.
The error you posted is similar, but it's not the same.

Actually after some digging I found out the problem I reported, it's a Packer regression bug related to proxmox-iso buider v.1.1.1.There some http header set wrong.
Here the link to the issue:
https://github.com/hashicorp/packer-plugin-proxmox/issues/154

Reverting the packer proxmox plugin to 1.1.0 solved the issue for now.
Hope this helps.

Thank you
Syphon
 
Great! Please mark the thread as solved (edit it, there's a dropdown near the title) so others with the same problem can find it more easily.

Now, I did not test it, but I do believe it's nonetheless an issue with our code :) https://github.com/Telmate/proxmox-api-go/pull/232/files
If the wrong headers were sent, we returned an 506. It's fixed in a newer version, but their fix (sending only the headers the bugged upload accepts) will work as well of course.
 
  • Like
Reactions: syphon
reverting to 1.1.0 did not solve the issue

I am still facing the same error
pveversion -v?
Anything abnormal in your syslog?
What's the error message?
If possible, please give the exact http request.
 
With the latest Packer release this issue should finally be fixed: https://github.com/hashicorp/packer-plugin-proxmox/releases/tag/v1.1.2
no, still has the same error with packer v1.8.6 nad proxmox plugin v1.1.2

pveversion -v?
Code:
proxmox-ve: 7.2-1 (running kernel: 5.15.30-2-pve)
pve-manager: 7.2-3 (running version: 7.2-3/c743d6c1)
pve-kernel-helper: 7.2-2
pve-kernel-5.15: 7.2-1
pve-kernel-5.15.30-2-pve: 5.15.30-3
ceph-fuse: 15.2.16-pve1
corosync: 3.1.5-pve2
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.22-pve2
libproxmox-acme-perl: 1.4.2
libproxmox-backup-qemu0: 1.2.0-1
libpve-access-control: 7.1-8
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.1-6
libpve-guest-common-perl: 4.1-2
libpve-http-server-perl: 4.1-1
libpve-storage-perl: 7.2-2
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 4.0.12-1
lxcfs: 4.0.12-pve1
novnc-pve: 1.3.0-3
proxmox-backup-client: 2.1.8-1
proxmox-backup-file-restore: 2.1.8-1
proxmox-mini-journalreader: 1.3-1
proxmox-widget-toolkit: 3.4-10
pve-cluster: 7.2-1
pve-container: 4.2-1
pve-docs: 7.2-2
pve-edk2-firmware: 3.20210831-2
pve-firewall: 4.2-5
pve-firmware: 3.4-1
pve-ha-manager: 3.3-4
pve-i18n: 2.7-1
pve-qemu-kvm: 6.2.0-5
pve-xtermjs: 4.16.0-1
qemu-server: 7.2-2
smartmontools: 7.2-pve3
spiceterm: 3.2-2
swtpm: 0.7.1~bpo11+1
vncterm: 1.7-1
zfsutils-linux: 2.1.4-pve1


Anything abnormal in your syslog?
no

What's the error message?
Code:
...

2023/03/03 21:11:20 [INFO] (telemetry) ending proxmox
==> Wait completed after 5 seconds 175 milliseconds
2023/03/03 21:11:20 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2023/03/03 21:11:20 machine readable: proxmox,error []string{"Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=73045a915d18944410b97039a5ed0a77bf522690f77549dbd1b500fda80f' not implemented, error status:  (params: map[agent:1 args: bios:ovmf boot: cores:8 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/win11.iso,media=cdrom kvm:true machine:q35 memory:4096 name:windows-11-amd64-1.0 net0:e1000=D6:84:10:23:B8:7C,bridge=vmbr4,firewall=false onboot:false ostype:win10 sata0:local:20,format=qcow2 scsihw:lsi sockets:1 startup: tags: vmid:103])"}
==> Builds finished but no artifacts were created.
2023/03/03 21:11:20 [INFO] (telemetry) Finalizing.
==> proxmox: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=73045a915d18944410b97039a5ed0a77bf522690f77549dbd1b500fda80f' not implemented, error status:  (params: map[agent:1 args: bios:ovmf boot: cores:8 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/win11.iso,media=cdrom kvm:true machine:q35 memory:4096 name:windows-11-amd64-1.0 net0:e1000=D6:84:10:23:B8:7C,bridge=vmbr4,firewall=false onboot:false ostype:win10 sata0:local:20,format=qcow2 scsihw:lsi sockets:1 startup: tags: vmid:103])
Build 'proxmox' errored after 5 seconds 175 milliseconds: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=73045a915d18944410b97039a5ed0a77bf522690f77549dbd1b500fda80f' not implemented, error status:  (params: map[agent:1 args: bios:ovmf boot: cores:8 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/win11.iso,media=cdrom kvm:true machine:q35 memory:4096 name:windows-11-amd64-1.0 net0:e1000=D6:84:10:23:B8:7C,bridge=vmbr4,firewall=false onboot:false ostype:win10 sata0:local:20,format=qcow2 scsihw:lsi sockets:1 startup: tags: vmid:103])

==> Wait completed after 5 seconds 175 milliseconds

==> Some builds didn't complete successfully and had errors:
--> proxmox: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=73045a915d18944410b97039a5ed0a77bf522690f77549dbd1b500fda80f' not implemented, error status:  (params: map[agent:1 args: bios:ovmf boot: cores:8 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/win11.iso,media=cdrom kvm:true machine:q35 memory:4096 name:windows-11-amd64-1.0 net0:e1000=D6:84:10:23:B8:7C,bridge=vmbr4,firewall=false onboot:false ostype:win10 sata0:local:20,format=qcow2 scsihw:lsi sockets:1 startup: tags: vmid:103])



If possible, please give the exact http request.
idk, packer is doing the communication
 
Please post your Packer template, including the packer {...} block.
Code:
2023/03/03 21:11:15 [INFO] Packer version: 1.8.6 [go1.18.9 linux amd64]
2023/03/03 21:11:15 [TRACE] discovering plugins in /usr/bin
2023/03/03 21:11:15 [TRACE] discovering plugins in /home/hradaideh/.config/packer/plugins
2023/03/03 21:11:15 [DEBUG] Discovered plugin: proxmox = /home/hradaideh/.config/packer/plugins/github.com/hashicorp/proxmox/packer-plugin-proxmox_v1.1.2_x5.0_linux_amd64
2023/03/03 21:11:15 [INFO] found external [clone iso] builders from proxmox plugin
2023/03/03 21:11:15 [TRACE] discovering plugins in .
2023/03/03 21:11:15 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/03/03 21:11:15 [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/hradaideh/.packerconfig
2023/03/03 21:11:15 [WARN] Config file doesn't exist: /home/hradaideh/.packerconfig
2023/03/03 21:11:15 [INFO] Setting cache directory: /home/hradaideh/.cache/packer
2023/03/03 21:11:15 [TRACE] Starting internal plugin packer-builder-proxmox
2023/03/03 21:11:15 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-builder-proxmox"}
2023/03/03 21:11:15 Waiting for RPC address for: /usr/bin/packer
2023/03/03 21:11:15 packer-builder-proxmox plugin: [INFO] Packer version: 1.8.6 [go1.18.9 linux amd64]
2023/03/03 21:11:15 packer-builder-proxmox plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/03/03 21:11:15 packer-builder-proxmox plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/hradaideh/.packerconfig
2023/03/03 21:11:15 packer-builder-proxmox plugin: [WARN] Config file doesn't exist: /home/hradaideh/.packerconfig
2023/03/03 21:11:15 packer-builder-proxmox plugin: [INFO] Setting cache directory: /home/hradaideh/.cache/packer
2023/03/03 21:11:15 packer-builder-proxmox plugin: args: []string{"packer-builder-proxmox"}
2023/03/03 21:11:15 packer-builder-proxmox plugin: Plugin address: unix /tmp/packer-plugin3819866266
2023/03/03 21:11:15 packer-builder-proxmox plugin: Waiting for connection...
2023/03/03 21:11:15 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin3819866266
2023/03/03 21:11:15 packer-builder-proxmox plugin: Serving a plugin connection...
2023/03/03 21:11:15 [TRACE] Starting internal plugin packer-provisioner-windows-shell
2023/03/03 21:11:15 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-provisioner-windows-shell"}
2023/03/03 21:11:15 Waiting for RPC address for: /usr/bin/packer
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: [INFO] Packer version: 1.8.6 [go1.18.9 linux amd64]
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/hradaideh/.packerconfig
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: [WARN] Config file doesn't exist: /home/hradaideh/.packerconfig
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: [INFO] Setting cache directory: /home/hradaideh/.cache/packer
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: args: []string{"packer-provisioner-windows-shell"}
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: Plugin address: unix /tmp/packer-plugin3298001242
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: Waiting for connection...
2023/03/03 21:11:15 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin3298001242
2023/03/03 21:11:15 packer-provisioner-windows-shell plugin: Serving a plugin connection...
2023/03/03 21:11:15 [TRACE] Starting internal plugin packer-provisioner-powershell
2023/03/03 21:11:15 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-provisioner-powershell"}
2023/03/03 21:11:15 Waiting for RPC address for: /usr/bin/packer
2023/03/03 21:11:15 packer-provisioner-powershell plugin: [INFO] Packer version: 1.8.6 [go1.18.9 linux amd64]
2023/03/03 21:11:15 packer-provisioner-powershell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/03/03 21:11:15 packer-provisioner-powershell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/hradaideh/.packerconfig
2023/03/03 21:11:15 packer-provisioner-powershell plugin: [WARN] Config file doesn't exist: /home/hradaideh/.packerconfig
2023/03/03 21:11:15 packer-provisioner-powershell plugin: [INFO] Setting cache directory: /home/hradaideh/.cache/packer
2023/03/03 21:11:15 packer-provisioner-powershell plugin: args: []string{"packer-provisioner-powershell"}
2023/03/03 21:11:15 packer-provisioner-powershell plugin: Plugin address: unix /tmp/packer-plugin3170658544
2023/03/03 21:11:15 packer-provisioner-powershell plugin: Waiting for connection...
2023/03/03 21:11:15 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin3170658544
2023/03/03 21:11:15 packer-provisioner-powershell plugin: Serving a plugin connection...
2023/03/03 21:11:15 Preparing build: proxmox
2023/03/03 21:11:15 packer-builder-proxmox plugin: Number of sockets 0 is too small, using default: 1
2023/03/03 21:11:15 packer-builder-proxmox plugin: CPU type not set, using default 'kvm64'
2023/03/03 21:11:15 packer-builder-proxmox plugin: NIC 0 model not set, using default 'e1000'
2023/03/03 21:11:15 packer-builder-proxmox plugin: Disk 0 size not set, using default '20G'
2023/03/03 21:11:15 packer-builder-proxmox plugin: Disk 0 cache mode not set, using default 'none'
2023/03/03 21:11:15 packer-builder-proxmox plugin: SCSI controller not set, using default 'lsi'
2023/03/03 21:11:15 Build debug mode: false
2023/03/03 21:11:15 Force build: false
2023/03/03 21:11:15 On error:
2023/03/03 21:11:15 Waiting on builds to complete...
2023/03/03 21:11:15 Starting build run: proxmox
2023/03/03 21:11:15 Running builder: proxmox
2023/03/03 21:11:15 [INFO] (telemetry) Starting builder proxmox
proxmox: output will be in this color.

2023/03/03 21:11:15 packer-builder-proxmox plugin: using password auth
2023/03/03 21:11:17 packer-builder-proxmox plugin: No URLs were provided to Step Download. Continuing...
2023/03/03 21:11:17 packer-builder-proxmox plugin: No CD files specified. CD disk will not be made.
==> proxmox: Retrieving additional ISO
==> proxmox: Trying Autounattend.iso
2023/03/03 21:11:17 packer-builder-proxmox plugin: Acquiring lock for: Autounattend.iso?checksum=md5%3A554bebd2edba22e350f7f224f44e5097 (downloaded_additional_iso_path_0/baffe6f4d9c2b73e942cc5841ff233e3049e4b8b.iso.lock)
==> proxmox: Trying Autounattend.iso?checksum=md5%3A554bebd2edba22e350f7f224f44e5097
2023/03/03 21:11:17 packer-builder-proxmox plugin: Leaving retrieve loop for additional ISO
==> proxmox: Autounattend.iso?checksum=md5%3A554bebd2edba22e350f7f224f44e5097 => /home/hradaideh/sourcegit/infra-scripts/packer/proxmox/windows/Autounattend.iso
    proxmox: Uploaded ISO to local:iso/Autounattend.iso
==> proxmox: Creating VM
==> proxmox: No VM ID given, getting next free from Proxmox
2023/03/03 21:11:20 [INFO] (telemetry) ending proxmox
==> Wait completed after 5 seconds 175 milliseconds
2023/03/03 21:11:20 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2023/03/03 21:11:20 machine readable: proxmox,error []string{"Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=73045a915d18944410b97039a5ed0a77bf522690f77549dbd1b500fda80f' not implemented, error status:  (params: map[agent:1 args: bios:ovmf boot: cores:8 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/win11.iso,media=cdrom kvm:true machine:q35 memory:4096 name:windows-11-amd64-1.0 net0:e1000=D6:84:10:23:B8:7C,bridge=vmbr4,firewall=false onboot:false ostype:win10 sata0:local:20,format=qcow2 scsihw:lsi sockets:1 startup: tags: vmid:103])"}
==> Builds finished but no artifacts were created.
2023/03/03 21:11:20 [INFO] (telemetry) Finalizing.
==> proxmox: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=73045a915d18944410b97039a5ed0a77bf522690f77549dbd1b500fda80f' not implemented, error status:  (params: map[agent:1 args: bios:ovmf boot: cores:8 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/win11.iso,media=cdrom kvm:true machine:q35 memory:4096 name:windows-11-amd64-1.0 net0:e1000=D6:84:10:23:B8:7C,bridge=vmbr4,firewall=false onboot:false ostype:win10 sata0:local:20,format=qcow2 scsihw:lsi sockets:1 startup: tags: vmid:103])
Build 'proxmox' errored after 5 seconds 175 milliseconds: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=73045a915d18944410b97039a5ed0a77bf522690f77549dbd1b500fda80f' not implemented, error status:  (params: map[agent:1 args: bios:ovmf boot: cores:8 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/win11.iso,media=cdrom kvm:true machine:q35 memory:4096 name:windows-11-amd64-1.0 net0:e1000=D6:84:10:23:B8:7C,bridge=vmbr4,firewall=false onboot:false ostype:win10 sata0:local:20,format=qcow2 scsihw:lsi sockets:1 startup: tags: vmid:103])

==> Wait completed after 5 seconds 175 milliseconds

==> Some builds didn't complete successfully and had errors:
--> proxmox: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=73045a915d18944410b97039a5ed0a77bf522690f77549dbd1b500fda80f' not implemented, error status:  (params: map[agent:1 args: bios:ovmf boot: cores:8 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/win11.iso,media=cdrom kvm:true machine:q35 memory:4096 name:windows-11-amd64-1.0 net0:e1000=D6:84:10:23:B8:7C,bridge=vmbr4,firewall=false onboot:false ostype:win10 sata0:local:20,format=qcow2 scsihw:lsi sockets:1 startup: tags: vmid:103])

==> Builds finished but no artifacts were created.
2023/03/03 21:11:21 waiting for all plugin processes to complete...
2023/03/03 21:11:21 /usr/bin/packer: plugin process exited
2023/03/03 21:11:21 /usr/bin/packer: plugin process exited
2023/03/03 21:11:21 /usr/bin/packer: plugin process exited


Code:
{
  "variables": {
    "iso_md5": "{{ env `PACKER_WINDOWS_AUTO_MD5` }}",

    "preseed_url": "{{env `PACKER_PRESEED_URL`}}",
    "proxmox_host": "{{env `PACKER_PROXMOX_URL`}}",
    "proxmox_username": "{{env `PACKER_PROXMOX_USERNAME`}}",
    "proxmox_password": "{{env `PACKER_PROXMOX_PASSWORD`}}",
    "proxmox_node": "{{env `PACKER_PROXMOX_NODE`}}",
    "vm_id": "{{env `PACKER_NODE_ID`}}",
    "datastore": "local",
    "datastore_type": "directory",
    "network_bridge": "{{env `PACKER_NETWORK_BRIDGE`}}",


    "vm_name": "{{env `PACKER_WINDOWS_VM_NAME`}}",
    "vm_cpu_cores": "8",
    "vm_memory": "4096",
    "vm_disk_size": "100",

    "winrm_username": "X",
    "winrm_password": "X",

    "template_description": "Windows Template Machine",
    "iso_file": "local:iso/win11.iso"
  },
  "builders": [
    {
      "machine": "q35",
      "type": "proxmox",
      "node": "{{user `proxmox_node`}}",
      "proxmox_url": "{{user `proxmox_host`}}/api2/json",
      "insecure_skip_tls_verify": true,
      "username": "{{ user `proxmox_username` }}",
      "password": "{{ user `proxmox_password` }}",
      "vm_name": "{{ user `vm_name`}}",
      "template_description": "{{ user `template_description` }}",
      "iso_file": "{{ user `iso_file` }}",
      "memory": "{{ user `vm_memory` }}",
      "cores": "{{ user `vm_cpu_cores` }}",
      "os": "win10",
      "bios": "ovmf",
      "network_adapters": [
        {
          "bridge": "{{ user `network_bridge` }}"
        }
      ],
      "disks": [
        {
          "type": "sata",
          "disk_size": "{{ user `disk_size`}}",
          "storage_pool": "{{user `datastore`}}",
          "storage_pool_type": "{{user `datastore_type`}}",
          "format": "qcow2"
        }
      ],
      "additional_iso_files": [
        {
          "device": "sata3",
          "iso_url": "Autounattend.iso",
          "iso_checksum": "{{ user `iso_md5` }}",
          "iso_storage_pool": "{{user `datastore`}}",
          "unmount": true
        }
      ],
      "communicator": "winrm",
      "winrm_username": "{{ user `winrm_username` }}",
      "winrm_password": "{{ user `winrm_password` }}",
      "winrm_insecure": true,
      "winrm_use_ssl": true,
      "boot_wait": 1,
      "boot_command": [
        "<wait2>",
        "<enter>",
        "<wait2>",
        "<enter>",
        "<wait2>",
        "<enter>",
        "<wait2>",
        "<enter>"
      ]
    }
  ],
  "provisioners": [
    {
      "type": "windows-shell",
      "scripts": [
        "X.bat"
      ]
    },
    {
      "type": "powershell",
      "scripts": [
        "Y.ps1"
      ]
    }
  ]
}
 
You're using the plugin built into Packer itself, which doesn't contain the fixes of version 1.1.2 (yet).

1. You have to specify the builder type. In your case you have to use proxmox-iso instead of proxmox. Using only proxmox will always load the plugin built into Packer and not the specified one.
2. To be able to use packer init and specify a custom (more recent) plugin you'll have to convert your template to HCL and add a Packer block. It should look like this:
Code:
packer {
  required_plugins {
    proxmox = {
      version = ">= 1.1.2"
      source  = "github.com/hashicorp/proxmox"
    }
  }
}
3. Run packer init .

After that, Packer will use the plugin version specified in the Packer block of your template.

Here is the relevant documentation: https://developer.hashicorp.com/packer/docs/commands/init
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!