Commit Graph

28 Commits

Author SHA1 Message Date
Adam Harwell f8d023fbfe Retiring neutron-lbaas
Depends-On: https://review.opendev.org/#/c/658493/
Change-Id: Ia4f4b335295c0e6add79fe0db5dd31b4327fdb54
2019-05-11 03:18:03 -07:00
Boden R fe6a360456 use setup_extension in unit tests
This patch switches usages of _setUpExtension over to setup_extension to
phase out the unused attr map parameter. For more details see
https://review.openstack.org/#/c/561305/

Change-Id: I65b3daa6ba0c6db324973fed4da5951b169e573d
2018-08-22 14:18:05 -06:00
ycx aa50c49b6f Add "delay" value determination for health monitor
Creating health monitor with excessive delay value can produce
an error, because delay exceeds database restrictions.
This fix adds delay value determination in the health monitor
creation, error message can get displayed over prompt.

Change-Id: I216c3fd947136ce7c26d3094edfa72084632c5a3
Closes-bug: 1706078
2017-08-02 14:33:06 +08:00
reedip f99f4f8a6d Migrate Constants from neutron.plugin to neutron_lib
With the merge of [1], plugin constants are now available in
neutron_lib, so it makes sense to move there .

[1] https://review.openstack.org/#/c/429036/

Change-Id: Ic6e5620d6d3ff33447d3804919cd63716d4a6894
2017-04-15 05:59:50 +00:00
Cedric Shock 4455759f45 Allow creating loadbalancer with network_id
Create loadbalancer accepts either a vip_subnet_id
or vip_network_id. If vip_network_id is provided the
vip port is created on that network using the default
neutron behavior. If neutron assigns multiple fixed ips,
an ipv4 addresses is chosen as the vip in preference to
ipv6 addresses.

-----

Who would use the feature?
LBaaS users on a network with multiple subnets

Why use the feature?
Large deployments may have many subnets to allocate
vip addresses. Many of these subnets might have
no addresses remaining to allocate. Creating a
loadbalancer by network selects a subnet with an
available address.

What is the exact usage for the feature?

POST /lbaas/loadbalancers
Host: lbaas-service.cloudX.com:8651
Content-Type: application/json
Accept: application/json
X-Auth-Token:887665443383838

{
    "loadbalancer": {
        "name": "loadbalancer1",
        "description": "simple lb",
        "tenant_id": "b7c1a69e88bf4b21a8148f787aef2081",
        "vip_network_id": "a3847aea-fa6d-45bc-9bce-03d4472d209d",
        "admin_state_up": true
    }
}

DocImpact: 2.0 API Create a loadbalancer attributes
APIImpact
Closes-Bug: #1465758
Change-Id: I31f10581369343fde7f928ff0aeb1024eb752dc4
2016-09-14 23:28:20 +00:00
Stephen Balukoff c46100fca3 Expect project_id in API calls
Change I8775aa8a477191ef21e7c3c6da31d098befefc3c in the Neutron code
tree recently updated API commands to include objects' project_id in
the call. This broke the neutron-lbaas gate. This commit updates the
neutron-lbaas API tests to expect the project_id as a paramenter as
appropriate.

Change-Id: Ib9661bc36372c182b814b17f94740a2a21b63874
Closes-Bug: #1623252
2016-09-13 16:08:12 -07:00
Doug Wiegley 7aa3d9ff9c Nuke lbaas v1
v1 is not going to ship in Newton, the deprecation notice
been around for two cycles, and there is now a migration
script.

Also includes: Fix alembic migration env

The include_object() checking was missing, and also the inclusion
of all lbaas DB models

Co-Authored-By: Henry Gessau <gessau@gmail.com>
Co-Authored-By: Adam Harwell <flux.adam@gmail.com>
Change-Id: I506949e75bc62681412358ba689cb07b16311b68
2016-08-23 13:05:48 -05:00
Trevor Vardeman e22d2009a0 Add Health Monitor Max Retries Down
Add a "fall threshold" to health monitors such that sequential
checks will be required before reporting an unhealthy state.

