Cannot delete vlan type network via network generic switch (ngs)

Bug #1938023 reported by Bartosz Bezak
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Networking ML2 Generic Switch
New
Undecided
Unassigned
neutron
New
Medium
Unassigned

Bug Description

User cannot delete vlan type network via network generic switch:

how to reproduce:
1.Create network - works fine - NGS is able to create vlans on switch
openstack network create test-network

2.Delete network - Is not failing via CLI - however goes too quickly - error log in neutron-server (pasted below)
openstack network delete test-network

neutron stable/victoria - It seems that something had changed in neutron between those two versions (the same NGS version):

working neutron version:
$ pip list | grep -E "neutron|generic-switch"
networking-generic-switch 4.0.1.dev3
neutron 17.1.2.dev36
neutron-dynamic-routing 17.0.1.dev3
neutron-fwaas 16.0.0
neutron-lib 2.6.1
neutron-vpnaas 17.0.1.dev4
python-neutronclient 7.2.1

not working neutron version:
$ pip list | grep -E "neutron|generic-switch"
networking-generic-switch 4.0.1.dev3
neutron 17.2.1.dev4
neutron-dynamic-routing 17.0.1.dev3
neutron-fwaas 16.0.0
neutron-lib 2.6.1
neutron-vpnaas 17.0.1.dev4
python-neutronclient 7.2.1

error:
2021-07-26 09:23:05.274 25 DEBUG neutron.db.ovn_revision_numbers_db [req-80f2ecdb-2321-4d36-8f9c-886e9ff03967 d01eab5bbeb54381aee11cc57b44b45b 2eb2193c72574662945d7a0a60212413 - default default] delete_revision(b23a36b9-1906-4494-bb56-b3a7525c39bb) delete_revision /var/lib/kolla/venv/lib/python3.6/site-packages/neutron/db/ovn_revision_numbers_db.py:118
2021-07-26 09:23:05.293 25 ERROR neutron.plugins.ml2.managers [req-80f2ecdb-2321-4d36-8f9c-886e9ff03967 d01eab5bbeb54381aee11cc57b44b45b 2eb2193c72574662945d7a0a60212413 - default default] Mechanism driver 'genericswitch' failed in delete_network_postcommit: KeyError: 'provider:network_type'
2021-07-26 09:23:05.293 25 ERROR neutron.plugins.ml2.managers Traceback (most recent call last):
2021-07-26 09:23:05.293 25 ERROR neutron.plugins.ml2.managers File "/var/lib/kolla/venv/lib/python3.6/site-packages/neutron/plugins/ml2/managers.py", line 477, in _call_on_drivers
2021-07-26 09:23:05.293 25 ERROR neutron.plugins.ml2.managers getattr(driver.obj, method_name)(context)
2021-07-26 09:23:05.293 25 ERROR neutron.plugins.ml2.managers File "/var/lib/kolla/venv/lib/python3.6/site-packages/networking_generic_switch/generic_switch_mech.py", line 164, in delete_network_postcommit
2021-07-26 09:23:05.293 25 ERROR neutron.plugins.ml2.managers provider_type = network['provider:network_type']
2021-07-26 09:23:05.293 25 ERROR neutron.plugins.ml2.managers KeyError: 'provider:network_type'
2021-07-26 09:23:05.293 25 ERROR neutron.plugins.ml2.managers
2021-07-26 09:23:05.294 25 ERROR neutron.plugins.ml2.plugin [req-80f2ecdb-2321-4d36-8f9c-886e9ff03967 d01eab5bbeb54381aee11cc57b44b45b 2eb2193c72574662945d7a0a60212413 - default default] mechanism_manager.delete_network_postcommit failed: neutron.plugins.ml2.common.exceptions.MechanismDriverError

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

The provider information is added to the network dictionary in [1]. If the number of segments in a network is 1, the provider information will be set in the network dictionary. If the number of segments is >1, the provider information will be written in network['segments'] = [...].

You are probably hitting this issue.

I'll add "networking_generic_switch" to this bug to make this project aware of this problem.

Regards.

[1]https://github.com/openstack/neutron/blob/84ba0a9aebcb22ce8ebb8131bb114dbb035c0d50/neutron/plugins/ml2/managers.py#L167-L184

Revision history for this message
Bartosz Bezak (bbezak) wrote (last edit ):

Interesting...I'm wondering why it is working correctly with older neutron version. And there is only one segment in this network.

Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Bartosz Bezak (bbezak) wrote :
Revision history for this message
Oleg Bondarev (obondarev) wrote :

Yep, same

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.