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/master to 771b53b
Date Wed, 16 Jul 2014 23:38:51 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 2f2efb095 -> 771b53b34


CLOUDSTACK-4725: if storage pool has different path, but the uuid is the same, then treat
them as the same storage pool


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

Branch: refs/heads/master
Commit: 771b53b3421fcde27e882a022e4f1b43146ca0e4
Parents: 2f2efb0
Author: Edison Su <sudison@gmail.com>
Authored: Wed Jul 16 16:30:15 2014 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Wed Jul 16 16:38:17 2014 -0700

----------------------------------------------------------------------
 .../storage/datastore/db/PrimaryDataStoreDaoImpl.java       | 4 +++-
 server/src/com/cloud/storage/StorageManagerImpl.java        | 9 +++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/771b53b3/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
index cb8ec31..0c372a5 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
@@ -184,7 +184,9 @@ public class PrimaryDataStoreDaoImpl extends GenericDaoBase<StoragePoolVO,
Long>
     public StoragePoolVO findPoolByHostPath(long datacenterId, Long podId, String host, String
path, String uuid) {
         SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
         sc.setParameters("hostAddress", host);
-        sc.setParameters("path", path);
+        if (path != null) {
+            sc.setParameters("path", path);
+        }
         sc.setParameters("datacenterId", datacenterId);
         sc.setParameters("podId", podId);
         sc.setParameters("uuid", uuid);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/771b53b3/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 06f2718..2246387 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -554,6 +554,15 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager,
C
                     pool = _storagePoolDao.findPoolByHostPath(host.getDataCenterId(), host.getPodId(),
pInfo.getHost(), "", pInfo.getUuid());
                 }
             }
+            if (pool == null) {
+                //the path can be different, but if they have the same uuid, assume they
are the same storage
+                pool = _storagePoolDao.findPoolByHostPath(host.getDataCenterId(), host.getPodId(),
pInfo.getHost(), null,
+                        pInfo.getUuid());
+                if (pool != null) {
+                    s_logger.debug("Found a storage pool: " + pInfo.getUuid() + ", but with
different hostpath " + pInfo.getHostPath() + ", still treat it as the same pool");
+                }
+            }
+
             DataStoreProvider provider = dataStoreProviderMgr.getDefaultPrimaryDataStoreProvider();
             DataStoreLifeCycle lifeCycle = provider.getDataStoreLifeCycle();
             if (pool == null) {


Mime
View raw message