Change-Id: Ifcdad59cfee7769f4fc3dce93c4eba45bca9f4c2
2016-07-05 11:20:34 -05:00
Trevor Vardeman eafbfd23b2 Get Me A LB
Allows a request to be passed to the lbaas API that contains the full graph
structure of a load balancer.  This means that an entire load balancer graph
can be created in one POST to the API, or a partial graph can be.

This creates a new driver method to the driver interface that when implemented
will be called when a full or partial graph is attempted to be created.  If
the driver does not implement this method, then the request is not allowed.

Co-Author: Trevor Vardeman <trevor.vardeman@rackspace.com>

Closes-Bug: #1463202
Depends-On: Id3a5ddb8efded8c6ad72a7118424ec01c777318d
Change-Id: Ic16ca4cb3cb407d9e91eea74315a39bf86c654f3
2016-05-20 17:37:44 -05:00
Trevor Vardeman 9fe9b9e0b8 Neutron LBaaS Deprecation Update
Neutron deprecated the original location for ATTR_NOT_SPECIFIED.  The
changes here update to the new location.

Change-Id: I02f3979a7e67c5ad1e10ebe75d7d6fda2dae6122
2016-05-18 18:51:30 +00:00
Stephen Balukoff 4f3cf15482 Shared pools support
In preparation for L7 switching functionality, we need to
reduce the rigidity of our model somewhat and allow pools
to exist independent of listeners and be shared by 0 or
more listeners. With this patch, pools are now associated
with loadbalancers directly, and there is now a N:M
relationship between listeners and pools.

This patch does alter the Neutron LBaaS v2 API slightly,
but all these changes are backward compatible. Nevertheless,
since Neutron core dev team has asked that any API changes
take place in an extension, that is what is being done in
this patch.

This patch also updates the reference namespace driver to
render haproxy config templates correctly given the pool
sharing functionality added with the patch.

