81f9380765
This change implement's a new BGP plugin which allows BGP support in Openstack, using NSXv service edges (ESG). When a BGP speaker is associated with an external network, service edges which accommodates tenant routers that have their GW port on this network would be configured to enable BGP/Dynamic-routing. The specific BGP configuration (e.g - localAS, neighbours) for the edge is retrieved from the BGP speaker object and its peers. This change also adds an extension to the BGP peer object, this extension allows the cloud operator to associate a BGP peer with a specific service edge that will serve as GW edge for the network, multiple GW edges are supported by enabling ECMP on tenant service edges. Co-Authored: yuyangbj <yangyu@vmware.com> Change-Id: Ife69b97f3232bee378a48d91dc53bdc8837de7f5
62 lines
2.4 KiB
Python
62 lines
2.4 KiB
Python
# Copyright 2013 VMware, Inc
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
import os
|
|
|
|
from oslo_config import cfg
|
|
from oslo_log import log as logging
|
|
|
|
from vmware_nsx.plugins.nsx_v.vshield import edge_appliance_driver
|
|
from vmware_nsx.plugins.nsx_v.vshield import edge_dynamic_routing_driver
|
|
from vmware_nsx.plugins.nsx_v.vshield import edge_firewall_driver
|
|
from vmware_nsx.plugins.nsx_v.vshield.tasks import tasks
|
|
from vmware_nsx.plugins.nsx_v.vshield import vcns
|
|
from vmware_nsx.services.lbaas.nsx_v.v2 import (
|
|
edge_loadbalancer_driver_v2 as lbaas_v2)
|
|
|
|
LOG = logging.getLogger(__name__)
|
|
|
|
|
|
class VcnsDriver(edge_appliance_driver.EdgeApplianceDriver,
|
|
lbaas_v2.EdgeLoadbalancerDriverV2,
|
|
edge_firewall_driver.EdgeFirewallDriver,
|
|
edge_dynamic_routing_driver.EdgeDynamicRoutingDriver):
|
|
|
|
def __init__(self, callbacks):
|
|
super(VcnsDriver, self).__init__()
|
|
|
|
self.callbacks = callbacks
|
|
self.vcns_uri = cfg.CONF.nsxv.manager_uri
|
|
self.vcns_user = cfg.CONF.nsxv.user
|
|
self.vcns_passwd = cfg.CONF.nsxv.password
|
|
self.ca_file = cfg.CONF.nsxv.ca_file
|
|
self.insecure = cfg.CONF.nsxv.insecure
|
|
self.deployment_container_id = cfg.CONF.nsxv.deployment_container_id
|
|
self._pid = None
|
|
self._task_manager = None
|
|
self.vcns = vcns.Vcns(self.vcns_uri, self.vcns_user, self.vcns_passwd,
|
|
self.ca_file, self.insecure)
|
|
|
|
@property
|
|
def task_manager(self):
|
|
if (self._task_manager is None or
|
|
self._pid != os.getpid()):
|
|
LOG.debug("Creating task manager")
|
|
self._pid = os.getpid()
|
|
interval = cfg.CONF.nsxv.task_status_check_interval
|
|
self._task_manager = tasks.TaskManager(interval)
|
|
LOG.debug("Starting task manager")
|
|
self._task_manager.start()
|
|
return self._task_manager
|