cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [1/2] git commit: updated refs/heads/master to b366077
Date Fri, 12 Jul 2013 22:20:38 GMT
Updated Branches:
  refs/heads/master 505ab2eeb -> b36607742


CLOUDSTACK-3264: [ZWPS]NPE while finding storage pools for migration

Description:

    Filter primary storage pools based on zonewide/clusterwide configuration
    when considering pools to list for storage migration of volumes.


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

Branch: refs/heads/master
Commit: d9ce49b1f18c14a7acfb7a81316d4f6555717851
Parents: 505ab2e
Author: Vijayendra Bhamidipati <vijayendra.bhamidipati@citrix.com>
Authored: Mon Jul 8 13:15:23 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Fri Jul 12 15:19:36 2013 -0700

----------------------------------------------------------------------
 .../storage/allocator/AbstractStoragePoolAllocator.java   |  3 +++
 .../allocator/ClusterScopeStoragePoolAllocator.java       |  3 +++
 .../storage/allocator/LocalStoragePoolAllocator.java      |  3 +++
 .../storage/allocator/RandomStoragePoolAllocator.java     |  5 +++++
 server/src/com/cloud/server/ManagementServerImpl.java     | 10 ++++++++--
 5 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9ce49b1/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
index e16703e..89e0974 100755
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
@@ -145,6 +145,9 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase
implement
 
     protected List<StoragePool> reOrder(List<StoragePool> pools,
             VirtualMachineProfile<? extends VirtualMachine> vmProfile, DeploymentPlan
plan) {
+        if (pools == null) {
+            return null;
+        }
         Account account = null;
         if (vmProfile.getVirtualMachine() != null) {
             account = vmProfile.getOwner();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9ce49b1/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
index 0933adc..41afa83 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
@@ -59,6 +59,9 @@ public class ClusterScopeStoragePoolAllocator extends AbstractStoragePoolAllocat
         Long podId = plan.getPodId();
         Long clusterId = plan.getClusterId();
 
+		if (clusterId == null) {
+			return null;
+		}
         if (dskCh.getTags() != null && dskCh.getTags().length != 0) {
             s_logger.debug("Looking for pools in dc: " + dcId + "  pod:" + podId + "  cluster:"
+ clusterId
                     + " having tags:" + Arrays.toString(dskCh.getTags()));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9ce49b1/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
index ef9e84e..4056fe7 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
@@ -96,6 +96,9 @@ public class LocalStoragePoolAllocator extends AbstractStoragePoolAllocator
{
                 }
             }
         } else {
+            if (plan.getClusterId() == null) {
+                return null;
+            }
             List<StoragePoolVO> availablePools = _storagePoolDao.findLocalStoragePoolsByTags(plan.getDataCenterId(),
                     plan.getPodId(), plan.getClusterId(), dskCh.getTags());
             for (StoragePoolVO pool : availablePools) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9ce49b1/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
b/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
index 76ce663..fda787f 100644
--- a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
+++ b/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
@@ -46,6 +46,11 @@ public class RandomStoragePoolAllocator extends AbstractStoragePoolAllocator
{
         long dcId = plan.getDataCenterId();
         Long podId = plan.getPodId();
         Long clusterId = plan.getClusterId();
+
+		if (clusterId == null) {
+			return null;
+		}
+
         s_logger.debug("Looking for pools in dc: " + dcId + "  pod:" + podId + "  cluster:"
+ clusterId);
         List<StoragePoolVO> pools = _storagePoolDao.listBy(dcId, podId, clusterId,
ScopeType.CLUSTER);
         if (pools.size() == 0) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9ce49b1/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 36b3879..58e4b44 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -1258,8 +1258,14 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
 
             // Get all the pools available. Only shared pools are considered because only
a volume on a shared pools
             // can be live migrated while the virtual machine stays on the same host.
-            List<StoragePoolVO> storagePools = _poolDao.findPoolsByTags(volume.getDataCenterId(),
-                    volume.getPodId(), srcVolumePool.getClusterId(), null);
+            List<StoragePoolVO> storagePools = null;
+
+            if (srcVolumePool.getClusterId() == null) {
+                storagePools = _poolDao.findZoneWideStoragePoolsByTags(volume.getDataCenterId(),
null);
+            } else {
+                storagePools = _poolDao.findPoolsByTags(volume.getDataCenterId(), volume.getPodId(),
srcVolumePool.getClusterId(), null);
+            }
+
             storagePools.remove(srcVolumePool);
             for (StoragePoolVO pool : storagePools) {
                 if (pool.isShared()) {


Mime
View raw message