incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [2/43] git commit: refs/heads/ui-plugins - CLOUDSTACK-737 add xenserver support in UI only XenServer and KVM clusters are allowed in security enabled zone. only shared security enabled networks are allowed in security enabled zone.
Date Fri, 08 Feb 2013 21:10:34 GMT
CLOUDSTACK-737
     add xenserver support in UI
     only XenServer and KVM clusters are allowed in security enabled zone.
     only shared security enabled networks are allowed in security enabled zone.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d7201dfe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d7201dfe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d7201dfe

Branch: refs/heads/ui-plugins
Commit: d7201dfe1f49fb75054e1f0b6922ed21446ad130
Parents: 95aef33
Author: anthony <anthony@cloud.com>
Authored: Thu Jan 24 17:26:51 2013 -0800
Committer: anthony <anthony@cloud.com>
Committed: Thu Jan 24 17:26:51 2013 -0800

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkManagerImpl.java  |   15 +++++++++------
 .../com/cloud/resource/ResourceManagerImpl.java    |    6 ++++++
 ui/scripts/zoneWizard.js                           |    1 -
 3 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d7201dfe/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index bb60dcf..b327391 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -1870,13 +1870,16 @@ public class NetworkManagerImpl implements NetworkManager, Manager,
Listener {
 
         } else if (zone.getNetworkType() == NetworkType.Advanced) {
             if (zone.isSecurityGroupEnabled()) {
-                // Only Account specific Isolated network with sourceNat service disabled
are allowed in security group
+                // Only shared network with sourceNat service disabled are allowed in security
group
                 // enabled zone
-                boolean allowCreation = (ntwkOff.getGuestType() == GuestType.Isolated 
-                        && !_networkModel.areServicesSupportedByNetworkOffering(ntwkOff.getId(),
Service.SourceNat));
-                if (!allowCreation) {
-                    throw new InvalidParameterValueException("Only Account specific Isolated
network with sourceNat " +
-                            "service disabled are allowed in security group enabled zone");
+                if ( ntwkOff.getGuestType() != GuestType.Shared ){
+                    throw new InvalidParameterValueException("Only shared guest network can
be created in security group enabled zone");
+                }
+                if ( _networkModel.areServicesSupportedByNetworkOffering(ntwkOff.getId(),
Service.SourceNat)) {
+                    throw new InvalidParameterValueException("Service SourceNat is not allowed
in security group enabled zone");
+                }
+                if ( _networkModel.areServicesSupportedByNetworkOffering(ntwkOff.getId(),
Service.SecurityGroup)) {
+                    throw new InvalidParameterValueException("network must have SecurityGroup
provider in security group enabled zone");
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d7201dfe/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index f82424a..5817d4d 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -388,6 +388,12 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService,
Ma
             throw new InvalidParameterValueException("Unable to resolve " + cmd.getHypervisor()
+ " to a supported ");
         }
 
+        if (zone.isSecurityGroupEnabled()) {
+            if( hypervisorType != HypervisorType.KVM && hypervisorType != HypervisorType.XenServer
) {
+                throw new InvalidParameterValueException("Don't support hypervisor type "
+ hypervisorType + " in advanced security enabled zone");
+            }
+        }
+
         Cluster.ClusterType clusterType = null;
         if (cmd.getClusterType() != null && !cmd.getClusterType().isEmpty()) {
             clusterType = Cluster.ClusterType.valueOf(cmd.getClusterType());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d7201dfe/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 26838a1..141cd6d 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -373,7 +373,6 @@
 									var nonSupportedHypervisors = {};									
 									if(args.context.zones[0]['network-model']	== "Advanced" && args.context.zones[0]['zone-advanced-sg-enabled']
==	"on") {
 									  firstOption = "KVM";
-										nonSupportedHypervisors["XenServer"] = 1;  //to developers: comment this line if
you need to test Advanced SG-enabled zone with XenServer hypervisor
 										nonSupportedHypervisors["VMware"] = 1;
 										nonSupportedHypervisors["BareMetal"] = 1;
 										nonSupportedHypervisors["Ovm"] = 1;


Mime
View raw message