machine: correctly select pve machine version for non pinned windows guests

When we don't have a specific machine version on a windows guest, we
use the creation meta info to pin the machine version. Currently we
always append the pve machine version from the current installed KVM
version, which is not necessarily the version we pinned the guest to.

Instead, use the same mechanism as for normal version pinned machines,
which use 'pve0'.

For non-windows machines, we use the current QEMU machine version so
we should use the pve machine version from that too, so that stays the
same.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Link: https://lore.proxmox.com/20250404125345.3244659-4-d.csapak@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2025-04-04 14:53:39 +02:00 committed by Thomas Lamprecht
parent bafc9f4187
commit 3f589e8c7e

View File

@ -240,11 +240,12 @@ sub get_vm_machine {
}
}
$machine = windows_get_pinned_machine_version($machine, $base_version, $kvmversion);
} else {
$arch //= 'x86_64';
$machine ||= default_machine_for_arch($arch);
my $pvever = get_pve_version($kvmversion);
$machine .= "+pve$pvever";
}
$arch //= 'x86_64';
$machine ||= default_machine_for_arch($arch);
my $pvever = get_pve_version($kvmversion);
$machine .= "+pve$pvever";
}
if ($machine !~ m/\+pve\d+?(?:\.pxe)?$/) {