Roy Golan has posted comments on this change. Change subject: sla: Update balancers and add memory based load balancing ......................................................................
Patch Set 4: (4 comments) just still wondering about the underutilized. otherwise all looks good https://gerrit.ovirt.org/#/c/38189/4/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CpuAndMemoryBalancingPolicyUnit.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CpuAndMemoryBalancingPolicyUnit.java: Line 63: * returns list of Hosts with Line 64: * cpuUtilization >= highUtilization Line 65: * && cpuOverCommitMinutes >= CpuOverCommitDurationMinutes Line 66: */ Line 67: List<VDS> overUtilizedCPUHosts = getPrimarySources(cluster, hosts, parameters); > I copied most of the code intact so I would rather return empty structures +1 Line 68: Line 69: /* get hosts with not enough free memory */ Line 70: final List<VDS> overUtilizedMemoryHosts = getSecondarySources(cluster, hosts, parameters); Line 71: Line 109: // if no host has memory to spare, then there is nothing we can do to balance it.. Line 110: if (underUtilizedHosts == null || underUtilizedHosts.size() == 0) { Line 111: log.warn("All hosts are Memory over-utilized, can't Memory balance the cluster '{}'", cluster.getName()); Line 112: return null; Line 113: } > The SchedulingManager's logic expects either null or proper response here. am not big fan of Pair but it can be handy sometime. any other thought on making a valid empty answer for the API? Line 114: Line 115: FindVmAndDestinations.Result result = findVmAndDestinations.invoke(overUtilizedMemoryHosts, underUtilizedHosts, getVmDao()); Line 116: if (result != null) { Line 117: destinationHosts = result.getDestinationHosts(); Line 149: List<VDS> result = new ArrayList<>(); Line 150: Line 151: for (VDS h: hosts) { Line 152: if (h.getMaxSchedulingMemory() > lowFreeMemoryLimit Line 153: && h.getVmCount() >= minVmCount) { > It is needed for evenly balanced vs. power saving balancing. Power saving u this is very obscure. the method name says you get a list of hosts which are underutilized. a host with no VM will no be in the list. doesn't make sense even for evenly-dist. Line 154: result.add(h); Line 155: } Line 156: } Line 157: https://gerrit.ovirt.org/#/c/38189/4/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VdsCpuUsageComparator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VdsCpuUsageComparator.java: Line 13: INSTANCE; Line 14: Line 15: @Override Line 16: public int compare(VDS o1, VDS o2) { Line 17: return Integer.valueOf(calculateCpuUsage(o1)).compareTo(calculateCpuUsage(o2)); > This needs to stay as it is because of the Pending resource manager. Which just mean that you can use Integer.compare(x,y) directly Line 18: } Line 19: Line 20: private static int calculateCpuUsage(VDS o1) { Line 21: return o1.getUsageCpuPercent() * SlaValidator.getEffectiveCpuCores(o1) / o1.getVdsStrength(); -- To view, visit https://gerrit.ovirt.org/38189 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1fe13267feca89ab6c8fb9d85656f05930d0b333 Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Sivák <msi...@redhat.com> Gerrit-Reviewer: Martin Sivák <msi...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Tomer Saban <tsa...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches