'Remove the router from l3 agent.
After removal, the router will be non-hosted until there is update
which leads to re-schedule or be added to another agent manually.'

def remove_router_from_l3_agent(self, context, agent_id, router_id):

    agent = self._get_agent(context, agent_id)
    agent_mode = self._get_agent_mode(agent)
    if (agent_mode == constants.L3_AGENT_MODE_DVR):
        raise l3agentscheduler.DVRL3CannotRemoveFromDvrAgent()
    self._unbind_router(context, router_id, agent_id)
    router = self.get_router(context, router_id)
    plugin = directory.get_plugin(plugin_constants.L3)
    if router.get('ha'):
        plugin.delete_ha_interfaces_on_host(context, router_id, agent.host)
    retain_router = False
    if router.get('distributed'):
        subnet_ids = plugin.get_subnet_ids_on_router(context, router_id)
        if (subnet_ids and agent.host):
            retain_router = plugin._check_dvr_serviceable_ports_on_host(context, agent.host, subnet_ids)
    l3_notifier = self.agent_notifiers.get(constants.AGENT_TYPE_L3)
    if (retain_router and l3_notifier):
        l3_notifier.routers_updated_on_host(context, [router_id], agent.host)
    elif l3_notifier:
        l3_notifier.router_removed_from_agent(context, router_id, agent.host)
