diff --git a/.web-docs/components/builder/clone/README.md b/.web-docs/components/builder/clone/README.md index 5f708a17..af5a84fa 100644 --- a/.web-docs/components/builder/clone/README.md +++ b/.web-docs/components/builder/clone/README.md @@ -182,9 +182,6 @@ boot time. - `tags` (string) - The tags to set. This is a semicolon separated list. For example, `debian-12;template`. -- `args` (string) - Arbitrary arguments passed to KVM. For example `-no-reboot -smbios type=0,vendor=FOO`. - Note: this option is for experts only. - - `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) @@ -275,6 +272,10 @@ boot time. - `vm_interface` (string) - Name of the network interface that Packer gets the VMs IP from. Defaults to the first non loopback interface. +- `qemu_additional_args` (string) - Arbitrary arguments passed to KVM. + For example `-no-reboot -smbios type=0,vendor=FOO`. + Note: this option is for experts only. + diff --git a/.web-docs/components/builder/iso/README.md b/.web-docs/components/builder/iso/README.md index ebd862c8..0e7c992a 100644 --- a/.web-docs/components/builder/iso/README.md +++ b/.web-docs/components/builder/iso/README.md @@ -113,9 +113,6 @@ in the image's Cloud-Init settings for provisioning. - `tags` (string) - The tags to set. This is a semicolon separated list. For example, `debian-12;template`. -- `args` (string) - Arbitrary arguments passed to KVM. For example `-no-reboot -smbios type=0,vendor=FOO`. - Note: this option is for experts only. - - `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) @@ -206,6 +203,10 @@ in the image's Cloud-Init settings for provisioning. - `vm_interface` (string) - Name of the network interface that Packer gets the VMs IP from. Defaults to the first non loopback interface. +- `qemu_additional_args` (string) - Arbitrary arguments passed to KVM. + For example `-no-reboot -smbios type=0,vendor=FOO`. + Note: this option is for experts only. + diff --git a/builder/proxmox/clone/config.hcl2spec.go b/builder/proxmox/clone/config.hcl2spec.go index f1cd9af4..44193de8 100644 --- a/builder/proxmox/clone/config.hcl2spec.go +++ b/builder/proxmox/clone/config.hcl2spec.go @@ -89,7 +89,6 @@ type FlatConfig struct { VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` VMID *int `mapstructure:"vm_id" cty:"vm_id" hcl:"vm_id"` Tags *string `mapstructure:"tags" cty:"tags" hcl:"tags"` - Args *string `mapstructure:"args" cty:"args" hcl:"args"` Boot *string `mapstructure:"boot" cty:"boot" hcl:"boot"` Memory *int `mapstructure:"memory" cty:"memory" hcl:"memory"` BalloonMinimum *int `mapstructure:"ballooning_minimum" cty:"ballooning_minimum" hcl:"ballooning_minimum"` @@ -124,6 +123,7 @@ type FlatConfig struct { Nameserver *string `mapstructure:"nameserver" required:"false" cty:"nameserver" hcl:"nameserver"` Searchdomain *string `mapstructure:"searchdomain" required:"false" cty:"searchdomain" hcl:"searchdomain"` Ipconfigs []FlatcloudInitIpconfig `mapstructure:"ipconfig" required:"false" cty:"ipconfig" hcl:"ipconfig"` + AdditionalArgs *string `mapstructure:"qemu_additional_args" cty:"qemu_additional_args" hcl:"qemu_additional_args"` } // FlatMapstructure returns a new FlatConfig. @@ -216,7 +216,6 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "vm_id": &hcldec.AttrSpec{Name: "vm_id", Type: cty.Number, Required: false}, "tags": &hcldec.AttrSpec{Name: "tags", Type: cty.String, Required: false}, - "args": &hcldec.AttrSpec{Name: "args", Type: cty.String, Required: false}, "boot": &hcldec.AttrSpec{Name: "boot", Type: cty.String, Required: false}, "memory": &hcldec.AttrSpec{Name: "memory", Type: cty.Number, Required: false}, "ballooning_minimum": &hcldec.AttrSpec{Name: "ballooning_minimum", Type: cty.Number, Required: false}, @@ -251,6 +250,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "nameserver": &hcldec.AttrSpec{Name: "nameserver", Type: cty.String, Required: false}, "searchdomain": &hcldec.AttrSpec{Name: "searchdomain", Type: cty.String, Required: false}, "ipconfig": &hcldec.BlockListSpec{TypeName: "ipconfig", Nested: hcldec.ObjectSpec((*FlatcloudInitIpconfig)(nil).HCL2Spec())}, + "qemu_additional_args": &hcldec.AttrSpec{Name: "qemu_additional_args", Type: cty.String, Required: false}, } return s } diff --git a/builder/proxmox/common/config.go b/builder/proxmox/common/config.go index 58a0a497..f6416ce5 100644 --- a/builder/proxmox/common/config.go +++ b/builder/proxmox/common/config.go @@ -97,10 +97,6 @@ type Config struct { // `debian-12;template`. Tags string `mapstructure:"tags"` - // Arbitrary arguments passed to KVM. For example - // `-no-reboot -smbios type=0,vendor=FOO`. - // Note: this option is for experts only. - Args string `mapstructure:"args"` // 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 string `mapstructure:"boot"` @@ -195,6 +191,11 @@ type Config struct { // the VMs IP from. Defaults to the first non loopback interface. VMInterface string `mapstructure:"vm_interface"` + // Arbitrary arguments passed to KVM. + // For example `-no-reboot -smbios type=0,vendor=FOO`. + // Note: this option is for experts only. + AdditionalArgs string `mapstructure:"qemu_additional_args"` + Ctx interpolate.Context `mapstructure-to-hcl2:",skip"` } diff --git a/builder/proxmox/common/config.hcl2spec.go b/builder/proxmox/common/config.hcl2spec.go index 8a1fc256..a0e496e9 100644 --- a/builder/proxmox/common/config.hcl2spec.go +++ b/builder/proxmox/common/config.hcl2spec.go @@ -88,7 +88,6 @@ type FlatConfig struct { VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` VMID *int `mapstructure:"vm_id" cty:"vm_id" hcl:"vm_id"` Tags *string `mapstructure:"tags" cty:"tags" hcl:"tags"` - Args *string `mapstructure:"args" cty:"args" hcl:"args"` Boot *string `mapstructure:"boot" cty:"boot" hcl:"boot"` Memory *int `mapstructure:"memory" cty:"memory" hcl:"memory"` BalloonMinimum *int `mapstructure:"ballooning_minimum" cty:"ballooning_minimum" hcl:"ballooning_minimum"` @@ -117,6 +116,7 @@ type FlatConfig struct { CloudInitStoragePool *string `mapstructure:"cloud_init_storage_pool" cty:"cloud_init_storage_pool" hcl:"cloud_init_storage_pool"` AdditionalISOFiles []FlatadditionalISOsConfig `mapstructure:"additional_iso_files" cty:"additional_iso_files" hcl:"additional_iso_files"` VMInterface *string `mapstructure:"vm_interface" cty:"vm_interface" hcl:"vm_interface"` + AdditionalArgs *string `mapstructure:"qemu_additional_args" cty:"qemu_additional_args" hcl:"qemu_additional_args"` } // FlatMapstructure returns a new FlatConfig. diff --git a/builder/proxmox/common/step_start_vm.go b/builder/proxmox/common/step_start_vm.go index 8d3c774d..cf039948 100644 --- a/builder/proxmox/common/step_start_vm.go +++ b/builder/proxmox/common/step_start_vm.go @@ -114,7 +114,6 @@ func (s *stepStartVM) Run(ctx context.Context, state multistep.StateBag) multist Agent: agent, QemuKVM: &kvm, Tags: c.Tags, - Args: c.Args, Boot: c.Boot, // Boot priority, example: "order=virtio0;ide2;net0", virtio0:Disk0 -> ide0:CDROM -> net0:Network QemuCpu: c.CPUType, Description: "Packer ephemeral build VM", @@ -134,6 +133,7 @@ func (s *stepStartVM) Run(ctx context.Context, state multistep.StateBag) multist QemuSerials: generateProxmoxSerials(c.Serials), Scsihw: c.SCSIController, Onboot: &c.Onboot, + Args: c.AdditionalArgs, } // 0 disables the ballooning device, which is useful for all VMs diff --git a/builder/proxmox/iso/config.hcl2spec.go b/builder/proxmox/iso/config.hcl2spec.go index 97e257dc..9338c09b 100644 --- a/builder/proxmox/iso/config.hcl2spec.go +++ b/builder/proxmox/iso/config.hcl2spec.go @@ -89,7 +89,6 @@ type FlatConfig struct { VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` VMID *int `mapstructure:"vm_id" cty:"vm_id" hcl:"vm_id"` Tags *string `mapstructure:"tags" cty:"tags" hcl:"tags"` - Args *string `mapstructure:"args" cty:"args" hcl:"args"` Boot *string `mapstructure:"boot" cty:"boot" hcl:"boot"` Memory *int `mapstructure:"memory" cty:"memory" hcl:"memory"` BalloonMinimum *int `mapstructure:"ballooning_minimum" cty:"ballooning_minimum" hcl:"ballooning_minimum"` @@ -127,6 +126,7 @@ type FlatConfig struct { ISOStoragePool *string `mapstructure:"iso_storage_pool" cty:"iso_storage_pool" hcl:"iso_storage_pool"` ISODownloadPVE *bool `mapstructure:"iso_download_pve" cty:"iso_download_pve" hcl:"iso_download_pve"` UnmountISO *bool `mapstructure:"unmount_iso" cty:"unmount_iso" hcl:"unmount_iso"` + AdditionalArgs *string `mapstructure:"qemu_additional_args" cty:"qemu_additional_args" hcl:"qemu_additional_args"` } // FlatMapstructure returns a new FlatConfig. @@ -219,7 +219,6 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "vm_id": &hcldec.AttrSpec{Name: "vm_id", Type: cty.Number, Required: false}, "tags": &hcldec.AttrSpec{Name: "tags", Type: cty.String, Required: false}, - "args": &hcldec.AttrSpec{Name: "args", Type: cty.String, Required: false}, "boot": &hcldec.AttrSpec{Name: "boot", Type: cty.String, Required: false}, "memory": &hcldec.AttrSpec{Name: "memory", Type: cty.Number, Required: false}, "ballooning_minimum": &hcldec.AttrSpec{Name: "ballooning_minimum", Type: cty.Number, Required: false}, @@ -257,6 +256,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "iso_storage_pool": &hcldec.AttrSpec{Name: "iso_storage_pool", Type: cty.String, Required: false}, "iso_download_pve": &hcldec.AttrSpec{Name: "iso_download_pve", Type: cty.Bool, Required: false}, "unmount_iso": &hcldec.AttrSpec{Name: "unmount_iso", Type: cty.Bool, Required: false}, + "qemu_additional_args": &hcldec.AttrSpec{Name: "qemu_additional_args", Type: cty.String, Required: false}, } return s }