Skip to content

Commit

Permalink
Feat: Add default loab balance policies per VRF
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc committed Dec 20, 2023
1 parent 9d248e6 commit 4a2356e
Show file tree
Hide file tree
Showing 17 changed files with 94 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ router path-selection
load-balance policy it_it_lb
path-group INET priority 2
!
load-balance policy voice_default_lb
path-group INET priority 1
!
load-balance policy voice_voice_lb
path-group INET priority 1
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ router path-selection
load-balance policy it_it_lb
path-group INET priority 2
!
load-balance policy voice_default_lb
path-group INET priority 1
!
load-balance policy voice_voice_lb
path-group INET priority 1
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ router path-selection
load-balance policy it_it_lb
path-group INET priority 2
!
load-balance policy voice_default_lb
path-group INET priority 1
!
load-balance policy voice_voice_lb
path-group INET priority 1
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ router path-selection
path-group INET priority 1
path-group MPLS priority 1
!
load-balance policy voice_default_lb
path-group INET priority 1
path-group MPLS priority 2
!
load-balance policy voice_voice_lb
path-group MPLS priority 1
path-group INET priority 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ router path-selection
path-group INET priority 1
path-group MPLS priority 1
!
load-balance policy voice_default_lb
path-group INET priority 1
path-group MPLS priority 2
!
load-balance policy voice_voice_lb
path-group MPLS priority 1
path-group INET priority 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ router path-selection
path-group INET priority 1
path-group MPLS priority 1
!
load-balance policy voice_default_lb
path-group INET priority 1
path-group MPLS priority 2
!
load-balance policy voice_voice_lb
path-group MPLS priority 1
path-group INET priority 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ router path-selection
path-group INET priority 1
path-group MPLS priority 1
!
load-balance policy voice_default_lb
path-group INET priority 1
path-group MPLS priority 2
!
load-balance policy voice_voice_lb
path-group MPLS priority 1
path-group INET priority 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ router path-selection
path-group INET priority 1
path-group MPLS priority 1
!
load-balance policy voice_default_lb
path-group INET priority 1
path-group MPLS priority 2
!
load-balance policy voice_voice_lb
path-group MPLS priority 1
path-group INET priority 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ router_path_selection:
path_groups:
- name: INET
priority: 1
- name: voice_default_lb
path_groups:
- name: INET
priority: 1
- name: it_it_lb
path_groups:
- name: INET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ router_path_selection:
path_groups:
- name: INET
priority: 1
- name: voice_default_lb
path_groups:
- name: INET
priority: 1
- name: it_it_lb
path_groups:
- name: INET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ router_path_selection:
path_groups:
- name: INET
priority: 1
- name: voice_default_lb
path_groups:
- name: INET
priority: 1
- name: it_it_lb
path_groups:
- name: INET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ router_path_selection:
priority: 1
- name: INET
priority: 2
- name: voice_default_lb
path_groups:
- name: INET
priority: 1
- name: MPLS
priority: 2
- name: it_it_lb
path_groups:
- name: INET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ router_path_selection:
priority: 1
- name: INET
priority: 2
- name: voice_default_lb
path_groups:
- name: INET
priority: 1
- name: MPLS
priority: 2
- name: it_it_lb
path_groups:
- name: INET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ router_path_selection:
priority: 1
- name: INET
priority: 2
- name: voice_default_lb
path_groups:
- name: INET
priority: 1
- name: MPLS
priority: 2
- name: it_it_lb
path_groups:
- name: INET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ router_path_selection:
priority: 1
- name: INET
priority: 2
- name: voice_default_lb
path_groups:
- name: INET
priority: 1
- name: MPLS
priority: 2
- name: it_it_lb
path_groups:
- name: INET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ router_path_selection:
priority: 1
- name: INET
priority: 2
- name: voice_default_lb
path_groups:
- name: INET
priority: 1
- name: MPLS
priority: 2
- name: it_it_lb
path_groups:
- name: INET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,27 @@ def _wan_load_balance_policies(self) -> list:
# TODO implement also the jitter / ...
wan_load_balance_policies.append(wan_load_balance_policy)

if default_policy := get(avt_policy, "default_policy"):
name = get(default_policy, "name", default=f"{avt_policy['name']}_default")
wan_load_balance_policy = {"name": f"{name}_lb"}

# TODO add LAN_HA with prio 1 when HA is implemented
# TODO for now hardcoding priorities as requested by team
for path_group in get(default_policy, "preferred_path_groups", []):
wan_load_balance_policy.setdefault("path_groups", []).append(
{
"name": path_group,
"priority": 1,
}
)
for path_group in get(default_policy, "alternate_path_groups", []):
wan_load_balance_policy.setdefault("path_groups", []).append(
{
"name": path_group,
"priority": 2,
}
)

wan_load_balance_policies.append(wan_load_balance_policy)

return wan_load_balance_policies

0 comments on commit 4a2356e

Please sign in to comment.