wido closed pull request #2720: Disable creation of new Basic Networking Zones
URL: https://github.com/apache/cloudstack/pull/2720
 
 
   

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/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index b5aca5d9f10..ac28a5bda08 100644
--- 
a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -2114,41 +2114,16 @@ public Network createGuestNetwork(final long 
networkOfferingId, final String nam
         // Validate zone
         final DataCenterVO zone = _dcDao.findById(zoneId);
         if (zone.getNetworkType() == NetworkType.Basic) {
-            // In Basic zone the network should have aclType=Domain, 
domainId=1, subdomainAccess=true
-            if (aclType == null || aclType != ACLType.Domain) {
-                throw new InvalidParameterValueException("Only AclType=Domain 
can be specified for network creation in Basic zone");
-            }
-
-            // Only one guest network is supported in Basic zone
-            final List<NetworkVO> guestNetworks = 
_networksDao.listByZoneAndTrafficType(zone.getId(), TrafficType.Guest);
-            if (!guestNetworks.isEmpty()) {
-                throw new InvalidParameterValueException("Can't have more than 
one Guest network in zone with network type " + NetworkType.Basic);
-            }
-
-            // if zone is basic, only Shared network offerings w/o source nat 
service are allowed
-            if (!(ntwkOff.getGuestType() == GuestType.Shared && 
!_networkModel.areServicesSupportedByNetworkOffering(ntwkOff.getId(), 
Service.SourceNat))) {
-                throw new InvalidParameterValueException("For zone of type " + 
NetworkType.Basic + " only offerings of " + "guestType " + GuestType.Shared + " 
with disabled "
-                        + Service.SourceNat.getName() + " service are 
allowed");
-            }
-
-            if (domainId == null || domainId != Domain.ROOT_DOMAIN) {
-                throw new InvalidParameterValueException("Guest network in 
Basic zone should be dedicated to ROOT domain");
-            }
+            /*
+                Basic Networking zones are deprecated are no longer supported 
for creation
 
-            if (subdomainAccess == null) {
-                subdomainAccess = true;
-            } else if (!subdomainAccess) {
-                throw new InvalidParameterValueException("Subdomain access 
should be set to true for the" + " guest network in the Basic zone");
-            }
-
-            if (vlanId == null) {
-                vlanId = Vlan.UNTAGGED;
-            } else {
-                if (!vlanId.equalsIgnoreCase(Vlan.UNTAGGED)) {
-                    throw new InvalidParameterValueException("Only vlan " + 
Vlan.UNTAGGED + " can be created in " + "the zone of type " + 
NetworkType.Basic);
-                }
-            }
+                Advanced Networking with a Shared Network with Security 
Grouping enabled offers the same and even
+                more functionality to end-users.
 
+                Therefor creation of new Basic Networking Zones is disabled so 
that it can be removed in a future release
+            */
+            throw new InvalidParameterValueException("Creating new Basic 
Networking zones is no longer supported. " +
+                    "Please created a Advanced Networking zone with a Shared 
Network.");
         } else if (zone.getNetworkType() == NetworkType.Advanced) {
             if (zone.isSecurityGroupEnabled()) {
                 if (ipv6) {
@@ -2290,11 +2265,6 @@ public Network createGuestNetwork(final long 
networkOfferingId, final String nam
 
         checkL2OfferingServices(ntwkOff);
 
-        // No cidr can be specified in Basic zone
-        if (zone.getNetworkType() == NetworkType.Basic && cidr != null) {
-            throw new 
InvalidParameterValueException("StartIp/endIp/gateway/netmask can't be 
specified for zone of type " + NetworkType.Basic);
-        }
-
         // Check if cidr is RFC1918 compliant if the network is Guest Isolated 
for IPv4
         if (cidr != null && ntwkOff.getGuestType() == 
Network.GuestType.Isolated && ntwkOff.getTrafficType() == TrafficType.Guest) {
             if (!NetUtils.validateGuestCidr(cidr)) {


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to