[pve-devel] [RFC pve-container 3/3] Destroy all remote and local replication datasets when a CT will destroyed.
Wolfgang Link
w.link at proxmox.com
Wed Apr 12 12:41:14 CEST 2017
---
src/PVE/API2/LXC.pm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 47dcb08..a913982 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -19,6 +19,7 @@ use PVE::LXC::Migrate;
use PVE::API2::LXC::Config;
use PVE::API2::LXC::Status;
use PVE::API2::LXC::Snapshot;
+use PVE::ReplicationTools;
use PVE::JSONSchema qw(get_standard_option);
use base qw(PVE::RESTHandler);
@@ -614,6 +615,9 @@ __PACKAGE__->register_method({
die $running_error_msg if PVE::LXC::check_running($vmid);
+ # return without error if vm has no replica job
+ PVE::ReplicationTools::destroy_replica($vmid);
+
PVE::LXC::destroy_lxc_container($storage_cfg, $vmid, $conf);
PVE::AccessControl::remove_vm_access($vmid);
PVE::Firewall::remove_vmfw_conf($vmid);
--
2.1.4
More information about the pve-devel
mailing list