From 223e032b742a7ec45a0b2f209b478a543b1d559a Mon Sep 17 00:00:00 2001 From: Wolfgang Link Date: Tue, 27 Jun 2017 15:12:03 +0200 Subject: [PATCH] Remove guest states to ensure no old states are exists --- PVE/API2/Qemu.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index eb7d6dde..40e68ddd 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -526,6 +526,9 @@ __PACKAGE__->register_method({ PVE::AccessControl::add_vm_to_pool($vmid, $pool) if $pool; }; + # ensure no old replication state are exists + PVE::ReplicationState::delete_guest_states($vmid); + return $rpcenv->fork_worker('qmrestore', $vmid, $authuser, $realcmd); }; @@ -534,6 +537,9 @@ __PACKAGE__->register_method({ # test after locking PVE::Cluster::check_vmid_unused($vmid); + # ensure no old replication state are exists + PVE::ReplicationState::delete_guest_states($vmid); + my $realcmd = sub { my $vollist = [];