Merge pull request #10260 from loloolllool/10252-proxmox-iso-bad-boot-order-prevent

Proxmox builder pass through boot-order
This commit is contained in:
Calle Pettersson 2020-11-16 08:18:14 +01:00 committed by GitHub
commit ae4c9461ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 1 deletions

View File

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

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

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

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,

View File

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

View File

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

View File

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