Skip to content

Commit 73f4929

Browse files
committed
server: exclude webserver/apache2 check in VPC VR without tiers
1 parent d1e1aa5 commit 73f4929

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,16 +1568,23 @@ private SetMonitorServiceCommand createMonitorServiceCommand(DomainRouterVO rout
15681568
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ENABLED, RouterHealthChecksEnabled.value().toString());
15691569
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_BASIC_INTERVAL, RouterHealthChecksBasicInterval.value().toString());
15701570
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ADVANCED_INTERVAL, RouterHealthChecksAdvancedInterval.value().toString());
1571+
1572+
final List<Long> routerGuestNtwkIds = _routerDao.getRouterNetworks(router.getId());
15711573
String excludedTests = RouterHealthChecksToExclude.valueIn(router.getDataCenterId());
15721574
if (router.getIsRedundantRouter()) {
15731575
// Disable gateway check if VPC has no tiers or no active VM's in it
1574-
final List<Long> routerGuestNtwkIds = _routerDao.getRouterNetworks(router.getId());
15751576
if (RedundantState.BACKUP.equals(router.getRedundantState()) ||
15761577
routerGuestNtwkIds == null || routerGuestNtwkIds.isEmpty()) {
15771578
excludedTests = excludedTests.isEmpty() ? BACKUP_ROUTER_EXCLUDED_TESTS : excludedTests + "," + BACKUP_ROUTER_EXCLUDED_TESTS;
15781579
}
15791580
}
15801581

1582+
if (router.getVpcId() != null && CollectionUtils.isEmpty(routerGuestNtwkIds)) {
1583+
// If router belongs to a VPC and has no guest network associated, exclude webserver service which is expected to fail
1584+
String webserverServiceName = _monitorServiceDao.getServiceByName(MonitoringService.Service.Webserver.toString()).getServiceName();
1585+
excludedTests = excludedTests.isEmpty() ? webserverServiceName : excludedTests + "," + webserverServiceName;
1586+
}
1587+
15811588
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_EXCLUDED, excludedTests);
15821589
command.setHealthChecksConfig(routerHealthCheckConfig);
15831590
command.setReconfigureAfterUpdate(reconfigure);

0 commit comments

Comments
 (0)