Bug 1932188 - The nic href in the response of getting template nics is wrong
Summary: The nic href in the response of getting template nics is wrong
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.4.5.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.4.5
: ---
Assignee: Ori Liel
QA Contact: Raul Aghayev
URL:
Whiteboard:
: 1932186 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-24 08:07 UTC by Qin Yuan
Modified: 2021-03-18 15:16 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.4.5.8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-18 15:16:28 UTC
oVirt Team: Infra
Embargoed:
pm-rhel: ovirt-4.4+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 113675 0 master MERGED Fix Template Nic List Problem 2021-03-01 11:01:50 UTC

Description Qin Yuan 2021-02-24 08:07:14 UTC
Description of problem:
Request to get template nics after a nic is added to the template gets wrong nic href in the response occasionally.

2021-02-22 02:30:47,623 - MainThread - nics - DEBUG - CREATE request content is --  url:/ovirt-engine/api/templates/6e969eca-b3d7-4b10-9022-34542d483415/nics body:<nic>
    <name>template_nic</name>
    <vnic_profile href="/ovirt-engine/api/vnicprofiles/ef311433-8459-42b3-b65e-6ae01e77201c" id="ef311433-8459-42b3-b65e-6ae01e77201c">
        <name>ovirtmgmt</name>
        <link href="/ovirt-engine/api/vnicprofiles/ef311433-8459-42b3-b65e-6ae01e77201c/permissions" rel="permissions"/>
        <pass_through>
            <mode>disabled</mode>
        </pass_through>
        <port_mirroring>false</port_mirroring>
        <network href="/ovirt-engine/api/networks/4e2ef15d-07ae-4894-acec-4a5426bf2028" id="4e2ef15d-07ae-4894-acec-4a5426bf2028"/>
        <network_filter href="/ovirt-engine/api/networkfilters/d2370ab4-fee3-11e9-a310-8c1645ce738e" id="d2370ab4-fee3-11e9-a310-8c1645ce738e"/>
    </vnic_profile>
</nic>

2021-02-22 02:30:47,723 - MainThread - nics - DEBUG - Response body for CREATE request is: 
<nic href="/ovirt-engine/api/templates/6e969eca-b3d7-4b10-9022-34542d483415/nics/da832111-c541-468d-927c-ac03335216da" id="da832111-c541-468d-927c-ac03335216da">
    <actions>
        <link href="/ovirt-engine/api/templates/6e969eca-b3d7-4b10-9022-34542d483415/nics/da832111-c541-468d-927c-ac03335216da/activate" rel="activate"/>
        <link href="/ovirt-engine/api/templates/6e969eca-b3d7-4b10-9022-34542d483415/nics/da832111-c541-468d-927c-ac03335216da/deactivate" rel="deactivate"/>
    </actions>
    <name>template_nic</name>
    <template href="/ovirt-engine/api/templates/6e969eca-b3d7-4b10-9022-34542d483415" id="6e969eca-b3d7-4b10-9022-34542d483415"/>
    <vm href="/ovirt-engine/api/vms/6e969eca-b3d7-4b10-9022-34542d483415" id="6e969eca-b3d7-4b10-9022-34542d483415"/>
    <interface>virtio</interface>
    <linked>true</linked>
    <plugged>true</plugged>
    <vnic_profile href="/ovirt-engine/api/vnicprofiles/ef311433-8459-42b3-b65e-6ae01e77201c" id="ef311433-8459-42b3-b65e-6ae01e77201c"/>
</nic>

2021-02-22 02:30:47,803 - MainThread - templates - DEBUG - GET request content is --  url:/ovirt-engine/api/templates/6e969eca-b3d7-4b10-9022-34542d483415/nics 
2021-02-22 02:30:47,823 - MainThread - templates - DEBUG - Response body for GET request is: 
<nics>
    <nic href="/ovirt-engine/api/vms/6e969eca-b3d7-4b10-9022-34542d483415/nics/da832111-c541-468d-927c-ac03335216da" id="da832111-c541-468d-927c-ac03335216da">
        <actions>
            <link href="/ovirt-engine/api/vms/6e969eca-b3d7-4b10-9022-34542d483415/nics/da832111-c541-468d-927c-ac03335216da/activate" rel="activate"/>
            <link href="/ovirt-engine/api/vms/6e969eca-b3d7-4b10-9022-34542d483415/nics/da832111-c541-468d-927c-ac03335216da/deactivate" rel="deactivate"/>
        </actions>
        <name>template_nic</name>
        <template href="/ovirt-engine/api/templates/6e969eca-b3d7-4b10-9022-34542d483415" id="6e969eca-b3d7-4b10-9022-34542d483415"/>
        <vm href="/ovirt-engine/api/vms/6e969eca-b3d7-4b10-9022-34542d483415" id="6e969eca-b3d7-4b10-9022-34542d483415"/>
        <interface>virtio</interface>
        <linked>true</linked>
        <plugged>true</plugged>
        <vnic_profile href="/ovirt-engine/api/vnicprofiles/ef311433-8459-42b3-b65e-6ae01e77201c" id="ef311433-8459-42b3-b65e-6ae01e77201c"/>
    </nic>
</nics>

As you can see in the get response, the nic href is "/ovirt-engine/api/vms/...", but it should be "/ovirt-engine/api/templates/..."


Version-Release number of selected component (if applicable):
ovirt-engine-4.4.5.6-0.11.el8ev.noarch


How reproducible:
Occurred occasionally in automation tests.

Steps to Reproduce:
1. Create a new template
2. Add a nic to the template
3. Get template nics

Actual results:
1. The nic href is wrong in the get response as above

Expected results:
1. The nic href in get response should be "/ovirt-engine/api/templates/..."

Additional info:

Comment 1 Ori Liel 2021-02-24 08:10:19 UTC
Patch posted:

  https://gerrit.ovirt.org/c/ovirt-engine/+/113675

Comment 2 Martin Perina 2021-03-01 09:30:39 UTC
*** Bug 1932186 has been marked as a duplicate of this bug. ***

Comment 3 Raul Aghayev 2021-03-17 12:55:38 UTC
Verified on ovirt-engine-4.4.5.9-0.1.el8ev.noarch

Comment 4 Sandro Bonazzola 2021-03-18 15:16:28 UTC
This bugzilla is included in oVirt 4.4.5 release, published on March 18th 2021.

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


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