diff --git a/doc/source/devstack.rst b/doc/source/devstack.rst index 0c57c534cd..337be13a23 100644 --- a/doc/source/devstack.rst +++ b/doc/source/devstack.rst @@ -134,6 +134,7 @@ Add octavia repo as an external repository and configure following flags in ``lo [[local|localrc]] OCTAVIA_NODE=api DISABLE_AMP_IMAGE_BUILD=True + LIBS_FROM_GIT=python-openstackclient,python-octaviaclient enable_plugin octavia https://git.openstack.org/openstack/octavia.git enable_plugin octavia-dashboard https://git.openstack.org/openstack/octavia-dashboard enable_service octavia @@ -258,6 +259,7 @@ Add octavia repo as an external repository and configure following flags in ``lo [[local|localrc]] OCTAVIA_NODE=api DISABLE_AMP_IMAGE_BUILD=True + LIBS_FROM_GIT=python-openstackclient,python-octaviaclient enable_plugin octavia https://git.openstack.org/openstack/octavia.git enable_plugin octavia-dashboard https://git.openstack.org/openstack/octavia-dashboard enable_service octavia diff --git a/vmware_nsx/services/lbaas/nsx_v3/implementation/listener_mgr.py b/vmware_nsx/services/lbaas/nsx_v3/implementation/listener_mgr.py index 3c9304793e..3a989245f7 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/implementation/listener_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v3/implementation/listener_mgr.py @@ -287,7 +287,6 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager): completor(success=True) -@log_helpers.log_method_call def stats_getter(context, core_plugin, ignore_list=None): """Update Octavia statistics for each listener (virtual server)""" stat_list = [] @@ -300,8 +299,6 @@ def stats_getter(context, core_plugin, ignore_list=None): continue lb_service_id = lb_binding.get('lb_service_id') - LOG.debug("Getting listeners statistics for NSX lb service %s", - lb_service_id) try: # get the NSX statistics for this LB service rsp = lb_service_client.get_stats(lb_service_id) diff --git a/vmware_nsx/services/lbaas/nsx_v3/implementation/loadbalancer_mgr.py b/vmware_nsx/services/lbaas/nsx_v3/implementation/loadbalancer_mgr.py index bb72d62b91..7726852059 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/implementation/loadbalancer_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v3/implementation/loadbalancer_mgr.py @@ -38,6 +38,7 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager): lb['vip_subnet_id']): completor(success=True) else: + completor(success=False) msg = (_('Cannot create lb on subnet %(sub)s for ' 'loadbalancer %(lb)s. The subnet needs to connect a ' 'router which is already set gateway.') % diff --git a/vmware_nsx/services/lbaas/nsx_v3/implementation/member_mgr.py b/vmware_nsx/services/lbaas/nsx_v3/implementation/member_mgr.py index dc16ca3d12..7abbff922b 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/implementation/member_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v3/implementation/member_mgr.py @@ -173,17 +173,18 @@ class EdgeMemberManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager): lb_service = self._create_lb_service( context, service_client, member['tenant_id'], router_id, nsx_router_id, loadbalancer['id'], lb_size) - if lb_service: - lb_service_id = lb_service['id'] - self._add_loadbalancer_binding( - context, loadbalancer['id'], lb_service_id, - nsx_router_id, loadbalancer['vip_address']) - else: - completor(success=False) - msg = (_('Failed to get lb service to attach virtual ' - 'server %(vs)s for member %(member)s') % - {'vs': vs_id, 'member': member['id']}) - raise nsx_exc.NsxPluginException(err_msg=msg) + if not lb_service: + completor(success=False) + msg = (_('Failed to create lb service to attach ' + 'virtual server %(vs)s for member ' + '%(member)s') % + {'vs': vs_id, 'member': member['id']}) + raise nsx_exc.NsxPluginException(err_msg=msg) + + lb_service_id = lb_service['id'] + self._add_loadbalancer_binding( + context, loadbalancer['id'], lb_service_id, + nsx_router_id, loadbalancer['vip_address']) with locking.LockManager.get_lock('pool-member-%s' % lb_pool_id): lb_pool = pool_client.get(lb_pool_id) diff --git a/vmware_nsx/services/lbaas/octavia/octavia_driver.py b/vmware_nsx/services/lbaas/octavia/octavia_driver.py index a997f27e17..c9f4bb1a9c 100644 --- a/vmware_nsx/services/lbaas/octavia/octavia_driver.py +++ b/vmware_nsx/services/lbaas/octavia/octavia_driver.py @@ -45,7 +45,7 @@ unsupported_keys = {'Loadbalancer': ['vip_qos_policy_id'], 'timeout_member_connect', 'timeout_member_data', 'timeout_tcp_inspect'], - 'HealthMonitor': ['expected_codes', 'max_retries_down'], + 'HealthMonitor': ['max_retries_down'], 'Member': ['monitor_address', 'monitor_port', 'backup']} @@ -155,6 +155,12 @@ class NSXOctaviaDriver(driver_base.ProviderDriver): recurse=False, render_unsets=True) listener_dict['id'] = listener_dict['listener_id'] listener_dict['l7_policies'] = listener_dict['l7policies'] + # Add the loadbalancer to the listener dict + if pool_dict.get('loadbalancer_id'): + # Generate a loadbalancer object + listener_dict['loadbalancer'] = ( + self._get_load_balancer_dict( + pool_dict['loadbalancer_id'])) pool_dict['listener'] = listener_dict if 'listeners' not in pool_dict: # multiple listeners is not really supported yet diff --git a/vmware_nsx/services/lbaas/octavia/octavia_listener.py b/vmware_nsx/services/lbaas/octavia/octavia_listener.py index 14fd365377..acda3384c2 100644 --- a/vmware_nsx/services/lbaas/octavia/octavia_listener.py +++ b/vmware_nsx/services/lbaas/octavia/octavia_listener.py @@ -152,6 +152,8 @@ class NSXOctaviaListenerEndpoint(object): constants.PROVISIONING_STATUS: parent_prov_status, constants.OPERATING_STATUS: op_status}] + LOG.debug("Octavia transaction completed with statuses %s", + status_dict) kw = {'status': status_dict} self.client.cast({}, 'update_loadbalancer_status', **kw) @@ -333,7 +335,6 @@ class NSXOctaviaStatisticsCollector(object): eventlet.spawn_n(self.thread_runner, cfg.CONF.octavia_stats_interval) - @log_helpers.log_method_call def thread_runner(self, interval): while True: time.sleep(interval) @@ -353,7 +354,6 @@ class NSXOctaviaStatisticsCollector(object): nl_loadbalancers = context.session.query(models.LoadBalancer).all() return [lb.id for lb in nl_loadbalancers] - @log_helpers.log_method_call def collect(self): if not self.core_plugin.octavia_listener: return