rhtyd closed pull request #2448: CLOUDSTACK-10274: L2 network refused to be designed on VXLAN physical network URL: https://github.com/apache/cloudstack/pull/2448
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java b/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java index c065bd191d0..35f588fd567 100644 --- a/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java +++ b/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java @@ -55,11 +55,12 @@ public VxlanGuestNetworkGuru() { @Override protected boolean canHandle(NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork) { // This guru handles only Guest Isolated network that supports Source nat service - if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && offering.getGuestType() == Network.GuestType.Isolated && - isMyIsolationMethod(physicalNetwork)) { + if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && + (offering.getGuestType() == Network.GuestType.Isolated || offering.getGuestType() == Network.GuestType.L2) && + isMyIsolationMethod(physicalNetwork)) { return true; } else { - s_logger.trace("We only take care of Guest networks of type " + GuestType.Isolated + " in zone of type " + NetworkType.Advanced); + s_logger.trace("We only take care of Guest networks of type " + GuestType.Isolated + " or " + GuestType.L2 + " in zone of type " + NetworkType.Advanced); return false; } } @@ -72,6 +73,10 @@ public Network design(NetworkOffering offering, DeploymentPlan plan, Network use return null; } + if (offering.getGuestType() == GuestType.L2 && network.getBroadcastUri() != null) { + String vxlan = BroadcastDomainType.getValue(network.getBroadcastUri()); + network.setBroadcastUri(BroadcastDomainType.Vxlan.toUri(vxlan)); + } network.setBroadcastDomainType(BroadcastDomainType.Vxlan); return network; ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services