Bug 1781380 - Rest API for creating affinity group with labels is resulted with the group created with missing labels [RHV clone - 4.3.8]
Summary: Rest API for creating affinity group with labels is resulted with the group c...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: unspecified
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ovirt-4.3.8
: 4.3.8
Assignee: Andrej Krejcir
QA Contact: Polina
URL:
Whiteboard:
Depends On: 1769212
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-09 21:38 UTC by RHV bug bot
Modified: 2022-07-09 14:49 UTC (History)
7 users (show)

Fixed In Version: ovirt-engine-4.3.8.2
Doc Type: Bug Fix
Doc Text:
Previously, after using the REST API to create an affinity group, the resulting group did not have the required labels, even though they were defined in the request body. The current release fixes this issue so the affinity group has the labels that were defined in the request body.
Clone Of: 1769212
Environment:
Last Closed: 2020-02-13 15:24:42 UTC
oVirt Team: SLA
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-47481 0 None None None 2022-07-09 14:49:23 UTC
Red Hat Product Errata RHSA-2020:0498 0 None None None 2020-02-13 15:24:54 UTC
oVirt gerrit 105449 0 None MERGED restapi: Affinity group mapper reads labels 2020-02-13 15:36:16 UTC

Description RHV bug bot 2019-12-09 21:38:57 UTC
+++ This bug is an upstream to downstream clone. The original bug is: +++
+++   bug 1769212 +++
======================================================================

Description of problem: the Affinity Group created by Rest API has no labels even they are defined in the request body


Version-Release number of selected component (if applicable):
ovirt-engine-4.3.7.1-0.1.el7.noarch

How reproducible:100%


Steps to Reproduce:
1.Create Label (host or vm or both) in Compute/Clusters/Cluster/Affinity Labels tag
2.POST https://{{host}}/ovirt-engine/api/clusters/9684ce59-4549-4204-bb6f-9a6f685a27c8/affinitygroups
<affinity_group>
    <name>test_2</name>
    <enforcing>true</enforcing>
    <hosts_rule>
        <enabled>true</enabled>
        <enforcing>true</enforcing>
        <positive>true</positive>
    </hosts_rule>
    <positive>true</positive>
    <priority>1</priority>
    <vms_rule>
        <enabled>true</enabled>
        <enforcing>true</enforcing>
        <positive>true</positive>
    </vms_rule>
    <host_labels>
        <affinity_label id="90e8e1ee-0968-47c1-ac57-685d817179bf"/>
    </host_labels>
    <hosts/>
    <vm_labels>
        <affinity_label id="90e8e1ee-0968-47c1-ac57-685d817179bf"/>
    </vm_labels>
    <vms/>
</affinity_group>


Actual results:
The responce is 201 but the labels are missing 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<affinity_group href="/ovirt-engine/api/clusters/9684ce59-4549-4204-bb6f-9a6f685a27c8/affinitygroups/724d8529-acf4-49d3-b46c-dc91478cb2ae" id="724d8529-acf4-49d3-b46c-dc91478cb2ae">
    <name>test_2</name>
    <link href="/ovirt-engine/api/clusters/9684ce59-4549-4204-bb6f-9a6f685a27c8/affinitygroups/724d8529-acf4-49d3-b46c-dc91478cb2ae/hostlabels" rel="hostlabels"/>
    <link href="/ovirt-engine/api/clusters/9684ce59-4549-4204-bb6f-9a6f685a27c8/affinitygroups/724d8529-acf4-49d3-b46c-dc91478cb2ae/vmlabels" rel="vmlabels"/>
    <link href="/ovirt-engine/api/clusters/9684ce59-4549-4204-bb6f-9a6f685a27c8/affinitygroups/724d8529-acf4-49d3-b46c-dc91478cb2ae/vms" rel="vms"/>
    <enforcing>true</enforcing>
    <hosts_rule>
        <enabled>true</enabled>
        <enforcing>true</enforcing>
        <positive>true</positive>
    </hosts_rule>
    <positive>true</positive>
    <priority>1</priority>
    <vms_rule>
        <enabled>true</enabled>
        <enforcing>true</enforcing>
        <positive>true</positive>
    </vms_rule>
    <cluster href="/ovirt-engine/api/clusters/9684ce59-4549-4204-bb6f-9a6f685a27c8" id="9684ce59-4549-4204-bb6f-9a6f685a27c8"/>
    <host_labels/>
    <hosts/>
    <vm_labels/>
    <vms/>
</affinity_group>


Expected results:
the group must contain labels

Additional info:

(Originally by Polina Agranat)

Comment 3 Andrej Krejcir 2019-12-10 10:55:00 UTC
Here is the patch: https://gerrit.ovirt.org/#/c/105449/

I cannot add it to the 'Links' section above, because of a bugzilla internal error.

Comment 4 RHV bug bot 2019-12-12 12:01:44 UTC
WARN: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.3.z': '?'}', ]

For more info please contact: rhv-devops: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.3.z': '?'}', ]

For more info please contact: rhv-devops

Comment 6 Polina 2020-01-12 09:50:42 UTC
verified on ovirt-engine-4.3.8.1-0.1.master.el7.noarch

Comment 7 RHV bug bot 2020-01-16 15:21:23 UTC
INFO: Bug status (VERIFIED) wasn't changed but the folowing should be fixed:

[No relevant external trackers attached]

For more info please contact: rhv-devops

Comment 11 errata-xmlrpc 2020-02-13 15:24:42 UTC
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/RHSA-2020:0498


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