Bug 1647928 - Using 'setupnetworks' restapi call to update an existing network attachment does not work
Summary: Using 'setupnetworks' restapi call to update an existing network attachment d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.2.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.3.0
: ---
Assignee: Miguel Martin
QA Contact: msheena
URL:
Whiteboard:
Depends On: 1647912
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-08 14:56 UTC by Miguel Martin
Modified: 2021-12-10 18:23 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
This release ensures the `setupnetworks` REST API can remove or modify an existing network attachment.
Clone Of: 1647912
Environment:
Last Closed: 2019-05-08 12:38:47 UTC
oVirt Team: Network
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-44335 0 None None None 2021-12-10 18:23:57 UTC
Red Hat Product Errata RHEA-2019:1085 0 None None None 2019-05-08 12:39:02 UTC
oVirt gerrit 95330 0 master MERGED restapi: Allow to update/remove network attachments by network name or id. 2020-06-01 15:49:51 UTC

Description Miguel Martin 2018-11-08 14:56:28 UTC
+++ This bug was initially created as a clone of Bug #1647912 +++

Description of problem:

According to [1] a network attachment within a host can be created, modified and removed using the corresponding tags:

Create or modify -> <modified_network_attachments> 
Remove: -> <removed_network_attachments>

However it doesn't work when modifying or removing an existing network attachment.

[1] http://ovirt.github.io/ovirt-engine-api-model/4.2/#services/host/methods/setup_networks

Version-Release number of selected component (if applicable):
4.2

How reproducible:
Always

Steps to Reproduce:
1. Create a network and bind it to an interface as described at [1]:
~~~
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
  <modified_network_attachments>
    <network_attachment>
      <network>
        <name>mynetwork</name>
      </network>
      <host_nic>
        <name>eth0</name>
      </host_nic>
    </network_attachment>
  </modified_network_attachments>
</action>
~~~

2. Try to modify the network to bind it to another interface:
~~~
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
  <modified_network_attachments>
    <network_attachment>
      <network>
        <name>mynetwork</name>
      </network>
      <host_nic>
        <name>eth1</name>
      </host_nic>
    </network_attachment>
  </modified_network_attachments>
</action>
~~~

3. Or try to remove the network attachment:
~~~
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
  <removed_network_attachments>
    <network_attachment>
      <network>
        <name>mynetwork</name>
      </network>
      <host_nic>
        <name>eth0</name>
      </host_nic>
    </network_attachment>
  </removed_network_attachments>
</action>
~~~

Actual results:

The network attachment cannot be modified failing with:
~~~
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>[Cannot setup Networks. Network mynetwork is already attached via attachment 11111111-1111-1111-111111111111. A new attachment cannot be used for the same network, please reuse the existing one.]</detail>
    <reason>Operation Failed</reason>
</fault>

~~~

The network attachment cannot be removed failing with:
~~~
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>[Cannot setup Networks. Cannot remove following Network Attachments, because they do not exist: 	null.]</detail>
    <reason>Operation Failed</reason>
</fault>
~~~

Expected results:

The network attachment successfuly modified or removed.

Additional info:

It's only possible to modify or remove a network attachment if it is referenced by ID.
The below examples would work.

To modify the network attachment:
~~~
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
  <modified_network_attachments>
    <network_attachment id="11111111-1111-1111-111111111111">
      <network>
        <name>mynetwork</name>
      </network>
      <host_nic>
        <name>eth1</name>
      </host_nic>
    </network_attachment>
  </modified_network_attachments>
</action>
~~~

To remove the network attachment:
~~~
<action>
  <modified_network_attachments>
    <network_attachment id="11111111-1111-1111-111111111111"/>
  </modified_network_attachments>
</action>
~~~

--- Additional comment from Ondra Machacek on 2018-11-08 09:37:23 EST ---

I think we should improve the documentation to explicitly say that it's supported only with ID and add examples how to do so.

Comment 2 RHV bug bot 2018-12-10 15:13:15 UTC
WARN: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.3-ga': '?'}', ]

For more info please contact: rhv-devops: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.3-ga': '?'}', ]

For more info please contact: rhv-devops

Comment 4 Dan Kenigsberg 2018-12-12 06:26:49 UTC
It misses a pm ack from Martin.

Comment 5 msheena 2018-12-17 18:15:27 UTC
Verified on:
4.3.0-0.6.alpha2.el7

Comment 7 errata-xmlrpc 2019-05-08 12:38:47 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

Comment 8 Daniel Gur 2019-08-28 13:11:30 UTC
sync2jira

Comment 9 Daniel Gur 2019-08-28 13:15:42 UTC
sync2jira


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