mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-4725: if storage pool has different path, but the uuid is the same, then treat them as the same storage pool
This commit is contained in:
parent
2f2efb0954
commit
771b53b342
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user