diff --git a/vmware_nsx/services/lbaas/lb_const.py b/vmware_nsx/services/lbaas/lb_const.py index 5e106fb4fb..465fb392de 100644 --- a/vmware_nsx/services/lbaas/lb_const.py +++ b/vmware_nsx/services/lbaas/lb_const.py @@ -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', diff --git a/vmware_nsx/services/lbaas/nsx_v3/pool_mgr.py b/vmware_nsx/services/lbaas/nsx_v3/pool_mgr.py index 86ff321380..6816d3b30e 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/pool_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v3/pool_mgr.py @@ -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'])