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/master to df3dea5
Date Fri, 01 May 2015 13:28:30 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master fdea7eb47 -> df3dea58a


CLOUDSTACK-6139: Fix regression, allow zone level systemvm localstorage config

>From b3f18e7d74a0f09db9977554a6c7648b7edbc33d, the zone level systemvm local
storage setting never worked as it needed to be moved to config depot.

(cherry picked from commit 279efb04324249a2e1a5487b58b40a723baf4600)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java


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

Branch: refs/heads/master
Commit: df3dea58a243c7dc4ed77a9cdbd4e02d1961ba47
Parents: fdea7eb
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Fri May 1 15:24:04 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Fri May 1 15:27:40 2015 +0200

----------------------------------------------------------------------
 api/src/com/cloud/dc/DataCenter.java            | 10 +++++--
 .../lb/ElasticLoadBalancerManagerImpl.java      |  2 +-
 .../lb/InternalLoadBalancerVMManagerImpl.java   |  2 +-
 server/src/com/cloud/configuration/Config.java  | 18 ------------
 .../configuration/ConfigurationManagerImpl.java |  4 +--
 .../consoleproxy/ConsoleProxyManagerImpl.java   |  4 +--
 .../deploy/DeploymentPlanningManagerImpl.java   | 31 +++++++++++++-------
 .../VirtualNetworkApplianceManagerImpl.java     |  3 +-
 .../SecondaryStorageManagerImpl.java            |  2 +-
 9 files changed, 36 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/api/src/com/cloud/dc/DataCenter.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/dc/DataCenter.java b/api/src/com/cloud/dc/DataCenter.java
index 4ee95e6..6cd054e 100644
--- a/api/src/com/cloud/dc/DataCenter.java
+++ b/api/src/com/cloud/dc/DataCenter.java
@@ -16,18 +16,22 @@
 // under the License.
 package com.cloud.dc;
 
-import java.util.Map;
-
+import com.cloud.org.Grouping;
 import org.apache.cloudstack.acl.InfrastructureEntity;
 import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
+import org.apache.cloudstack.framework.config.ConfigKey;
 
