When cloning from a snapshot, VM-state-related properties would be accidentally copied, see commit "partially fix #6805: api: clone: properly remove all snapshot-related info". Detect and remove such left-over properties upon VM start.
Signed-off-by: Fiona Ebner <[email protected]> Link: https://lore.proxmox.com/[email protected] (cherry picked from commit 0db14e60109ea91a558f0f08594583588ef9ec66) [FE: drop running-nets-host-mtu which does not exist in PVE 8] Signed-off-by: Fiona Ebner <[email protected]> --- src/PVE/QemuServer.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 8bc55def..94d12a92 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -5905,6 +5905,20 @@ sub vm_migrate_alloc_nbd_disks { return $nbd; } +my sub remove_left_over_vmstate_opts { + my ($vmid, $conf) = @_; + + my $found; + for my $opt (qw(runningmachine runningcpu)) { + if (defined($conf->{$opt})) { + print "No VM state set, removing left-over option '$opt'\n"; + delete $conf->{$opt}; + $found = 1; + } + } + PVE::QemuConfig->write_config($vmid, $conf) if $found; +} + # see vm_start_nolock for parameters, additionally: # migrate_opts: # storagemap = parsed storage map for allocating NBD disks @@ -6434,6 +6448,8 @@ sub vm_start_nolock { } delete $conf->@{qw(lock vmstate runningmachine runningcpu)}; PVE::QemuConfig->write_config($vmid, $conf); + } elsif (!$conf->{vmstate}) { + remove_left_over_vmstate_opts($vmid, $conf); } PVE::GuestHelpers::exec_hookscript($conf, $vmid, 'post-start'); -- 2.39.5 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
