diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index 7cafc20f4e9..7676aba4dc2 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -3357,6 +3357,7 @@ STP mode: **rapid-pvst** - Spanning Tree disabled for VLANs: **105,202,505-506** - Global BPDU Guard for Edge ports is disabled. - Global BPDU Filter for Edge ports is disabled. +- Range of port-ids reserved for port-channels: 201-2001. ### Spanning Tree Device Configuration @@ -3368,6 +3369,7 @@ no spanning-tree edge-port bpduguard default no spanning-tree edge-port bpdufilter default spanning-tree bpduguard rate-limit default spanning-tree bpduguard rate-limit count 100 +spanning-tree port-id allocation port-channel range 201 2001 spanning-tree vlan-id 1,2,3,4,5,10-15 priority 4096 spanning-tree vlan-id 3 priority 8192 spanning-tree vlan-id 100-500 priority 16384 diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg index c70052f14e1..898d2eb199c 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg @@ -1129,6 +1129,7 @@ no spanning-tree edge-port bpduguard default no spanning-tree edge-port bpdufilter default spanning-tree bpduguard rate-limit default spanning-tree bpduguard rate-limit count 100 +spanning-tree port-id allocation port-channel range 201 2001 spanning-tree vlan-id 1,2,3,4,5,10-15 priority 4096 spanning-tree vlan-id 3 priority 8192 spanning-tree vlan-id 100-500 priority 16384 diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/spanning-tree.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/spanning-tree.yml index 84a6dcebe1f..62c78f70a69 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/spanning-tree.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/spanning-tree.yml @@ -17,3 +17,6 @@ spanning_tree: - id: "100-500" priority: 16384 no_spanning_tree_vlan: 105,202,505-506 + port_id_allocation_port_channel_range: + minimum: 201 + maximum: 2001 diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/spanning-tree.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/spanning-tree.md index de02375784c..5ca6bf206f7 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/spanning-tree.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/spanning-tree.md @@ -32,6 +32,9 @@ | [  rapid_pvst_instances](## "spanning_tree.rapid_pvst_instances") | List, items: Dictionary | | | | | | [    - id](## "spanning_tree.rapid_pvst_instances.[].id") | String | Required, Unique | | | "< vlan_id >, < vlan_id >-< vlan_id >"
Example: 105,202,505-506
| | [      priority](## "spanning_tree.rapid_pvst_instances.[].priority") | Integer | | | | | + | [  port_id_allocation_port_channel_range](## "spanning_tree.port_id_allocation_port_channel_range") | Dictionary | | | | Specify range of port-ids to reserve for port-channels. | + | [    minimum](## "spanning_tree.port_id_allocation_port_channel_range.minimum") | Integer | Required | | Min: 1
Max: 2048 | Specify minimum value for reserved range. | + | [    maximum](## "spanning_tree.port_id_allocation_port_channel_range.maximum") | Integer | Required | | Min: 1
Max: 2048 | Specify maximum value for reserved range. | === "YAML" @@ -78,4 +81,13 @@ # Example: 105,202,505-506 - id: priority: + + # Specify range of port-ids to reserve for port-channels. + port_id_allocation_port_channel_range: + + # Specify minimum value for reserved range. + minimum: + + # Specify maximum value for reserved range. + maximum: ``` diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/spanning-tree.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/spanning-tree.j2 index 617b3ef24cd..9a1b0f03b18 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/spanning-tree.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/spanning-tree.j2 @@ -81,6 +81,11 @@ STP Root Super: **{{ spanning_tree.root_super }}** {% endif %} {% endif %} {% endif %} +{% if spanning_tree.port_id_allocation_port_channel_range is arista.avd.defined %} +{% set min_range = spanning_tree.port_id_allocation_port_channel_range.minimum %} +{% set max_range = spanning_tree.port_id_allocation_port_channel_range.maximum %} +{% do global_settings.append("- Range of port-ids reserved for port-channels: " ~ min_range ~ "-" ~ max_range ~ ".") %} +{% endif %} {% if global_settings | length > 0 %} #### Global Spanning-Tree Settings diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/spanning-tree.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/spanning-tree.j2 index 0eed357f095..833cc3c3ddc 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/spanning-tree.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/spanning-tree.j2 @@ -38,6 +38,11 @@ spanning-tree bpduguard rate-limit count {{ spanning_tree.bpduguard_rate_limit.c {% if spanning_tree.root_super is arista.avd.defined(true) %} spanning-tree root super {% endif %} +{% if spanning_tree.port_id_allocation_port_channel_range is arista.avd.defined %} +{% set min_range = spanning_tree.port_id_allocation_port_channel_range.minimum %} +{% set max_range = spanning_tree.port_id_allocation_port_channel_range.maximum %} +spanning-tree port-id allocation port-channel range {{ min_range }} {{ max_range }} +{% endif %} {% if spanning_tree.mode is arista.avd.defined('mstp') %} {% for mst_instance in spanning_tree.mst_instances | arista.avd.natural_sort('id') %} {% if mst_instance.priority is arista.avd.defined %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py b/python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py index a8a7a542b6d..e88197ce909 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py @@ -58781,6 +58781,30 @@ class RapidPvstInstances(AvdIndexedList[str, RapidPvstInstancesItem]): RapidPvstInstances._item_type = RapidPvstInstancesItem + class PortIdAllocationPortChannelRange(AvdModel): + """Subclass of AvdModel.""" + + _fields: ClassVar[dict] = {"minimum": {"type": int}, "maximum": {"type": int}} + minimum: int + """Specify minimum value for reserved range.""" + maximum: int + """Specify maximum value for reserved range.""" + + if TYPE_CHECKING: + + def __init__(self, *, minimum: int | UndefinedType = Undefined, maximum: int | UndefinedType = Undefined) -> None: + """ + PortIdAllocationPortChannelRange. + + + Subclass of AvdModel. + + Args: + minimum: Specify minimum value for reserved range. + maximum: Specify maximum value for reserved range. + + """ + _fields: ClassVar[dict] = { "root_super": {"type": bool}, "edge_port": {"type": EdgePort}, @@ -58791,6 +58815,7 @@ class RapidPvstInstances(AvdIndexedList[str, RapidPvstInstancesItem]): "mst_instances": {"type": MstInstances}, "no_spanning_tree_vlan": {"type": str}, "rapid_pvst_instances": {"type": RapidPvstInstances}, + "port_id_allocation_port_channel_range": {"type": PortIdAllocationPortChannelRange}, } root_super: bool | None edge_port: EdgePort @@ -58810,6 +58835,12 @@ class RapidPvstInstances(AvdIndexedList[str, RapidPvstInstancesItem]): """ rapid_pvst_instances: RapidPvstInstances """Subclass of AvdIndexedList with `RapidPvstInstancesItem` items. Primary key is `id` (`str`).""" + port_id_allocation_port_channel_range: PortIdAllocationPortChannelRange + """ + Specify range of port-ids to reserve for port-channels. + + Subclass of AvdModel. + """ if TYPE_CHECKING: @@ -58825,6 +58856,7 @@ def __init__( mst_instances: MstInstances | UndefinedType = Undefined, no_spanning_tree_vlan: str | None | UndefinedType = Undefined, rapid_pvst_instances: RapidPvstInstances | UndefinedType = Undefined, + port_id_allocation_port_channel_range: PortIdAllocationPortChannelRange | UndefinedType = Undefined, ) -> None: """ SpanningTree. @@ -58844,6 +58876,10 @@ def __init__( "< vlan_id >, < vlan_id >-< vlan_id >" Example: 105,202,505-506 rapid_pvst_instances: Subclass of AvdIndexedList with `RapidPvstInstancesItem` items. Primary key is `id` (`str`). + port_id_allocation_port_channel_range: + Specify range of port-ids to reserve for port-channels. + + Subclass of AvdModel. """ diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index 4230c2ff468..953195e4902 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -21991,6 +21991,26 @@ keys: type: int convert_types: - str + port_id_allocation_port_channel_range: + description: Specify range of port-ids to reserve for port-channels. + type: dict + keys: + minimum: + description: Specify minimum value for reserved range. + type: int + min: 1 + max: 2048 + required: true + convert_types: + - str + maximum: + description: Specify maximum value for reserved range. + type: int + min: 1 + max: 2048 + required: true + convert_types: + - str standard_access_lists: type: list primary_key: name diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/spanning_tree.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/spanning_tree.schema.yml index c95c1e3ee48..42897488e1d 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/spanning_tree.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/spanning_tree.schema.yml @@ -107,3 +107,23 @@ keys: type: int convert_types: - str + port_id_allocation_port_channel_range: + description: Specify range of port-ids to reserve for port-channels. + type: dict + keys: + minimum: + description: Specify minimum value for reserved range. + type: int + min: 1 + max: 2048 + required: true + convert_types: + - str + maximum: + description: Specify maximum value for reserved range. + type: int + min: 1 + max: 2048 + required: true + convert_types: + - str