cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject [1/2] git commit: updated refs/heads/4.2 to 941c12d
Date Sat, 10 Aug 2013 19:30:58 GMT
Updated Branches:
  refs/heads/4.2 644f8173e -> 941c12dcd


CLOUDSTACK-4234:Dedicated Resources: When multiple dedication groups are chosen for VM deployment,
dedicated resources belonging to both groups should be considered

Changes:
- Do not add the dedicated resource to avoid list if it is present in the list of resources
to consider for the deployment.


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

Branch: refs/heads/4.2
Commit: 61bd96cb3e6913aac44f2c28211985f13e03440e
Parents: 644f817
Author: Prachi Damle <prachi@cloud.com>
Authored: Sat Aug 10 12:11:56 2013 -0700
Committer: Prachi Damle <prachi@cloud.com>
Committed: Sat Aug 10 12:14:07 2013 -0700

----------------------------------------------------------------------
 .../affinity/ExplicitDedicationProcessor.java      | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61bd96cb/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
b/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
index 9343cd8..3489b57 100644
--- a/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
+++ b/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
@@ -276,7 +276,7 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase
implement
                 List<HostVO> hostList = _hostDao.findByClusterId(dr.getClusterId());
                 for (HostVO host : hostList) {
                     DedicatedResourceVO dHost = _dedicatedDao.findByHostId(host.getId());
-                    if (dHost != null) {
+                    if (dHost != null && !dedicatedResources.contains(dHost)) {
                         avoidList.addHost(host.getId());
                     } else {
                         includeList.addHost(host.getId());
@@ -291,7 +291,8 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase
implement
                 //add all cluster under this pod in includeList
                 List<ClusterVO> clusterList = _clusterDao.listByPodId(dr.getPodId());
                 for (ClusterVO cluster : clusterList) {
-                    if (_dedicatedDao.findByClusterId(cluster.getId()) != null) {
+                    DedicatedResourceVO dCluster = _dedicatedDao.findByClusterId(cluster.getId());
+                    if (dCluster != null && !dedicatedResources.contains(dCluster))
{
                         avoidList.addCluster(cluster.getId());
                     } else {
                         includeList.addCluster(cluster.getId());
@@ -300,7 +301,8 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase
implement
                 //add all hosts inside this pod in includeList
                 List<HostVO> hostList = _hostDao.findByPodId(dr.getPodId());
                 for (HostVO host : hostList) {
-                    if (_dedicatedDao.findByHostId(host.getId()) != null) {
+                    DedicatedResourceVO dHost = _dedicatedDao.findByHostId(host.getId());
+                    if (dHost != null && !dedicatedResources.contains(dHost)) {
                         avoidList.addHost(host.getId());
                     } else {
                         includeList.addHost(host.getId());
@@ -313,7 +315,8 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase
implement
                 //add all Pod under this data center in includeList
                 List<HostPodVO> podList = _podDao.listByDataCenterId(dr.getDataCenterId());
                 for (HostPodVO pod : podList) {
-                    if (_dedicatedDao.findByPodId(pod.getId()) != null) {
+                    DedicatedResourceVO dPod = _dedicatedDao.findByPodId(pod.getId());
+                    if (dPod != null && !dedicatedResources.contains(dPod)) {
                         avoidList.addPod(pod.getId());
                     } else {
                         includeList.addPod(pod.getId());
@@ -321,7 +324,8 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase
implement
                 }
                 List<ClusterVO> clusterList = _clusterDao.listClustersByDcId(dr.getDataCenterId());
                 for (ClusterVO cluster : clusterList) {
-                    if (_dedicatedDao.findByClusterId(cluster.getId()) != null) {
+                    DedicatedResourceVO dCluster = _dedicatedDao.findByClusterId(cluster.getId());
+                    if (dCluster != null && !dedicatedResources.contains(dCluster))
{
                         avoidList.addCluster(cluster.getId());
                     } else {
                         includeList.addCluster(cluster.getId());
@@ -330,7 +334,8 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase
implement
                 //add all hosts inside this in includeList
                 List<HostVO> hostList = _hostDao.listByDataCenterId(dr.getDataCenterId());
                 for (HostVO host : hostList) {
-                    if (_dedicatedDao.findByHostId(host.getId()) != null) {
+                    DedicatedResourceVO dHost = _dedicatedDao.findByHostId(host.getId());
+                    if (dHost != null && !dedicatedResources.contains(dHost)) {
                         avoidList.addHost(host.getId());
                     } else {
                         includeList.addHost(host.getId());


Mime
View raw message