Skip to content

Commit 7d7e7f7

Browse files
committed
Check there is at least a host to verify pool compatibility for a storage policy
1 parent 795dc01 commit 7d7e7f7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,10 @@ public List<StoragePool> listVsphereStoragePolicyCompatibleStoragePools(ListVsph
14961496
for (StoragePoolVO pool : poolsInZone) {
14971497
StorageFilerTO storageFilerTO = new StorageFilerTO(pool);
14981498
List<Long> hostIds = storageManager.getUpHostsInPool(pool.getId());
1499+
if (CollectionUtils.isNullOrEmpty(hostIds)) {
1500+
s_logger.debug("Did not find a suitable host to verify compatibility of the pool " + pool.getName());
1501+
continue;
1502+
}
14991503
Collections.shuffle(hostIds);
15001504
CheckDataStoreStoragePolicyComplainceCommand command = new CheckDataStoreStoragePolicyComplainceCommand(storagePolicy.getPolicyId(), storageFilerTO);
15011505
long targetHostId = hypervisorGuruManager.getGuruProcessedCommandTargetHost(hostIds.get(0), command);

0 commit comments

Comments
 (0)