Skip to content

Commit

Permalink
Do not remove configured RT from RI on restart
Browse files Browse the repository at this point in the history
When Schema Transformer restarts, it currently resets all route targets on all
routing instances. If there were any RTs configured on the parent VN, those will
be removed and added back when notification is received for adding those targets
to the VN. This can cause lack of connectivity for some time. Instead, now we
read the configured targets when routing istance is created and add the
configured route targets to the RI.

Change-Id: Id9bdb45c5a782bd4e4ae03a29dd1cd37ca20b081
Closes-Bug: 1418701
(cherry picked from commit 28a871d)
  • Loading branch information
Sachin Bansal committed Feb 12, 2015
1 parent fed0d74 commit c78cfb3
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/config/schema-transformer/to_bgp.py
Expand Up @@ -238,7 +238,13 @@ def __init__(self, name):
self.dynamic_acl = acl_obj

self.ipams = {}
self.rt_list = set()
rt_list = self.obj.get_route_target_list()
if rt_list:
self.rt_list = set(rt_list.get_route_target())
for rt in self.rt_list:
RouteTargetST.locate(rt)
else:
self.rt_list = set()
self._route_target = 0
self.route_table_refs = set()
self.route_table = {}
Expand Down Expand Up @@ -571,13 +577,30 @@ def locate_routing_instance(self, rinst_name, service_chain=None):
else:
rinst_obj.set_route_target(rtgt_obj, inst_tgt_data)
rinst_obj.set_routing_instance_is_default(is_default)
for rt in self.rt_list:
rtgt_obj = RouteTarget(rt)
if is_default:
inst_tgt_data = InstanceTargetType()
else:
inst_tgt_data = InstanceTargetType(
import_export="export")
rinst_obj.add_route_target(rtgt_obj, inst_tgt_data)

_vnc_lib.routing_instance_update(rinst_obj)
except NoIdError:
rinst_obj = None
if rinst_obj is None:
rinst_obj = RoutingInstance(rinst_name, self.obj)
rinst_obj.set_route_target(rtgt_obj, inst_tgt_data)
rinst_obj.set_routing_instance_is_default(is_default)
for rt in self.rt_list:
rtgt_obj = RouteTarget(rt)
if is_default:
inst_tgt_data = InstanceTargetType()
else:
inst_tgt_data = InstanceTargetType(
import_export="export")
rinst_obj.add_route_target(rtgt_obj, inst_tgt_data)
_vnc_lib.routing_instance_create(rinst_obj)
except (BadRequest, HttpError) as e:
_sandesh._logger.error(
Expand Down

0 comments on commit c78cfb3

Please sign in to comment.