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.
This commit is contained in:
lollen 2020-11-14 07:27:55 +01:00
parent 6871a3a85d
commit 2bdfd53756
2 changed files with 2 additions and 1 deletions

View File

@ -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"`

View File

@ -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,