I found meaning of option "router_auto_schedule" is hard to follow. A quick code review finds it is only used at
```python
def get_router_ids(self, context, host):
"""Returns IDs of routers scheduled to l3 agent on <host>
This will autoschedule unhosted routers to l3 agent on <host> and then
return all ids of routers scheduled to it.
"""
if extensions.is_extension_supported( self.l3plugin, constants.L3_AGENT_SCHEDULER_EXT_ALIAS):
if cfg.CONF.router_auto_schedule: self.l3plugin.auto_schedule_routers(context, host)
return self.l3plugin.list_router_ids_on_host(context, host)
```
which seems to be fixing router without agents associated with it. And even if I turn this option off, router is still able to be properly scheduled to agents. because
```python
@registry.receives(resources.ROUTER, [events.AFTER_CREATE], priority_group.PRIORITY_ROUTER_EXTENDED_ATTRIBUTE)
def _after_router_create(self, resource, event, trigger, context, router_id, router, router_db, **kwargs):
if not router['ha']:
return
try: self.schedule_router(context, router_id) router['ha_vr_id'] = router_db.extra_attributes.ha_vr_id self._notify_router_updated(context, router_id)
except Exception as e:
with excutils.save_and_reraise_exception() as ctx:
if isinstance(e, l3ha_exc.NoVRIDAvailable): ctx.reraise = False LOG.warning("No more VRIDs for router: %s", e) else: LOG.exception("Failed to schedule HA router %s.", router_id) router['status'] = self._update_router_db( context, router_id, {'status': constants.ERROR})['status']
```
seems to not respecting this option.
So IMO auto_schedule_router might better be renamed to something like `fix_dangling_routers` etc and could be turned off if user wants to fix wrong routers manually. The reason is that could router by agent is pretty expensive for a relatively large deployment with around 10,000 routers.
I found meaning of option "router_ auto_schedule" is hard to follow. A quick code review finds it is only used at
```python ids(self, context, host):
def get_router_
"""Returns IDs of routers scheduled to l3 agent on <host>
This will autoschedule unhosted routers to l3 agent on <host> and then is_extension_ supported(
self. l3plugin, constants. L3_AGENT_ SCHEDULER_ EXT_ALIAS) : router_ auto_schedule:
self. l3plugin. auto_schedule_ routers( context, host) list_router_ ids_on_ host(context, host)
return all ids of routers scheduled to it.
"""
if extensions.
if cfg.CONF.
return self.l3plugin.
```
which seems to be fixing router without agents associated with it. And even if I turn this option off, router is still able to be properly scheduled to agents. because
```python receives( resources. ROUTER, [events. AFTER_CREATE] ,
priority_ group.PRIORITY_ ROUTER_ EXTENDED_ ATTRIBUTE) router_ create( self, resource, event, trigger, context,
router_ id, router, router_db, **kwargs):
self. schedule_ router( context, router_id)
router[ 'ha_vr_ id'] = router_ db.extra_ attributes. ha_vr_id
self. _notify_ router_ updated( context, router_id) save_and_ reraise_ exception( ) as ctx: NoVRIDAvailable ):
ctx. reraise = False
LOG. warning( "No more VRIDs for router: %s", e)
else:
LOG. exception( "Failed to schedule HA router %s.",
router_ id)
router[ 'status' ] = self._update_ router_ db(
context, router_id,
{ 'status' : constants. ERROR}) ['status' ]
@registry.
def _after_
if not router['ha']:
return
try:
except Exception as e:
with excutils.
if isinstance(e, l3ha_exc.
```
seems to not respecting this option.
So IMO auto_schedule_ router might better be renamed to something like `fix_dangling_ routers` etc and could be turned off if user wants to fix wrong routers manually. The reason is that could router by agent is pretty expensive for a relatively large deployment with around 10,000 routers.