From 2bdfd53756611eafed685a4edced00aa1011de4e Mon Sep 17 00:00:00 2001 From: lollen Date: Sat, 14 Nov 2020 07:27:55 +0100 Subject: [PATCH] Proxmox-builder pass through boot-order Adding the boot field supported by Proxmox api and proxmox-api-go library. This is due to a change in Proxmox to allow for multiple boot harddrives which would break the packer proxmox builder (the hardcoded cdn boot value). Can be specified like the following example: "disks": [ { "type": "scsi", "disk_size": "20G", "storage_pool": "vmstorage", "storage_pool_type": "lvm" } ], "boot": "order=scsi0;ide2", "iso_file": "media:iso/{{ user `ubuntu_iso_file` }}" Not sure this is ideal, but it's a workaround for the #10252 issue. --- builder/proxmox/common/config.go | 1 + builder/proxmox/common/step_start_vm.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/builder/proxmox/common/config.go b/builder/proxmox/common/config.go index 1428345f9..2e3083b52 100644 --- a/builder/proxmox/common/config.go +++ b/builder/proxmox/common/config.go @@ -39,6 +39,7 @@ type Config struct { VMName string `mapstructure:"vm_name"` VMID int `mapstructure:"vm_id"` + Boot string `mapstructure:"boot"` Memory int `mapstructure:"memory"` Cores int `mapstructure:"cores"` CPUType string `mapstructure:"cpu_type"` diff --git a/builder/proxmox/common/step_start_vm.go b/builder/proxmox/common/step_start_vm.go index 0e92334fb..d5877a6a2 100644 --- a/builder/proxmox/common/step_start_vm.go +++ b/builder/proxmox/common/step_start_vm.go @@ -43,7 +43,7 @@ func (s *stepStartVM) Run(ctx context.Context, state multistep.StateBag) multist Name: c.VMName, Agent: agent, QemuKVM: kvm, - Boot: "cdn", // Boot priority, c:CDROM -> d:Disk -> n:Network + Boot: c.Boot, // Boot priority, example: "order=virtio0;ide2;net0", virtio0:Disk0 -> ide0:CDROM -> net0:Network QemuCpu: c.CPUType, Description: "Packer ephemeral build VM", Memory: c.Memory,