cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject git commit: updated refs/heads/4.5 to 1e8476d
Date Tue, 06 Jan 2015 09:39:50 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 744c1a1b0 -> 1e8476d38


CLOUDSTACK-8140: CS fails to start after secstorage/consoleproxy.service.offering is set to
uuid
(cherry picked from commit 84c44b63140e8acf2336549040bda9c0a8f2ff66)


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

Branch: refs/heads/4.5
Commit: 1e8476d38a44037f7d5c24d7d2bb7e9c131a19a0
Parents: 744c1a1
Author: Wei Zhou <w.zhou@tech.leaseweb.com>
Authored: Tue Jan 6 10:23:44 2015 +0100
Committer: Wei Zhou <w.zhou@tech.leaseweb.com>
Committed: Tue Jan 6 10:26:04 2015 +0100

----------------------------------------------------------------------
 server/src/com/cloud/configuration/Config.java  |  6 +++---
 .../consoleproxy/ConsoleProxyManagerImpl.java   | 18 ++++++++----------
 .../SecondaryStorageManagerImpl.java            | 20 +++++++++++++-------
 setup/db/db/schema-442to450.sql                 |  2 ++
 4 files changed, 26 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1e8476d3/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 a486d3d..091a3e9 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -1783,7 +1783,7 @@ public enum Config {
     ConsoleProxyServiceOffering(
             "Advanced",
             ManagementServer.class,
-            Long.class,
+            String.class,
             "consoleproxy.service.offering",
             null,
             "Uuid of the service offering used by console proxy; if NULL - system offering
will be used",
@@ -1791,10 +1791,10 @@ public enum Config {
     SecondaryStorageServiceOffering(
             "Advanced",
             ManagementServer.class,
-            Long.class,
+            String.class,
             "secstorage.service.offering",
             null,
-            "Service offering used by secondary storage; if NULL - system offering will be
used",
+            "Uuid of the service offering used by secondary storage; if NULL - system offering
will be used",
             null),
     HaTag("Advanced", ManagementServer.class, String.class, "ha.tag", null, "HA tag defining
that the host marked with this tag can be used for HA purposes only", null),
     ImplicitHostTags(

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1e8476d3/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 14d782a..7f2b52a 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -91,7 +91,6 @@ import com.cloud.network.dao.IPAddressVO;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.rules.RulesManager;
-import com.cloud.offering.DiskOffering;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offering.ServiceOffering;
 import com.cloud.offerings.dao.NetworkOfferingDao;
@@ -105,7 +104,6 @@ import com.cloud.storage.Storage;
 import com.cloud.storage.StoragePoolStatus;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
 import com.cloud.storage.VMTemplateVO;
-import com.cloud.storage.dao.DiskOfferingDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
@@ -196,8 +194,6 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
     @Inject
     private ServiceOfferingDao _offeringDao;
     @Inject
-    private DiskOfferingDao _diskOfferingDao;
-    @Inject
     private NetworkOfferingDao _networkOfferingDao;
     @Inject
     private PrimaryDataStoreDao _storagePoolDao;
@@ -1254,13 +1250,15 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements
ConsoleProxy
         //check if there is a default service offering configured
         String cpvmSrvcOffIdStr = configs.get(Config.ConsoleProxyServiceOffering.key());
         if (cpvmSrvcOffIdStr != null) {
-            DiskOffering diskOffering = _diskOfferingDao.findByUuid(cpvmSrvcOffIdStr);
-            if (diskOffering == null) {
-                diskOffering = _diskOfferingDao.findById(Long.parseLong(cpvmSrvcOffIdStr));
+            _serviceOffering = _offeringDao.findByUuid(cpvmSrvcOffIdStr);
+            if (_serviceOffering == null) {
+                try {
+                    _serviceOffering = _offeringDao.findById(Long.parseLong(cpvmSrvcOffIdStr));
+                } catch (NumberFormatException ex) {
+                    s_logger.debug("The system service offering specified by global config
is not id, but uuid=" + cpvmSrvcOffIdStr + " for console proxy vm");
+                }
             }
-            if (diskOffering != null) {
-                _serviceOffering = _offeringDao.findById(diskOffering.getId());
-            } else {
+            if (_serviceOffering == null) {
                 s_logger.warn("Can't find system service offering specified by global config,
uuid=" + cpvmSrvcOffIdStr + " for console proxy vm");
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1e8476d3/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 86d94df..25e5b85 100755
--- a/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
+++ b/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
@@ -842,14 +842,20 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements
Secondar
         //check if there is a default service offering configured
         String ssvmSrvcOffIdStr = configs.get(Config.SecondaryStorageServiceOffering.key());
         if (ssvmSrvcOffIdStr != null) {
-            Long ssvmSrvcOffId = Long.parseLong(ssvmSrvcOffIdStr);
-            _serviceOffering = _offeringDao.findById(ssvmSrvcOffId);
-            if (_serviceOffering == null || !_serviceOffering.getSystemUse()) {
-                String msg = "Can't find system service offering id=" + ssvmSrvcOffId + "
for secondary storage vm";
-                s_logger.error(msg);
-                throw new ConfigurationException(msg);
+            _serviceOffering = _offeringDao.findByUuid(ssvmSrvcOffIdStr);
+            if (_serviceOffering == null) {
+                try {
+                    _serviceOffering = _offeringDao.findById(Long.parseLong(ssvmSrvcOffIdStr));
+                } catch (NumberFormatException ex) {
+                    s_logger.debug("The system service offering specified by global config
is not id, but uuid=" + ssvmSrvcOffIdStr + " for secondary storage vm");
+                }
             }
-        } else {
+            if (_serviceOffering == null) {
+                s_logger.warn("Can't find system service offering specified by global config,
uuid=" + ssvmSrvcOffIdStr + " for secondary storage vm");
+            }
+        }
+
+        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()));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1e8476d3/setup/db/db/schema-442to450.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-442to450.sql b/setup/db/db/schema-442to450.sql
index 60c3e45..b268eca 100644
--- a/setup/db/db/schema-442to450.sql
+++ b/setup/db/db/schema-442to450.sql
@@ -990,3 +990,5 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type,
hypervis
 
 INSERT IGNORE INTO `cloud`.`configuration` (`category`, `instance`, `component`, `name`,
`value`, `default_value`, `description`) VALUES ('Advanced', 'DEFAULT', 'ManagementServer',
'xen.heartbeat.timeout' , '180', '120', 'Timeout value to send to the xenheartbeat script
for guarding the self fencing functionality');
 
+UPDATE `cloud`.`configuration` SET description='Uuid of the service offering used by secondary
storage; if NULL - system offering will be used' where name='secstorage.service.offering';
+


Mime
View raw message