From 44666b63336ed2169a1a61bf1fb13ed4bcc87b03 Mon Sep 17 00:00:00 2001 From: Alex Huang Date: Fri, 8 Jul 2011 00:05:29 -0700 Subject: [PATCH] fixed the problem that vms in starting state were not being cleaned up when management server restarts --- server/src/com/cloud/vm/VirtualMachineManagerImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index a2ef6fee5a6..e8a75cc865e 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -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 profile = new VirtualMachineProfileImpl(vm);