diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index a6ad8316..20d73f74 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1142,9 +1142,8 @@ __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"; - } + die "unable to remove VM $vmid - used in HA resources\n" + if PVE::HA::Config::vm_is_ha_managed($vmid); my $realcmd = sub { my $upid = shift;