cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.4 to 7703872
Date Wed, 13 May 2015 07:32:27 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 1e88346e5 -> 7703872bc


backport of CLOUDSTACK-8197 create MinVRVersion config item

Conflicts:
  api/src/com/cloud/network/VirtualNetworkApplianceService.java
  engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #243


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

Branch: refs/heads/4.4
Commit: 7703872bcfde8a17e897c0ad95fde4a19e41cf6c
Parents: 1e88346
Author: Daan Hoogland <daan.hoogland@gmail.com>
Authored: Tue May 12 11:25:37 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Wed May 13 09:31:46 2015 +0200

----------------------------------------------------------------------
 .../com/cloud/network/VirtualNetworkApplianceService.java   | 2 --
 .../orchestration/service/NetworkOrchestrationService.java  | 7 ++++++-
 .../engine/orchestration/NetworkOrchestrator.java           | 8 +++++---
 .../src/com/cloud/agent/manager/MockVmManagerImpl.java      | 5 ++---
 .../com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java    | 9 ++++-----
 .../network/router/VirtualNetworkApplianceManagerImpl.java  | 6 ++++--
 6 files changed, 21 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7703872b/api/src/com/cloud/network/VirtualNetworkApplianceService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/VirtualNetworkApplianceService.java b/api/src/com/cloud/network/VirtualNetworkApplianceService.java
index 6ea1a78..815ae4d 100644
--- a/api/src/com/cloud/network/VirtualNetworkApplianceService.java
+++ b/api/src/com/cloud/network/VirtualNetworkApplianceService.java
@@ -68,6 +68,4 @@ public interface VirtualNetworkApplianceService {
     VirtualRouter findRouter(long routerId);
 
     List<Long> upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd);
-
-    public static final String MinVRVersion = "4.4.1";
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7703872b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
index 1061c4d..9a361cc 100755
--- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
@@ -22,6 +22,7 @@ import java.util.Map;
 
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.ConfigKey.Scope;
 
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
@@ -62,9 +63,13 @@ public interface NetworkOrchestrationService {
     static final String NetworkLockTimeoutCK = "network.lock.timeout";
     static final String GuestDomainSuffixCK = "guest.domain.suffix";
     static final String NetworkThrottlingRateCK = "network.throttling.rate";
+    static final String MinVRVersionCK = "minreq.sysvmtemplate.version";
+
+    static final ConfigKey<String> MinVRVersion = new ConfigKey<String>(String.class,
MinVRVersionCK, "Advanced", "4.4.4",
+            "What version should the Virtual Routers report", true, ConfigKey.Scope.Zone,
null);
 
     static final ConfigKey<Integer> NetworkLockTimeout = new ConfigKey<Integer>(Integer.class,
NetworkLockTimeoutCK, "Network", "600",
-        "Lock wait timeout (seconds) while implementing network", true);
+        "Lock wait timeout (seconds) while implementing network", true, Scope.Global, null);
     static final ConfigKey<String> GuestDomainSuffix = new ConfigKey<String>(String.class,
GuestDomainSuffixCK, "Network", "cloud.internal",
         "Default domain name for vms inside virtualized networks fronted by router", true,
ConfigKey.Scope.Zone, null);
     static final ConfigKey<Integer> NetworkThrottlingRate = new ConfigKey<Integer>("Network",
Integer.class, NetworkThrottlingRateCK, "200",

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7703872b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 20a6257..dbe7874 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -45,6 +45,7 @@ import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.ConfigDepot;
 import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.ConfigKey.Scope;
 import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.framework.messagebus.MessageBus;
@@ -3215,12 +3216,13 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     }
 
     public static final ConfigKey<Integer> NetworkGcWait = new ConfigKey<Integer>(Integer.class,
"network.gc.wait", "Advanced", "600",
-            "Time (in seconds) to wait before shutting down a network that's not in used",
false);
+            "Time (in seconds) to wait before shutting down a network that's not in used",
false, Scope.Global, null);
     public static final ConfigKey<Integer> NetworkGcInterval = new ConfigKey<Integer>(Integer.class,
"network.gc.interval", "Advanced", "600",
-            "Seconds to wait before checking for networks to shutdown", true);
+            "Seconds to wait before checking for networks to shutdown", true, Scope.Global,
null);
 
     @Override
     public ConfigKey<?>[] getConfigKeys() {
-        return new ConfigKey<?>[] {NetworkGcWait, NetworkGcInterval, NetworkLockTimeout,
GuestDomainSuffix, NetworkThrottlingRate};
+        return new ConfigKey<?>[] {NetworkGcWait, NetworkGcInterval, NetworkLockTimeout,
GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion};
     }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7703872b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
