mirror of https://github.com/apache/cloudstack.git
CS-15398: Fix for dns issue in multiple pods
This commit is contained in:
parent
3e9eea42f0
commit
dd4e19c16f
|
|
@ -2379,7 +2379,7 @@ VirtualMachineGuru<DomainRouterVO>, Listener {
|
|||
}
|
||||
|
||||
//find domR's nic in the network
|
||||
NicVO domrDefaultNic = _nicDao.findByNetworkIdAndType(defaultNic.getNetworkId(), VirtualMachine.Type.DomainRouter);
|
||||
NicVO domrDefaultNic = _nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(), VirtualMachine.Type.DomainRouter, defaultNic.getGateway());
|
||||
return domrDefaultNic.getIp4Address();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ public interface NicDao extends GenericDao<NicVO, Long> {
|
|||
void removeNicsForInstance(long instanceId);
|
||||
|
||||
NicVO findByNetworkIdAndType(long networkId, VirtualMachine.Type vmType);
|
||||
|
||||
NicVO findByIp4AddressAndNetworkId(String ip4Address, long networkId);
|
||||
NicVO findByNetworkIdTypeAndGateway(long networkId, VirtualMachine.Type vmType, String gateway);
|
||||
|
||||
NicVO findDefaultNicForVM(long instanceId);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ public class NicDaoImpl extends GenericDaoBase<NicVO, Long> implements NicDao {
|
|||
AllFieldsSearch = createSearchBuilder();
|
||||
AllFieldsSearch.and("instance", AllFieldsSearch.entity().getInstanceId(), Op.EQ);
|
||||
AllFieldsSearch.and("network", AllFieldsSearch.entity().getNetworkId(), Op.EQ);
|
||||
AllFieldsSearch.and("gateway", AllFieldsSearch.entity().getGateway(), Op.EQ);
|
||||
AllFieldsSearch.and("vmType", AllFieldsSearch.entity().getVmType(), Op.EQ);
|
||||
AllFieldsSearch.and("address", AllFieldsSearch.entity().getIp4Address(), Op.EQ);
|
||||
AllFieldsSearch.and("isDefault", AllFieldsSearch.entity().isDefaultNic(), Op.EQ);
|
||||
|
|
@ -126,6 +127,15 @@ public class NicDaoImpl extends GenericDaoBase<NicVO, Long> implements NicDao {
|
|||
return findOneBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NicVO findByNetworkIdTypeAndGateway(long networkId, VirtualMachine.Type vmType, String gateway) {
|
||||
SearchCriteria<NicVO> sc = AllFieldsSearch.create();
|
||||
sc.setParameters("network", networkId);
|
||||
sc.setParameters("vmType", vmType);
|
||||
sc.setParameters("gateway", gateway);
|
||||
return findOneBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NicVO findByIp4AddressAndNetworkId(String ip4Address, long networkId) {
|
||||
SearchCriteria<NicVO> sc = AllFieldsSearch.create();
|
||||
|
|
|
|||
Loading…
Reference in New Issue