[pve-devel] [RFC qemu-server 3/3] Destroy all remote and local replication datasets when a VM will destroyed.

Wolfgang Link w.link at proxmox.com
Mon Apr 3 16:53:38 CEST 2017


---
 PVE/API2/Qemu.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 20491c9..dbcb323 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1326,11 +1326,15 @@ __PACKAGE__->register_method({
 
 	    syslog('info', "destroy VM $vmid: $upid\n");
 
+	    #return without error if vm has no replica job
+	    PVE::ReplicaTools::destroy_replica($vmid);
+
 	    PVE::QemuServer::vm_destroy($storecfg, $vmid, $skiplock);
 
 	    PVE::AccessControl::remove_vm_access($vmid);
 
             PVE::Firewall::remove_vmfw_conf($vmid);
+
 	};
 
 	return $rpcenv->fork_worker('qmdestroy', $vmid, $authuser, $realcmd);
-- 
2.1.4





More information about the pve-devel mailing list