cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject git commit: updated refs/heads/4.3 to 6df86db
Date Mon, 09 Dec 2013 22:32:32 GMT
Updated Branches:
  refs/heads/4.3 33ff20e1c -> 6df86db23


CLOUDSTACK-5426: Cannot deploy instance having multiple volumes that use different storage
tags for storage pools in same cluster

Changes:
- We need to reset the avoid set to its original state while calling the storage pool allocators
for each volume.
- This will prevent affecting allocation of the disks due to the avoid set output of the prior
disk allocations.


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

Branch: refs/heads/4.3
Commit: 6df86db2309db2b93b1001db42b5f797dd445a63
Parents: 33ff20e
Author: Prachi Damle <prachi@cloud.com>
Authored: Mon Dec 9 14:08:16 2013 -0800
Committer: Prachi Damle <prachi@cloud.com>
Committed: Mon Dec 9 14:10:55 2013 -0800

----------------------------------------------------------------------
 .../deploy/DeploymentPlanningManagerImpl.java     | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6df86db2/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 5d5258b..b528ae3 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -19,8 +19,10 @@ package com.cloud.deploy;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.Timer;
 import java.util.TreeSet;
 
@@ -1128,6 +1130,12 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
 
         // for each volume find list of suitable storage pools by calling the
         // allocators
+        Set<Long> originalAvoidPoolSet = avoid.getPoolsToAvoid();
+        if (originalAvoidPoolSet == null) {
+            originalAvoidPoolSet = new HashSet<Long>();
+        }
+        Set<Long> poolsToAvoidOutput = new HashSet<Long>(originalAvoidPoolSet);
+
         for (VolumeVO toBeCreated : volumesTobeCreated) {
             s_logger.debug("Checking suitable pools for volume (Id, Type): (" + toBeCreated.getId()
+ ","
                     + toBeCreated.getVolumeType().name() + ")");
@@ -1241,6 +1249,10 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
                     break;
                 }
             }
+            if (avoid.getPoolsToAvoid() != null) {
+                poolsToAvoidOutput.addAll(avoid.getPoolsToAvoid());
+                avoid.getPoolsToAvoid().retainAll(originalAvoidPoolSet);
+            }
 
             if (!foundPotentialPools) {
                 s_logger.debug("No suitable pools found for volume: " + toBeCreated + " under
cluster: "
@@ -1253,6 +1265,12 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
                 break;
             }
         }
+        if (suitableVolumeStoragePools.values() != null) {
+            poolsToAvoidOutput.removeAll(suitableVolumeStoragePools.values());
+        }
+        if (avoid.getPoolsToAvoid() != null) {
+            avoid.getPoolsToAvoid().addAll(poolsToAvoidOutput);
+        }
 
         if (suitableVolumeStoragePools.isEmpty()) {
             s_logger.debug("No suitable pools found");


Mime
View raw message