Bug 1647025

Summary: [downstream clone - 4.2.8] RESTAPI listing diskprofiles only shows 1 href for the same QoS even if there are more domains with the same QoS
Product: Red Hat Enterprise Virtualization Manager Reporter: RHV bug bot <rhv-bugzilla-bot>
Component: ovirt-engineAssignee: shani <sleviim>
Status: CLOSED ERRATA QA Contact: Evelina Shames <eshames>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.5CC: dfodor, ebenahar, eedri, ratamir, rbarry, Rhev-m-bugs, sborella, tnisan
Target Milestone: ovirt-4.2.8Keywords: ZStream
Target Release: ---Flags: lsvaty: testing_plan_complete-
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.8.1 Doc Type: Bug Fix
Doc Text:
This fix addresses listing disk profiles on a storage domain that have a Quality of Service link set where the href attribute value for the QoS link does not display for each listing. This release ensures that all QoS link values are visible.
Story Points: ---
Clone Of: 1640977 Environment:
Last Closed: 2019-01-22 12:44:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1640977    
Bug Blocks:    

Description RHV bug bot 2018-11-06 14:36:18 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1640977 +++
======================================================================

Description of problem:
When listing diskprofiles on storage domain that have a QoS set, the href for
this QoS is not show for each entry listed. Only once per QoS.
The ID is always shown.

Version-Release number of selected component (if applicable):
ovirt-engine-restapi-4.2.5.2-0.1.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Define 3 storage domain "Data1", "Data2" and "Data3"
2. Under Compute -> Data Center -> Default -> QoS
   define 2 storage QoS entries (with random parameters) named
   "QoS1" and "QoS2"
3. Under Storage -> Domains set:
   Data1 -> Disk Profiles -> QoS -> "QoS1"
   Data2 -> Disk Profiles -> QoS -> "QoS2"
   Data3 -> Disk Profiles -> QoS -> "QoS3"
4. Use the API to list the disk diskprofiles:
   curl -k --header 'Accept: application/xml' --request 'GET' -u 'admin@internal' \
     'https://rhvm.example.com/ovirt-engine/api/diskprofiles'

Actual results:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<disk_profiles>
    <disk_profile href="/ovirt-engine/api/diskprofiles/bb314a2b-f8fe-4b34-866e-5525f21fe08d" id="bb314a2b-f8fe-4b34-866e-5525f21fe08d">
        <name>hosted_storage</name>
        <link href="/ovirt-engine/api/diskprofiles/bb314a2b-f8fe-4b34-866e-5525f21fe08d/permissions" rel="permissions"/>
        <storage_domain href="/ovirt-engine/api/storagedomains/9c04b9ed-ab44-4a72-b253-ac8635690583" id="9c04b9ed-ab44-4a72-b253-ac8635690583"/>
    </disk_profile>
    <disk_profile href="/ovirt-engine/api/diskprofiles/bc52f83c-52ec-4ed3-baac-764b69551ba2" id="bc52f83c-52ec-4ed3-baac-764b69551ba2">
        <name>Data1</name>
        <link href="/ovirt-engine/api/diskprofiles/bc52f83c-52ec-4ed3-baac-764b69551ba2/permissions" rel="permissions"/>
        <qos id="1b8c9ecb-ed09-44d2-8d78-280bbf20995c"/>
         ^^^
           \--> no "href" shown

        <storage_domain href="/ovirt-engine/api/storagedomains/57854d4a-2934-45d9-91c1-fab1e3563446" id="57854d4a-2934-45d9-91c1-fab1e3563446"/>
    </disk_profile>
    <disk_profile href="/ovirt-engine/api/diskprofiles/31311c34-911d-4cfe-ba84-75b0ede0d118" id="31311c34-911d-4cfe-ba84-75b0ede0d118">
        <name>Data3</name>
        <link href="/ovirt-engine/api/diskprofiles/31311c34-911d-4cfe-ba84-75b0ede0d118/permissions" rel="permissions"/>
        <qos href="/ovirt-engine/api/datacenters/1d9f9f52-a611-11e8-b40b-00163e4663ae/qoss/1b8c9ecb-ed09-44d2-8d78-280bbf20995c" id="1b8c9ecb-ed09-44d2-8d78-280bbf20995c"/>
         ^^^^^^^^
              \--> "href" is shown for id *280bbf20995c only once!!!

        <storage_domain href="/ovirt-engine/api/storagedomains/e345a3da-805e-4206-8f91-41e309bce10b" id="e345a3da-805e-4206-8f91-41e309bce10b"/>
    </disk_profile>
    <disk_profile href="/ovirt-engine/api/diskprofiles/668383da-d1b2-4608-b950-b8109d7f3118" id="668383da-d1b2-4608-b950-b8109d7f3118">
        <name>Data2</name>
        <link href="/ovirt-engine/api/diskprofiles/668383da-d1b2-4608-b950-b8109d7f3118/permissions" rel="permissions"/>
        <qos href="/ovirt-engine/api/datacenters/1d9f9f52-a611-11e8-b40b-00163e4663ae/qoss/4c413898-c092-4f6b-8df5-efdd2c0602bb" id="4c413898-c092-4f6b-8df5-efdd2c0602bb"/>
         ^^^^^^^^
              \--> "href" is shown for id *-efdd2c0602bb

        <storage_domain href="/ovirt-engine/api/storagedomains/486988f8-ea63-4521-be30-95b66b62b85e" id="486988f8-ea63-4521-be30-95b66b62b85e"/>
    </disk_profile>
</disk_profiles>


Expected results:
The "href" for the QoS entry under all "disk_profiles" to be shown as it would
with for example "data_center" under "/ovirt-engine/api/storagedomains"


Additional info:
The same issue with JSON output when using --header 'Accept: application/json'

(Originally by rvdwees)

Comment 4 RHV bug bot 2018-11-28 14:37:54 UTC
WARN: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.2.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.2.z': '?'}', ]

For more info please contact: rhv-devops

Comment 5 Elad 2018-12-12 13:50:03 UTC
This bug should have been moved to ON_QA

Comment 6 Eyal Edri 2018-12-12 13:55:44 UTC
I can see it only got 4.2.z+ today, so it should move to ON_QA once the compose is done and new build is released TODAY.
@Dusan, please have a look at it once you do the release to verify.

Comment 8 Evelina Shames 2018-12-18 13:04:53 UTC
Verified on engine 4.2.8.1-0.1

Comment 10 errata-xmlrpc 2019-01-22 12:44:50 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/RHBA-2019:0121

Comment 11 Daniel Gur 2019-08-28 13:13:42 UTC
sync2jira

Comment 12 Daniel Gur 2019-08-28 13:17:56 UTC
sync2jira