ST not cleaning up RIs sometimes when SC policy detached from VNs

Bug #1544826 reported by amit surana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.0
Fix Committed
Medium
Sachin Bansal
Trunk
Fix Committed
Medium
Sachin Bansal

Bug Description

In some cases, ST does not do the the required cleanup when a policy with a SC is detached from the VN. This lead several discrepancies in the system (like duplicated RTs, invalid RI refs, routes showing up in incorrect VRfs etc.

Tags: blocker config
amit surana (asurana-t)
tags: added: blocker
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/17194
Submitter: Sachin Bansal (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/17194
Committed: http://github.org/Juniper/contrail-controller/commit/1615f137a1e09912b08c919017adc5687f38be1e
Submitter: Zuul
Branch: master

commit 1615f137a1e09912b08c919017adc5687f38be1e
Author: Sachin Bansal <email address hidden>
Date: Fri Feb 12 11:30:14 2016 -0800

Recreate link to route aggregate and policy in RI-ST constrtor

When routing instance is read during init time, we were not recreating any links
to the constructor. When such a routing instance is deleted, it will have those
back refs and we won't be able to delete it. If we recreate the links, we will
know to delete those links before deleting the routing instance.

Change-Id: I3938a2dfed27b084f2aa9c031ae39ea39400d33f
Closes-Bug: 1544826

Revision history for this message
Prakash Bailkeri (prakashmb) wrote :

While deleting the network policy which is attached to VNs, following traceback is seen
Please note: The SI in the policy had RA and RP object attached.

End result:
1. internal routing instance is not cleaned

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/schema_transformer/to_bgp.py", line 318, in _vnc_subscribe_callback
    res_obj.evaluate()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 1336, in evaluate
    service_chain.destroy()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 2683, in destroy
    RoutingInstanceST.delete(service_name1)
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 117, in delete
    obj.delete_obj()
  File "/usr/lib/python2.7/dist-packages/schema_transformer/config_db.py", line 2250, in delete_obj
    DBBaseST._vnc_lib.routing_instance_delete(id=self.obj.uuid)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 39, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 512, in _object_delete
    content = self._request_server(rest.OP_DELETE, uri)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 712, in _request_server
    retry_count=retry_count)
  File "/usr/lib/python2.7/dist-packages/vnc_api/vnc_api.py", line 757, in _request
    raise RefsExistError(content)
RefsExistError: Delete when resource still referred: ['http://10.204.216.70:8082/routing-policy/4fb1094d-4135-4552-9427-fec882c6b650']

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.0

Review in progress for https://review.opencontrail.org/17915
Submitter: Sachin Bansal (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/17921
Submitter: Sachin Bansal (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/17921
Committed: http://github.org/Juniper/contrail-controller/commit/eb91de601c932cf16813a9f0060d3f3e97b2767c
Submitter: Zuul
Branch: master

commit eb91de601c932cf16813a9f0060d3f3e97b2767c
Author: Sachin Bansal <email address hidden>
Date: Fri Feb 26 07:56:09 2016 -0800

Reinitialize routing instance refs in routing policy on start up

When schema transformer is restarted, we are not reinitializing link
betweeen routing instance and routing policy objects. As a result, if
we later try to delete the routing instance, it fails because of existing
refs to routing policy. With this fix, we will delete the ref first
before deleting the routing instance.

Change-Id: Iceb0ff46630076fcd0480808605f56a22f62036e
Closes-Bug: 1544826
(cherry picked from commit c094b23914bfed5c3a33920c25fd93c966173418)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/17915
Committed: http://github.org/Juniper/contrail-controller/commit/c094b23914bfed5c3a33920c25fd93c966173418
Submitter: Zuul
Branch: R3.0

commit c094b23914bfed5c3a33920c25fd93c966173418
Author: Sachin Bansal <email address hidden>
Date: Fri Feb 26 07:56:09 2016 -0800

Reinitialize routing instance refs in routing policy on start up

When schema transformer is restarted, we are not reinitializing link
betweeen routing instance and routing policy objects. As a result, if
we later try to delete the routing instance, it fails because of existing
refs to routing policy. With this fix, we will delete the ref first
before deleting the routing instance.

Change-Id: Iceb0ff46630076fcd0480808605f56a22f62036e
Closes-Bug: 1544826

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.