Finally, the nature of shared pools means that the usual
workflow for tenants can be (but doesn't have to be)
altered such that pools can be created before listeners
independently, and assigned to listeners as a later step.

DocImpact
APIImpact
Partially-Implements: blueprint lbaas-l7-rules
Change-Id: Ia0974b01f1f02771dda545c4cfb5ff428a9327b4
2016-02-21 04:42:23 -08:00
Dongcan Ye 78ad376117 Validate connection limit for LBaaS
Currently, LBaaS V1 vip's connection_limit and LBaaS V2 listeners'
connection_limit can be set to a value less than -1.

This patch add a validation for V1 vip's and V2 listeners'
connection_limit resource. Setting value less than -1 is not allowed.

Closes-Bug: #1520138
Change-Id: I9332cfeda89b87dfda9cd16dcc8b1d78b6e1dc41
2015-12-03 10:27:13 +08:00
James Arendt 96a558b5d0 Add flavor option to loadbalancerv2 creation
Builds on the Neutron services flavor framework in the referenced
Depends-On change id.

This solution uses a flavor of service type LOADBALANCERV2
associated with a flavor profile containing a driver.  If a
flavor_id is passed during loadbalancerv2 creation, the flavor is
used to find the provider for the driver and populate
the existing lbaas provider field.

This allows a user to specify a flavor like 'Gold' with the
operator dynamically controlling which provider is associated
with that flavor for subsequent creates.

The flavor_id is persisted in the DB.  The selected provider
controls subsequent control operations against the created
loadbalancer.

Also ensure everything works gracefully if flavors plugin is not loaded.

Adding api and doc impact tags as the new optional flavor_id parameter
should be described to consumers.

Co-Authored-By: James Arendt <james.arendt@hp.com>
Co-Authored-By: Madhusudhan Kandadai <madhusudhan.kandadai@hpe.com>

ApiImpact
DocImpact
Change-Id: Ic3b459692d092658df93d4c855079311d9bc7ace
Depends-On: I5c22ab655a8e2a2e586c10eae9de9b72db49755f
Partially implements: blueprint neutron-flavor-framework
2015-12-02 14:01:34 -08:00
Reedip Banerjee cb3ae497c0 Support for Name field in Members and HMs
This patch adds support to enable naming LBaasV2 Members and Health
Monitors(HMs).

DocImpact

Closes-Bug: #1515506
Change-Id: Ieb66386fac3a5a4dace0112838fe9afde212f055
2015-11-26 22:16:16 +05:30
Jenkins d6a9396df4 Merge "Fix order of arguments in assertEqual" 2015-10-14 04:37:17 +00:00
Kenji Yasui c37f43b27e Fix order of arguments in assertEqual
assertEqual expects that the arguments provided to it should be
(expected, observed).If a particluar order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit Tests
fail. There are several Unit Test files where the arguments for assertEqual
have been swapped. This commit fixes the issue in lbaas.

Change-Id: I890deda05a26c9f84d7e2884970d051faa30830c
Partial-Bug: #1259292
Related-Bug: #1259292
2015-10-08 02:45:02 +00:00
ptoohill1 b8c3978de6 Allow updating TLS refs
A bug prevented updating of default_tls_container_ref and failing
with a 503

This bug uncovered a few other issues with null key checks
and complaints if sni_container_refs were not provided.

Change-Id: I636e9f78b38ba9f02d10a013bf56459cc2a723e1
Closes-Bug: #1501505
2015-09-30 15:52:41 -05:00
Brandon Logan 8f647c1cde Change tls and sni listener API attributes to ref
It was originally thought that neutron lbaas would take a uuid for a tls
container that references a container of secrets.  This has changed due to the
fact that we will now take a URI for barbican containers, which makes the use
of default_tls_container_id and sni_container_ids inappropriate.  This changes
them to be default_tls_container_ref and sni_container_refs.

This patch does not change the db models or data models as that would make this
a much larger patch and due to time would be a lot to merge in by the
Liberty-3.  Since V2 API will probably lose the experimental tag this cycle, it
is important to make this change now while it is experimental.
This just changes the API to accept and return these attributes so
whenever the db and data model changes are done, it will not break API
backwards compatibility.

DocImpact
APIImpact

Change-Id: Iddc5d95fc6822e19e3166f9a6974dc56edd3193e
2015-08-25 19:23:46 -05:00
Cedric Brandily 19a51d8666 Switch to oslo_utils.uuidutils
Get rid of oslo-incubator uuidutils

Change-Id: I9f8e98ad9517864a9ffdacf01c0a9a5aab554edb
Partial-Bug: #1467020
2015-06-20 01:21:22 +02:00
Brandon Logan f759bf0027 Rename imports based on neutron tests reorganization.
Co-Authored-By: Doug Wiegley <dougw@a10networks.com>
Change-Id: Ieaacc08e27567afe3710a6836bc42810f184ce73
Depends-On: If307593259139171be21a71c58e3a34bf148cc7f
Related-Bug: #1440834
2015-04-07 14:34:33 -07:00
Evgeny Fedoruk 0cc103564b TLS capability extension implementation for lbaas v2
Including extension modifications
Including db model modifications
Including db model unit testing
Including alembic migration
Including usage of new common module for TLS containers retrieval and validation

Change-Id: I4c5c494370479176af6f80623ae3a0c6af30ef14
Implements: blueprint lbaas-ssl-termination
2015-03-16 22:28:13 -05:00
Brandon Logan b1664c0184 Simplify user workflow creating loadbalancers
Users must now create a load balancer, then listener,
then pool, then members.  GETs will also now show children
and backrefs to parents.

Removed the DEFERRED state because it is unneeded.  Changed
the synchronous namespace driver to reflect this change and
added a helper driver mixin for setting the correct status.

Added get_statuses method to the plugin to retrieve the
status tree of a load balancer and children.

Added provisioning_status and operating status to entities

Added Driver methods to successfully or unsuccessfully
complete driver operations.

Implemented mutualy exclusive loading of lbaas v1 or
lbaas v2.

Change-Id: Ic79a481e086c59b17e6a2d1a5cf7d057d0efde44
Implements: blueprint lbaas-api-and-objmodel-improvement
2015-02-03 14:30:55 -06:00
Doug Wiegley c10dd7ed1b Move config and extensions to service repo
Depends on neutron change I16b5e5b2bb70717166da14faa975fa2ab9129049

Change-Id: I25b38747af1d41834ccb340f069acce0aa5aee8f
Partially-Implements: blueprint services-split
Co-Authored-By: Brandon Logan <brandon.logan@rackspace.com>
2015-01-30 23:01:39 -06:00
Doug Wiegley c7c77b33ba Merge feature/lbaasv2
New extension for version 2 of LBaaS API

Also added some constants for supported protocols, algorithms,
health monitor types, and session persistence types.

Implement Jinja templates for haproxy config

Added templates dir
Added haproxy v1.4 template
Added template tests
Added jinja_cfg for new haproxy jinja templating

Tests for extension, db and plugin for LBaaS V2

Adding needed driver interface changes for tests.
Adding LoggingNoop driver needed changes for tests.
Adding extension, plugin, and db unit tests.

Plugin/DB additions for version 2 of LBaaS API

Added alembic migrations, models, db methods and plugin methods.
Added DEFERRED status for entities not linked to a load balancer.
Added to_dict method in BaseNeutron model.
Sql Alchemy models in its own module.
Plugin database methods are accessed by composition through the plugin.
Added data models to convert sql alchemy models before passing to driver.

Partially-implements: blueprint lbaas-api-and-objmodel-improvement
Partially-implements: blueprint lbaas-refactor-haproxy-namespace-driver-to-n
Partially-implements: blueprint services-split

Change-Id: I8343d83c645f3037ac237d7f47744c1c7e4356f8
Co-Authored-By: Brandon Logan <brandon.logan@rackspace.com>
Co-Authored-By: Phillip Toohill <phillip.toohill@rackspace.com>
Co-Authored-By: Dustin Lundquist <dustin@null-ptr.net>
Co-authored-by: Vijayendra Bhamidipati <vbhamidipati@paypal.com>
Co-authored-by: Craig Tracey <Craig.Tracey@gmail.com>
Co-authored-by: Pattabi Ayyasami <pattabi@brocade.com>
2015-01-06 17:27:36 -06:00
Paul Michali 864cde91bb LBaaS: Unit tests using policy.conf
Instead of adding override_nvalue() in setUp() for tests that need
the policy.json setting for config, created a new base class for
VPN tests, which derives from the neutron BaseTestCase and overrides
the config for policy_file. Applying same changes as done with
141932 for VPNaaS.

The big question here, is whether or not this is better than
sprinkling override_nvalues() calls in the four places, where this
is a problem currently.  The issue is that with LBaaS, there are
some tests that inherit from Neutron classes, other than the
BaseTestCase, so a simple override in BaseTestCase.setUp() won't
suffice.

Change-Id: Ia504df51510d964c5f5baccb0b921af1de406f21
Partially-Implements: blueprint service-split
2014-12-17 19:23:54 -05:00
Brandon Logan 3028ab0326 Fixing the tests to run again
Also some minor pep8 and pylint fixes.

Change-Id: I22348710a7829197b539830f6acdc92b619bdc0c
2014-12-12 01:55:47 -06:00
Doug Wiegley 221f2964b2 Post-split, get jenkins tests passing
Change-Id: Ic6e545008504be633bf399712cd5bbbdf8184ad8
2014-12-08 22:52:02 -07:00
Doug Wiegley 2598677497 Split lbaas services code into neutron-lbaas
Change-Id: I8dfd3b4163b680cfe6ce16792877bb6ad5def5d3
2014-12-08 13:37:18 -07:00