Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ public String getNetworkTag(long physicalNetworkId, TrafficType trafficType, Hyp
}

sc.setParameters("physicalNetworkId", physicalNetworkId);
sc.setParameters("trafficType", trafficType);
if (trafficType != null) {
sc.setParameters("trafficType", trafficType);
}
List<String> tag = customSearch(sc, null);

return tag.size() == 0 ? null : tag.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String nicA
String brName = createVnetBr(vNetId, trafficLabel, protocol);
intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType, nicAdapter), networkRateKBps);
} else {
String brName = createVnetBr(vNetId, _bridges.get("private"), protocol);
String brName = createVnetBr(vNetId, _bridges.get("guest"), protocol);
intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType, nicAdapter), networkRateKBps);
}
} else {
Expand Down
6 changes: 5 additions & 1 deletion server/src/main/java/com/cloud/network/NetworkModelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1430,11 +1430,11 @@ public String getNetworkTag(HypervisorType hType, Network network) {
return null;
}

NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
Long physicalNetworkId = null;
if (effectiveTrafficType != TrafficType.Guest) {
physicalNetworkId = getNonGuestNetworkPhysicalNetworkId(network, effectiveTrafficType);
} else {
NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
physicalNetworkId = network.getPhysicalNetworkId();
if (physicalNetworkId == null) {
physicalNetworkId = findPhysicalNetworkId(network.getDataCenterId(), offering.getTags(), offering.getTrafficType());
Expand All @@ -1447,6 +1447,10 @@ public String getNetworkTag(HypervisorType hType, Network network) {
return null;
}

if (offering != null && TrafficType.Guest.equals(offering.getTrafficType()) && offering.isSystemOnly()) {
// For private gateway, do not check the Guest traffic type
return _pNTrafficTypeDao.getNetworkTag(physicalNetworkId, null, hType);
}
return _pNTrafficTypeDao.getNetworkTag(physicalNetworkId, effectiveTrafficType, hType);
}

Expand Down