You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2013/05/29 15:28:13 UTC

[1/4] git commit: updated refs/heads/master to cea9e39

Updated Branches:
  refs/heads/master e3a104aa5 -> cea9e3919


CLOUDSTACK-2477: [GSLB] CloudStack currently allows admin to map LB rule
of one account to GSLB rule of a different account

ensuring account id of GSLB rule and LB rule are same


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

Branch: refs/heads/master
Commit: c8a0c40a2f50fdabab085a0d6896edcdb8226ef4
Parents: 2b93969
Author: Murali Reddy <mu...@gmail.com>
Authored: Wed May 29 17:01:54 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Wed May 29 18:54:35 2013 +0530

----------------------------------------------------------------------
 .../gslb/GlobalLoadBalancingRulesServiceImpl.java  |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8a0c40a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
index a803f9f..96ac76e 100644
--- a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
+++ b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
@@ -204,6 +204,10 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR
 
             _accountMgr.checkAccess(caller, null, true, loadBalancer);
 
+            if (gslbRule.getAccountId() != loadBalancer.getAccountId()) {
+                throw new InvalidParameterValueException("GSLB rule and load balancer rule does not belong to same account");
+            }
+
             if (loadBalancer.getState() == LoadBalancer.State.Revoke) {
                 throw new InvalidParameterValueException("Load balancer ID " + loadBalancer.getUuid()  + " is in revoke state");
             }


[2/4] git commit: updated refs/heads/master to cea9e39

Posted by mu...@apache.org.
add upgrade path to "cloud.dns.name" global config value.

fail creating GSLB rule if DNS name is not confiugred


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

Branch: refs/heads/master
Commit: 2b9396982323e17116515806836cd2f615968557
Parents: e3a104a
Author: Murali Reddy <mu...@gmail.com>
Authored: Wed May 29 15:48:13 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Wed May 29 18:54:35 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/configuration/Config.java     |    2 +-
 .../gslb/GlobalLoadBalancingRulesServiceImpl.java  |    3 ++-
 setup/db/db/schema-410to420.sql                    |    2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b939698/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index e1d3751..7c88aae 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -408,7 +408,7 @@ public enum Config {
     VMSnapshotMax("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.max", "10", "Maximum vm snapshots for a vm", null),
     VMSnapshotCreateWait("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.create.wait", "1800", "In second, timeout for create vm snapshot", null),
 
-    CloudDnsName("Advanced", ManagementServer.class, String.class, "cloud.dns.name", "default", " DNS name of the cloud", null),
+    CloudDnsName("Advanced", ManagementServer.class, String.class, "cloud.dns.name", null, "DNS name of the cloud for the GSLB service", null),
 	
     BlacklistedRoutes("Advanced", VpcManager.class, String.class, "blacklisted.routes", null, "Routes that are blacklisted, can not be used for Static Routes creation for the VPC Private Gateway",
 	           "routes", ConfigurationParameterScope.zone.toString()),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b939698/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
index a1865c6..a803f9f 100644
--- a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
+++ b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
@@ -126,7 +126,8 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR
             throw new InvalidParameterValueException("Invalid region ID: " + regionId);
         }
 
