Skip to content

Commit f25d35c

Browse files
authored
VM Import: Use datastore name when datastore path is not set to search for pools on DB (apache#8759)
1 parent 0208e09 commit f25d35c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ private StoragePool getStoragePool(final UnmanagedInstanceTO.Disk disk, final Da
551551
List<StoragePoolVO> pools = primaryDataStoreDao.listPoolsByCluster(cluster.getId());
552552
pools.addAll(primaryDataStoreDao.listByDataCenterId(zone.getId()));
553553
for (StoragePool pool : pools) {
554-
if (StringUtils.contains(pool.getPath(), dsPath)) {
554+
String searchPoolParam = StringUtils.isNotBlank(dsPath) ? dsPath : dsName;
555+
if (StringUtils.contains(pool.getPath(), searchPoolParam)) {
555556
storagePool = pool;
556557
break;
557558
}

0 commit comments

Comments
 (0)