Merge "NSXv3: Fix LB pool algorithm"

This commit is contained in:
Jenkins 2017-10-04 11:12:59 +00:00 committed by Gerrit Code Review
commit e844e2204b
2 changed files with 7 additions and 1 deletions

View File

@ -86,6 +86,11 @@ NSXV3_MONITOR_MAP = {LB_HEALTH_MONITOR_PING: 'LbIcmpMonitor',
LB_HEALTH_MONITOR_TCP: 'LbTcpMonitor',
LB_HEALTH_MONITOR_HTTP: 'LbHttpMonitor',
LB_HEALTH_MONITOR_HTTPS: 'LbHttpsMonitor'}
LB_POOL_ALGORITHM_MAP = {
LB_METHOD_ROUND_ROBIN: 'WEIGHTED_ROUND_ROBIN',
LB_METHOD_LEAST_CONNECTIONS: 'LEAST_CONNECTION',
LB_METHOD_SOURCE_IP: 'IP_HASH',
}
LB_STATS_MAP = {'active_connections': 'current_sessions',
'bytes_in': 'bytes_in',
'bytes_out': 'bytes_out',

View File

@ -44,11 +44,12 @@ class EdgePoolManager(base_mgr.Nsxv3LoadbalancerBaseManager):
tags = lb_utils.get_tags(self.core_plugin, pool.id,
lb_const.LB_POOL_TYPE, pool.tenant_id,
context.project_name)
lb_algorithm = lb_const.LB_POOL_ALGORITHM_MAP.get(pool.lb_algorithm)
try:
snat_translation = {'type': "LbSnatAutoMap"}
lb_pool = pool_client.create(display_name=pool_name,
tags=tags,
algorithm=pool.lb_algorithm,
algorithm=lb_algorithm,
snat_translation=snat_translation)
nsx_db.add_nsx_lbaas_pool_binding(
context.session, lb_id, pool.id, lb_pool['id'])