Bug 1441741 - [Docs][REST][Python][Ruby][Java] v4 API - Document the proper way to retrieve IP-addresses of a VM [NEEDINFO]
Summary: [Docs][REST][Python][Ruby][Java] v4 API - Document the proper way to retrieve...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.0.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.3.3
: 4.3.0
Assignee: Ori Liel
QA Contact: samuel macko
URL:
Whiteboard: docs-accepted
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-12 15:19 UTC by Igor Netkachev
Modified: 2020-05-14 15:57 UTC (History)
14 users (show)

Fixed In Version: ovirt-engine-sdk-4.3.1
Doc Type: Bug Fix
Doc Text:
In the current release, the v4 API documentation shows how to retrieve the IP addresses of a virtual machine.
Clone Of:
Environment:
Last Closed: 2019-05-08 12:36:48 UTC
oVirt Team: Infra
Target Upstream Version:
rdlugyhe: needinfo? (oliel)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Article) 3256091 0 None None None 2018-02-05 13:57:06 UTC
Red Hat Product Errata RHEA-2019:1085 0 None None None 2019-05-08 12:37:11 UTC
oVirt gerrit 97677 0 master MERGED Add Get Vm IPs example 2020-09-30 15:07:07 UTC

Description Igor Netkachev 2017-04-12 15:19:02 UTC
Description of problem:
When one runs v4 API call to /api/vms in RHV 4.0.7 (and in earlier RHV 4.0.x as well I believe), even if guest agent is installed the information about IP address of a virtual machine is missing (entire <guest_info> block) , only <fqdn> is visible. If one enforces a v3 API call, everything is displayed as expected.


Version-Release number of selected component (if applicable):
RHV 4.0.x
v4 REST API


How reproducible:
100%


Steps to Reproduce:
1. Create a VM in RHEV env, install guest agent
2. Run a v4 API GET call to /api/vms:
# curl \
--cacert '/path/to/ca.crt' \
--request GET \
--header 'Version: 4' \
--header 'Accept: application/xml' \
--user 'admin@internal:password' \
https://rhevm-fqdn/ovirt-engine/api/vms


Actual results:
<guest_info> block is completely missing in output, only <fqdn> is visible


Expected results:
<guest_info> is displayed like in below example:

        <guest_info>
            <ips>
                <ip address="xxx.xxx.xxx.xxx" version="v4"/>
                <ip address="fe80::xxxx:xxxx:xxxx:xxxx" version="v6"/>
                <ip address="xxxx:xx:x:xxxx:xxx:xxxx:xxxx:xxx" version="v6"/>
            </ips>
            <fqdn>vm_fqdn.domain.zone</fqdn>
        </guest_info>



--
Kind Regards,
Igor Netkachev
Technical Support Engineer
Red Hat Global Support Services

Comment 4 Juan Hernández 2017-04-14 07:39:22 UTC
The 'guest_info' element has been removed in version 4 of the API. The information is now available in the collection of 'reported devices' of the virtual machine:

  GET /ovirt-engine/api/vms/123/reporteddevices

  <reported_devices>
    <reported_device>
      <name>eth0</name>
      <type>network</type>
      <mac>
        <address>00:1a:4a:b5:4c:94</address>
      </mac>
      <ips>
        <ip>
          <address>192.168.1.115</address>
          <version>v4</version>
        </ip>
        ...
      </ips>
    </reported_device>
    ...
  </reported_devices>

Note that the same VM may contain multiple reported devices, and in particular multiple network interface cards. Each network interface card may then contain multiple IP addresses.

For a particular network interface card the same information is also available in /ovirt-engine/api/vms/123/nics/456/reporteddevices.

This change is documented here:

  http://ovirt.github.io/ovirt-engine-api-model/4.1/#_removed_the_code_guest_info_code_element

That documentation can be improved. And we should probably add to the SDKs examples showing how to get IP addresses of virtual machines, as it is a common use case.

Comment 5 Juan Hernández 2017-04-14 07:41:49 UTC
I am removing the 'Regression' keyword, as 'guest_info' is still available in V3 of the API, and was never available in V4.

Comment 6 Oved Ourfali 2017-04-15 16:15:44 UTC
Juan, should this move to virt?

Comment 7 Juan Hernández 2017-04-15 19:59:39 UTC
Yes, I think so, moving it. Note that in my opinion the only thing that should do is improve the documentation and add examples to the SDKs.

Comment 15 Sandro Bonazzola 2019-01-28 09:41:35 UTC
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.

Comment 16 RHV bug bot 2019-03-05 21:22:43 UTC
INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[No relevant external trackers attached]

For more info please contact: rhv-devops@redhat.com

Comment 18 RHV bug bot 2019-03-29 11:14:37 UTC
INFO: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[No relevant external trackers attached]

For more info please contact: rhv-devops@redhat.com

Comment 19 samuel macko 2019-04-05 12:15:55 UTC
Verified on ovirt-engine-4.3.3.2-0.1.el7.noarch and python-ovirt-engine-sdk4-4.3.1-1.el7ev.x86_64.

Comment 22 errata-xmlrpc 2019-05-08 12:36:48 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/RHEA-2019:1085


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