Bug 1875412 - Request to create a nic on template gets wrong response content
Summary: Request to create a nic on template gets wrong response content
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.4.2.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.4.5
: ---
Assignee: Ori Liel
QA Contact: Raul Aghayev
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-03 13:56 UTC by Qin Yuan
Modified: 2021-03-18 15:13 UTC (History)
8 users (show)

Fixed In Version: ovirt-engine-4.4.5.4
Clone Of:
Environment:
Last Closed: 2021-03-18 15:13:12 UTC
oVirt Team: Infra
Embargoed:
pm-rhel: ovirt-4.4+
gdeolive: testing_ack+


Attachments (Terms of Use)
auto-test-logs (22.93 KB, application/x-xz)
2020-09-03 13:56 UTC, Qin Yuan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1893780 0 medium CLOSED [REST] failed to delete a VNIC from a template 2021-05-01 17:40:34 UTC
oVirt gerrit 112849 0 master MERGED restapi: fix link to template nic 2021-02-15 12:12:38 UTC

Internal Links: 1893780

Description Qin Yuan 2020-09-03 13:56:42 UTC
Created attachment 1713625 [details]
auto-test-logs

Description of problem:
A request to create nic on template is:

2020-09-02 16:25:47,889 - MainThread - nics - DEBUG - CREATE request content is --  url:/ovirt-engine/api/templates/b0e22323-3bce-42e6-9215-4d481c215223/nics body:<nic>
    <name>template_nic</name>
    <vnic_profile href="/ovirt-engine/api/vnicprofiles/fc1bbebb-8809-4a4d-8390-39104894cf93" id="fc1bbebb-8809-4a4d-8390-39104894cf93">
        <name>ovirtmgmt</name>
        <link href="/ovirt-engine/api/vnicprofiles/fc1bbebb-8809-4a4d-8390-39104894cf93/permissions" rel="permissions"/>
        <pass_through>
            <mode>disabled</mode>
        </pass_through>
        <port_mirroring>false</port_mirroring>
        <network href="/ovirt-engine/api/networks/4e307f7a-0c5b-4667-9355-e4e2e1a8b01e" id="4e307f7a-0c5b-4667-9355-e4e2e1a8b01e"/>
        <network_filter href="/ovirt-engine/api/networkfilters/d2370ab4-fee3-11e9-a310-8c1645ce738e" id="d2370ab4-fee3-11e9-a310-8c1645ce738e"/>
    </vnic_profile>
</nic>

The nic href in response body is /ovirt-engine/api/vms/b0e22323-3bce-42e6-9215-4d481c215223/nics/.., but not /ovirt-engine/api/templates/b0e22323-3bce-42e6-9215-4d481c215223/nics/.., and it has deactivate/activate actions which shouldn't be present, see:

2020-09-02 16:25:47,955 - MainThread - nics - DEBUG - Response body for CREATE request is: 
<nic href="/ovirt-engine/api/vms/b0e22323-3bce-42e6-9215-4d481c215223/nics/a4f57a1a-ab6a-4e0e-ba39-72522ff049fc" id="a4f57a1a-ab6a-4e0e-ba39-72522ff049fc">
    <actions>
        <link href="/ovirt-engine/api/vms/b0e22323-3bce-42e6-9215-4d481c215223/nics/a4f57a1a-ab6a-4e0e-ba39-72522ff049fc/deactivate" rel="deactivate"/>
        <link href="/ovirt-engine/api/vms/b0e22323-3bce-42e6-9215-4d481c215223/nics/a4f57a1a-ab6a-4e0e-ba39-72522ff049fc/activate" rel="activate"/>
    </actions>
    <name>template_nic</name>
    <template href="/ovirt-engine/api/templates/b0e22323-3bce-42e6-9215-4d481c215223" id="b0e22323-3bce-42e6-9215-4d481c215223"/>
    <vm href="/ovirt-engine/api/vms/b0e22323-3bce-42e6-9215-4d481c215223" id="b0e22323-3bce-42e6-9215-4d481c215223"/>
    <interface>virtio</interface>
    <linked>true</linked>
    <plugged>true</plugged>
    <vnic_profile href="/ovirt-engine/api/vnicprofiles/fc1bbebb-8809-4a4d-8390-39104894cf93" id="fc1bbebb-8809-4a4d-8390-39104894cf93"/>
</nic>


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

How reproducible:
It happened twice on latest tests, RHV-4.4-tier1-PPC #9, RHV-4.4-tier1-PPC #10.
Failed to reproduce it by running the same test from local.

Steps to Reproduce:
1. Add a new vm template_base_vm_1
2. Create template test_template_1_base from vm template_base_vm_1
3. Create vm vm_no_disk_1 from template test_template_1_base
4. Add nic template_nic to template test_template_1_base

Actual results:
1. The create response body is wrong as above

Expected results:
1. The nic href in response body should be /ovirt-engine/api/templates/b0e22323-3bce-42e6-9215-4d481c215223/nics/.., and no deactivate/activate actions.

Additional info:

Comment 3 Sandro Bonazzola 2021-01-15 10:22:39 UTC
Referenced patch has been merged, anything else needed or can this bug be moved to MODIFIED?

Comment 4 Raul Aghayev 2021-02-18 09:04:46 UTC
Verified on ovirt-engine-4.4.5.4-0.6.el8ev.noarch

Comment 5 Sandro Bonazzola 2021-03-18 15:13:12 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.