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

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


[PATCH v2] error message changed
---
 src/PVE/API2/LXC.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 35f2c24..935493b 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -532,6 +532,9 @@ __PACKAGE__->register_method({
 
 	my $storage_cfg = cfs_read_file("storage.cfg");
 
+	if (PVE::HA::Config::vm_is_ha_managed($vmid)) {
+	    die "unable to remove 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