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