0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 10:33:46 +00:00

fix(vm): edge case error when cloning a VM with EFI disk (#1897)

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2025-04-11 10:50:04 -04:00 committed by GitHub
parent 13401465c9
commit 4ca2f32ac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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