def _add_redundancy_routers(self, context, start_index, stop_index,<EOL>user_visible_router, ports=None,<EOL>ha_settings_db=None, create_ha_group=True):
priority = (DEFAULT_MASTER_PRIORITY +<EOL>(start_index - <NUM_LIT:1>) * PRIORITY_INCREASE_STEP)<EOL>r = copy.deepcopy(user_visible_router)<EOL>r['<STR_LIT>'] = '<STR_LIT>'<EOL>name = r['<STR_LIT:name>']<EOL>redundancy_r_ids = []<EOL>for i in range(start_index, stop_index):<EOL><INDENT>del r['<STR_LIT:id>']<EOL>r.pop('<STR_LIT>', None)<EOL>r[ha.ENABLED] = False<EOL>r['<STR_LIT:name>'] = name + REDUNDANCY_ROUTER_SUFFIX + str(i)<EOL>r[routerrole.ROUTER_ROLE_ATTR] = ROUTER_ROLE_HA_REDUNDANCY<EOL>gw_info = r[EXTERNAL_GW_INFO]<EOL>if gw_info and gw_info['<STR_LIT>']:<EOL><INDENT>for e_fixed_ip in gw_info['<STR_LIT>']:<EOL><INDENT>e_fixed_ip.pop('<STR_LIT>', None)<EOL><DEDENT><DEDENT>r = self.create_router(context, {'<STR_LIT>': r})<EOL>LOG.debug("<STR_LIT>"<EOL>"<STR_LIT>", {'<STR_LIT:index>': i, '<STR_LIT>': r['<STR_LIT:id>']})<EOL>priority += PRIORITY_INCREASE_STEP<EOL>r_b_b = RouterRedundancyBinding(<EOL>redundancy_router_id=r['<STR_LIT:id>'],<EOL>priority=priority,<EOL>user_router_id=user_visible_router['<STR_LIT:id>'])<EOL>context.session.add(r_b_b)<EOL>redundancy_r_ids.append(r['<STR_LIT:id>'])<EOL><DEDENT>for port_db in ports or []:<EOL><INDENT>port = self._core_plugin._make_port_dict(port_db)<EOL>self._add_redundancy_router_interfaces(<EOL>context, user_visible_router, None, port,<EOL>redundancy_r_ids, ha_settings_db, create_ha_group)<EOL><DEDENT>
Creates a redundancy router and its interfaces on
        the specified subnets.