Skip to content

Commit

Permalink
Feat(eos_designs): Add the possibility to set CPU max allocation (ari…
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc authored Jan 26, 2024
1 parent bc5accb commit 5fd3af3
Show file tree
Hide file tree
Showing 22 changed files with 105 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ wan_edge:
evpn_role: server
id: 1

# If this is not set, the other error message is not triggered
data_plane_cpu_allocation_max: 1

expected_error_message: >-
'wan_role' must be 'client' when 'cv_pathfinder_role' is set to 'transit' or 'edge'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: wan_rr
bgp_as: 65000
wan_rr:
defaults:
loopback_ipv4_pool: 10.42.0.0/24
nodes:
- name: missing-data-plane_cpu-allocation-max
id: 1

expected_error_message: "For AutoVPN RRs and Pathfinders, 'data_plane_cpu_allocation_max' must be set"
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ all:
source-interfaces-tacacs-missing-inband-mgmt-interface:
source-interfaces-tacacs-missing-mgmt-ip:
ul-filter-evpn-default-vrf-services:
missing-data-plane_cpu-allocation-max:
children:
duplicate-ip-address-router-bgp:
hosts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ router path-selection
!
spanning-tree mode none
!
platform sfe data-plane cpu allocation maximum 2
!
no enable password
no aaa root
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ router path-selection
!
spanning-tree mode none
!
platform sfe data-plane cpu allocation maximum 2
!
no enable password
no aaa root
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ router path-selection
!
spanning-tree mode none
!
platform sfe data-plane cpu allocation maximum 1
!
no enable password
no aaa root
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ router path-selection
!
spanning-tree mode none
!
platform sfe data-plane cpu allocation maximum 3
!
no enable password
no aaa root
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ router path-selection
!
spanning-tree mode none
!
platform sfe data-plane cpu allocation maximum 3
!
no enable password
no aaa root
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ spanning_tree:
vrfs:
- name: MGMT
ip_routing: false
platform:
sfe:
data_plane_cpu_allocation_max: 2
management_api_http:
enable_vrfs:
- name: MGMT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ spanning_tree:
vrfs:
- name: MGMT
ip_routing: false
platform:
sfe:
data_plane_cpu_allocation_max: 2
management_api_http:
enable_vrfs:
- name: MGMT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ spanning_tree:
vrfs:
- name: MGMT
ip_routing: false
platform:
sfe:
data_plane_cpu_allocation_max: 1
management_api_http:
enable_vrfs:
- name: MGMT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ spanning_tree:
vrfs:
- name: MGMT
ip_routing: false
platform:
sfe:
data_plane_cpu_allocation_max: 3
management_api_http:
enable_vrfs:
- name: MGMT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ spanning_tree:
vrfs:
- name: MGMT
ip_routing: false
platform:
sfe:
data_plane_cpu_allocation_max: 3
management_api_http:
enable_vrfs:
- name: MGMT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
data_plane_cpu_allocation_max: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
data_plane_cpu_allocation_max: 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
# Inherit most of the variables from CV_PATHFINDERS_TESTS

# overwriting data_plane_cpu_allocation_max from CV_PATHINDERS
data_plane_cpu_allocation_max: 3

wan_route_servers:
# Not testing the overloading
- hostname: cv-pathfinder-pathfinder1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,27 @@ all:
WAN_TESTS:
children:
AUTOVPN_TESTS:
children:
AUTOVPN_RRS:
hosts:
autovpn-rr1:
autovpn-rr2:
hosts:
autovpn-edge:
autovpn-rr1:
autovpn-rr2:
CV_PATHFINDER_TESTS:
hosts:
cv-pathfinder-edge:
cv-pathfinder-edge-no-common-path-group:
cv-pathfinder-transit:
cv-pathfinder-pathfinder:
children:
CV_PATHFINDER_MULTI_RR_TESTS:
CV_PATHFINDERS:
hosts:
cv-pathfinder-pathfinder1:
cv-pathfinder-pathfinder2:
cv-pathfinder-pathfinder:
children:
CV_PATHFINDER_MULTI_RR_TESTS:
hosts:
cv-pathfinder-pathfinder1:
cv-pathfinder-pathfinder2:
AVD_LAB:
children:
DC1_FABRIC:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

| Variable | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| [<samp>data_plane_cpu_allocation_max</samp>](## "data_plane_cpu_allocation_max") | Integer | | | Min: 1<br>Max: 128 | Set the maximum number of CPU used for the data plane.<br>This setting is useful on virtual Route Reflectors and Pathfinders node. |
| [<samp>default_igmp_snooping_enabled</samp>](## "default_igmp_snooping_enabled") | Boolean | | `True` | | When set to false, disables IGMP snooping at fabric level and overrides per vlan settings.<br> |
| [<samp>hardware_counters</samp>](## "hardware_counters") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;features</samp>](## "hardware_counters.features") | List, items: Dictionary | | | | This data model allows to configure the list of hardware counters feature<br>available on Arista platforms.<br><br>The `name` key accepts a list of valid_values which MUST be updated to support<br>new feature as they are released in EOS.<br><br>The available values of the different keys like 'direction' or 'address_type'<br>are feature and hardware dependent and this model DOES NOT validate that the<br>combinations are valid. It is the responsability of the user of this data model<br>to make sure that the rendered CLI is accepted by the targeted device.<br><br>Examples:<br><br> * Use:<br> ```yaml<br> hardware_counters:<br> features:<br> - name: ip<br> direction: out<br> layer3: true<br> units_packets: true<br> ```<br><br> to render:<br> ```eos<br> hardware counter feature ip out layer3 units packets<br> ```<br> * Use:<br> ```yaml<br> hardware_counters:<br> features:<br> - name: route<br> address_type: ipv4<br> vrf: test<br> prefix: 192.168.0.0/24<br> ```<br><br> to render:<br> ```eos<br> hardware counter feature route ipv4 vrf test 192.168.0.0/24<br> ```<br> |
Expand Down Expand Up @@ -44,6 +45,10 @@
=== "YAML"

```yaml
# Set the maximum number of CPU used for the data plane.
# This setting is useful on virtual Route Reflectors and Pathfinders node.
data_plane_cpu_allocation_max: <int; 1-128>

# When set to false, disables IGMP snooping at fabric level and overrides per vlan settings.
default_igmp_snooping_enabled: <bool; default=True>
hardware_counters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,10 @@ def tcam_profile(self) -> dict | None:
@cached_property
def platform(self) -> dict | None:
"""
platform set based on platform_settings.lag_hardware_only,
platform_settings.trident_forwarding_table_partition and switch.evpn_multicast facts
platform set based on:
* platform_settings.lag_hardware_only,
* platform_settings.trident_forwarding_table_partition and switch.evpn_multicast facts
* data_plane_cpu_allocation_max
"""
platform = {}
if (lag_hardware_only := get(self.shared_utils.platform_settings, "lag_hardware_only")) is not None:
Expand All @@ -520,6 +522,13 @@ def platform(self) -> dict | None:
if trident_forwarding_table_partition is not None and get(self._hostvars, "switch.evpn_multicast") is True:
platform["trident"] = {"forwarding_table_partition": trident_forwarding_table_partition}

if (cpu_max_allocation := get(self._hostvars, "data_plane_cpu_allocation_max")) is not None:
platform["sfe"] = {"data_plane_cpu_allocation_max": cpu_max_allocation}
elif self.shared_utils.wan_role == "server":
# For AutoVPN Route Reflectors and Pathfinders, running on CloudEOS, setting
# this value is required for the solution to work.
raise AristaAvdMissingVariableError("For AutoVPN RRs and Pathfinders, 'data_plane_cpu_allocation_max' must be set")

if platform:
return platform
return None
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2023-2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
# yaml-language-server: $schema=../../../../plugins/plugin_utils/schema/avd_meta_schema.json
# Line above is used by RedHat's YAML Schema vscode extension
# Use Ctrl + Space to get suggestions for every field. Autocomplete will pop up after typing 2 letters.
type: dict
keys:
data_plane_cpu_allocation_max:
documentation_options:
table: system-settings
type: int
$ref: "eos_cli_config_gen#/keys/platform/keys/sfe/keys/data_plane_cpu_allocation_max"
description: |-
Set the maximum number of CPU used for the data plane.
This setting is useful on virtual Route Reflectors and Pathfinders node.

0 comments on commit 5fd3af3

Please sign in to comment.