Check there is at least a host to verify pool compatibility for a storage policy

This commit is contained in:
nvazquez 2020-10-26 09:07:23 -03:00
parent 795dc01212
commit 7d7e7f7941

View File

@ -1496,6 +1496,10 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
for (StoragePoolVO pool : poolsInZone) {
StorageFilerTO storageFilerTO = new StorageFilerTO(pool);
List<Long> hostIds = storageManager.getUpHostsInPool(pool.getId());
if (CollectionUtils.isNullOrEmpty(hostIds)) {
s_logger.debug("Did not find a suitable host to verify compatibility of the pool " + pool.getName());
continue;
}
Collections.shuffle(hostIds);
CheckDataStoreStoragePolicyComplainceCommand command = new CheckDataStoreStoragePolicyComplainceCommand(storagePolicy.getPolicyId(), storageFilerTO);
long targetHostId = hypervisorGuruManager.getGuruProcessedCommandTargetHost(hostIds.get(0), command);