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.5 to 06de2d6
Date Wed, 13 May 2015 07:33:22 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 9e3c7d309 -> 06de2d629


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 #244


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

Branch: refs/heads/4.5
Commit: 06de2d6292352d771931883979dcd8f38793427e
Parents: 9e3c7d3
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:33:16 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/06de2d62/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 2984e3f..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.5.0";
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/06de2d62/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 5412ee4..62aec8f 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.5.0",
+            "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/06de2d62/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 244ce47..093f113 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -46,6 +46,7 @@ import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMNetworkMapDao;
 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;
@@ -3328,12 +3329,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/06de2d62/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 00cd108..f77e12b 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;
 
@@ -551,7 +550,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/06de2d62/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 b054b0e..6f7ef43 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/06de2d62/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 c09634f..46463cd 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3792,7 +3792,7 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State,
VirtualMachine.
     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;
@@ -4427,8 +4427,10 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State,
VirtualMachine.
         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