-        if (!region.checkIfServiceEnabled(Region.Service.Gslb)) {
+        String providerDnsName = _globalConfigDao.getValue(Config.CloudDnsName.key());
+        if (!region.checkIfServiceEnabled(Region.Service.Gslb) || (providerDnsName == null)) {
             throw new CloudRuntimeException("GSLB service is not enabled in region : " + region.getName());
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2b939698/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index cf4e98d..ec79237 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -332,6 +332,8 @@ CREATE TABLE `cloud`.`global_load_balancer_lb_rule_map` (
   CONSTRAINT `fk_lb_rule_id` FOREIGN KEY(`lb_rule_id`) REFERENCES `load_balancing_rules`(`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'cloud.dns.name', null, 'DNS name of the cloud for the GSLB service');
+
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.cpus', '40', 'The default maximum number of cpu cores that can be used for an account');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.memory', '40960', 'The default maximum memory (in MiB) that can be used for an account');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.primary.storage', '200', 'The default maximum primary storage space (in GiB) that can be used for an account');


[4/4] git commit: updated refs/heads/master to cea9e39

Posted by mu...@apache.org.
fixing unit tests to comply with bug "CLOUDSTACK-2477: [GSLB]
CloudStack currently allows admin to map LB rule of one account to GSLB
rule of a different account"


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

Branch: refs/heads/master
Commit: cea9e3919a613c71da5d95acf631355ab2b6d018
Parents: ee31728
Author: Murali Reddy <mu...@gmail.com>
Authored: Wed May 29 18:52:12 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Wed May 29 18:54:36 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cea9e391/server/test/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImplTest.java
----------------------------------------------------------------------
diff --git a/server/test/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImplTest.java b/server/test/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImplTest.java
index 1c281a0..ab54534 100644
--- a/server/test/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImplTest.java
+++ b/server/test/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImplTest.java
@@ -577,8 +577,14 @@ public class GlobalLoadBalancingRulesServiceImplTest extends TestCase {
         LoadBalancerVO lbRule1 = new LoadBalancerVO();
         lbRule1.setState(FirewallRule.State.Active);
         Field networkIdField1 = LoadBalancerVO.class.getSuperclass().getDeclaredField("networkId");
+        Field accountIdField1 = LoadBalancerVO.class.getSuperclass().getDeclaredField("accountId");
+        Field domainIdField1 = LoadBalancerVO.class.getSuperclass().getDeclaredField("domainId");
         networkIdField1.setAccessible(true);
+        accountIdField1.setAccessible(true);
+        domainIdField1.setAccessible(true);
         networkIdField1.set(lbRule1, new Long(1));
+        accountIdField1.set(lbRule1, new Long(3));
+        domainIdField1.set(lbRule1, new Long(1));
         Field idField1 = LoadBalancerVO.class.getSuperclass().getDeclaredField("id");
         idField1.setAccessible(true);
         idField1.set(lbRule1, new Long(1));
@@ -586,8 +592,14 @@ public class GlobalLoadBalancingRulesServiceImplTest extends TestCase {
         LoadBalancerVO lbRule2 = new LoadBalancerVO();
         lbRule2.setState(FirewallRule.State.Active);
         Field networkIdField2 = LoadBalancerVO.class.getSuperclass().getDeclaredField("networkId");
+        Field accountIdField2 = LoadBalancerVO.class.getSuperclass().getDeclaredField("accountId");
+        Field domainIdField2 = LoadBalancerVO.class.getSuperclass().getDeclaredField("domainId");
         networkIdField2.setAccessible(true);
+        accountIdField2.setAccessible(true);
+        domainIdField2.setAccessible(true);
         networkIdField2.set(lbRule2, new Long(1));
+        accountIdField2.set(lbRule2, new Long(3));
+        domainIdField2.set(lbRule2, new Long(1));
         Field idField2 = LoadBalancerVO.class.getSuperclass().getDeclaredField("id");
         idField2.setAccessible(true);
         idField2.set(lbRule2, new Long(2));
@@ -611,6 +623,7 @@ public class GlobalLoadBalancingRulesServiceImplTest extends TestCase {
         try {
             gslbServiceImpl.assignToGlobalLoadBalancerRule(assignCmd);
         } catch (InvalidParameterValueException e) {
+            s_logger.info(e.getMessage());
             Assert.assertTrue(e.getMessage().contains("Load balancer rule specified should be in unique zone"));
         }
     }


[3/4] git commit: updated refs/heads/master to cea9e39

Posted by mu...@apache.org.
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/master
Commit: ee317287b3981200ec1a54ee096600fd24a16475
Parents: c8a0c40
Author: Murali Reddy <mu...@gmail.com>
Authored: Wed May 29 18:50:06 2013 +0530
Committer: Murali Reddy <mu...@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) {