Bug 1679158 - [REST] Fix Link To Network Under Cluster
Summary: [REST] Fix Link To Network Under Cluster
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: 4.3.0
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: ovirt-4.3.2
: ---
Assignee: Ori Liel
QA Contact: msheena
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-20 13:35 UTC by msheena
Modified: 2019-03-19 10:03 UTC (History)
6 users (show)

Fixed In Version: ovirt-engine-4.3.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-19 10:03:24 UTC
oVirt Team: Network
Embargoed:
pm-rhel: ovirt-4.3+
pm-rhel: blocker+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 97963 0 master MERGED restapi: Fix Link To Network Under Cluster 2019-02-28 07:49:26 UTC

Description msheena 2019-02-20 13:35:19 UTC
Description of problem:
Trying to update a cluster's network roles via REST reports 200[OK] although the network's roles are not updated

Version-Release number of selected component (if applicable):
4.3.0.4-0.1.el7

How reproducible:
100%

Steps to Reproduce:
1. Create a logical network 'net_1' with 'vm' usage only
2. Attempt to update the network using REST in the following manner:
PUT https://<ENGINE_FQDN>/ovirt-engine/api/datacenters/<DATACENTER_ID>/networks/<NETWORK_ID>
with the following body:
<network>
    <usages>
        <usage>display</usage>
        <usage>vm</usage>
    </usages>
</network>

Actual results:
Engine returns 200[OK] but the network does NOT have a display role in the cluster it is assigned to

Expected results:
Engine returns 200[OK] and the network does have a display role in the cluster it is assigned to

Additional info:
- This also reproduces with any other role BESIDES 'vm' role which behaves ok and can be removed or added (roles can be found here http://ovirt.github.io/ovirt-engine-api-model/4.3/#types/network_usage)

- The Engine log reports the network was updated successfully
2019-02-20 15:18:34,271+02 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-50) [networks_update_e0d7b049-495f-488e] EVENT_ID: NETWORK_UPDATE_NETWOR
K(1,114), Network C5_jumbo_net1 was updated on Data Center: golden_env_mixed

Comment 1 msheena 2019-02-20 13:55:57 UTC
It seems that via the https://network-ge-1.scl.lab.tlv.redhat.com/ovirt-engine/api/clusters/7f690914-6c2b-4e49-92f4-7751af6d63ab/networks/cc7f33c4-4e6e-400d-b273-10d1ca61083b URL it is possible to update the roles, however when performing a GET https://network-ge-1.scl.lab.tlv.redhat.com/ovirt-engine/api/clusters/7f690914-6c2b-4e49-92f4-7751af6d63ab/networks
then the href associated with each network is: /ovirt-engine/api/datacenters/648ea7c6-d34d-4b6e-a5b5-ac997ae94db9/networks/8f68d575-f8f6-4fa8-aba7-db07805c1c8c which is not working for update

Comment 2 Dominik Holler 2019-02-20 14:01:24 UTC
Did this request work in older versions?

Comment 3 Dominik Holler 2019-02-20 14:05:58 UTC
Ori, is the scenario expected to work and is this related to bug 1645890 ?

Comment 4 Dominik Holler 2019-02-20 14:25:09 UTC
Did this request work in older versions?

Comment 5 msheena 2019-02-20 16:19:57 UTC
I tested on 4.2.8.3-0.1.el7ev and it works.
What also happens is that upon performing a GET /ovirt-engine/api/clusters/dbba8bf2-f402-11e8-be47-00163e7ba003/networks
the network's href points to: /ovirt-engine/api/clusters/dbba8bf2-f402-11e8-be47-00163e7ba003/networks/ffd80c4e-2d09-47b8-b95d-bbf49c164dca which as I added in comment #1 works perfectly well, so the question is if it should point to the href that works or if the new href is not working properly becuase it does report 200[OK] upon updating, but doesn't change roles (other then vm role)

Comment 6 Dominik Holler 2019-02-20 16:34:02 UTC
Ori, is the scenario expected to work and is this related to bug 1645890 ?

Comment 7 Ori Liel 2019-02-21 08:32:51 UTC
Sounds like two separate issues:

1. GET ...api/clusters/xxx/networks returns networks with href ...api/datacenters/xxx/networks instead of ...api/cluster/xxx/networks. 

   This is probably related to a family of bugs which have inevitably popped-up after https://gerrit.ovirt.org/#/c/82294. 
   So yes, it sounds like it's similar to bug 1645890, and this has an easy fix.

2. PUT .../api/datacenters/networks/yyy providing display usage returns 200 but the display usage is ignored

   Before we go any further I want to make sure I understand - Moshe, when you say it worked on 4.2.8.3-0.1.el7ev, do you mean that 
   PUT .../api/datacenters/networks/yyy worked, or do you mean that the flow worked because ...api/clusters/xxx/networks/yyy is the
   link which was returned, and PUT on that link (as opposed to .../api/datacenters/networks/yyy) works?

Comment 8 msheena 2019-02-21 09:44:02 UTC
My intention was that the networks were mapped with the clusters resource instead of the datacenters one, and this is how it should be according to the documentation: http://ovirt.github.io/ovirt-engine-api-model/master/#types/network/attributes/usages

So the urgency is more a matter of the href pointing to an href other than the one it should point to.
On another note, there is room to consider the fact that using PUT on the datacenters resource returns 200 and ignores the network usages, however, this is of lesser importance at the moment if any since there is no potential of harming data here.

Comment 9 Ori Liel 2019-02-21 10:03:12 UTC
Alright, then IIUC the urgent issue is that 

GET ...api/clusters/xxx/networks will return networks with href ...api/cluster/xxx/networks. I will shortly submit a patch fixing this

Comment 10 RHEL Program Management 2019-02-21 10:20:00 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 11 msheena 2019-03-10 17:30:51 UTC
Verified on:
4.3.2-0.1.el7

Comment 12 Sandro Bonazzola 2019-03-19 10:03:24 UTC
This bugzilla is included in oVirt 4.3.2 release, published on March 19th 2019.

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