Bug 1503577 - Duplicate OVN network name (with subnet) on different DCs pops unfriendly UI message
Summary: Duplicate OVN network name (with subnet) on different DCs pops unfriendly UI ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-provider-ovn
Classification: oVirt
Component: provider
Version: 1.0.4
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ovirt-4.2.6
: ---
Assignee: Miguel Duarte Barroso
QA Contact: msheena
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-18 12:20 UTC by Mor
Modified: 2018-09-03 15:08 UTC (History)
6 users (show)

Fixed In Version: ovirt-provider-ovn-1.2.14
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-03 15:08:21 UTC
oVirt Team: Network
Embargoed:
rule-engine: ovirt-4.2+
rule-engine: ovirt-4.3+


Attachments (Terms of Use)
logs + screenshot (294.75 KB, application/octet-stream)
2017-10-18 12:20 UTC, Mor
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 92177 0 master MERGED Allow duplicate network names 2020-09-07 13:48:34 UTC

Description Mor 2017-10-18 12:20:31 UTC
Created attachment 1340163 [details]
logs + screenshot

Description of problem:
Creation of duplicate OVN networks on different oVirt Data Centers, pops unfriendly UI error message:
"
Error while executing action:

    may not be null
    Attribute: networkId
"

Version-Release number of selected component (if applicable):
4.2.0-0.0.master.20171013142622.git15e767c.el7.centos
ovirt-provider-ovn-1.2-0.20171013135342.git023d6ce.el7.centos.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create OVN network 'ovn_network_1' with subnet (supply CIDR) on DC1.  
2. Try to create additional duplicate network name 'ovn_network_1' with subnet (supply CIDR) on the default DC.
3. UI shows an error (screenshot is attached to the ticket).

Actual results:
Unfriendly message.

Expected results:
Should be handled in UI (validation or better error message) or in engine (should block duplicate names).

Comment 1 Dan Kenigsberg 2017-10-19 09:18:39 UTC
Since OVN does not support it, we should not allow net name dups. We should have a clearer error message, though.

Comment 2 Marcin Mirecki 2017-12-15 10:33:32 UTC
self.idl.ls_add(switch=name, may_exist=False).execute() just exits cleanly if name is a duplicate

Two solution for this:
- better log message - must validate the logical switch exists before adding it
- allow duplicate names - store actual name in external_ids

Comment 3 Miguel Duarte Barroso 2018-07-16 09:22:38 UTC
Patch posted: https://gerrit.ovirt.org/#/c/92177/

Comment 4 Miguel Duarte Barroso 2018-08-07 14:36:33 UTC
Instead of updating the ui to throw a better error message, the ovirt-provider-ovn service was updated to *allow* networks having the same name.

This suggestion can be seen in comment#2: 'allow duplicate names - store actual name in external_ids'.

To verify the bug, you should check that indeed networks with the same name are allowed - e.g. no UI error thrown.

To further verify it, you could use ovn-nbctl in engine node to check the data of the networks:

 - ovn-nbctl list logical_switch

You should see multiple logical switches with names in the following format: ovirt-<network_name>-<generated_uuid>. 

Each of those logical switches should have the user specified name in its external ids column - one entry like 'name: <user_specified_name>'

Comment 5 msheena 2018-08-13 14:02:55 UTC
 Verified according to comment #4 on:
ovirt-engine-4.2.6-0.1.el7ev.noarch
ovirt-provider-ovn-1.2.14-1.el7ev.noarch
openvswitch-ovn-common-2.9.0-55.el7fdp.x86_64
openvswitch-ovn-central-2.9.0-55.el7fdp.x86_64


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