aristanetworks / avd

Arista Validated Designs
https://avd.arista.com
Apache License 2.0
295 stars 211 forks source link

Feat(eos_designs): Default configurations for unused ports #2755

Open gmuloc opened 1 year ago

gmuloc commented 1 year ago

Enhancement summary

There is currently an effort to warn the user about duplicate definitions of the same port in a given module (e.g. multiple definition of EthernetX in underlay, or in connected_endpoints).

Before PR #2627 the behavior used to be that the latest definition wins and sometimes it could lead to silent issues because difficult to notice. Since the PR was merged, an explicit error is raised if an interface is defined twice inside a module with different structured_configuration.

It has come to our attention though that in some specific use cases (campus designs) it could be desirable to be able to be able to have a global definitions for ports and then being able to overwrite them more spefically.

this issue is opened to track an effort to answer such functionality (and hence ignore the duplicate error messages)

Which component of AVD is impacted

eos_designs

Use case example

campus use case where for instance we want to define all the ports as unused and then overwrite definition for some:

# note that the order is important here
network_ports:
  - switches:
      - ACCESS.*
    switch_ports:
      - Ethernet 1-48
    description: "unused"
  - switches:
      - ACCESS.*
    switch_ports:
      - Ethernet 1-10
    profile: PHONE

Describe the solution you would like

use case being possible. could be some knob to authorise being overwritten by more specific definition for instance.

Describe alternatives you have considered

No response

Additional context

No response

Contributing Guide

gmuloc commented 1 year ago

outcome of discussions with other maintainers:

  1. (short term) implement some knob at the network_port list item level to allow it to be overwritten. Note that the order in which things are rendered then matters - for now we go through connected_endpoint first and then network_port in order of configuration. If we were to ignore the order and just check when we reach a networtk port if it is overwritable we could handle situations where neither is overwritable -> Error. one is overwritable -> keep the other. But we could not decide when both are overwritable and would probably have to error out.
  2. (short term) Add a global ignore_duplicate_network_ports knob
  3. (longer term) would be nice to add something generic in eos_designs for unused_ports with a default description and state

IMPORTANT: options 1&2 only work from within a single module (in that case connected_endpoints)

ClausHolbechArista commented 1 year ago

We have changed our minds, so in #2766 we re-implement the following duplicate checks for network_ports/connected_endpoints:

ClausHolbechArista commented 1 year ago

This issue now tracks: (longer term) would be nice to add something generic in eos_designs for unused_ports with a default description and state

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 90 days with no activity. The issue will be reviewed by a maintainer and may be closed

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 90 days with no activity. The issue will be reviewed by a maintainer and may be closed