NSX|V: Add pool transparency config flag

Allow creation of LB pools with transparent mode on. This is a global
flag which will apply to all of the pools which are created.

Change-Id: If0f9294224270957c00114dd237fc9b98c1a1cbb
This commit is contained in:
Kobi Samoray 2020-10-22 12:49:25 +03:00
parent 7d0f6e9de3
commit 76766cc1a3
2 changed files with 9 additions and 1 deletions

View File

@ -858,6 +858,10 @@ nsxv_opts = [
cfg.BoolOpt('init_validation',
default=True,
help=_("Set to False to skip plugin init validation")),
cfg.BoolOpt('loadbalancer_pool_transparency',
default=False,
help=_("Create LBaaS pools with transparent mode on. Use with "
"use_routers_as_lbaas_platform enabled")),
]

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_log import helpers as log_helpers
from oslo_log import log as logging
from oslo_utils import excutils
@ -35,6 +36,9 @@ class EdgePoolManagerFromDict(base_mgr.EdgeLoadbalancerBaseManager):
def __init__(self, vcns_driver):
super(EdgePoolManagerFromDict, self).__init__(vcns_driver)
self._fw_section_id = None
self.pool_transparency = (
cfg.CONF.nsxv.use_routers_as_lbaas_platform and
cfg.CONF.nsxv.loadbalancer_pool_transparency)
def create(self, context, pool, completor):
@ -44,7 +48,7 @@ class EdgePoolManagerFromDict(base_mgr.EdgeLoadbalancerBaseManager):
'description': pool.get('description', pool.get('name')),
'algorithm': lb_const.BALANCE_MAP.get(pool['lb_algorithm'],
'round-robin'),
'transparent': False
'transparent': self.pool_transparency
}
lb_id = pool['loadbalancer_id']