From 59fe551ebbcb5c9fcfeede85f0df197acf225781 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Tue, 23 Aug 2011 18:13:14 -0700 Subject: [PATCH] bug 11214: Don't try to start the running router again It's very like caused by StartRouterCmd sent to the running router. I can reproduce it by issue a StartRouterCmd to a running redundant router. And this patch should the following exception: Exception: com.cloud.exception.ResourceUnavailableException: Resource [VirtualNetworkApplianceManagerImpl$$EnhancerByCGLIB$$565b4d45:0] is unreachable: There are already two redundant routers with IP 10.91.32.126, they are r-5-VM(5) and r-4-VM(4) status 11214: resolved fixed --- .../network/router/VirtualNetworkApplianceManagerImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 7f48cbe0ac2..f6208894947 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -988,6 +988,11 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian return this.start(router, user, caller, params, null); } + if (router.getState() == State.Running) { + s_logger.debug("Redundant router " + router.getInstanceName() + " is already running!"); + return router; + } + DataCenterDeployment plan = new DataCenterDeployment(0, null, null, null, null); DomainRouterVO result = null; assert router.getIsRedundantRouter();