[pve-devel] [PATCH] HA resources check before destroying vm
    Alen Grizonic 
    a.grizonic at proxmox.com
       
    Fri Aug 28 13:26:40 CEST 2015
    
    
  
---
 PVE/API2/Qemu.pm | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 513b224..a6ad831 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1142,6 +1142,10 @@ __PACKAGE__->register_method({
 
 	my $storecfg = PVE::Storage::config();
 
+	if (PVE::HA::Config::vm_is_ha_managed($vmid)) {
+	    die "unable to delete VM $vmid - used in HA resources\n";
+	}
+
 	my $realcmd = sub {
 	    my $upid = shift;
 
-- 
2.1.4
    
    
More information about the pve-devel
mailing list