[ https://issues.apache.org/jira/browse/CLOUDSTACK-9114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16467324#comment-16467324 ]
ASF GitHub Bot commented on CLOUDSTACK-9114: -------------------------------------------- rhtyd commented on a change in pull request #2508: CLOUDSTACK-9114: Reduce VR downtime during network restart URL: https://github.com/apache/cloudstack/pull/2508#discussion_r186706446 ########## File path: server/src/com/cloud/network/vpc/VpcManagerImpl.java ########## @@ -2435,4 +2444,43 @@ public boolean isSrcNatIpRequired(long vpcOfferingId) { final Map<Network.Service, Set<Network.Provider>> vpcOffSvcProvidersMap = getVpcOffSvcProvidersMap(vpcOfferingId); return vpcOffSvcProvidersMap.get(Network.Service.SourceNat).contains(Network.Provider.VPCVirtualRouter); } + + private boolean rollingRestartVpc(final Vpc vpc, final ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException { + s_logger.debug("Performing rolling restart of routers of VPC " + vpc); + _ntwkMgr.destroyExpendableRouters(_routerDao.listByVpcId(vpc.getId()), context); + + final DeployDestination dest = new DeployDestination(_dcDao.findById(vpc.getZoneId()), null, null, null); + final List<DomainRouterVO> oldRouters = _routerDao.listByVpcId(vpc.getId()); + + // Create a new router + if (oldRouters.size() > 0) { + vpc.setRollingRestart(true); + } + startVpc(vpc, dest, context); + if (oldRouters.size() > 0) { Review comment: @rafaelweingartner if there are any existing old routers, we do rolling restart which is to deploy a new VR and then destroy old VRs. The `setRollingRestart` is a way to tell lower facade to treat deployment like for redundant routers, i.e. expect upto 2 VRs at a given point which is seen in changes in `VirtualRouterElement.java`. The startVpc will call the facade to deploy suitable number of routers. If there is only one old VPC VR, and if rolling restart is `true` this will cause the lower layers to deploy a new VPC VR. After that, we set the rolling restart to false which works great both in case of rVR (expected VRs is 2) and non-rVRs (expected VRs becomes 1), and finally we destroy old VR. If the VPC has rVRs, a new backup router is created when `startVpc` is called otherwise this will simply reconfigure existing VRs. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > restartnetwork with cleanup should not update/restart both routers at once > -------------------------------------------------------------------------- > > Key: CLOUDSTACK-9114 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9114 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) > Reporter: Wei Zhou > Assignee: Wei Zhou > Priority: Major > > for now, restartnetwork with cleanup will stop both RVRs at first, then start > two new RVRs. > to reduce the downtime of network, we'd better restart the RVRs one by one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)