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.
This commit is contained in:
Wei Zhou 2019-06-29 08:39:36 +02:00 committed by Rohit Yadav
parent 2408783355
commit 9ac32aae38
1 changed files with 6 additions and 1 deletions

View File

@ -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) {