Description of problem:
When balancing a cluster, the balancing logic should return a VM and acceptable hosts, while filtering those hosts the scheduler doesn't take into account the predicted VM CPU load.
How reproducible:
100%
Steps to Reproduce:
0. have a 2 similar hosts cluster and enable load balancing in cluster policy.
1. create a VM that consume all host CPU resources.
Actual results:
The vm bounces between 2 hosts
Expected results:
The scheduler should identify, that migrating the VM will cause the host to exceed its CPU load, and shouldn't balance that VM.
Additional info:
predictedVmCpu = (vm.usageCpuPercent * vm.numOfCpus) / host.effectiveCpuCores
verified in av8, no more bouncing VMs
event:
2014-Apr-30, 16:09
Used CPU of host 10.34.62.204 [96%] exceeded defined threshold [95%].
log:
2014-04-30 16:12:02,449 INFO [org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl] (DefaultQuartzScheduler_Worker-41) VdsLoadBalancer: vm selection - selected vm: stressed-vm, cpu: 12. => no migration