Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(eos_cli_config_gen): support for flow-tracking #2233

Closed
1 task done
gmuloc opened this issue Oct 27, 2022 · 0 comments · Fixed by #2270
Closed
1 task done

Feat(eos_cli_config_gen): support for flow-tracking #2233

gmuloc opened this issue Oct 27, 2022 · 0 comments · Fixed by #2270
Assignees
Labels
type: enhancement New feature or request

Comments

@gmuloc
Copy link
Contributor

gmuloc commented Oct 27, 2022

Enhancement summary

Add support for Flow-tracking in eos_cli_config_gen

Which component of AVD is impacted

eos_cli_config_gen

Use case example

Configuring flow tracking for an interface

Describe the solution you would like

currently used custom_template that is a starting point

{# Jinja template for flow-tracking #}
{% for flow in flows if flow.name is arista.avd.defined %}
flow tracking {{ flow.name }}
   sample {{ flow.sample | arista.avd.default(16384) }}
{%     for tracker in flow.trackers if tracker.name is arista.avd.defined %}
   tracker {{ tracker.name }}
{%         if tracker.record_export is arista.avd.defined %}
{%             if tracker.record_export.inactive_timeout is arista.avd.defined %}
      record export on inactive timeout {{ tracker.record_export.inactive_timeout }}
{%             endif %}
{%             if tracker.record_export.interval is arista.avd.defined %}
      record export on interval {{ tracker.record_export.interval }}
{%             endif %}
{%         endif %}
{%         for exporter in tracker.exporters if exporter.name is arista.avd.defined %}
      exporter {{ exporter.name }}
{%             if exporter.collector.ip is arista.avd.defined %}
{%                 set collector_cli = 'collector ' ~ exporter.collector.ip %}
{%                 if exporter.collector.port is arista.avd.defined %}
{%                     set collector_cli = collector_cli ~ ' port ' ~ exporter.collector.port %}
{%                 endif %}
         {{ collector_cli }}
{%             endif %}
         format ipfix version 10
{# TODO - the next line works in AVD 3.7.0 but will probably fail in future releases as the switch is #}
{#        unavailable by default. Additionally this is using an eos_designs construct in a eos_cli_config_gen #}
{#        custom template  #}
         local interface {{ exporter.local_interface | arista.avd.default(switch.mgmt_interface) }}
{%             if exporter.template_interval is arista.avd.defined %}
         template interval {{ exporter.template_interval }}
{%             endif %}
{%         endfor %}
{%     endfor %}
   no shutdown
{% endfor %}
# flow-tracking.j2 variables
flows:
  - name: sampled
    sample: 10000
    trackers:
      - name: EXAMPLE-TRACKER-NAME
        record_export:
          inactive_timeout: 666
          interval: 666
        exporters:
          - name: exporter1
            collector:
              ip: 127.0.0.1
            local_interface: Loopback0
          - name: exporter2
            collector:
              ip: 10.42.42.42
              port: 666

This then requires the following eos_cli usage that should be modeled under ethernet_interfaces

custom_structured_configuration_ethernet_interfaces:
  Ethernet42:
    eos_cli:
      flow tracker sampled EXAMPLE-TRACKER-NAME

Describe alternatives you have considered

using custom_template for now

Additional context

No response

Contributing Guide

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant