cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/feature/minvrversion to b586439
Date Tue, 03 Feb 2015 12:18:39 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/feature/minvrversion 552f2ae60 -> b586439c9


CLOUDSTACK-8197 create MinVRVersion config item


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

Branch: refs/heads/feature/minvrversion
Commit: b586439c9f20539c914693c5baef8d90877a34a3
Parents: 552f2ae
Author: Daan Hoogland <daan@onecht.net>
Authored: Tue Feb 3 13:18:15 2015 +0100
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue Feb 3 13:18:15 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b586439c/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/b586439c/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..b71aa96 100644
--- 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.6.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/b586439c/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 0c7b3ed..ead4682 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -38,6 +38,7 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import com.cloud.network.Networks;
+
 import org.apache.log4j.Logger;
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.context.CallContext;
@@ -47,6 +48,7 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationSe
 import org.apache.cloudstack.framework.config.ConfigDepot;
 import org.apache.cloudstack.framework.config.ConfigKey;
 import org.apache.cloudstack.framework.config.Configurable;
+import org.apache.cloudstack.framework.config.ConfigKey.Scope;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.framework.messagebus.MessageBus;
 import org.apache.cloudstack.framework.messagebus.PublishScope;
@@ -3327,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/b586439c/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/b586439c/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/b586439c/server/src/com/cloud/network/router/NetworkHelperImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/NetworkHelperImpl.java b/server/src/com/cloud/network/router/NetworkHelperImpl.java
index 968251c..eb6a609 100644
--- a/server/src/com/cloud/network/router/NetworkHelperImpl.java
+++ b/server/src/com/cloud/network/router/NetworkHelperImpl.java
@@ -66,7 +66,6 @@ import com.cloud.network.Network;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Networks.IsolationType;
-import com.cloud.network.VirtualNetworkApplianceService;
 import com.cloud.network.addr.PublicIp;
 import com.cloud.network.dao.IPAddressDao;
 import com.cloud.network.dao.NetworkDao;
@@ -163,7 +162,7 @@ public class NetworkHelperImpl implements NetworkHelper {
     public boolean sendCommandsToRouter(final VirtualRouter router, final Commands cmds)
throws AgentUnavailableException, ResourceUnavailableException {
         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 : " + VirtualNetworkApplianceService.MinVRVersion);
+                    + ", minimal required version : " + NetworkOrchestrationService.MinVRVersion.valueIn(router.getDataCenterId()));
             throw new ResourceUnavailableException("Unable to send command. Router requires
upgrade", VirtualRouter.class, router.getId());
         }
         Answer[] answers = null;
@@ -284,8 +283,9 @@ public class NetworkHelperImpl implements NetworkHelper {
         if (router.getTemplateVersion() == null) {
             return false;
         }
+        long dcid = router.getDataCenterId();
         final String trimmedVersion = Version.trimRouterVersion(router.getTemplateVersion());
-        return Version.compare(trimmedVersion, VirtualNetworkApplianceService.MinVRVersion)
>= 0;
+        return Version.compare(trimmedVersion, NetworkOrchestrationService.MinVRVersion.valueIn(dcid))
>= 0;
     }
 
     protected DomainRouterVO start(DomainRouterVO router, final User user, final Account
caller, final Map<Param, Object> params, final DeploymentPlan planToDeploy)


Mime
View raw message