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"` VMName string `mapstructure:"vm_name"`
VMID int `mapstructure:"vm_id"` VMID int `mapstructure:"vm_id"`
Boot string `mapstructure:"boot"`
Memory int `mapstructure:"memory"` Memory int `mapstructure:"memory"`
Cores int `mapstructure:"cores"` Cores int `mapstructure:"cores"`
CPUType string `mapstructure:"cpu_type"` 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, Name: c.VMName,
Agent: agent, Agent: agent,
QemuKVM: kvm, 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, QemuCpu: c.CPUType,
Description: "Packer ephemeral build VM", Description: "Packer ephemeral build VM",
Memory: c.Memory, Memory: c.Memory,