diff --git a/builder/proxmox/clone/config.hcl2spec.go b/builder/proxmox/clone/config.hcl2spec.go index 074f82d6f..ea333d2aa 100644 --- a/builder/proxmox/clone/config.hcl2spec.go +++ b/builder/proxmox/clone/config.hcl2spec.go @@ -83,6 +83,7 @@ type FlatConfig struct { Pool *string `mapstructure:"pool" cty:"pool" hcl:"pool"` VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` VMID *int `mapstructure:"vm_id" cty:"vm_id" hcl:"vm_id"` + Boot *string `mapstructure:"boot" cty:"boot" hcl:"boot"` Memory *int `mapstructure:"memory" cty:"memory" hcl:"memory"` Cores *int `mapstructure:"cores" cty:"cores" hcl:"cores"` CPUType *string `mapstructure:"cpu_type" cty:"cpu_type" hcl:"cpu_type"` @@ -190,6 +191,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "pool": &hcldec.AttrSpec{Name: "pool", Type: cty.String, Required: false}, "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "vm_id": &hcldec.AttrSpec{Name: "vm_id", Type: cty.Number, Required: false}, + "boot": &hcldec.AttrSpec{Name: "boot", Type: cty.String, Required: false}, "memory": &hcldec.AttrSpec{Name: "memory", Type: cty.Number, Required: false}, "cores": &hcldec.AttrSpec{Name: "cores", Type: cty.Number, Required: false}, "cpu_type": &hcldec.AttrSpec{Name: "cpu_type", Type: cty.String, Required: false}, 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/config.hcl2spec.go b/builder/proxmox/common/config.hcl2spec.go index 5675e2d69..f47b11958 100644 --- a/builder/proxmox/common/config.hcl2spec.go +++ b/builder/proxmox/common/config.hcl2spec.go @@ -82,6 +82,7 @@ type FlatConfig struct { Pool *string `mapstructure:"pool" cty:"pool" hcl:"pool"` VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` VMID *int `mapstructure:"vm_id" cty:"vm_id" hcl:"vm_id"` + Boot *string `mapstructure:"boot" cty:"boot" hcl:"boot"` Memory *int `mapstructure:"memory" cty:"memory" hcl:"memory"` Cores *int `mapstructure:"cores" cty:"cores" hcl:"cores"` CPUType *string `mapstructure:"cpu_type" cty:"cpu_type" hcl:"cpu_type"` @@ -187,6 +188,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "pool": &hcldec.AttrSpec{Name: "pool", Type: cty.String, Required: false}, "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "vm_id": &hcldec.AttrSpec{Name: "vm_id", Type: cty.Number, Required: false}, + "boot": &hcldec.AttrSpec{Name: "boot", Type: cty.String, Required: false}, "memory": &hcldec.AttrSpec{Name: "memory", Type: cty.Number, Required: false}, "cores": &hcldec.AttrSpec{Name: "cores", Type: cty.Number, Required: false}, "cpu_type": &hcldec.AttrSpec{Name: "cpu_type", Type: cty.String, Required: false}, 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, diff --git a/builder/proxmox/iso/config.hcl2spec.go b/builder/proxmox/iso/config.hcl2spec.go index 272f8a794..374456efc 100644 --- a/builder/proxmox/iso/config.hcl2spec.go +++ b/builder/proxmox/iso/config.hcl2spec.go @@ -83,6 +83,7 @@ type FlatConfig struct { Pool *string `mapstructure:"pool" cty:"pool" hcl:"pool"` VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` VMID *int `mapstructure:"vm_id" cty:"vm_id" hcl:"vm_id"` + Boot *string `mapstructure:"boot" cty:"boot" hcl:"boot"` Memory *int `mapstructure:"memory" cty:"memory" hcl:"memory"` Cores *int `mapstructure:"cores" cty:"cores" hcl:"cores"` CPUType *string `mapstructure:"cpu_type" cty:"cpu_type" hcl:"cpu_type"` @@ -196,6 +197,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "pool": &hcldec.AttrSpec{Name: "pool", Type: cty.String, Required: false}, "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "vm_id": &hcldec.AttrSpec{Name: "vm_id", Type: cty.Number, Required: false}, + "boot": &hcldec.AttrSpec{Name: "boot", Type: cty.String, Required: false}, "memory": &hcldec.AttrSpec{Name: "memory", Type: cty.Number, Required: false}, "cores": &hcldec.AttrSpec{Name: "cores", Type: cty.Number, Required: false}, "cpu_type": &hcldec.AttrSpec{Name: "cpu_type", Type: cty.String, Required: false}, diff --git a/website/pages/docs/builders/proxmox/clone.mdx b/website/pages/docs/builders/proxmox/clone.mdx index df5b3fc14..892c5e739 100644 --- a/website/pages/docs/builders/proxmox/clone.mdx +++ b/website/pages/docs/builders/proxmox/clone.mdx @@ -190,6 +190,9 @@ in the image's Cloud-Init settings for provisioning. - `full_clone` (bool) - Whether to run a full or shallow clone from the base clone_vm. Defaults to `true`. +- `boot` - (string) - Override default boot order. Format example `order=virtio0;ide2;net0`. + Prior to Proxmox 6.2-15 the format was `cdn` (c:CDROM -> d:Disk -> n:Network) + ## Example: Cloud-Init enabled Debian Here is a basic example creating a Debian 10 server image. This assumes diff --git a/website/pages/docs/builders/proxmox/iso.mdx b/website/pages/docs/builders/proxmox/iso.mdx index b290b5937..d97d1f6e2 100644 --- a/website/pages/docs/builders/proxmox/iso.mdx +++ b/website/pages/docs/builders/proxmox/iso.mdx @@ -256,6 +256,9 @@ builder. - `vm_interface` - (string) - Name of the network interface that Packer gets the VMs IP from. Defaults to the first non loopback interface. +- `boot` - (string) - Override default boot order. Format example `order=virtio0;ide2;net0`. + Prior to Proxmox 6.2-15 the format was `cdn` (c:CDROM -> d:Disk -> n:Network) + ## Boot Command The `boot_command` configuration is very important: it specifies the keys to