[OVSDB-200] Stale OF entries retained in br-int flow table on openstack-controller side,when VM resides on unstacked compute node Created: 01/Sep/15  Updated: 19/Oct/17  Resolved: 30/Sep/15

Status: Resolved
Project: ovsdb
Component/s: openstack.net-virt
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Vasanthan Balasubramaniyan Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File Controller_Node_br_int.txt     Text File compute_node_br_int.txt     File plugin.sh    
External issue ID: 4229

 Description   

Build#: Lithium-SR1 Build
Openstack: stable/kilo

local.conf snip
=======
enable_plugin networking-odl https://github.com/stackforge/networking-odl stable/kilo
Q_PLUGIN=ml2
ENABLE_TENANT_TUNNELS=True
Q_ML2_TENANT_NETWORK_TYPE=vxlan
PUBLIC_INTERFACE=em3
ODL_LOCAL_IP=20.1.1.3
disable_service q-l3
Q_L3_ENABLED=True
ODL_L3=True

ODL custom.properites
================
ovsdb.l3.fwd.enabled=yes
ovsdb.l3gateway.mac=00:00:5E:00:02:01 (tested with both enable/disabled option)

Environment
============
Openstack controller & 10 compute node connected with ODL as external mode.

Problem:
==========
1.Have create the VxLAN tunnel Network (3.3.3.0/24) and spawed 1 VM instance on each compute node (i.e 12 compute node).Respective OF entries created on br-int (as per sudo ovs-ofctl -O OpenFlow13 dump-flows br-int)

2.Unstacked the all 12 compute node

3.Check br-int OF entries on openstack controller side.
(sudo ovs-ofctl -O OpenFlow13 dump-flows br-int)

Expected all OF entries needs to be removed either by OF flow expire mechanism or unstack event from compute node side.

Current behaviour all 12 VM Instance OF entries retained untill openstack controller unstacked and restacked.

sudo ovs-ofctl -O OpenFlow13 dump-flows br-int



 Comments   
Comment by Ravi Shankar S [ 01/Sep/15 ]

The OVS cleanup is not initiated by the ODL controller. It is initiated by unstack.sh script.

The script file /opt/stack/networking-odl/devstack/plugin.sh has a function stop_opendaylight-compute(). This function will try to delete all the ports and bridges of the OVS. This issue is not related to ODL and it should be related to openstack.

Comment by Vasanthan Balasubramaniyan [ 02/Sep/15 ]

Attachment Controller_Node_br_int.txt has been added with description: OpenstackCOntroller_BR_INT_OFENTRIES

Comment by Vasanthan Balasubramaniyan [ 02/Sep/15 ]

Compute node br-int OF entries and you can see stale OF entries on controller_br_int attachment

Comment by Vasanthan Balasubramaniyan [ 02/Sep/15 ]

Attachment compute_node_br_int.txt has been added with description: openstackComputeNode_BRINT_OFEntries

Comment by Vasanthan Balasubramaniyan [ 02/Sep/15 ]

Flow programming(i.e flow creation) done thru ODL controller,so respective flow deletion also needs to be performed thru ODL Controller.

Step to recreate :
==================
1.Stack the Openstack controller and one compute node (i.e used one compute node because to isolated stale entries easily)
2.Create Networks on openstack controller
3.Spawn VM-1 on openstack controller node (i.e openstack controller node also act as compute node),check the br-int OF entries
4.Spawn VM-2 on openstack compute node),check br-int OF entries on both openstack controller and compute node.
5.Unstack & cleanup the compute node instance(where VM2 node spawned).Check the br-int OF entries on openstack-controller node side.
6.stack the compute node and spawn the VM-3 (and attach step3 created network).Verify the br-int OF entries on openstack controller & compute node .
7.You can see the OF stale entries br-int of openstack controller.Each VM instance(spawned on compute node) will create one OF entry on openstack controller node br-int.So OF stale entries will grow,if number of VM grows on compute node side and overload the openstack controller.

This complete br-int OF entries captured and attached with defects.

On Practical scenario,
=====================
1.Openstack Compute node stack/unstack is common beahviour in datacenter.
2.Openstack Controller node cannot be unstacked too often,(i.e on each openstack Compute node unstack).
3.if OF stale entries doesn't cleaned on Controller node of each Compute node unstack & clean side,then easily overload/exhaust the Openstack controller node OVS flow table using ODL controller.

Comment by Ravi Shankar S [ 03/Sep/15 ]

As per the bug, a VM is created in each of the compute nodes. When the unstack.sh script is executed only the openstack services are disabled. The VM and the network are not deleted.

When a VM/network is deleted from openstack, 2 types of event will reach ODL,
1. Northbound events from openstack
2. South bound events from OVS

Only after processing these 2 types of event, the ODL will clear the flows. When the unstack.sh scripts is executed on any node, the northbound events are not generated. This event will be generated by the openstack and that's the reason for flows not getting removed. The proper cleanup has to be initiated from openstack.

The unstack.sh procedure will put ODL in a inconsistent state with respect to the flows. So, ODL cannot do anything to fix this issue. This bug will be more appropriate in openstack context.

Comment by Ravi Shankar S [ 07/Sep/15 ]

When the unstack.sh script is run the neutron PORT DELETE southound events does not reach ODL controller. This is the reason why the stale entries are present in controller node.
When the same cleanup is done through the openstack, the neutron PORT DELETE southbound events reach the ODL controller which clears the flows in all the connected nodes.

So, unstack.sh will not be the clean way to removes VM's and network.

Comment by Ravi Shankar S [ 08/Sep/15 ]

The clean way to cleanup the node is to delete VM and network from openstack Horizon UI. In this way stale entry issue can be resolved. Cleanup from openstack is the preferred approach.

So, could you please close the BUG?

Comment by Ravi Shankar S [ 10/Sep/15 ]

Fixed the plugin.sh scipt to delete all the ports and then delete the OVSDB connection.

Comment by Ravi Shankar S [ 10/Sep/15 ]

Attachment plugin.sh has been added with description: The modified Plugin.sh will solve the stale entry issue

Comment by Vasanthan Balasubramaniyan [ 10/Sep/15 ]

1.Copied the plugin.sh (attached this bugzilla)on /opt/stack/networking-odl/devstack/
2.Restacked the compute node
3.Spwaned VM1 on compute node1 and VM2 on compute node2

Compute node1 snip
==================
sudo ovs-ofctl -O OpenFlow13 dump-flows br-int | grep "x427"

cookie=0x0, duration=311.991s, table=110, n_packets=5, n_bytes=968, tun_id=0x427,dl_dst=fa:16:3e:94:dd:6c actions=output:3

4.Unstacked the compute node-2 and vm-2 related OF entries has been removed from br-int

This bug fix specific with *Openstack* side .Hence closing this issue.

Comment by Ravi Shankar S [ 30/Sep/15 ]

This BUG is specific to openstack. Submitted a review in openstack
https://review.openstack.org/#/c/228393

Generated at Wed Feb 07 20:35:46 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.