When remove l2gw connection, can not remove vlan binding in neutron db when binding vlan is zero

Bug #1883203 reported by fanghuilin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-l2gw
Fix Released
Undecided
fanghuilin

Bug Description

When remove l2gw connection, can not remove vlan binding in neutron db when binding vlan is zero. And then, it cannot
create this l2gw connection again.

Step1: At first, no l2gw connection exist

# openstack l2gw list
+--------------------------------------+----------------------------------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID | Tenant | Name | Devices |
+--------------------------------------+----------------------------------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 67eb8390-8cc8-409a-85fd-282e05e59758 | 02c0f9589cca400abd623868516c209b | gw1 | device_name='WAI-4_3_617-H68-10.160.9.161.lyct', id='c875d2c4-494d-41f1-a992-1956a6ff6048', interfaces='[{u'segmentation_id': [], u'name': u'Ten-GigabitEthernet1/0/42'}]' |
+--------------------------------------+----------------------------------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

# openstack l2gw connection list

Step2: create l2gw connection
# openstack l2gw connection create --default-segmentation-id 0 gw1 fhl-self-network
+-----------------+--------------------------------------+
| Field | Value |
+-----------------+--------------------------------------+
| ID | 5f221b47-13c4-4282-8abd-b3e9a222bb69 |
| L2 GateWay ID | 67eb8390-8cc8-409a-85fd-282e05e59758 |
| Network ID | 318ee112-4254-4139-abed-b51125a3fe29 |
| Segmentation ID | 0 |
| Tenant | 02c0f9589cca400abd623868516c209b |
+-----------------+--------------------------------------+

Step3: Get info from neutron db
logical_switches
+--------------------------------------+--------------------------------------+------+------------------+
| uuid | name | key | ovsdb_identifier |
+--------------------------------------+--------------------------------------+------+------------------+
| b17aab90-6871-44eb-85ac-7e60bbdcc6d5 | 318ee112-4254-4139-abed-b51125a3fe29 | 5 | ovsdb1 |

vlan_bindings
+--------------------------------------+------+--------------------------------------+------------------+
| port_uuid | vlan | logical_switch_uuid | ovsdb_identifier |
+--------------------------------------+------+--------------------------------------+------------------+
| f38b77ec-a928-4b04-aed1-ec7d1c587b8c | 0 | b17aab90-6871-44eb-85ac-7e60bbdcc6d5 | ovsdb1 |
+--------------------------------------+------+--------------------------------------+------------------+

Step4: delete l2gw connection
# openstack l2gw connection delete 5f221b47-13c4-4282-8abd-b3e9a222bb69
L2 Gateaway Connection 5f221b47-13c4-4282-8abd-b3e9a222bb69 deleted

Step5: Get info from neutron db, there have vlan bindings info left over
logical_switches
+--------------------------------------+--------------------------------------+------+------------------+
| uuid | name | key | ovsdb_identifier |
+--------------------------------------+--------------------------------------+------+------------------+
| b17aab90-6871-44eb-85ac-7e60bbdcc6d5 | 318ee112-4254-4139-abed-b51125a3fe29 | 5 | ovsdb1 |

vlan_bindings
+--------------------------------------+------+--------------------------------------+------------------+
| port_uuid | vlan | logical_switch_uuid | ovsdb_identifier |
+--------------------------------------+------+--------------------------------------+------------------+
| f38b77ec-a928-4b04-aed1-ec7d1c587b8c | 0 | b17aab90-6871-44eb-85ac-7e60bbdcc6d5 | ovsdb1 |
+--------------------------------------+------+--------------------------------------+------------------+

Step6: create l2gw connection again, it cannot create.
# openstack l2gw connection create --default-segmentation-id 0 gw1 fhl-self-network
Duplicate segmentation ID for the interface name=Ten-GigabitEthernet1/0/42 uuid=f38b77ec-a928-4b04-aed1-ec7d1c587b8c
Neutron server returns request_ids: ['req-23c19d6c-4c8c-4ffb-acb6-d618139bd366']

Changed in networking-l2gw:
assignee: nobody → fanghuilin (fanghuilin1987)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-l2gw (master)

Fix proposed to branch: master
Review: https://review.opendev.org/735285

Revision history for this message
Lajos Katona (lajos-katona) wrote :

Thank you for the bug report, I check it this week.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-l2gw (master)

Reviewed: https://review.opendev.org/735285
Committed: https://git.openstack.org/cgit/openstack/networking-l2gw/commit/?id=0c22e5ab19ed0203e3f517341f550e6b01905676
Submitter: Zuul
Branch: master

commit 0c22e5ab19ed0203e3f517341f550e6b01905676
Author: fanghuilin <fanghuilin@360.cn>
Date: Fri Jun 12 11:59:29 2020 +0800

    Fix cleaning vlan_bindings in neutron db when vlan is 0.

    Change-Id: I115f777d3e990587a58ce97a61f59b3480e9270b
    Closes-bug: #1883203

Changed in networking-l2gw:
status: In Progress → Fix Released
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.