Bug 1577191

Summary: reporteddevices by VM's NIC doesn't return anything
Product: [oVirt] ovirt-engine Reporter: Lucie Leistnerova <lleistne>
Component: RestAPIAssignee: Ori Liel <oliel>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hrazdil <rhrazdil>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.3.5CC: bugs, lsvaty, mperina
Target Milestone: ovirt-4.2.5Keywords: Automation, Reopened
Target Release: ---Flags: rule-engine: ovirt-4.2+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-31 15:26:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lucie Leistnerova 2018-05-11 12:30:31 UTC
Description of problem:
Getting link href for reporteddevices by VM's NIC doesn't return anything even when it should.

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

How reproducible: always


Steps to Reproduce:
1. create new VM with default parameters in engine
2. install OS and guest agent on the VM
3. in webadmin you can see some info in VM detail -> Network interfaces -> nic1 -> Guest Agent Data
3. get nic1 id for that VM, e.g. from
curl -k -u admin@internal:xxx -H "Prefer: persistent-auth" https://engine/ovirt-engine/api/vms/<vm_id>/nics
3. get reported devices from links by that NIC, e.g.
curl -k -u admin@internal:xxx -H "Prefer: persistent-auth" https://engine/ovirt-engine/api/vms/<vm_id>/nics/<nic_id>/reporteddevices

Actual results: no devices
    <reported_devices/>


Expected results: some device e.g.
    <reported_devices>
        <reported_device href="/ovirt-engine/api/vms/735917b1-e057-4265-bdc5-c8cb98eb1930/reporteddevices/65746830-3030-3a31-613a-34343a30383a" id="65746830-3030-3a31-613a-34343a30383a">
            <name>eth0</name>
            <description>guest reported data</description>
            <ips>
                <ip>
                    <address>...</address>
                    <version>v4</version>
                </ip>
                <ip>
                    <address>...</address>
                    <version>v6</version>
                </ip>
            </ips>
            <mac>
                <address>...</address>
            </mac>
            <type>network</type>
        </reported_device>
    </reported_devices>

or the link should be removed, because reported_devices is printed already by the NIC

Comment 1 Ori Liel 2018-05-30 08:15:15 UTC
The bug does not reproduce for me. 

I've reproduced the scenario: created a VM, installed an OS on it, installed and ran the guest-agent, then queried for the VM's nic, and inside it followed the link to the reported-devices. 

The result of the query contained the expected 'guest reported data'.

I've closed the bug, please re-open if necessary with more precise steps to reproduce

Comment 2 Lucie Leistnerova 2018-05-30 09:02:34 UTC
There are two links to reported devices by the vnic

<name>nic1</name>
...
<link href="/ovirt-engine/api/vms/ee8fd101-7bf7-4f8f-a8b5-774c78f039ce/nics/0e3f7916-b2b2-42c5-90ad-32907cdc1292/reporteddevices" rel="reporteddevices"/>
...
<reported_devices>
<reported_device href="/ovirt-engine/api/vms/ee8fd101-7bf7-4f8f-a8b5-774c78f039ce/reporteddevices/65746830-3030-3a31-613a-34613a31363a" id="65746830-3030-3a31-613a-34613a31363a">

and the first one (that goes to nics->devices) doesn't show anything. 
Second that goes to exact device with vms->devices works fine.

Comment 3 Radim Hrazdil 2018-07-09 11:20:19 UTC
Verified that query for reporteddevices returns following structure:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reported_devices>
    <reported_device href="/ovirt-engine/api/vms/<vm_id>/reporteddevices/<nic_id>" id="<nic_id>">
        <name>eth0</name>
        <description>guest reported data</description>
        <ips>
            <ip>
                <address><ip></address>
                <version>v4</version>
            </ip>

        </ips>
        <mac>
            <address><mac_addr></address>
        </mac>
        <type>network</type>
        <vm href="/ovirt-engine/api/vms/<vm_id>" id="<vm_id>"/>
    </reported_device>
</reported_devices>


Software Version:4.2.5-0.1.el7ev

Comment 4 Sandro Bonazzola 2018-07-31 15:26:33 UTC
This bugzilla is included in oVirt 4.2.5 release, published on July 30th 2018.

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