Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1511369 - REST: add external network provider by name
Summary: REST: add external network provider by name
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: ovirt-4.2.1
: ---
Assignee: Dominik Holler
QA Contact: Mor
Depends On:
TreeView+ depends on / blocked
Reported: 2017-11-09 09:05 UTC by Nelly Credi
Modified: 2018-02-12 11:47 UTC (History)
7 users (show)

Fixed In Version: upstream 4.2.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-02-12 11:47:24 UTC
oVirt Team: Network
rule-engine: ovirt-4.2+
ykaul: blocker-
lsvaty: testing_ack+

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Github oVirt ovirt-ansible pull 133 None None None 2017-11-15 12:35:25 UTC
oVirt gerrit 84039 master MERGED core: Add GetProviderByNameQuery 2017-11-26 15:02:48 UTC
oVirt gerrit 84040 master MERGED restapi: External network providers by name 2017-11-27 07:47:41 UTC
oVirt gerrit 84702 master MERGED External network providers by name 2017-11-30 11:06:05 UTC
oVirt gerrit 84935 model_4.2 MERGED External network providers by name 2017-11-30 11:06:51 UTC
oVirt gerrit 85622 master MERGED restapi: Update to model 4.2.27 2017-12-20 12:45:52 UTC
oVirt gerrit 86518 master MERGED Updating the model version to 4.2.28 2018-01-18 07:57:15 UTC

Description Nelly Credi 2017-11-09 09:05:59 UTC
Description of problem:
External network provider is not added while adding cluster

Version-Release number of selected component (if applicable):
External network provider is not added while adding cluster

How reproducible:

Steps to Reproduce:
1. add cluster via rest
    <type>Intel Penryn Family</type>
  <data_center id="123"/>
    <external_provider name="ovirt-provider-ovn"/>

Actual results:
rest returns 200

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <cluster href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9" id="76e90824-5ccb-4e46-bae2-e6d099e00fc9">
            <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/resetemulatedmachine" rel="resetemulatedmachine"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/glustervolumes" rel="glustervolumes"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/enabledfeatures" rel="enabledfeatures"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/externalnetworkproviders" rel="externalnetworkproviders"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/networkfilters" rel="networkfilters"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/networks" rel="networks"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/permissions" rel="permissions"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/cpuprofiles" rel="cpuprofiles"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/affinitygroups" rel="affinitygroups"/>
        <link href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/glusterhooks" rel="glusterhooks"/>
            <type>Intel Penryn Family</type>
        <data_center href="/ovirt-engine/api/datacenters/7bf6dc7b-3580-427e-8a9a-07a46f2b9002" id="7bf6dc7b-3580-427e-8a9a-07a46f2b9002"/>
        <mac_pool href="/ovirt-engine/api/macpools/58ca604b-017d-0374-0220-00000000014e" id="58ca604b-017d-0374-0220-00000000014e"/>
        <management_network href="/ovirt-engine/api/clusters/76e90824-5ccb-4e46-bae2-e6d099e00fc9/networks/9144960c-f538-4018-b085-d7f521202bd1" id="9144960c-f538-4018-b085-d7f521202bd1"/>
        <scheduling_policy href="/ovirt-engine/api/schedulingpolicies/b4ed2332-a7ac-4d5f-9596-99a439cb2812" id="b4ed2332-a7ac-4d5f-9596-99a439cb2812"/>
BUT in the UI cluster edit shows that it is not set
and in REST:
https://ENGINE/ovirt-engine/api/clusters/123/externalnetworkproviders gives an empty value

Expected results:
external network provider should be set

Additional info:

Comment 1 Juan Hernández 2017-11-09 11:17:20 UTC
Currently adding the network provider when adding a cluster requires using the `id` attribute, as described here:

So your request should be like this:

      <type>Intel Penryn Family</type>
    <data_center id="123"/>
      <external_provider id="123"/>

(Replace `123` with the identifier of the network provider.)

As there is a way to do it, I am lowering the priority. Please check that it works correctly.

Specifying the network provider by name isn't currently implemented. Would be nice to do it. In that case you request would be like this:

      <type>Intel Penryn Family</type>
    <data_center id="123"/>

Dan, I'd suggest to keep this bug open if you plan to implement add by name.

Comment 2 Juan Hernández 2017-11-09 11:18:10 UTC
Also, please remove the blocker+ flag if adding by id works correctly.

Comment 3 Dan Kenigsberg 2017-11-12 08:40:18 UTC
Nelly told me in person that this is required for Ansible, where the cluster id is not readily available.

Comment 4 Nelly Credi 2017-11-13 07:44:56 UTC
I actually found a W/A for it.
But it means that Ansible doesnt work as expected, 
so if it not going to be fixed soon, maybe the ansible module should at least indicate that it is not working (when using name, ansible seems to work - no failure, but it actually doesnt set the value)

Comment 5 Dominik Holler 2017-11-14 12:33:45 UTC
I just want to highlight that ansible works like documented in , but the ovirt ansible role does not yet support external_network_providers, as documented in . I will extend the ovirt ansible role to support external_network_providers.
Nevertheless, it might be nice to have the possibility to add an external network provider by name.

Comment 6 Nelly Credi 2017-11-14 12:52:15 UTC
Thanks Dominik,
Im lowering the priority as it seems that we shouldnt use this functionality yet, as 4.2 is supporting ansible 2.4 atm and this was added to ansible master.

We will update the cluster in the tests, to be able to test the feature
Still, I would like to see the possibility added to rest

Comment 7 Mor 2018-01-09 12:05:45 UTC
Verified on:
RHV 4.2.1-0.2.el7

The API doc is on https://<SERVER_FQDN>/ovirt-engine/apidoc/#/services/clusters/methods/add is misleading. 

The following request body works:

    <type>Intel Penryn Family</type>
  <data_center id="<DC_ID>"/>

Comment 8 Sandro Bonazzola 2018-02-12 11:47:24 UTC
This bugzilla is included in oVirt 4.2.1 release, published on Feb 12th 2018.

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