Bug 1932186 - 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 DUPLICATE of bug 1932188
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.4.5.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ori Liel
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-24 08:05 UTC by Qin Yuan
Modified: 2021-03-01 09:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-01 09:30:39 UTC
oVirt Team: Infra
Embargoed:


Attachments (Terms of Use)

Description Qin Yuan 2021-02-24 08:05:35 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 Martin Perina 2021-03-01 09:30:39 UTC

*** This bug has been marked as a duplicate of bug 1932188 ***


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