VM Import: Use datastore name when datastore path is not set to search for pools on DB (#8759)

This commit is contained in:
Nicolas Vazquez 2024-03-14 22:07:23 -03:00 committed by GitHub
parent 0208e094ce
commit f25d35c5d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -551,7 +551,8 @@ public class UnmanagedVMsManagerImpl implements UnmanagedVMsManager {
List<StoragePoolVO> pools = primaryDataStoreDao.listPoolsByCluster(cluster.getId());
pools.addAll(primaryDataStoreDao.listByDataCenterId(zone.getId()));
for (StoragePool pool : pools) {
if (StringUtils.contains(pool.getPath(), dsPath)) {
String searchPoolParam = StringUtils.isNotBlank(dsPath) ? dsPath : dsName;
if (StringUtils.contains(pool.getPath(), searchPoolParam)) {
storagePool = pool;
break;
}