cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [21/50] [abbrv] git commit: updated refs/heads/ui-restyle to 326b3a6
Date Tue, 10 Dec 2013 23:52:01 GMT
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.

Conflicts:

	server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java


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

Branch: refs/heads/ui-restyle
Commit: 5618a44ed0089e43ec24847b0b7db5c7e754fdb7
Parents: 1db19c3
Author: Prachi Damle <prachi@cloud.com>
Authored: Mon Dec 9 14:53:48 2013 -0800
Committer: Prachi Damle <prachi@cloud.com>
Committed: Mon Dec 9 15:37:13 2013 -0800

----------------------------------------------------------------------
 .../deploy/DeploymentPlanningManagerImpl.java   | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5618a44e/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 8b7ed87..a0890c2 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -1119,6 +1119,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() + ")");
 
@@ -1228,6 +1234,11 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
                 }
             }
 
+            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: " + plan.getClusterId());
                 // No suitable storage pools found under this cluster for this
@@ -1239,6 +1250,13 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
             }
         }
 
+        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");
         }
@@ -1346,4 +1364,4 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
         }
         return true;
     }
-}
+}
\ No newline at end of file


Mime
View raw message