mirror of https://github.com/apache/cloudstack.git
Update redundant router status even router is down
We need to update the status to UNKNOWN if router is down(also ensure we can't contact the router if the state is Stopped in our database).
This commit is contained in:
parent
4369b0ba96
commit
843e41752f
|
|
@ -844,8 +844,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
final List<DomainRouterVO> routers = _routerDao.listVirtualUpByHostId(null);
|
||||
s_logger.debug("Found " + routers.size() + " running routers. ");
|
||||
final List<DomainRouterVO> routers = _routerDao.listVirtualByHostId(null);
|
||||
s_logger.debug("Found " + routers.size() + " routers. ");
|
||||
|
||||
updateRoutersRedundantState(routers);
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,15 @@ public interface DomainRouterDao extends GenericDao<DomainRouterVO, Long> {
|
|||
public List<DomainRouterVO> listByHostId(Long hostId);
|
||||
public List<DomainRouterVO> listByLastHostId(Long hostId);
|
||||
|
||||
/**
|
||||
* list virtual machine routers by host id.
|
||||
* pass in null to get all
|
||||
* virtual machine routers.
|
||||
* @param hostId id of the host. null if to get all.
|
||||
* @return list of DomainRouterVO
|
||||
*/
|
||||
public List<DomainRouterVO> listVirtualByHostId(Long hostId);
|
||||
|
||||
/**
|
||||
* list virtual machine routers by host id. exclude destroyed, stopped, expunging VM,
|
||||
* pass in null to get all
|
||||
|
|
|
|||
|
|
@ -145,6 +145,16 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
|
|||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DomainRouterVO> listVirtualByHostId(Long hostId) {
|
||||
SearchCriteria<DomainRouterVO> sc = HostUpSearch.create();
|
||||
if (hostId != null) {
|
||||
sc.setParameters("host", hostId);
|
||||
}
|
||||
sc.setJoinParameters("network", "guestType", GuestIpType.Virtual);
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DomainRouterVO> listVirtualUpByHostId(Long hostId) {
|
||||
SearchCriteria<DomainRouterVO> sc = HostUpSearch.create();
|
||||
|
|
|
|||
Loading…
Reference in New Issue