Pearl1594 commented on code in PR #10369:
URL: https://github.com/apache/cloudstack/pull/10369#discussion_r1954466791
##########
server/src/main/java/com/cloud/server/ManagementServerImpl.java:
##########
@@ -1612,6 +1613,12 @@ public Ternary<Pair<List<? extends Host>, Integer>,
List<? extends Host>, Map<Ho
logger.debug("Hosts having capacity and suitable for migration:
{}", suitableHosts);
}
+ // Only list hosts of the same architecture as the source Host in a
multi-arch zone
+ List<CPU.CPUArch> clusterArchs =
ApiDBUtils.listZoneClustersArchs(vm.getDataCenterId());
+ if (CollectionUtils.isNotEmpty(clusterArchs) && clusterArchs.size() >
1) {
+ suitableHosts = suitableHosts.stream().filter(h -> h.getArch() ==
srcHost.getArch()).collect(Collectors.toList());
+ }
Review Comment:
done, it shouldn't have any issues even if it were empty, it would still
return an empty list. But I have addressed it.
--
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]