Jump to: navigation, search

Neutron/LBaaS/CommonAgentDriver

LBaaS Common Agent-based Driver

Rationale

Haproxy-on-host reference implementation which is using agents is quite specific:

  • with haproxy it is easier to deploy the whole loadbalancer config from scratch every time then to create/update/delete separate components
  • namespace driver needs virtual interface driver on init, other drivers may have their own specific parameters


So it is useful to unify reference agent implementation to:

  • make it suite any driver which wants to use async mechanism
  • have single lbaas agent type and hense single agent scheduling mechanism


What is required

  1. Revision of agent API
  2. Revision of agent loading device driver(s) mechanism
  3. Add optional device_driver field to ServiceProvider. Should be passed to lbaas agent if present.
Agent API changes

Current lbaas agent API is specific for haproxy but it doesn't fit well with other loadbalancers where deploying the whole config from scratch every time is unacceptable. Need to modify agent API as well as device driver API to make them almost a duplication of plugin driver API (quantum.services.loadbalancer.drivers.abstract_driver.LoadBalancerAbstractDriver). In addition every call to agent should contain a device driver reference (according to service provider choosen by tenant):

 class LbaasAgentManager(periodic_task.PeriodicTasks):
 ...
 def update_pool(self, old_pool, pool, device_driver):
     if not device_driver:
         device_driver = self.default_driver  # taken from config
     driver = self.device_drivers.get(device_driver)
     if driver:
         driver.update_pool(old_pool, pool)
     else:
         LOG.error(...
 ...
Loading drivers in agent

Different device drivers may require different initial parameters (like vif_driver for haproxy namespace_driver). Current solution will be to have special sections in lbaas_agent.ini for every device driver so that it can read those parameters itself when loading.