cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/4.2 to 784bef7
Date Thu, 25 Jul 2013 22:11:34 GMT
Updated Branches:
  refs/heads/4.2 05d278556 -> 784bef766


CLOUDSTACK-2536: fix the regression introduced by 4c81ea69c4e8326cc81a0e2607f6a6d99645ce5f


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

Branch: refs/heads/4.2
Commit: 784bef766c5ece7165cd37dcc2994111846ef586
Parents: 05d2785
Author: Edison Su <sudison@gmail.com>
Authored: Thu Jul 25 15:10:49 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Thu Jul 25 15:11:17 2013 -0700

----------------------------------------------------------------------
 .../com/cloud/resource/ResourceManagerImpl.java    | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/784bef76/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 43b1b2a..12b9749 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -216,8 +216,6 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
     PlannerHostReservationDao _plannerHostReserveDao;
     @Inject
     protected DedicatedResourceDao           _dedicatedDao;
-    @Inject
-    protected ConfigurationServer _configServer;
 
     protected List<? extends Discoverer> _discoverers;
 
@@ -463,7 +461,6 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
 
         List<ClusterVO> result = new ArrayList<ClusterVO>();
 
-        long clusterId = 0;
         ClusterVO cluster = new ClusterVO(dcId, podId, clusterName);
         cluster.setHypervisorType(cmd.getHypervisor());
 
@@ -480,14 +477,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
             ex.addProxyObject(zone.getUuid(), "dcId");
             throw ex;
         }
-        clusterId = cluster.getId();
         result.add(cluster);
 
-        ClusterDetailsVO cluster_detail_cpu = new ClusterDetailsVO(clusterId, "cpuOvercommitRatio",
_configServer.getConfigValue(Config.CPUOverprovisioningFactor.key(), null, null));
-        ClusterDetailsVO cluster_detail_ram = new ClusterDetailsVO(clusterId, "memoryOvercommitRatio",
_configServer.getConfigValue(Config.MemOverprovisioningFactor.key(), null, null));
-        _clusterDetailsDao.persist(cluster_detail_cpu);
-        _clusterDetailsDao.persist(cluster_detail_ram);
-
         if (clusterType == Cluster.ClusterType.CloudManaged) {
             return result;
         }
@@ -497,6 +488,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
         details.put("url", url);
         details.put("username", username);
         details.put("password", password);
+        details.put("cpuOvercommitRatio", _configDao.getValue(Config.CPUOverprovisioningFactor.key()));
+        details.put("memoryOvercommitRatio", _configDao.getValue(Config.MemOverprovisioningFactor.key()));
         _clusterDetailsDao.persist(cluster.getId(), details);
 
         boolean success = false;
@@ -516,7 +509,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
 
             List<HostVO> hosts = new ArrayList<HostVO>();
             Map<? extends ServerResource, Map<String, String>> resources = null;
-            resources = discoverer.find(dcId, podId, clusterId, uri, username, password,
null);
+            resources = discoverer.find(dcId, podId, cluster.getId(), uri, username, password,
null);
 
             if (resources != null) {
                 for (Map.Entry<? extends ServerResource, Map<String, String>>
entry : resources.entrySet()) {
@@ -537,8 +530,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
             throw new DiscoveryException("Unable to add the external cluster");
         } finally {
             if (!success) {
-                _clusterDetailsDao.deleteDetails(clusterId);
-                _clusterDao.remove(clusterId);
+                _clusterDetailsDao.deleteDetails(cluster.getId());
+                _clusterDao.remove(cluster.getId());
             }
         }
     }


Mime
View raw message