[OVSDB-197] Network delete doesnot removed the Vxlan tunnel entries on ovs switch Created: 27/Aug/15  Updated: 03/May/18  Resolved: 15/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: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Duplicate
duplicates OVSDB-196 VM delete doesnot removed all related... Resolved
External issue ID: 4206

 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

Problem:
=======
1.Create Network on openstack(using horizon/cli)

Following flow entries created for specific tunnel.
openflow@os-controller:~/devstack$ sudo ovs-ofctl -O OpenFlow13 dump-flows br-int | grep 439
cookie=0x0, duration=285.661s, table=0, n_packets=8, n_bytes=648, in_port=12,dl_src=fa:16:3e:3d:bd:d9 actions=set_field:0x439->tun_id,load:0x1->NXM_NX_REG0[],goto_table:20
cookie=0x0, duration=283.527s, table=0, n_packets=0, n_bytes=0, tun_id=0x439,in_port=5 actions=load:0x2->NXM_NX_REG0[],goto_table:20
cookie=0x0, duration=283.594s, table=110, n_packets=0, n_bytes=0, priority=8192,tun_id=0x439 actions=drop
cookie=0x0, duration=283.680s, table=110, n_packets=2, n_bytes=140, priority=16383,reg0=0x1,tun_id=0x439,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=output:12,output:5
cookie=0x0, duration=283.744s, table=110, n_packets=0, n_bytes=0, priority=16384,reg0=0x2,tun_id=0x439,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=output:12
cookie=0x0, duration=283.810s, table=110, n_packets=0, n_bytes=0, tun_id=0x439,dl_dst=fa:16:3e:3d:bd:d9 actions=output:12

openflow@os-compute1:~/devstack$ sudo ovs-ofctl -O OpenFlow13 dump-flows br-int | grep 439
cookie=0x0, duration=316.031s, table=110, n_packets=0, n_bytes=0, tun_id=0x439,dl_dst=fa:16:3e:3d:bd:d9 actions=output:3

2.After deleting the Network,Expected to delete this tunnel entries from flow table.
But this entries retaining in the ovs-switch both openstack controller and compute node.



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

The issue in the bug is when a network is created, flows are configured in the openvswitch for a particular tunnel ID. When the same network is deleted, these flows are not deleted.

Observation:

1. When the network is to be deleted, the network:dhcp neutron port is not present (getTenantNetwork did not find neutronPort) in OVSDB. Because of this the local and tunnel rules were not deleted.

getTenantNetwork for OvsdbTerminationPointAugmentation{getInterfaceExternalIds=[InterfaceExternalIds{getExternalIdKey=iface-id, getExternalIdValue=27581e57-ca33-40fa-aced-ef0aa7b56629, augmentations={}}, InterfaceExternalIds{getExternalIdKey=iface-status, getExternalIdValue=active, augmentations={}}, InterfaceExternalIds{getExternalIdKey=attached-mac, getExternalIdValue=fa:16:3e:84:24:a3, augmentations={}}], getInterfaceType=class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeInternal, getInterfaceUuid=Uuid [_value=2238f5b3-f004-452d-94ec-d7268409c5c0], getName=tap27581e57-ca, getOfport=11, getPortUuid=Uuid [_value=a8c26072-08b3-4125-9872-2c76e2abca96]}
2015-08-31 06:17:10,279 | INFO | ntDispatcherImpl | TenantNetworkManagerImpl | 259 - org.opendaylight.ovsdb.openstack.net-virt - 1.1.1.Lithium-SR1 | getTenantNetwork did not find neutronPort 27581e57-ca33-40fa-aced-ef0aa7b56629 from termination point tap27581e57-ca

2. When a network is created a subnet and a DHCP interface (network:dhcp) is also created.

Work Around:
When I tried to delete the subnet/disable the dhcp in the subnet, the local and tunnel rules were deleted properly.

a. In the above case if I delete the subnet, I could also see a Null pointer exception which corresponds to the OVSDB-196

java.lang.NullPointerException
at org.opendaylight.ovsdb.openstack.netvirt.impl.SecurityServicesImpl.getDHCPServerPort(SecurityServicesImpl.java:133)[259:org.opendaylight.ovsdb.openstack.net-virt:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.OF13Provider.removeLocalRules(OF13Provider.java:844)[260:org.opendaylight.ovsdb.openstack.net-virt-providers:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.OF13Provider.handleInterfaceDelete(OF13Provider.java:1147)[260:org.opendaylight.ovsdb.openstack.net-virt-providers:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.SouthboundHandler.handleInterfaceDelete(SouthboundHandler.java:112)[259:org.opendaylight.ovsdb.openstack.net-virt:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.SouthboundHandler.processPortDelete(SouthboundHandler.java:165)[259:org.opendaylight.ovsdb.openstack.net-virt:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.SouthboundHandler.processPortEvent(SouthboundHandler.java:290)[259:org.opendaylight.ovsdb.openstack.net-virt:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.SouthboundHandler.processEvent(SouthboundHandler.java:232)[259:org.opendaylight.ovsdb.openstack.net-virt:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:97)[259:org.opendaylight.ovsdb.openstack.net-virt:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl.access$100(EventDispatcherImpl.java:30)[259:org.opendaylight.ovsdb.openstack.net-virt:1.1.1.Lithium-SR1]
at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl$1.run(EventDispatcherImpl.java:59)[259:org.opendaylight.ovsdb.openstack.net-virt:1.1.1.Lithium-SR1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_79]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]e
at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]

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

The workaround for this issue is disable the dhcp in the subnet. Then go ahead and delete the network. The local and tunnel rules were deleted properly.

Comment by Vasanthan Balasubramaniyan [ 03/Sep/15 ]

As a workaround,
1.Disabled the Subnet DHCP service
2.Delete the Network

Only below stale tunnel OF entries retained,

cookie=0x0, duration=160.332s, table=110, n_packets=0, n_bytes=0, priority=8192,tun_id=0x406 actions=drop

Without Disable DHCP,if we delete the Network,It will retained the 6 OF stale entries related to same tunnel.

Comment by Aswin Suryanarayanan [ 09/Sep/15 ]

For a DHCP port, the same port shall be returned without checking the subnet cache in getDHCPServerPort. This can prevent the null pointer exception caused by the reference to subnet cache in case of a DHCP port delete

https://git.opendaylight.org/gerrit/26740

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

The OVSDB-197 is a duplicate of OVSDB-196. The issue
in 4205 is related to removing neutron port while VM deletion.
The issue in OVSDB-197 is related to removing dhcp neutron port while deleting network.
So, for confirmation we put a sleep in the handler for removing
neutron port in neutron transcriber module. After that the issue in
OVSDB-196 and 4206 were not re-created.
So, a proper fix for 4205 will also resolve the OVSDB-197. Hence, moving the BUG to DUPLICATE state

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