-import com.cloud.org.Grouping;
+import java.util.Map;
 
 /**
  *
  */
 public interface DataCenter extends InfrastructureEntity, Grouping, Identity, InternalIdentity
{
+    public static final String SystemVMUseLocalStorageCK = "system.vm.use.local.storage";
+    public static final ConfigKey<Boolean> UseSystemVMLocalStorage = new ConfigKey<Boolean>(Boolean.class,
SystemVMUseLocalStorageCK, "Advanced", "false",
+            "Indicates whether to use local storage pools or shared storage pools for system
VMs.", true, ConfigKey.Scope.Zone, null);
+
     public enum NetworkType {
         Basic, Advanced,
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
index 0415bae..d853299 100644
--- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
+++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
@@ -290,7 +290,7 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements
Elast
         }
         _mgmtCidr = _configDao.getValue(Config.ManagementNetwork.key());
 
-        boolean useLocalStorage = Boolean.parseBoolean(configs.get(Config.SystemVMUseLocalStorage.key()));
+        boolean useLocalStorage = Boolean.parseBoolean(configs.get(DataCenter.SystemVMUseLocalStorageCK));
 
         _elasticLbVmRamSize = NumbersUtil.parseInt(configs.get(Config.ElasticLoadBalancerVmMemory.key()),
DEFAULT_ELB_VM_RAMSIZE);
         _elasticLbvmCpuMHz = NumbersUtil.parseInt(configs.get(Config.ElasticLoadBalancerVmCpuMhz.key()),
DEFAULT_ELB_VM_CPU_MHZ);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
index 3b8be5b..affbd5c 100644
--- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
+++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
@@ -380,7 +380,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements
In
 
         //if offering wasn't set, try to get the default one
         if (_internalLbVmOfferingId == 0L) {
-            final boolean useLocalStorage = Boolean.parseBoolean(configs.get(Config.SystemVMUseLocalStorage.key()));
+            final boolean useLocalStorage = Boolean.parseBoolean(configs.get(DataCenter.SystemVMUseLocalStorageCK));
             ServiceOfferingVO newOff =
                     new ServiceOfferingVO("System Offering For Internal LB VM", 1, InternalLoadBalancerVMManager.DEFAULT_INTERNALLB_VM_RAMSIZE,
                             InternalLoadBalancerVMManager.DEFAULT_INTERNALLB_VM_CPU_MHZ,
null, null, true, null,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/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 1d0a387..8dcddc8 100644
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -686,14 +686,6 @@ public enum Config {
             "The mount point on the Management Server for Secondary Storage.",
             null),
 //    UpgradeURL("Advanced", ManagementServer.class, String.class, "upgrade.url", "http://example.com:8080/client/agent/update.zip",
"The upgrade URL is the URL of the management server that agents will connect to in order
to automatically upgrade.", null),
-    SystemVMUseLocalStorage(
-            "Advanced",
-            ManagementServer.class,
-            Boolean.class,
-            "system.vm.use.local.storage",
-            "false",
-            "Indicates whether to use local storage pools or shared storage pools for system
VMs.",
-            null, ConfigKey.Scope.Zone.toString()),
     SystemVMAutoReserveCapacity(
             "Advanced",
             ManagementServer.class,
@@ -2025,16 +2017,6 @@ public enum Config {
     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", 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",
-            ConfigKey.Scope.Zone.toString()),
     InternalLbVmServiceOfferingId(
             "Advanced",
             ManagementServer.class,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 06eff48..a739695 100644
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -575,11 +575,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements
Configurati
             } catch (Throwable e) {
                 throw new CloudRuntimeException("Failed to update storage.network.device2
in host_details due to exception ", e);
             }
-        } else if (Config.SystemVMUseLocalStorage.key().equalsIgnoreCase(name)) {
+        } else if (DataCenter.SystemVMUseLocalStorageCK.equalsIgnoreCase(name)) {
             if (s_logger.isDebugEnabled()) {
                 s_logger.debug("Config 'system.vm.use.local.storage' changed to value:" +
value + ", need to update System VM offerings");
             }
-            boolean useLocalStorage = Boolean.parseBoolean(_configDao.getValue(Config.SystemVMUseLocalStorage.key()));
+            boolean useLocalStorage = Boolean.parseBoolean(_configDao.getValue(DataCenter.SystemVMUseLocalStorageCK));
             ServiceOfferingVO serviceOffering = _serviceOfferingDao.findByName(ServiceOffering.consoleProxyDefaultOffUniqueName);
             if (serviceOffering != null) {
                 serviceOffering.setUseLocalStorage(useLocalStorage);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index 8a065dc..bfcef5f 100644
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -1208,7 +1208,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements
ConsoleProxy
             _disableRpFilter = true;
         }
 
-        value = configs.get(Config.SystemVMUseLocalStorage.key());
+        value = configs.get(DataCenter.SystemVMUseLocalStorageCK);
         if (value != null && value.equalsIgnoreCase("true")) {
             _useLvm = true;
         }
@@ -1238,7 +1238,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements
ConsoleProxy
 
         _itMgr.registerGuru(VirtualMachine.Type.ConsoleProxy, this);
 
-        boolean useLocalStorage = Boolean.parseBoolean(configs.get(Config.SystemVMUseLocalStorage.key()));
+        boolean useLocalStorage = Boolean.parseBoolean(configs.get(DataCenter.SystemVMUseLocalStorageCK));
 
         //check if there is a default service offering configured
         String cpvmSrvcOffIdStr = configs.get(Config.ConsoleProxyServiceOffering.key());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index 7345c2a..44a8ac4 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -45,6 +45,8 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.messagebus.MessageBus;
 import org.apache.cloudstack.framework.messagebus.MessageSubscriber;
 import org.apache.cloudstack.managed.context.ManagedContextTimerTask;
@@ -132,7 +134,7 @@ import com.cloud.vm.dao.VMInstanceDao;
 
 @Local(value = {DeploymentPlanningManager.class})
 public class DeploymentPlanningManagerImpl extends ManagerBase implements DeploymentPlanningManager,
Manager, Listener,
-StateListener<State, VirtualMachine.Event, VirtualMachine> {
+StateListener<State, VirtualMachine.Event, VirtualMachine>, Configurable {
 
     private static final Logger s_logger = Logger.getLogger(DeploymentPlanningManagerImpl.class);
     @Inject
@@ -200,8 +202,6 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
     protected StoragePoolHostDao _poolHostDao;
 
     @Inject
-    protected DataCenterDao _zoneDao;
-    @Inject
     protected VolumeDao _volsDao;
     @Inject
     protected CapacityManager _capacityMgr;
@@ -762,6 +762,16 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
         return false;
     }
 
+    @Override
+    public String getConfigComponentName() {
+        return DeploymentPlanningManagerImpl.class.getSimpleName();
+    }
+
+    @Override
+    public ConfigKey<?>[] getConfigKeys() {
+        return new ConfigKey<?>[] {DataCenter.UseSystemVMLocalStorage};
+    }
+
     class HostReservationReleaseChecker extends ManagedContextTimerTask {
         @Override
         protected void runInContext() {
@@ -1290,20 +1300,21 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
             DiskProfile diskProfile = new DiskProfile(toBeCreated, diskOffering, vmProfile.getHypervisorType());
             boolean useLocalStorage = false;
             if (vmProfile.getType() != VirtualMachine.Type.User) {
-                String ssvmUseLocalStorage = _configDao.getValue(Config.SystemVMUseLocalStorage.key());
-
-                DataCenterVO zone = _zoneDao.findById(plan.getDataCenterId());
-
+                DataCenterVO zone = _dcDao.findById(plan.getDataCenterId());
                 // It should not happen to have a "null" zone here. There can be NO instance
if there is NO zone,
                 // so this part of the code would never be reached if no zone has been created.
-                //
                 // Added the check and the comment just to make it clear.
                 boolean zoneUsesLocalStorage = zone != null ? zone.isLocalStorageEnabled()
: false;
-
+                boolean ssvmUseLocalStorage = DataCenter.UseSystemVMLocalStorage.value();
+                if (zone != null) {
+                    ssvmUseLocalStorage = DataCenter.UseSystemVMLocalStorage.valueIn(plan.getDataCenterId());
+                }
+                s_logger.debug("Checking if we need local storage for systemvms is needed
for zone id=" + plan.getDataCenterId() + " with system.vm.use.local.storage=" + ssvmUseLocalStorage);
                 // Local storage is used for the NON User VMs if, and only if, the Zone is
marked to use local storage AND
                 // the global settings (ssvmUseLocalStorage) is set to true. Otherwise, the
global settings won't be applied.
-                if (ssvmUseLocalStorage.equalsIgnoreCase("true") && zoneUsesLocalStorage)
{
+                if (ssvmUseLocalStorage && zoneUsesLocalStorage) {
                     useLocalStorage = true;
+                    s_logger.debug("SystemVMs will use local storage for zone id=" + plan.getDataCenterId());
                 }
             } else {
                 useLocalStorage = diskOffering.getUseLocalStorage();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/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 ca99688..c7e0c29 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -631,8 +631,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine>
{
 
         _agentMgr.registerForHostEvents(new SshKeysDistriMonitor(_agentMgr, _hostDao, _configDao),
true, false, false);
 
-        final boolean useLocalStorage = Boolean.parseBoolean(configs.get(Config.SystemVMUseLocalStorage.key()));
-
+        final boolean useLocalStorage = Boolean.parseBoolean(configs.get(DataCenter.SystemVMUseLocalStorageCK));
         ServiceOfferingVO offering = new ServiceOfferingVO("System Offering For Software
Router", 1, _routerRamSize, _routerCpuMHz, null, null, true, null, ProvisioningType.THIN,
                 useLocalStorage, true, null, true, VirtualMachine.Type.DomainRouter, true);
         offering.setUniqueName(ServiceOffering.routerDefaultOffUniqueName);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df3dea58/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
b/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
index 6abb421..4dc6dbb 100644
--- a/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
+++ b/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
@@ -875,7 +875,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements
Secondar
         if(_serviceOffering == null || !_serviceOffering.getSystemUse()){
             int ramSize = NumbersUtil.parseInt(_configDao.getValue("ssvm.ram.size"), DEFAULT_SS_VM_RAMSIZE);
             int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("ssvm.cpu.mhz"), DEFAULT_SS_VM_CPUMHZ);
-            _useLocalStorage = Boolean.parseBoolean(configs.get(Config.SystemVMUseLocalStorage.key()));
+            _useLocalStorage = Boolean.parseBoolean(configs.get(DataCenter.SystemVMUseLocalStorageCK));
             _serviceOffering =
                 new ServiceOfferingVO("System Offering For Secondary Storage VM", 1, ramSize,
cpuFreq, null, null, false, null,
                         Storage.ProvisioningType.THIN,  _useLocalStorage, true, null, true,
VirtualMachine.Type.SecondaryStorageVm, true);


Mime
View raw message