You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 87f5150
Browse filesBrowse the repository at this point in the historyBrowse files
//this method should return Guest network offering in Enabled state; and this network offering should be unique, otherwise Runtime exception is going to be thrown
thrownewCloudRuntimeException("Unable to find network offering in state " + NetworkOffering.State.Enabled + ", traffic type " + TrafficType.Guest + " and guest type " + GuestType.Shared);
1159
-
}
1160
-
1161
-
if (offerings.size() > 1) {
1162
-
thrownewCloudRuntimeException("Found more than 1 network offering in state " + NetworkOffering.State.Enabled + ", traffic type " + TrafficType.Guest + " and guest type " + GuestType.Shared);
1163
-
1164
-
}
1165
-
returnofferings.get(0);
1166
-
}
1167
1151
1168
1152
@Override
1169
1153
@DB
@@ -1886,12 +1870,12 @@ public Network createNetwork(CreateNetworkCmd cmd) throws InsufficientCapacityEx
thrownewInvalidParameterValueException("Can't have more than one Guest network in zone with network type " + NetworkType.Basic);
1902
+
}
1903
+
1904
+
//if zone is basic, only Shared network offerings w/o source nat service are allowed
1905
+
if (!(networkOffering.getGuestType() == GuestType.Shared && !areServicesSupportedByNetworkOffering(networkOffering.getId(), Service.SourceNat))) {
1906
+
thrownewInvalidParameterValueException("For zone of type " + NetworkType.Basic + " only offerings of guestType " + GuestType.Shared + " with disabled " + Service.SourceNat.getName() + " service are allowed");
1907
+
}
1908
+
1909
+
} elseif (zone.isSecurityGroupEnabled()) {
1910
+
//Only Account specific Isolated network with sourceNat service disabled are allowed in security group enabled zone
thrownewInvalidParameterValueException("Only Account specific Isolated network with sourceNat service disabled are allowed in security group enabled zone");
1914
+
}
1925
1915
}
1926
-
1916
+
1927
1917
1928
1918
// allow isDefault to be set only for Shared network and Isolated networks with source nat disabled service
thrownewInvalidParameterValueException("isDefault parameter can be passed in only for network creation of guestType Shared or Isolated with source nat service disabled; and only in Advance zone");
1937
1929
}
1938
1930
}
1939
-
1940
-
// Don't allow to create network with vlan that already exists in the system
// Cidr for Shared networks and Isolated networks w/o source nat service can't be NULL - 2.2.x limitation, remove after we introduce support for multiple ip ranges
1991
+
// In Advance zone Cidr for Shared networks and Isolated networks w/o source nat service can't be NULL - 2.2.x limitation, remove after we introduce support for multiple ip ranges
1999
1992
// with different Cidrs for the same Shared network
thrownewInvalidParameterValueException("StartIp/endIp/gateway/netmask are required when create network of type " + Network.GuestType.Shared + " and network of type " + GuestType.Isolated + " with service " + Service.SourceNat.getName() + " disabled");
1996
+
}
1997
+
1998
+
//No cidr can be specified in Basic zone
1999
+
if (zone.getNetworkType() == NetworkType.Basic && cidr != null) {
2000
+
thrownewInvalidParameterValueException("StartIp/endIp/gateway/netmask can't be specified for zone of type " + NetworkType.Basic);
2003
2001
}
2004
2002
2005
2003
// Check if cidr is RFC1918 compliant if the network is Guest Isolated
@@ -3285,6 +3283,7 @@ public Network updateNetwork(long networkId, String name, String displayText, Ac
0 commit comments