Skip to content

Commit a5856a6

Browse files
nvazquezrohityadavcloud
authored andcommitted
network: allow advanced zones with security groups and VXLAN isolation type (apache#2693)
Not possible to deploy an Advanced zone with Security Groups, and VXLAN isolation method on KVM. Exception: "Unable to convert network offering with specified id to network profile" is logged.
1 parent 779649f commit a5856a6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

server/src/com/cloud/network/guru/DirectNetworkGuru.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,20 @@ public TrafficType[] getSupportedTrafficType() {
133133
return TrafficTypes;
134134
}
135135

136+
/**
137+
* True for Advanced zones, with VXLAN isolation method and Security Groups enabled
138+
*/
139+
private boolean isMyIsolationMethodVxlanWithSecurityGroups(NetworkOffering offering, DataCenter dc, PhysicalNetwork physnet) {
140+
return dc.getNetworkType().equals(NetworkType.Advanced) &&
141+
_networkModel.areServicesSupportedByNetworkOffering(offering.getId(), Service.SecurityGroup) &&
142+
physnet.getIsolationMethods().contains("VXLAN");
143+
}
144+
136145
protected boolean canHandle(NetworkOffering offering, DataCenter dc, PhysicalNetwork physnet) {
137146
// this guru handles only Guest networks in Advance zone with source nat service disabled
138-
if (dc.getNetworkType() == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) && isMyIsolationMethod(physnet) && offering.getGuestType() == GuestType.Shared
147+
boolean vxlanWithSecurityGroups = isMyIsolationMethodVxlanWithSecurityGroups(offering, dc, physnet);
148+
if (dc.getNetworkType() == NetworkType.Advanced && isMyTrafficType(offering.getTrafficType()) &&
149+
(isMyIsolationMethod(physnet) || vxlanWithSecurityGroups) && offering.getGuestType() == GuestType.Shared
139150
&& !_ntwkOfferingSrvcDao.isProviderForNetworkOffering(offering.getId(), Network.Provider.NuageVsp)
140151
&& !_ntwkOfferingSrvcDao.isProviderForNetworkOffering(offering.getId(), Network.Provider.NiciraNvp)) {
141152
return true;

0 commit comments

Comments
 (0)