Skip to content

Commit c0b920f

Browse files
nvazquezyadvr
authored andcommitted
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.
1 parent 0bb20a7 commit c0b920f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ public VxlanGuestNetworkGuru() {
5555
@Override
5656
protected boolean canHandle(NetworkOffering offering, final NetworkType networkType, final PhysicalNetwork physicalNetwork) {
5757
// This guru handles only Guest Isolated network that supports Source nat service
58-
if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && offering.getGuestType() == Network.GuestType.Isolated &&
59-
isMyIsolationMethod(physicalNetwork)) {
58+
if (networkType == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) &&
59+
(offering.getGuestType() == Network.GuestType.Isolated || offering.getGuestType() == Network.GuestType.L2) &&
60+
isMyIsolationMethod(physicalNetwork)) {
6061
return true;
6162
} else {
62-
s_logger.trace("We only take care of Guest networks of type " + GuestType.Isolated + " in zone of type " + NetworkType.Advanced);
63+
s_logger.trace("We only take care of Guest networks of type " + GuestType.Isolated + " or " + GuestType.L2 + " in zone of type " + NetworkType.Advanced);
6364
return false;
6465
}
6566
}
@@ -72,6 +73,10 @@ public Network design(NetworkOffering offering, DeploymentPlan plan, Network use
7273
return null;
7374
}
7475

76+
if (offering.getGuestType() == GuestType.L2 && network.getBroadcastUri() != null) {
77+
String vxlan = BroadcastDomainType.getValue(network.getBroadcastUri());
78+
network.setBroadcastUri(BroadcastDomainType.Vxlan.toUri(vxlan));
79+
}
7580
network.setBroadcastDomainType(BroadcastDomainType.Vxlan);
7681

7782
return network;

0 commit comments

Comments
 (0)