weizhouapache commented on code in PR #8875:
URL: https://github.com/apache/cloudstack/pull/8875#discussion_r1609350275
##########
engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java:
##########
@@ -1041,6 +1042,8 @@ public Pair<List<VMInstanceVO>, Integer>
listByVmsNotInClusterUsingPool(long clu
sc.setParameters("vmStates", State.Starting, State.Running,
State.Stopping, State.Migrating, State.Restoring);
sc.setJoinParameters("volumeSearch", "poolId", poolId);
sc.setJoinParameters("hostSearch2", "clusterId", clusterId);
- return searchAndCount(sc, null, false);
+ List<VMInstanceVO> vms = search(sc, null);
+ List<VMInstanceVO> uniqueVms =
vms.stream().distinct().collect(Collectors.toList());
+ return new Pair<>(uniqueVms, uniqueVms.size());
Review Comment:
make sense :+1:
@abh1sar
code looks good. have you tested it ? (vm has multiple disks on a pool)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]