[pve-devel] [PATCH guest-common 1/6] Cleanup fix for stateless jobs.

Wolfgang Link w.link at proxmox.com
Wed Dec 13 15:46:23 CET 2017


If a VM config was stolen or migrated through HA there is no state on that node.
It must be possible to cleanup the remote-side without state.
---
 PVE/Replication.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/PVE/Replication.pm b/PVE/Replication.pm
index c25ed44..ce2109e 100644
--- a/PVE/Replication.pm
+++ b/PVE/Replication.pm
@@ -200,8 +200,14 @@ sub replicate {
 
 	if ($remove_job eq 'full' && $jobcfg->{target} ne $local_node) {
 	    # remove all remote volumes
+	    my $store_list = [];
+	    foreach my $volid (@$sorted_volids) {
+		my ($storeid) = PVE::Storage::parse_volume_id($volid);
+		push @$store_list, $storeid;
+	    }
+
 	    my $ssh_info = PVE::Cluster::get_ssh_info($jobcfg->{target});
-	    remote_prepare_local_job($ssh_info, $jobid, $vmid, [], $state->{storeid_list}, 0, undef, 1, $logfunc);
+	    remote_prepare_local_job($ssh_info, $jobid, $vmid, [], $store_list, 0, undef, 1, $logfunc);
 
 	}
 	# remove all local replication snapshots (lastsync => 0)
-- 
2.11.0





More information about the pve-devel mailing list