Browse Source

Octavia driver: agent implementation

The driver is loaded, then terminated whenever a request is issued.
This behavior causes termination of the Octavia listener which is
responsible to the processing of the driver status updates and
statistics processing.
The following change implements an agent which will execute the
listener.

Change-Id: I566aaa65df4ba7455577a539aa9eebb6cc36a099
(cherry picked from commit 24e93461d0)
tags/14.0.1
Kobi Samoray 10 months ago
committed by asarfaty
parent
commit
bac9c058e5
3 changed files with 30 additions and 15 deletions
  1. +8
    -0
      doc/source/devstack.rst
  2. +2
    -0
      setup.cfg
  3. +20
    -15
      vmware_nsx/services/lbaas/octavia/octavia_driver.py

+ 8
- 0
doc/source/devstack.rst View File

@@ -153,6 +153,9 @@ Add octavia and python-octaviaclient repos as external repositories and configur
[controller_worker]
network_driver = allowed_address_pairs_driver

[driver_agent]
enabled_provider_agents=vmwareagent

NSX-T
-----

@@ -276,6 +279,8 @@ Add octavia and python-octaviaclient repos as external repositories and configur
[controller_worker]
network_driver = allowed_address_pairs_driver

[driver_agent]
enabled_provider_agents=vmwareagent

NSX-P
-----
@@ -357,6 +362,9 @@ Add octavia and python-octaviaclient repos as external repositories and configur
[controller_worker]
network_driver = allowed_address_pairs_driver

[driver_agent]
enabled_provider_agents=vmwareagent

Trunk Driver
~~~~~~~~~~~~



+ 2
- 0
setup.cfg View File

@@ -98,6 +98,8 @@ vmware_nsx.neutron.nsxv3.housekeeper.jobs =
mismatch_logical_port = vmware_nsx.plugins.nsx_v3.housekeeper.mismatch_logical_port:MismatchLogicalportJob
octavia.api.drivers =
vmwareedge = vmware_nsx.services.lbaas.octavia.octavia_driver:NSXOctaviaDriver
octavia.driver_agent.provider_agents =
vmwareagent = vmware_nsx.services.lbaas.octavia.octavia_driver:vmware_nsx_provider_agent
[build_sphinx]
source-dir = doc/source
build-dir = doc/build


+ 20
- 15
vmware_nsx/services/lbaas/octavia/octavia_driver.py View File

@@ -15,6 +15,7 @@

import copy
import socket
import time

from oslo_config import cfg
from oslo_log import helpers as log_helpers
@@ -73,7 +74,6 @@ class NSXOctaviaDriver(driver_base.ProviderDriver):
def __init__(self):
super(NSXOctaviaDriver, self).__init__()
self._init_rpc_messaging()
self._init_rpc_listener()
self.repositories = repositories.Repositories()

@log_helpers.log_method_call
@@ -85,20 +85,6 @@ class NSXOctaviaDriver(driver_base.ProviderDriver):
version='1.0')
self.client = messaging.RPCClient(transport, target)

@log_helpers.log_method_call
def _init_rpc_listener(self):
# Initialize RPC listener
topic = d_const.DRIVER_TO_OCTAVIA_TOPIC
server = socket.gethostname()
target = messaging.Target(topic=topic, server=server,
exchange="common", fanout=False)
endpoints = [NSXOctaviaDriverEndpoint()]
access_policy = dispatcher.DefaultRPCAccessPolicy

self.octavia_server = get_rpc_server(target, endpoints,
access_policy)
self.octavia_server.start()

def get_obj_project_id(self, obj_type, obj_dict):
if obj_dict.get('project_id'):
return obj_dict['project_id']
@@ -596,3 +582,22 @@ class NSXOctaviaDriverEndpoint(driver_lib.DriverLibrary):
except exceptions.UpdateStatisticsError as e:
LOG.error("Failed to update Octavia listener statistics. "
"Stats %s, Error %s", statistics, e.fault_string)


@log_helpers.log_method_call
def vmware_nsx_provider_agent(exit_event):
# Initialize RPC listener
topic = d_const.DRIVER_TO_OCTAVIA_TOPIC
server = socket.gethostname()
target = messaging.Target(topic=topic, server=server,
exchange="common", fanout=False)
endpoints = [NSXOctaviaDriverEndpoint()]
access_policy = dispatcher.DefaultRPCAccessPolicy
get_transport()
octavia_server = get_rpc_server(target, endpoints, access_policy)
octavia_server.start()

LOG.info('VMware NSX Octavia provider agent has started.')
while not exit_event.is_set():
time.sleep(1)
LOG.info('VMware NSX Octavia provider agent is exiting.')

Loading…
Cancel
Save