fixed the problem that vms in starting state were not being cleaned up when management server restarts

This commit is contained in:
Alex Huang 2011-07-08 00:05:29 -07:00
parent 4c0fce700b
commit 44666b6333
1 changed files with 4 additions and 1 deletions

View File

@ -940,7 +940,10 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
throw new ConcurrentOperationException("VM is being operated on.");
}
} catch (NoTransitionException e1) {
throw new CloudRuntimeException("We cannot stop " + vm + " when it is in state " + vm.getState());
if (!forced) {
throw new CloudRuntimeException("We cannot stop " + vm + " when it is in state " + vm.getState());
}
s_logger.debug("Unable to transition the state but we're moving on because it's forced stop");
}
VirtualMachineProfile<T> profile = new VirtualMachineProfileImpl<T>(vm);