I tried a few things, including throwing a CloudRuntimeException in several places where I thought it made sense, such as an empty AgentUnavailableException catch block, but it doesn't seem to do anything at all, I don't see it in the logs, even though I do see the debug code that I placed next to it. So I give up for now :-)
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 7bf04ec..0373690 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -685,7 +685,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use if (status) { return status; } else { - return status; + throw new CloudRuntimeException( + "Unable to stop the virtual machine" + vm ); } } diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl. index 2c2986f..e320ff1 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -1083,7 +1083,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac vmGuru.finalizeStop(profile, answer); } catch (AgentUnavailableException e) { + s_logger.error("Unable to stop vm, agent unavailable: " + e.toString()); + throw new CloudRuntimeException("Unable to stop vm, agent unavailable"); } catch (OperationTimedoutException e) { + s_logger.error("Unable to stop vm, operation timed out: " + e.toString()); + throw new CloudRuntimeException("Unable to stop vm, operation timed out"); } finally { if (!stopped) { if (!forced) { On Thu, Apr 25, 2013 at 2:06 PM, Chip Childers <chip.child...@sungard.com>wrote: > On Thu, Apr 25, 2013 at 02:01:56PM -0600, Marcus Sorensen wrote: > > I didn't mark this one as a blocker, but it's still pretty bad for > someone > > managing VMs in an automated fashion. Trying to stop a VM when the KVM > > agent is disconnected reports success. > > > > https://issues.apache.org/jira/browse/CLOUDSTACK-2195 > > I'll pull a fix in, if we have one ready before the final blockers. > Otherwise I'd pull it into a 4.1.1 release. >