From 4ca2f32ac63b7f1844566023071adcd7eca12868 Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Fri, 11 Apr 2025 10:50:04 -0400 Subject: [PATCH] fix(vm): edge case error when cloning a VM with EFI disk (#1897) Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- proxmoxtf/resource/vm/vm.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proxmoxtf/resource/vm/vm.go b/proxmoxtf/resource/vm/vm.go index 4c4e8c3a..347ed67d 100644 --- a/proxmoxtf/resource/vm/vm.go +++ b/proxmoxtf/resource/vm/vm.go @@ -2235,9 +2235,13 @@ func vmCreateClone(ctx context.Context, d *schema.ResourceData, m interface{}) d continue } - if efiType != *currentDiskInfo.Type { + // the efitype is either "2m" or "4m" + // so it's kinda resizing, but with 2 fixed sizes it treated as a "type" by PVE + // default is "2m", hence this elaborated check. + if (currentDiskInfo.Type != nil && efiType != *currentDiskInfo.Type) || + (currentDiskInfo.Type == nil && efiType != dvEFIDiskType) { return diag.Errorf( - "resizing of efidisks is not supported.", + "changing the EFI disk type (4m / 2m) is not supported", ) }