From 46d323d31b1568af363bbee84f7ea7e6a46a62cc Mon Sep 17 00:00:00 2001 From: joris <5111464+tyxieblub@users.noreply.github.com> Date: Fri, 12 Apr 2024 05:09:56 +0200 Subject: [PATCH] fix(vm): error 'resizing of efidisks is not supported' when clonning a VM with re-defined `efi_disk` (#1206) * fix(vm): compare efiType value instead of address Signed-off-by: tyxieblub <5111464+tyxieblub@users.noreply.github.com> * update example to reproduce the error case Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --------- Signed-off-by: tyxieblub <5111464+tyxieblub@users.noreply.github.com> Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- example/resource_virtual_environment_vm.tf | 6 ++++++ proxmoxtf/resource/vm/vm.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/example/resource_virtual_environment_vm.tf b/example/resource_virtual_environment_vm.tf index d5d23d7e..991f5865 100644 --- a/example/resource_virtual_environment_vm.tf +++ b/example/resource_virtual_environment_vm.tf @@ -155,6 +155,12 @@ resource "proxmox_virtual_environment_vm" "example" { serial = "my-custom-serial" } + efi_disk { + datastore_id = local.datastore_id + file_format = "raw" + type = "4m" + } + initialization { datastore_id = local.datastore_id // if unspecified: diff --git a/proxmoxtf/resource/vm/vm.go b/proxmoxtf/resource/vm/vm.go index 2d12588f..37120129 100644 --- a/proxmoxtf/resource/vm/vm.go +++ b/proxmoxtf/resource/vm/vm.go @@ -2233,7 +2233,7 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d continue } - if &efiType != currentDiskInfo.Type { + if efiType != *currentDiskInfo.Type { return diag.Errorf( "resizing of efidisks is not supported.", )