Updated the balancing module code to ensure that clusters are balanced sooner. The balancing module will now attempt to migrate a different virtual machine if it detects that the current candidate will not fit on any destination host.
Description of problem:
Now in CpuAndMemory balance module possible situation, when engine have valid vm for migration, but vm will not selected for migration
Version-Release number of selected component (if applicable):
rhevm-3.6.0-0.12.master.el6.noarch
How reproducible:
Always
Steps to Reproduce:
1. Have two hosts(host_1 and host_2)
2. Run two vms on host_1(vm_1 and vm_2) vm_1 have 8Gb and 0% cpu load; vm_2 have 1Gb and 5% cpu load
3. Run vm_3 on host_2, vm_3 have 8Gb memory
4. Load host_2 cpu to 50%
5. Change cluster policy to power saving with parameters:
CpuOverCommitDurationMinutes = 2
HighUtilization = 75
LowUtilization = 35
MinFreeMemoryForUnderUtilized = 12GB
MaxFreeMemoryForOverUtilized = 4GB
Actual results:
vm_2 not migrate to host_2
Expected results:
vm_2 must be migrated on host_1
Additional info:
Scheduler policy balancing module (power saving or event distribution) must guarantee,
that as much as possible VMs will run on "normal utilized" hosts.
In case of a VM, that run on "under utilized" host,
and this VM can be migrated to a "normal utilized host (without over utilized host CPU and memory), scheduler must migrate it.
In the scenario, mentioned in the description, I showed that because of incorrect condition in code,
scheduler from two vms, that host_1 have, will first check vm_1,
see that it will over utilize host_2 memory and migration will not happen.
The scheduler then do not check vm_2 to see if it will over utilize host_2 memory - and this is the bug.
As a result we will have state, when vm_2 never will be chosen for migration.