mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix for dns issue in multiple pods
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
parent
eb4e09ec58
commit
a5248f1cfc
@ -2414,7 +2414,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||||||
}
|
}
|
||||||
|
|
||||||
//find domR's nic in the network
|
//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();
|
return domrDefaultNic.getIp4Address();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,8 @@ public interface NicDao extends GenericDao<NicVO, Long> {
|
|||||||
NicVO findByInstanceIdAndNetworkId(long networkId, long instanceId);
|
NicVO findByInstanceIdAndNetworkId(long networkId, long instanceId);
|
||||||
|
|
||||||
NicVO findByInstanceIdAndNetworkIdIncludingRemoved(long networkId, long instanceId);
|
NicVO findByInstanceIdAndNetworkIdIncludingRemoved(long networkId, long instanceId);
|
||||||
|
|
||||||
|
NicVO findByNetworkIdTypeAndGateway(long networkId, VirtualMachine.Type vmType, String gateway);
|
||||||
|
|
||||||
void removeNicsForInstance(long instanceId);
|
void removeNicsForInstance(long instanceId);
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,7 @@ public class NicDaoImpl extends GenericDaoBase<NicVO, Long> implements NicDao {
|
|||||||
AllFieldsSearch = createSearchBuilder();
|
AllFieldsSearch = createSearchBuilder();
|
||||||
AllFieldsSearch.and("instance", AllFieldsSearch.entity().getInstanceId(), Op.EQ);
|
AllFieldsSearch.and("instance", AllFieldsSearch.entity().getInstanceId(), Op.EQ);
|
||||||
AllFieldsSearch.and("network", AllFieldsSearch.entity().getNetworkId(), 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("vmType", AllFieldsSearch.entity().getVmType(), Op.EQ);
|
||||||
AllFieldsSearch.and("address", AllFieldsSearch.entity().getIp4Address(), Op.EQ);
|
AllFieldsSearch.and("address", AllFieldsSearch.entity().getIp4Address(), Op.EQ);
|
||||||
AllFieldsSearch.and("isDefault", AllFieldsSearch.entity().isDefaultNic(), Op.EQ);
|
AllFieldsSearch.and("isDefault", AllFieldsSearch.entity().isDefaultNic(), Op.EQ);
|
||||||
@ -130,6 +131,15 @@ public class NicDaoImpl extends GenericDaoBase<NicVO, Long> implements NicDao {
|
|||||||
return findOneBy(sc);
|
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
|
@Override
|
||||||
public NicVO findByIp4AddressAndNetworkId(String ip4Address, long networkId) {
|
public NicVO findByIp4AddressAndNetworkId(String ip4Address, long networkId) {
|
||||||
SearchCriteria<NicVO> sc = AllFieldsSearch.create();
|
SearchCriteria<NicVO> sc = AllFieldsSearch.create();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user