CLOUDSTACK-6079:

fixed issue: if public traffic is on a physical network isolated by VLAN,
and guest traffic is on an another physical network isolated by VXLAN,
public traffic's broadcast type is updated to VXLAN by mistake.

submitted-by: mail@ynojima.net
This commit is contained in:
Marcus Sorensen 2014-02-20 23:23:58 -07:00
parent c04fb68fc7
commit 96355dca4b
1 changed files with 11 additions and 9 deletions

View File

@ -3587,15 +3587,17 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
// For public traffic, get isolation method of physical network and update the public network accordingly
// each broadcast type will individually need to be qualified for support of public traffic
List<String> isolationMethods = network.getIsolationMethods();
if ((isolationMethods.size() == 1 && isolationMethods.get(0).toLowerCase().equals("vxlan"))
|| (isolationMethod != null && isolationMethods.contains(isolationMethod) && isolationMethod.toLowerCase().equals("vxlan"))) {
// find row in networks table that is defined as 'Public', created when zone was deployed
NetworkVO publicNetwork = _networksDao.listByZoneAndTrafficType(network.getDataCenterId(),TrafficType.Public).get(0);
if (publicNetwork != null) {
s_logger.debug("setting public network " + publicNetwork + " to broadcast type vxlan");
publicNetwork.setBroadcastDomainType(BroadcastDomainType.Vxlan);
_networksDao.persist(publicNetwork);
if (TrafficType.Public.equals(trafficType)){
List<String> isolationMethods = network.getIsolationMethods();
if ((isolationMethods.size() == 1 && isolationMethods.get(0).toLowerCase().equals("vxlan"))
|| (isolationMethod != null && isolationMethods.contains(isolationMethod) && isolationMethod.toLowerCase().equals("vxlan"))) {
// find row in networks table that is defined as 'Public', created when zone was deployed
NetworkVO publicNetwork = _networksDao.listByZoneAndTrafficType(network.getDataCenterId(),TrafficType.Public).get(0);
if (publicNetwork != null) {
s_logger.debug("setting public network " + publicNetwork + " to broadcast type vxlan");
publicNetwork.setBroadcastDomainType(BroadcastDomainType.Vxlan);
_networksDao.persist(publicNetwork);
}
}
}