davidjumani commented on a change in pull request #4375:
URL: https://github.com/apache/cloudstack/pull/4375#discussion_r505234261
##########
File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
##########
@@ -1326,10 +1327,9 @@ private HypervisorType getHypervisorType(VMInstanceVO
vm, StoragePool srcVolumeP
if (s_logger.isDebugEnabled()) {
s_logger.debug("Searching for all hosts in cluster " + cluster
+ " for migrating VM " + vm);
}
- allHostsPair = searchForServers(startIndex, pageSize, null,
hostType, null, null, null, cluster, null, keyword, null, null, null, null);
- // Filter out the current host.
+ allHostsPair = searchForServers(startIndex, pageSize, null,
hostType, null, null, null, cluster, null, keyword, null, null, null,
+ null, srcHost.getId());
allHosts = allHostsPair.first();
- allHosts.remove(srcHost);
Review comment:
It does since I've added an excludes param in the `searchForServers`
method and passing the source host ID to it. This excludes the source host in
the query, as well as ensures that the allHosts list is never altered. So the
count remains consistant but unsuitable hosts are marked accordingly
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]