This repository has been archived by the owner on Jul 22, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
6 changed files
with
234 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copyright 2016 A10 Networks | ||
# All rights reserved. | ||
# | ||
# 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. | ||
|
||
from neutron.api import extensions | ||
from neutron_lib import constants as n_constants | ||
|
||
EXTENDED_ATTRIBUTES_2_0 = { | ||
'loadbalancers': { | ||
'vip_subnet_id': {'allow_post': True, 'allow_put': False, | ||
'validate': {'type:uuid': None}, | ||
'is_visible': True, | ||
'default': n_constants.ATTR_NOT_SPECIFIED}, | ||
'vip_network_id': {'allow_post': True, 'allow_put': False, | ||
'validate': {'type:uuid': None}, | ||
'is_visible': False, | ||
'default': n_constants.ATTR_NOT_SPECIFIED} | ||
} | ||
} | ||
|
||
|
||
class Lb_network_vip(extensions.ExtensionDescriptor): | ||
|
||
@classmethod | ||
def get_name(cls): | ||
return "Create loadbalancer with network_id" | ||
|
||
@classmethod | ||
def get_alias(cls): | ||
return "lb_network_vip" | ||
|
||
@classmethod | ||
def get_description(cls): | ||
return "Create loadbalancer with network_id" | ||
|
||
@classmethod | ||
def get_namespace(cls): | ||
return "http://wiki.openstack.org/neutron/LBaaS/API_2.0" | ||
|
||
@classmethod | ||
def get_updated(cls): | ||
return "2016-09-09T22:00:00-00:00" | ||
|
||
def get_required_extensions(self): | ||
return ["lbaasv2"] | ||
|
||
def get_extended_resources(self, version): | ||
if version == "2.0": | ||
return EXTENDED_ATTRIBUTES_2_0 | ||
else: | ||
return {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
releasenotes/notes/create-lb-with-network-id-dba0a71878942af7.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
features: | ||
- | | ||
Adds support for creating a loadbalancer with a | ||
Neutron network id. | ||
* Adds an optional ``vip_network_id`` attribute | ||
when creating a loadbalancer. | ||
* When creating a loadbalancer, ``vip_subnet_id`` | ||
is optional if a ``vip_network_id`` is proviced. | ||
* If ``vip_network_id`` is provided the vip will | ||
be allocated on a subnet with an available | ||
address. An IPv4 subnet will be chosen if | ||
possible. |