index ab583e2..619ecd8 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
@@ -26,8 +26,7 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import com.cloud.network.VirtualNetworkApplianceService;
-
+import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -573,7 +572,7 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
 
     @Override
     public GetDomRVersionAnswer getDomRVersion(GetDomRVersionCmd cmd) {
-        String template_version = "CloudStack Release "+ VirtualNetworkApplianceService.MinVRVersion.toString();
+        String template_version = "CloudStack Release "+ NetworkOrchestrationService.MinVRVersion.defaultValue();
         return new GetDomRVersionAnswer(cmd, null, template_version, UUID.randomUUID().toString());
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7703872b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
index 9594c01..ddd2c0e 100644
--- a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java
@@ -22,18 +22,17 @@ import java.util.List;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.api.response.DomainRouterResponse;
 import org.apache.cloudstack.api.response.NicResponse;
+import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.api.ApiResponseHelper;
 import com.cloud.api.query.vo.DomainRouterJoinVO;
 import com.cloud.maint.Version;
 import com.cloud.network.Networks.TrafficType;
-import com.cloud.network.VirtualNetworkApplianceService;
 import com.cloud.network.router.VirtualRouter;
 import com.cloud.network.router.VirtualRouter.Role;
 import com.cloud.user.Account;
@@ -83,7 +82,7 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase<DomainRouterJoinVO,
         if (router.getTemplateVersion() != null) {
             String routerVersion = Version.trimRouterVersion(router.getTemplateVersion());
             routerResponse.setVersion(routerVersion);
-            routerResponse.setRequiresUpgrade((Version.compare(routerVersion, VirtualNetworkApplianceService.MinVRVersion)
< 0));
+            routerResponse.setRequiresUpgrade((Version.compare(routerVersion, NetworkOrchestrationService.MinVRVersion.valueIn(router.getDataCenterId()))
< 0));
         } else {
             routerResponse.setVersion("UNKNOWN");
             routerResponse.setRequiresUpgrade(true);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7703872b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index e66fcfb..59bd4c6 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3718,7 +3718,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase
implements V
     protected boolean sendCommandsToRouter(final VirtualRouter router, final Commands cmds)
throws AgentUnavailableException {
         if(!checkRouterVersion(router)){
             s_logger.debug("Router requires upgrade. Unable to send command to router:" +
router.getId() + ", router template version : " + router.getTemplateVersion()
-                    + ", minimal required version : " + MinVRVersion);
+                    + ", minimal required version : " + NetworkOrchestrationService.MinVRVersion.valueIn(router.getDataCenterId()));
             throw new CloudRuntimeException("Unable to send command. Upgrade in progress.
Please contact administrator.");
         }
         Answer[] answers = null;
@@ -4355,8 +4355,10 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase
implements V
         if(router.getTemplateVersion() == null){
             return false;
         }
+        long dcid = router.getDataCenterId();
+        final String dcVersion = NetworkOrchestrationService.MinVRVersion.valueIn(dcid);
         final String trimmedVersion = Version.trimRouterVersion(router.getTemplateVersion());
-        return (Version.compare(trimmedVersion, MinVRVersion) >= 0);
+        return (Version.compare(trimmedVersion, dcVersion) >= 0);
     }
 
     private List<Long> rebootRouters(List<DomainRouterVO> routers){


Mime
View raw message