This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.15 in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.15 by this push: new 47b7288 server: Disable VR health check for VPC without tiers (#4888) 47b7288 is described below commit 47b72883e21b336dc0257694722e13b5e824d368 Author: Rakesh <rakeshv....@gmail.com> AuthorDate: Mon Apr 5 09:03:45 2021 +0200 server: Disable VR health check for VPC without tiers (#4888) If the VPC has redundant VR's but doesnt have any tiers or there are no running VM's in a VPC then disable the gateway check for VR --- .../network/router/VirtualNetworkApplianceManagerImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 2b6032f..28855db 100644 --- a/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -1543,9 +1543,15 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_BASIC_INTERVAL, RouterHealthChecksBasicInterval.value().toString()); command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ADVANCED_INTERVAL, RouterHealthChecksAdvancedInterval.value().toString()); String excludedTests = RouterHealthChecksToExclude.valueIn(router.getDataCenterId()); - if (router.getIsRedundantRouter() && RedundantState.BACKUP.equals(router.getRedundantState())) { - excludedTests = excludedTests.isEmpty() ? BACKUP_ROUTER_EXCLUDED_TESTS : excludedTests + "," + BACKUP_ROUTER_EXCLUDED_TESTS; + if (router.getIsRedundantRouter()) { + // Disable gateway check if VPC has no tiers or no active VM's in it + final List<Long> routerGuestNtwkIds = _routerDao.getRouterNetworks(router.getId()); + if (RedundantState.BACKUP.equals(router.getRedundantState()) || + routerGuestNtwkIds == null || routerGuestNtwkIds.isEmpty()) { + excludedTests = excludedTests.isEmpty() ? BACKUP_ROUTER_EXCLUDED_TESTS : excludedTests + "," + BACKUP_ROUTER_EXCLUDED_TESTS; + } } + command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_EXCLUDED, excludedTests); command.setHealthChecksConfig(getRouterHealthChecksConfig(router)); command.setReconfigureAfterUpdate(reconfigure);