← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1416278] [NEW] Ha router should not schedule to 'dvr_snat' agent

 

Public bug reported:


Ha router should not schedule to 'dvr_snat' agent, but in 'get_l3_agent_candidates', it allow a Ha router to 'dvr-snat' agent,

    def get_l3_agent_candidates(self, context, sync_router, l3_agents):
        """Get the valid l3 agents for the router from a list of l3_agents."""
        candidates = []
        for l3_agent in l3_agents:
            if not l3_agent.admin_state_up:
                continue
            agent_conf = self.get_configuration_dict(l3_agent)
            router_id = agent_conf.get('router_id', None)
            use_namespaces = agent_conf.get('use_namespaces', True)
            handle_internal_only_routers = agent_conf.get(
                'handle_internal_only_routers', True)
            gateway_external_network_id = agent_conf.get(
                'gateway_external_network_id', None)
            agent_mode = agent_conf.get('agent_mode', 'legacy')
            if not use_namespaces and router_id != sync_router['id']:
                continue
            ex_net_id = (sync_router['external_gateway_info'] or {}).get(
                'network_id')
            if ((not ex_net_id and not handle_internal_only_routers) or
                (ex_net_id and gateway_external_network_id and
                 ex_net_id != gateway_external_network_id)):
                continue
            is_router_distributed = sync_router.get('distributed', False)
            if agent_mode in ('legacy', 'dvr_snat') and (
                not is_router_distributed):
                candidates.append(l3_agent)

so  'if agent_mode in ('legacy', 'dvr_snat') ' should be 'if agent_mode
== 'legacy''

** Affects: neutron
     Importance: Undecided
     Assignee: shihanzhang (shihanzhang)
         Status: In Progress

** Changed in: neutron
     Assignee: (unassigned) => shihanzhang (shihanzhang)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1416278

Title:
  Ha router should not schedule to 'dvr_snat' agent

Status in OpenStack Neutron (virtual network service):
  In Progress

Bug description:
  
  Ha router should not schedule to 'dvr_snat' agent, but in 'get_l3_agent_candidates', it allow a Ha router to 'dvr-snat' agent,

      def get_l3_agent_candidates(self, context, sync_router, l3_agents):
          """Get the valid l3 agents for the router from a list of l3_agents."""
          candidates = []
          for l3_agent in l3_agents:
              if not l3_agent.admin_state_up:
                  continue
              agent_conf = self.get_configuration_dict(l3_agent)
              router_id = agent_conf.get('router_id', None)
              use_namespaces = agent_conf.get('use_namespaces', True)
              handle_internal_only_routers = agent_conf.get(
                  'handle_internal_only_routers', True)
              gateway_external_network_id = agent_conf.get(
                  'gateway_external_network_id', None)
              agent_mode = agent_conf.get('agent_mode', 'legacy')
              if not use_namespaces and router_id != sync_router['id']:
                  continue
              ex_net_id = (sync_router['external_gateway_info'] or {}).get(
                  'network_id')
              if ((not ex_net_id and not handle_internal_only_routers) or
                  (ex_net_id and gateway_external_network_id and
                   ex_net_id != gateway_external_network_id)):
                  continue
              is_router_distributed = sync_router.get('distributed', False)
              if agent_mode in ('legacy', 'dvr_snat') and (
                  not is_router_distributed):
                  candidates.append(l3_agent)

  so  'if agent_mode in ('legacy', 'dvr_snat') ' should be 'if
  agent_mode  == 'legacy''

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1416278/+subscriptions


Follow ups

References