diff --git a/builder/proxmox/common/config.go b/builder/proxmox/common/config.go index 88a6ef79..5aa86663 100644 --- a/builder/proxmox/common/config.go +++ b/builder/proxmox/common/config.go @@ -363,6 +363,10 @@ type diskConfig struct { type efiConfig struct { // Name of the Proxmox storage pool to store the EFI disk on. EFIStoragePool string `mapstructure:"efi_storage_pool"` + // The format of the file backing the disk. Can be + // `raw`, `cow`, `qcow`, `qed`, `qcow2`, `vmdk` or `cloop`. Defaults to + // `raw`. + EFIFormat string `mapstructure:"efi_format"` // Whether Microsoft Standard Secure Boot keys should be pre-loaded on // the EFI disk. Defaults to `false`. PreEnrolledKeys bool `mapstructure:"pre_enrolled_keys"` diff --git a/builder/proxmox/common/config.hcl2spec.go b/builder/proxmox/common/config.hcl2spec.go index e5cf36f9..2f50e823 100644 --- a/builder/proxmox/common/config.hcl2spec.go +++ b/builder/proxmox/common/config.hcl2spec.go @@ -367,6 +367,7 @@ func (*FlatdiskConfig) HCL2Spec() map[string]hcldec.Spec { // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatefiConfig struct { EFIStoragePool *string `mapstructure:"efi_storage_pool" cty:"efi_storage_pool" hcl:"efi_storage_pool"` + EFIFormat *string `mapstructure:"efi_format" cty:"efi_format" hcl:"efi_format"` PreEnrolledKeys *bool `mapstructure:"pre_enrolled_keys" cty:"pre_enrolled_keys" hcl:"pre_enrolled_keys"` EFIType *string `mapstructure:"efi_type" cty:"efi_type" hcl:"efi_type"` } @@ -384,6 +385,7 @@ func (*efiConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spe func (*FlatefiConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "efi_storage_pool": &hcldec.AttrSpec{Name: "efi_storage_pool", Type: cty.String, Required: false}, + "efi_format": &hcldec.AttrSpec{Name: "efi_format", Type: cty.String, Required: false}, "pre_enrolled_keys": &hcldec.AttrSpec{Name: "pre_enrolled_keys", Type: cty.Bool, Required: false}, "efi_type": &hcldec.AttrSpec{Name: "efi_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 4c9bd859..950b906d 100644 --- a/builder/proxmox/common/step_start_vm.go +++ b/builder/proxmox/common/step_start_vm.go @@ -363,6 +363,7 @@ func generateProxmoxEfi(efi efiConfig) proxmox.QemuDevice { dev := make(proxmox.QemuDevice) setDeviceParamIfDefined(dev, "storage", efi.EFIStoragePool) setDeviceParamIfDefined(dev, "efitype", efi.EFIType) + setDeviceParamIfDefined(dev, "format", efi.EFIFormat) // efi.PreEnrolledKeys can be false, but we only want to set pre-enrolled-keys=0 // when other EFI options are set. if len(dev) > 0 { diff --git a/docs-partials/builder/proxmox/common/efiConfig-not-required.mdx b/docs-partials/builder/proxmox/common/efiConfig-not-required.mdx index 8ed6dd8d..ae133299 100644 --- a/docs-partials/builder/proxmox/common/efiConfig-not-required.mdx +++ b/docs-partials/builder/proxmox/common/efiConfig-not-required.mdx @@ -2,6 +2,9 @@ - `efi_storage_pool` (string) - Name of the Proxmox storage pool to store the EFI disk on. +- `efi_format` (string) - The format of the file backing the disk. Can be + `raw`, `cow`, `qcow`, `qed`, `qcow2`, `vmdk` or `cloop`. Defaults to `raw`. + - `pre_enrolled_keys` (bool) - Whether Microsoft Standard Secure Boot keys should be pre-loaded on the EFI disk. Defaults to `false`. diff --git a/docs-partials/builder/proxmox/common/efiConfig.mdx b/docs-partials/builder/proxmox/common/efiConfig.mdx index ff092043..f6d7dd0c 100644 --- a/docs-partials/builder/proxmox/common/efiConfig.mdx +++ b/docs-partials/builder/proxmox/common/efiConfig.mdx @@ -10,6 +10,7 @@ Usage example (JSON): { "efi_storage_pool": "local", "pre_enrolled_keys": true, + "efi_format": "raw", "efi_type": "4m" }