destroy VM: test for running VM before starting background task

This commit is contained in:
Dietmar Maurer 2015-11-07 12:09:01 +01:00
parent 0eeafe9f78
commit db593da26c

View File

@ -1164,6 +1164,10 @@ __PACKAGE__->register_method({
die "unable to remove VM $vmid - used in HA resources\n"
if PVE::HA::Config::vm_is_ha_managed($vmid);
# early tests (repeat after locking)
die "VM $vmid is running - destroy failed\n"
if PVE::QemuServer::check_running($vmid);
my $realcmd = sub {
my $upid = shift;