sudo87 commented on code in PR #10997:
URL: https://github.com/apache/cloudstack/pull/10997#discussion_r2204526040
##########
server/src/main/java/com/cloud/deploy/FirstFitPlanner.java:
##########
@@ -517,6 +514,104 @@ protected Pair<List<Long>, Map<Long, Double>>
listPodsByCapacity(long zoneId, in
}
+ private Pair<List<Long>, Map<Long, Double>> getOrderedPodsByCapacity(long
zoneId) {
+ double cpuToMemoryWeight =
ConfigurationManager.HostCapacityTypeCpuMemoryWeight.value();
+ short capacityType = getHostCapacityTypeToOrderCluster(
+
configDao.getValue(Config.HostCapacityTypeToOrderClusters.key()),
cpuToMemoryWeight);
+
+ logger.debug("CapacityType: {} is used for Pod ordering",
getCapacityTypeName(capacityType));
+ if (capacityType >= 0) { // for capacityType other than COMBINED
+ return capacityDao.orderPodsByAggregateCapacity(zoneId,
capacityType);
+ }
+ List<CapacityVO> capacities =
capacityDao.listPodCapacityByCapacityTypes(zoneId,
List.of(Capacity.CAPACITY_TYPE_CPU, Capacity.CAPACITY_TYPE_MEMORY));
+ Map<Long, Double> podsByCombinedCapacities =
getPodByCombinedCapacities(capacities, cpuToMemoryWeight);
+ return new Pair<>(new ArrayList<>(podsByCombinedCapacities.keySet()),
podsByCombinedCapacities);
+ }
+
+ // order pods by combining cpu and memory capacity considering
cpuToMemoeryWeight
Review Comment:
Sure @DaanHoogland, will remove comment in next commit.
--
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]