abh1sar commented on code in PR #8875:
URL: https://github.com/apache/cloudstack/pull/8875#discussion_r1609368832


##########
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:
   Yes, before this change it was returning multiple entries for the same VM 
like this
   
   ![Screenshot from 2024-05-22 
09-51-24](https://github.com/apache/cloudstack/assets/63767682/c672d51b-6a55-4c38-b3f5-bce3c338f32e)
   



-- 
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]

Reply via email to