[pve-devel] [PATCH] HA resources check before destroying lxc

Alen Grizonic a.grizonic at proxmox.com
Fri Aug 28 15:03:00 CEST 2015


---
 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 35f2c24..303f0ce 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -532,6 +532,10 @@ __PACKAGE__->register_method({
 
 	my $storage_cfg = cfs_read_file("storage.cfg");
 
+        if (PVE::HA::Config::vm_is_ha_managed($vmid)) {
+	    die "unable to delete CT $vmid - used in HA resources\n";
+        }
+
 	my $code = sub {
 	    # reload config after lock
 	    $conf = PVE::LXC::load_config($vmid);
-- 
2.1.4





More information about the pve-devel mailing list