Bug 1939286

Summary: [RFE] Expose broken Affinity Groups via API too
Product: Red Hat Enterprise Virtualization Manager Reporter: Germano Veit Michel <gveitmic>
Component: ovirt-engineAssignee: Saif Abusaleh <sabusale>
Status: CLOSED ERRATA QA Contact: Polina <pagranat>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4.4CC: ahadas, audgiri, ddacosta, dfodor, gdeolive, imomin, michal.skrivanek, pagranat
Target Milestone: ovirt-4.4.8Keywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.8.3 Doc Type: Enhancement
Doc Text:
Previously, you could only monitor broken affinity groups using the Administration Portal. In the current release, you can now monitor broken affinity groups using both the REST API and the Administration Portal.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-08 14:12:04 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:

Description Germano Veit Michel 2021-03-15 23:25:07 UTC
Description of problem:

Currently Broken Affinity groups are computed by the backend[1] and exposed to the user via Admin Portal[2] only. Please consider this RFE to expose the same getBroken() via REST API.

The use case is that the user would like to monitor for Broken Affinity groups via API, without having to manually check in the Admin Portal.

[1] https://github.com/oVirt/ovirt-engine/blob/master/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/scheduling/AffinityGroup.java#L343

[2] https://github.com/oVirt/ovirt-engine/blob/68721ead04cef0378937cd331fae3170b4c275ba/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/AffinityGroupStatusColumn.java#L44

Comment 2 RHEL Program Management 2021-08-08 07:06:53 UTC
The documentation text flag should only be set after 'doc text' field is provided. Please provide the documentation text and set the flag to '?' again.

Comment 3 Polina 2021-08-23 12:35:36 UTC
verified on 4.4.8.4-0.7.el8ev

<broken>true</broken> field appears now in GET https://{{host}}/ovirt-engine/api/clusters/<clusterId>/affinitygroups request, like 



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<affinity_groups>
    <affinity_group href="/ovirt-engine/api/clusters/e46e70a5-9a47-4243-8752-efcf35879e20/affinitygroups/a2f62f7d-c6a7-4c1f-b34a-b21a9be6dc0a" id="a2f62f7d-c6a7-4c1f-b34a-b21a9be6dc0a">
        <name>different_host</name>
        <link href="/ovirt-engine/api/clusters/e46e70a5-9a47-4243-8752-efcf35879e20/affinitygroups/a2f62f7d-c6a7-4c1f-b34a-b21a9be6dc0a/vms" rel="vms"/>
        <link href="/ovirt-engine/api/clusters/e46e70a5-9a47-4243-8752-efcf35879e20/affinitygroups/a2f62f7d-c6a7-4c1f-b34a-b21a9be6dc0a/hosts" rel="hosts"/>
        <link href="/ovirt-engine/api/clusters/e46e70a5-9a47-4243-8752-efcf35879e20/affinitygroups/a2f62f7d-c6a7-4c1f-b34a-b21a9be6dc0a/vmlabels" rel="vmlabels"/>
        <link href="/ovirt-engine/api/clusters/e46e70a5-9a47-4243-8752-efcf35879e20/affinitygroups/a2f62f7d-c6a7-4c1f-b34a-b21a9be6dc0a/hostlabels" rel="hostlabels"/>
        <broken>true</broken>
        <enforcing>false</enforcing>
        <hosts_rule>
            <enabled>false</enabled>
            <enforcing>false</enforcing>
            <positive>false</positive>
        </hosts_rule>
        <positive>true</positive>
        <priority>1</priority>
        <vms_rule>
            <enabled>true</enabled>
            <enforcing>false</enforcing>
            <positive>true</positive>
        </vms_rule>
        <cluster href="/ovirt-engine/api/clusters/e46e70a5-9a47-4243-8752-efcf35879e20" id="e46e70a5-9a47-4243-8752-efcf35879e20"/>
        <host_labels/>
        <hosts/>
        <vm_labels/>
        <vms>
            <vm href="/ovirt-engine/api/vms/2bd3fb7d-34b0-4f9c-81aa-4e81f4cda936" id="2bd3fb7d-34b0-4f9c-81aa-4e81f4cda936"/>
            <vm href="/ovirt-engine/api/vms/023252bd-9f81-4813-9008-19dfa9490467" id="023252bd-9f81-4813-9008-19dfa9490467"/>
        </vms>
    </affinity_group>
</affinity_groups>

Comment 8 errata-xmlrpc 2021-09-08 14:12:04 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 (RHV Manager (ovirt-engine) [ovirt-4.4.8]), 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/RHBA-2021:3460