Kobi Ianko has posted comments on this change. Change subject: engine: HA VM Reservation feature ......................................................................
Patch Set 5: (11 comments) .................................................... Commit Message Line 5: CommitDate: 2014-01-08 12:01:08 +0200 Line 6: Line 7: engine: HA VM Reservation feature Line 8: Line 9: Adding a feature HA VM Reservation feature, Done Line 10: The HA VM reservation feature ensure the safety of Line 11: HA VMs in case of host failover, Line 12: without negatively impacting performance. Line 13: Line 15: A new weight function Line 16: A new balance function Line 17: Rest api updated Line 18: A new scheduled task Line 19: A new alert Done Line 20: Line 21: Feature page: http://www.ovirt.org/Features/HA_VM_reservation Line 22: Line 23: Change-Id: I44e698e58ff5e4a0b74249d3fe3cf4acf042c324 .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/HaReservationHandling.java Line 16: import org.ovirt.engine.core.utils.linq.Predicate; Line 17: Line 18: /** Line 19: * A halper class for the scheduling mechanism for checking the HA Reservation status of a Cluster Line 20: */ Done Line 21: public class HaReservationHandling { Line 22: Line 23: /** Line 24: * @param cluster Line 35: if (hosts == null || hosts.isEmpty()) { Line 36: return true; Line 37: } Line 38: // HA Reservation is not possible with less than 2 hosts Line 39: if (hosts.size() < 2) { nop, you will exit with true at line 34: // No hosts, return true 34 if (hosts == null || hosts.isEmpty()) { 35 return true; 36 } Line 40: failedHosts.addAll(hosts); Line 41: return false; Line 42: } Line 43: Line 77: curVmMemSize = (int) Math.round(vm.getMemSizeMb() * (vm.getUsageMemPercent() / 100.0)); Line 78: } Line 79: int curVmCpuPercent = Line 80: vm.getUsageCpuPercent() * vm.getNumOfCpus() Line 81: / SlaValidator.getEffectiveCpuCores(host, cluster.getCountThreadsAsCores()); Done Line 82: Line 83: boolean foundForCurVm = false; Line 84: for (Pair<Guid, Pair<Integer, Integer>> hostData : hostsUnutilizedResources) { Line 85: // Make sure not to run on the same Host as the Host we are testing Line 158: } Line 159: innerUnutilizedCpuRamPair.setFirst(hostFreeCpu); Line 160: Line 161: int hostFreeMem = 0; Line 162: if (host.getPhysicalMemMb() != null && host.getUsageMemPercent() != null) will consult with doron on that Line 163: { Line 164: int usedMem = (int) Math.round(host.getPhysicalMemMb() * (host.getUsageMemPercent() / 100.0)); Line 165: hostFreeMem = host.getPhysicalMemMb() - usedMem; Line 166: } Line 179: @SuppressWarnings("unchecked") Line 180: public static Map<Guid, List<VM>> mapHaVmToHostByCluster(Guid clusterId) { Line 181: Line 182: List<VM> vms = DbFacade.getInstance().getVmDao().getAllForVdsGroup(clusterId); Line 183: if (vms == null) { Done Line 184: // return empty map Line 185: return Collections.EMPTY_MAP; Line 186: } Line 187: Line 191: return v.isAutoStartup(); Line 192: } Line 193: }); Line 194: Line 195: return HaReservationHandling.mapVmToHost(vms); Done Line 196: Line 197: } Line 198: .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/HaReservationBalancePolicyUnit.java Line 22: import org.ovirt.engine.core.utils.linq.Predicate; Line 23: Line 24: /** Line 25: * This balancing policy, is for use in cases the user selected HA Reservation for its Cluster. The basic methodology Line 26: * is: 1. get the optimal HA VMs for each VM assuming evenly spreded across the cluster 2. calc the overUtiliaze as Done Line 27: * (1)*user configured threshold in percent. 3. randomly choose a VM from a busy host to move to another more available Line 28: * host. Line 29: */ Line 30: public class HaReservationBalancePolicyUnit extends PolicyUnitImpl { .................................................... File packaging/dbscripts/upgrade/03_04_0400_add_ha_reservation_weight_module.sql Line 7: }', 2, 'balance hosts according to their HA score regardless of hosted engine'); Line 8: Line 9: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('20d25257-b4bd-4589-92a6-c4c5c5d3fd1a','7f262d70-6cac-11e3-981f-0800200c9a66',0,1); Line 10: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('5a2b0939-7d46-4b73-a469-e9c2c7fc6a53','7f262d70-6cac-11e3-981f-0800200c9a66',0,1); Line 11: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('b4ed2332-a7ac-4d5f-9596-99a439cb2812','7f262d70-6cac-11e3-981f-0800200c9a66',0,1); Done Line 12: Line 13: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('20d25257-b4bd-4589-92a6-c4c5c5d3fd1a','93431200-6d7e-11e3-981f-0800200c9a66',0,1); Line 14: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('5a2b0939-7d46-4b73-a469-e9c2c7fc6a53','93431200-6d7e-11e3-981f-0800200c9a66',0,1); Line 11: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('b4ed2332-a7ac-4d5f-9596-99a439cb2812','7f262d70-6cac-11e3-981f-0800200c9a66',0,1); Line 12: Line 13: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('20d25257-b4bd-4589-92a6-c4c5c5d3fd1a','93431200-6d7e-11e3-981f-0800200c9a66',0,1); Line 14: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('5a2b0939-7d46-4b73-a469-e9c2c7fc6a53','93431200-6d7e-11e3-981f-0800200c9a66',0,1); Line 15: INSERT INTO cluster_policy_units (cluster_policy_id,policy_unit_id,filter_sequence,factor) values ('b4ed2332-a7ac-4d5f-9596-99a439cb2812','93431200-6d7e-11e3-981f-0800200c9a66',0,1); will consult with doron -- To view, visit http://gerrit.ovirt.org/22929 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44e698e58ff5e4a0b74249d3fe3cf4acf042c324 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Kobi Ianko <k...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Kobi Ianko <k...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> 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