Bug 1769212

Summary: Rest API for creating affinity group with labels is resulted with the group created with missing labels
Product: [oVirt] ovirt-engine Reporter: Polina <pagranat>
Component: BLL.VirtAssignee: Andrej Krejcir <akrejcir>
Status: CLOSED CURRENTRELEASE QA Contact: Polina <pagranat>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.3.7.1CC: akrejcir, bugs, rbarry
Target Milestone: ovirt-4.4.0Flags: pm-rhel: ovirt-4.4+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine 4.4.0-27 22b6f82 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1781380 (view as bug list) Environment:
Last Closed: 2020-05-20 20:00:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1781380    

Description Polina 2019-11-06 07:43:43 UTC
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:

Comment 3 Michal Skrivanek 2020-03-10 12:25:37 UTC
change SLA team to virt, we're not tracking SLA separately anymore

Comment 4 Sandro Bonazzola 2020-03-20 15:15:36 UTC
This bug is targeted to 4.4.1 and in modified state. can we re-target to 4.4.0 and move to QA?

Comment 5 Polina 2020-03-29 20:04:04 UTC
verified on http://bob-dr.lab.eng.brq.redhat.com/builds/4.4/rhv-4.4.0-27

Comment 6 Sandro Bonazzola 2020-05-20 20:00:48 UTC
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020.

Since the problem described in this bug report should be
resolved in oVirt 4.4.0 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.