cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject [07/50] [abbrv] git commit: updated refs/heads/vmware-datamodel to 6a8c2bd
Date Fri, 31 May 2013 07:49:05 GMT
CLOUDSTACK-2285: [GSLB] addNetscalerLoadBalancer with GSLB functionality shouldn't be
exposed in basic zone

imposing restriction that NetScaler can only be added when EIP/ELB
service are available in basic zone.


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

Branch: refs/heads/vmware-datamodel
Commit: ee317287b3981200ec1a54ee096600fd24a16475
Parents: c8a0c40
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Wed May 29 18:50:06 2013 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Wed May 29 18:54:36 2013 +0530

----------------------------------------------------------------------
 .../ExternalLoadBalancerDeviceManagerImpl.java     |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ee317287/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
index f93bf7a..04f9682 100644
--- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
@@ -138,6 +138,8 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
     @Inject
     NetworkManager _networkMgr;
     @Inject
+    NetworkDao _networksDao = null;
+    @Inject
     InlineLoadBalancerNicMapDao _inlineLoadBalancerNicMapDao;
     @Inject
     NicDao _nicDao;
@@ -208,6 +210,17 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
         }
 
         zoneId = pNetwork.getDataCenterId();
+        DataCenter dc = _dcDao.findById(zoneId);
+        if (dc.getNetworkType() == DataCenter.NetworkType.Basic) {
+            List<com.cloud.network.dao.NetworkVO> guestNetworks = _networksDao.listByZoneAndTrafficType(dc.getId(),
TrafficType.Guest);
+            com.cloud.network.dao.NetworkVO basicZoneNetwork = guestNetworks.get(0);
+            NetworkOfferingVO ntwkOff = _networkOfferingDao.findById(basicZoneNetwork.getNetworkOfferingId());
+            if (!ntwkOff.getElasticIp() && !ntwkOff.getElasticLb()) {
+                throw new InvalidParameterValueException("Could not add external load balancer
device in to basic zone "
+                        + " with no Elastic IP and Elastic LB services.");
+            }
+        }
+
         PhysicalNetworkServiceProviderVO ntwkSvcProvider = _physicalNetworkServiceProviderDao.findByServiceProvider(pNetwork.getId(),
ntwkDevice.getNetworkServiceProvder());
 
         if (gslbProvider) {


Mime
View raw message