This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new 9ac32aa  server: VPC redundant vrs run on same hypervisor (#3421)
9ac32aa is described below

commit 9ac32aae385457392aaa7dccd799624a669490e3
Author: Wei Zhou <[email protected]>
AuthorDate: Sat Jun 29 08:39:36 2019 +0200

    server: VPC redundant vrs run on same hypervisor (#3421)
    
    For VPC supports redundant VRs, when start the second VR, the 
pod/cluster/host of first VR should be added to avoid list. This provides 
higher availability.
    
    The network VRs have the same process already.
---
 server/src/com/cloud/network/router/NetworkHelperImpl.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/src/com/cloud/network/router/NetworkHelperImpl.java 
b/server/src/com/cloud/network/router/NetworkHelperImpl.java
index fa17e7b..1262158 100644
--- a/server/src/com/cloud/network/router/NetworkHelperImpl.java
+++ b/server/src/com/cloud/network/router/NetworkHelperImpl.java
@@ -375,8 +375,13 @@ public class NetworkHelperImpl implements NetworkHelper {
         final List<Long> networkIds = 
_routerDao.getRouterNetworks(router.getId());
 
         DomainRouterVO routerToBeAvoid = null;
+        List<DomainRouterVO> routerList = null;
         if (networkIds.size() != 0) {
-            final List<DomainRouterVO> routerList = 
_routerDao.findByNetwork(networkIds.get(0));
+            routerList = _routerDao.findByNetwork(networkIds.get(0));
+        } else if (router.getVpcId() != null) {
+            routerList = _routerDao.listByVpcId(router.getVpcId());
+        }
+        if (routerList != null) {
             for (final DomainRouterVO rrouter : routerList) {
                 if (rrouter.getHostId() != null && 
rrouter.getIsRedundantRouter() && rrouter.getState() == State.Running) {
                     if (routerToBeAvoid != null) {

Reply via email to