Bug 1410040

Summary: VM enter to the migration loop when the engine has both VM to host soft affinity group and load balancer
Product: [oVirt] ovirt-engine Reporter: Artyom <alukiano>
Component: Backend.CoreAssignee: Yanir Quinn <yquinn>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: high Docs Contact:
Priority: high    
Version: 4.1.0CC: bugs, mgoldboi
Target Milestone: ovirt-4.1.0-betaKeywords: Triaged
Target Release: 4.1.0.2Flags: rule-engine: ovirt-4.1+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-01 14:43:28 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: 1404660    
Attachments:
Description Flags
engine log none

Description Artyom 2017-01-04 10:16:13 UTC
Created attachment 1237086 [details]
engine log

Description of problem:
If I define soft VM to host affinity group and update cluster scheduler policy to the policy with the load balancer, the engine starts to migrate VM all time between the hosts.

Version-Release number of selected component (if applicable):
rhevm-4.1.0-0.3.beta2.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. In the environment with at least two hosts
2. Create soft, positive VM to host affinity group(af_1)
3. Add vm_1 and host_1 to af_1
4. Create 50% CPU load on the host_2
5. Start vm_1
6. Change the cluster scheduling policy to power_saving
7. Wait 4-5 minutes

Actual results:
	
Jan 4, 2017 12:12:23 PM
Migration completed (VM: golden_env_mixed_virtio_0, Source: host_mixed_1, Destination: host_mixed_3, Duration: 5 seconds, Total: 5 seconds, Actual downtime: (N/A))

Jan 4, 2017 12:12:19 PM
Migration initiated by system (VM: golden_env_mixed_virtio_0, Source: host_mixed_1, Destination: host_mixed_3, Reason: Affinity rules enforcement).

Jan 4, 2017 12:12:03 PM
Migration completed (VM: golden_env_mixed_virtio_0, Source: host_mixed_3, Destination: host_mixed_1, Duration: 6 seconds, Total: 6 seconds, Actual downtime: (N/A))

Jan 4, 2017 12:11:59 PM
Migration initiated by system (VM: golden_env_mixed_virtio_0, Source: host_mixed_3, Destination: host_mixed_1, Reason: Load balancing).

Jan 4, 2017 12:11:21 PM
Migration completed (VM: golden_env_mixed_virtio_0, Source: host_mixed_1, Destination: host_mixed_3, Duration: 4 seconds, Total: 4 seconds, Actual downtime: (N/A))

Jan 4, 2017 12:11:18 PM
Migration initiated by system (VM: golden_env_mixed_virtio_0, Source: host_mixed_1, Destination: host_mixed_3, Reason: Affinity rules enforcement).

Jan 4, 2017 12:11:01 PM
Migration completed (VM: golden_env_mixed_virtio_0, Source: host_mixed_3, Destination: host_mixed_1, Duration: 4 seconds, Total: 4 seconds, Actual downtime: (N/A))

Jan 4, 2017 12:10:57 PM
Migration initiated by system (VM: golden_env_mixed_virtio_0, Source: host_mixed_3, Destination: host_mixed_1, Reason: Load balancing).

Jan 4, 2017 12:10:20 PM
Migration completed (VM: golden_env_mixed_virtio_0, Source: host_mixed_1, Destination: host_mixed_3, Duration: 4 seconds, Total: 4 seconds, Actual downtime: (N/A))

Jan 4, 2017 12:10:16 PM
Migration initiated by system (VM: golden_env_mixed_virtio_0, Source: host_mixed_1, Destination: host_mixed_3, Reason: Affinity rules enforcement).

Jan 4, 2017 12:10:00 PM
Migration completed (VM: golden_env_mixed_virtio_0, Source: host_mixed_3, Destination: host_mixed_1, Duration: 5 seconds, Total: 5 seconds, Actual downtime: (N/A))

Jan 4, 2017 12:09:56 PM
Migration initiated by system (VM: golden_env_mixed_virtio_0, Source: host_mixed_3, Destination: host_mixed_1, Reason: Load balancing).

Expected results:
Engine must prevent such behavior

Additional info:

Comment 1 Artyom 2017-01-26 10:55:39 UTC
Verified on rhevm-4.1.0.2-0.2.el7.noarch

Checked that no loop appears for power_saving, even_distribution and even_vm_distribution