Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1561932 - [RFE] Can not disable Host to VM affinity rule [NEEDINFO]
[RFE] Can not disable Host to VM affinity rule
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
4.1.10
x86_64 Linux
unspecified Severity medium
: ovirt-4.2.3
: ---
Assigned To: Andrej Krejcir
Polina
: FutureFeature, TestOnly
Depends On: 1493149
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-29 04:31 EDT by Roman Hodain
Modified: 2018-05-15 13:50 EDT (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1493149
Environment:
Last Closed: 2018-05-15 13:48:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
sfroemer: needinfo? (msivak)


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:1488 None None None 2018-05-15 13:50 EDT

  None (edit)
Description Roman Hodain 2018-03-29 04:31:45 EDT
+++ This bug was initially created as a clone of Bug #1493149 +++

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

--- Additional comment from Martin Sivák on 2017-10-12 07:35:35 EDT ---

This is not supported, host affinity is always enabled. You can only disable it by deleting the rule.

--- Additional comment from Roman Hodain on 2018-03-29 04:27:23 EDT ---

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 1 Martin Sivák 2018-04-18 09:49:43 EDT
This has already been fixed as part of different bug.
Comment 2 Steffen Froemer 2018-04-18 11:59:14 EDT
(In reply to Martin Sivák from comment #1)
> This has already been fixed as part of different bug.

Can you please give more details?
Does this mean, it will be possible in RHV-4.2 GA?
Comment 3 Martin Sivák 2018-04-18 12:06:13 EDT
Yes, we believe it should be working as expected there. QE might want to verify that though before we pronounce it fixed.
Comment 4 Steffen Froemer 2018-04-18 13:48:46 EDT
Sounds great, thanks. 
One more thing, are the bits already included in rhv-4.2 beta-3?
Comment 5 Polina 2018-04-26 08:23:51 EDT
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 10 errata-xmlrpc 2018-05-15 13:48:31 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHEA-2018:1488

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