You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2018/03/06 13:56:52 UTC

[cloudstack] branch 4.11 updated: CLOUDSTACK-10274: L2 network refused to be designed on VXLAN physical network (#2448)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new c0b920f  CLOUDSTACK-10274: L2 network refused to be designed on VXLAN physical network (#2448)
c0b920f is described below

commit c0b920f740f5e5ba33f0e210caf4642edb2b7224
Author: Nicolas Vazquez <ni...@gmail.com>
AuthorDate: Tue Mar 6 10:56:47 2018 -0300

    CLOUDSTACK-10274: L2 network refused to be designed on VXLAN physical network (#2448)
    
    L2 network refused to be designed on VXLAN physical network. Add fix for vxlan issue.
    Add condition for L2 networks which do not allow specifying vlan.
---
 .../src/com/cloud/network/guru/VxlanGuestNetworkGuru.java     | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

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 c065bd1..35f588f 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 class VxlanGuestNetworkGuru extends GuestNetworkGuru {
     @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 class VxlanGuestNetworkGuru extends GuestNetworkGuru {
             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;

-- 
To stop receiving notification emails like this one, please contact
rohit@apache.org.