Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1258780

Summary: Incorrect selection of vm for migration by CpuAndMemory balance module
Product: Red Hat Enterprise Virtualization Manager Reporter: Artyom <alukiano>
Component: ovirt-engineAssignee: Martin Sivák <msivak>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: urgent Docs Contact:
Priority: high    
Version: 3.6.0CC: bgraveno, bperkins, dfediuck, gklein, lsurette, mavital, mgoldboi, msivak, rbalakri, rgolan, Rhev-m-bugs, srevivo, ykaul
Target Milestone: ovirt-3.6.0-rc3Keywords: Triaged
Target Release: 3.6.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 01:31:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 736808    
Attachments:
Description Flags
engine log none

Description Artyom 2015-09-01 09:32:33 UTC
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:

Comment 1 Artyom 2015-09-24 14:00:44 UTC
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.

Comment 2 Artyom 2015-09-24 14:01:10 UTC
Created attachment 1076556 [details]
engine log

Comment 4 Artyom 2015-10-25 14:03:48 UTC
Verified on rhevm-3.6.0.2-0.1.el6.noarch