[pve-devel] [PATCH pve-manager 4/4] Remove guest form replication.cfg it no vms exists.

Wolfgang Link w.link at proxmox.com
Fri Jun 2 11:21:48 CEST 2017


---
 PVE/Replication.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/Replication.pm b/PVE/Replication.pm
index ae486e16..c0f80778 100644
--- a/PVE/Replication.pm
+++ b/PVE/Replication.pm
@@ -90,8 +90,11 @@ sub job_status {
 
 	die "internal error - not implemented" if $jobcfg->{type} ne 'local';
 
-	# skip non existing vms
-	next if !$vms->{ids}->{$vmid};
+	# skip non existing vms or delete if remove_job is set
+	if (!$vms->{ids}->{$vmid}) {
+	    delete_job($jobid) if $jobcfg->{remove_job};
+	    next;
+	}
 
 	# only consider guest on local node
 	next if $vms->{ids}->{$vmid}->{node} ne $local_node;
-- 
2.11.0





More information about the pve-devel mailing list