Bug 1493149 - [RFE] Can not disable Host to VM affinity rule
Summary: [RFE] Can not disable Host to VM affinity rule
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: 4.1.6.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ovirt-4.2.3
: ---
Assignee: Andrej Krejcir
QA Contact: Polina
URL:
Whiteboard:
Depends On: 1540955 1540973
Blocks: 1561932
TreeView+ depends on / blocked
 
Reported: 2017-09-19 13:27 UTC by Artyom
Modified: 2018-05-10 06:28 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: The host to VM affinity can now be explicitly disabled. Previously it was always enabled, but it had no effect if no hosts were assigned to the affinity group. Reason: Having the affinity always enabled could be confusing when using the REST API.
Clone Of:
: 1561932 (view as bug list)
Environment:
Last Closed: 2018-05-10 06:28:10 UTC
oVirt Team: SLA
Embargoed:
rule-engine: ovirt-4.2?
pagranat: testing_plan_complete+
rule-engine: planning_ack?
rule-engine: devel_ack+
pagranat: testing_ack+


Attachments (Terms of Use)
engine log (6.21 MB, text/plain)
2017-09-19 13:27 UTC, Artyom
no flags Details

Description Artyom 2017-09-19 13:27:11 UTC
Created attachment 1327947 [details]
engine log

Description of problem:
Once enabled "host to VM" affinity rule under affinity group cannot be disabled.

Version-Release number of selected component (if applicable):
rhevm-4.1.6.2-0.1.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create affinity group with host to VM affinity enabled
<affinity_group>
 <name>test</name>
 <enforcing>true</enforcing>
 <hosts_rule>
  <enabled>true</enabled>
  <enforcing>true</enforcing>
  <positive>false</positive>
 </hosts_rule>
 <positive>true</positive>
 <vms_rule>
  <enabled>true</enabled>
  <enforcing>true</enforcing>
  <positive>true</positive>
 </vms_rule>
</affinity_group>
2. Disable "host to vm" affinity rule
<affinity_group>
 <hosts_rule>
  <enabled>false</enabled>
  <enforcing>true</enforcing>
  <positive>false</positive>
 </hosts_rule>
</affinity_group>
3.

Actual results:
<affinity_group href="/ovirt-engine/api/clusters/00000002-0002-0002-0002-00000000017a/affinitygroups/a2cdfe24-5087-4d09-a02d-7cfb9a3d43b3" id="a2cdfe24-5087-4d09-a02d-7cfb9a3d43b3">
 <name>test</name>
 <link href="/ovirt-engine/api/clusters/00000002-0002-0002-0002-00000000017a/affinitygroups/a2cdfe24-5087-4d09-a02d-7cfb9a3d43b3/vms"rel="vms"/>
 <enforcing>true</enforcing>
 <hosts_rule>
  <enabled>true</enabled> !!! not updated !!!
  <enforcing>true</enforcing>
  <positive>false</positive>
 </hosts_rule>
....

Expected results:
Host to VM affinity rule must be disabled

Additional info:
Bug actual for REST and UI

Comment 1 Martin Sivák 2017-10-12 11:35:35 UTC
This is not supported, host affinity is always enabled. You can only disable it by deleting the rule.

Comment 2 Roman Hodain 2018-03-29 08:27:23 UTC
This is very confusing as the WebAdmin allows the user to disable the affinity for the hosts. It just does not persist the state.

To me, it rather feels like the disable state should be the same as not filling the list of the hosts. Because if you do not set any hosts the force the VMs to run out of any host or force them to run on any.

That is from the user perspective. Not talking about the implementation.

What do you think Martin?

Comment 4 Martin Sivák 2018-04-03 10:11:44 UTC
We have patches for this already and track it in different bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1540973
https://bugzilla.redhat.com/show_bug.cgi?id=1540955

Comment 5 Red Hat Bugzilla Rules Engine 2018-04-03 10:12:50 UTC
This request has been proposed for two releases. This is invalid flag usage. The ovirt-future release flag has been cleared. If you wish to change the release flag, you must clear one release flag and then set the other release flag to ?.

Comment 6 RHV bug bot 2018-04-13 09:53:09 UTC
INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[No external trackers attached]

For more info please contact: infra

Comment 7 Andrej Krejcir 2018-04-13 10:15:01 UTC
This is a test only bug and both of the bugs that implement the fix are already ON_QA.

Comment 8 Polina 2018-04-24 13:01:34 UTC
verified on rhv-release-4.2.3-2-001.noarch

steps for reproduce are performed by both - UI and Rest.

Step1.
POST https://{{host}}/ovirt-engine/api/clusters/de53e75b-b4b0-4252-9e94-af5098c45325/affinitygroups
<affinity_group>
 <name>test</name>
 <enforcing>true</enforcing>
 <hosts_rule>
  <enabled>true</enabled>
  <enforcing>true</enforcing>
  <positive>false</positive>
 </hosts_rule>
 <positive>true</positive>
 <vms_rule>
  <enabled>true</enabled>
  <enforcing>true</enforcing>
  <positive>true</positive>
 </vms_rule>
</affinity_group>


Step2. 
PUT https://{{host}}/ovirt-engine/api/clusters/de53e75b-b4b0-4252-9e94-af5098c45325/affinitygroups/4bd31a35-d3eb-4be5-b266-c880e9104a8c
<affinity_group>
 <hosts_rule>
  <enabled>false</enabled>
  <enforcing>true</enforcing>
  <positive>false</positive>
 </hosts_rule>
</affinity_group>

Result:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<affinity_group href="/ovirt-engine/api/clusters/de53e75b-b4b0-4252-9e94-af5098c45325/affinitygroups/4bd31a35-d3eb-4be5-b266-c880e9104a8c" id="4bd31a35-d3eb-4be5-b266-c880e9104a8c">
    <name>test</name>
    <link href="/ovirt-engine/api/clusters/de53e75b-b4b0-4252-9e94-af5098c45325/affinitygroups/4bd31a35-d3eb-4be5-b266-c880e9104a8c/vms" rel="vms"/>
    <enforcing>true</enforcing>
    <hosts_rule>
        <enabled>false</enabled>
        <enforcing>true</enforcing>
        <positive>false</positive>
    </hosts_rule>
    <positive>true</positive>
    <vms_rule>
        <enabled>true</enabled>
        <enforcing>true</enforcing>
        <positive>true</positive>
    </vms_rule>
    <cluster href="/ovirt-engine/api/clusters/de53e75b-b4b0-4252-9e94-af5098c45325" id="de53e75b-b4b0-4252-9e94-af5098c45325"/>
    <hosts/>
    <vms/>
</affinity_group>

Comment 9 Sandro Bonazzola 2018-05-10 06:28:10 UTC
This bugzilla is included in oVirt 4.2.3 release, published on May 4th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.3 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.