From 6c08fdab35fcb1fb415b1e0cb015610be5850488 Mon Sep 17 00:00:00 2001 From: tgodaA Date: Wed, 16 Feb 2022 18:43:15 -0500 Subject: [PATCH 1/3] Feat(eos_cli_config_gen): Support cos in policy-map and service-policy in qos profile --- .../eos_cli_config_gen/inventory/host_vars/policy-maps.yml | 1 + .../eos_cli_config_gen/inventory/host_vars/qos.yml | 3 +++ .../arista/avd/roles/eos_cli_config_gen/README.md | 4 ++++ .../templates/documentation/qos-profiles.j2 | 7 ++++--- .../eos_cli_config_gen/templates/eos/policy-maps-qos.j2 | 2 +- .../roles/eos_cli_config_gen/templates/eos/qos-profiles.j2 | 3 +++ 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/policy-maps.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/policy-maps.yml index 859c51d5202..0cbf9ba0bac 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/policy-maps.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/policy-maps.yml @@ -16,6 +16,7 @@ policy_maps: CM_REPLICATION_LD: set: dscp: af11 + cos: 4 pbr: PM_PBR_BREAKOUT: classes: diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/qos.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/qos.yml index b99c67164f1..4f7cdf97271 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/qos.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/qos.yml @@ -32,6 +32,9 @@ qos_profiles: experiment: trust: cos cos: 2 + service_policy: + type: + qos_input: test_qos_policy tx_queues: 3: bandwidth_percent: 30 diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/README.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/README.md index 6be1c1d2a53..be7c50ea187 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/README.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/README.md @@ -2381,6 +2381,7 @@ policy_maps: classes: < class name >: set: + cos: < cos_value > dscp: < dscp-code > traffic_class: < traffic-class ID > drop_precedence: < drop-precedence value > @@ -2396,6 +2397,9 @@ qos_profiles: dscp: < dscp-value > shape: rate: < "< rate > kbps" | "1-100 percent" | "< rate > pps" , supported options are platform dependent > + service_policy: + type: + qos_input: < policy_map_name > tx_queues: < tx-queue-id >: bandwidth_percent: < value > diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/qos-profiles.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/qos-profiles.j2 index f1bd8670347..93852248fa1 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/qos-profiles.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/qos-profiles.j2 @@ -10,13 +10,14 @@ QOS Profile: **{{ profile }}** **Settings** -| Default COS | Default DSCP | Trust | Shape Rate | -| ----------- | ------------ | ----- | ---------- | +| Default COS | Default DSCP | Trust | Shape Rate | Qos Service Policy | +| ----------- | ------------ | ----- | ---------- | ------------------ | {% set cos = qos_profiles[profile].cos | arista.avd.default('-') %} {% set dscp = qos_profiles[profile].dscp | arista.avd.default('-') %} {% set trust = qos_profiles[profile].trust | arista.avd.default('-') %} {% set shape_rate = qos_profiles[profile].shape.rate | arista.avd.default('-') %} -| {{ cos }} | {{ dscp }} | {{ trust }} | {{ shape_rate }} | +{% set qos_sp = qos_profiles[profile].service_policy.type.qos_input | arista.avd.default('-') %} +| {{ cos }} | {{ dscp }} | {{ trust }} | {{ shape_rate }} | {{ qos_sp }} | {% if qos_profiles[profile].tx_queues is arista.avd.defined %} **Tx-queues** diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/policy-maps-qos.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/policy-maps-qos.j2 index ea706b6bef7..9d9c08c1db5 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/policy-maps-qos.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/policy-maps-qos.j2 @@ -7,7 +7,7 @@ policy-map type quality-of-service {{ policy_map }} {% if policy_maps.qos[policy_map].classes[class].set is arista.avd.defined %} {% for set in policy_maps.qos[policy_map].classes[class].set %} {% set cli_set = set | replace('_','-') | lower %} -{% if cli_set in ['dscp', 'traffic-class', 'drop-precedence'] %} +{% if cli_set in ['cos', 'dscp', 'traffic-class', 'drop-precedence'] %} set {{ cli_set }} {{ policy_maps.qos[policy_map].classes[class].set[set] }} {% endif %} {% endfor %} diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/qos-profiles.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/qos-profiles.j2 index 6988fbacc9a..719d92fb140 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/qos-profiles.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/qos-profiles.j2 @@ -18,6 +18,9 @@ qos profile {{ profile }} {% if qos_profiles[profile].shape.rate is arista.avd.defined %} shape rate {{ qos_profiles[profile].shape.rate }} {% endif %} +{% if qos_profiles[profile].service_policy.type.qos_input is arista.avd.defined %} + service-policy type qos input {{ qos_profiles[profile].service_policy.type.qos_input }} +{% endif %} {% for tx_queue in qos_profiles[profile].tx_queues | arista.avd.natural_sort %} ! tx-queue {{ tx_queue }} From 3a68ce5579c9ab04d1d2bd5309756c05bed7972b Mon Sep 17 00:00:00 2001 From: tgodaA Date: Wed, 16 Feb 2022 18:45:28 -0500 Subject: [PATCH 2/3] Upload artifacts --- .../documentation/devices/policy-maps.md | 6 ++++-- .../documentation/devices/qos.md | 19 ++++++++++--------- .../intended/configs/policy-maps.cfg | 1 + .../intended/configs/qos.cfg | 1 + .../inventory/host_vars/qos.yml | 2 +- .../documentation/policy-maps-qos.j2 | 2 +- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/policy-maps.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/policy-maps.md index f068a2aa0bc..84461057662 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/policy-maps.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/policy-maps.md @@ -98,7 +98,7 @@ interface Management1 **PM_REPLICATION_LD** | class | Set | Value | -| ---- | ----- | ----- | +| ----- | --- | ----- | | CM_REPLICATION_LD | drop_precedence | 1 | | CM_REPLICATION_LD | dscp | af11 | | CM_REPLICATION_LD | traffic_class | 2 | @@ -108,7 +108,8 @@ interface Management1 **PM_REPLICATION_LD2** | class | Set | Value | -| ---- | ----- | ----- | +| ----- | --- | ----- | +| CM_REPLICATION_LD | cos | 4 | | CM_REPLICATION_LD | dscp | af11 | ### QOS Policy Maps configuration @@ -129,6 +130,7 @@ policy-map type quality-of-service PM_REPLICATION_LD policy-map type quality-of-service PM_REPLICATION_LD2 class CM_REPLICATION_LD set dscp af11 + set cos 4 ! ! policy-map type pbr PM_PBR_BREAKOUT diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/qos.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/qos.md index 94f6296a92f..2d7963d0cd2 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/qos.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/qos.md @@ -223,9 +223,9 @@ QOS Profile: **experiment** **Settings** -| Default COS | Default DSCP | Trust | Shape Rate | -| ----------- | ------------ | ----- | ---------- | -| 2 | - | cos | - | +| Default COS | Default DSCP | Trust | Shape Rate | Qos Service Policy | +| ----------- | ------------ | ----- | ---------- | ------------------ | +| 2 | - | cos | - | test_qos_policy_v1 | **Tx-queues** @@ -240,17 +240,17 @@ QOS Profile: **no_qos_trust** **Settings** -| Default COS | Default DSCP | Trust | Shape Rate | -| ----------- | ------------ | ----- | ---------- | -| 3 | 4 | disabled | - | +| Default COS | Default DSCP | Trust | Shape Rate | Qos Service Policy | +| ----------- | ------------ | ----- | ---------- | ------------------ | +| 3 | 4 | disabled | - | - | QOS Profile: **test** **Settings** -| Default COS | Default DSCP | Trust | Shape Rate | -| ----------- | ------------ | ----- | ---------- | -| - | 46 | dscp | 80 percent | +| Default COS | Default DSCP | Trust | Shape Rate | Qos Service Policy | +| ----------- | ------------ | ----- | ---------- | ------------------ | +| - | 46 | dscp | 80 percent | - | **Tx-queues** @@ -267,6 +267,7 @@ QOS Profile: **test** qos profile experiment qos trust cos qos cos 2 + service-policy type qos input test_qos_policy_v1 ! tx-queue 3 bandwidth percent 30 diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/policy-maps.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/policy-maps.cfg index ba6a17b1162..76f6ca578d5 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/policy-maps.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/policy-maps.cfg @@ -26,6 +26,7 @@ policy-map type quality-of-service PM_REPLICATION_LD policy-map type quality-of-service PM_REPLICATION_LD2 class CM_REPLICATION_LD set dscp af11 + set cos 4 ! ! policy-map type pbr PM_PBR_BREAKOUT diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/qos.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/qos.cfg index 03f2d5116fc..542366a853a 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/qos.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/qos.cfg @@ -7,6 +7,7 @@ hostname qos qos profile experiment qos trust cos qos cos 2 + service-policy type qos input test_qos_policy_v1 ! tx-queue 3 bandwidth percent 30 diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/qos.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/qos.yml index 4f7cdf97271..01e15d83fe6 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/qos.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/qos.yml @@ -34,7 +34,7 @@ qos_profiles: cos: 2 service_policy: type: - qos_input: test_qos_policy + qos_input: test_qos_policy_v1 tx_queues: 3: bandwidth_percent: 30 diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/policy-maps-qos.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/policy-maps-qos.j2 index a5060eee996..1c3a911f4b3 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/policy-maps-qos.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/policy-maps-qos.j2 @@ -8,7 +8,7 @@ **{{ policy_map }}** | class | Set | Value | -| ---- | ----- | ----- | +| ----- | --- | ----- | {% for class in policy_maps.qos[policy_map].classes | arista.avd.natural_sort %} {% for set in policy_maps.qos[policy_map].classes[class].set | arista.avd.natural_sort %} | {{ class }} | {{ set }} | {{ policy_maps.qos[policy_map].classes[class].set[set] }} | From 40c1bbc32d707b7e591ff15496219a25288b0291 Mon Sep 17 00:00:00 2001 From: Carl Buchmann Date: Wed, 16 Feb 2022 21:41:10 -0500 Subject: [PATCH 3/3] capitalize QOS for consistency --- .../eos_cli_config_gen/documentation/devices/qos.md | 6 +++--- .../templates/documentation/qos-profiles.j2 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/qos.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/qos.md index 2d7963d0cd2..908832fed19 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/qos.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/qos.md @@ -223,7 +223,7 @@ QOS Profile: **experiment** **Settings** -| Default COS | Default DSCP | Trust | Shape Rate | Qos Service Policy | +| Default COS | Default DSCP | Trust | Shape Rate | QOS Service Policy | | ----------- | ------------ | ----- | ---------- | ------------------ | | 2 | - | cos | - | test_qos_policy_v1 | @@ -240,7 +240,7 @@ QOS Profile: **no_qos_trust** **Settings** -| Default COS | Default DSCP | Trust | Shape Rate | Qos Service Policy | +| Default COS | Default DSCP | Trust | Shape Rate | QOS Service Policy | | ----------- | ------------ | ----- | ---------- | ------------------ | | 3 | 4 | disabled | - | - | @@ -248,7 +248,7 @@ QOS Profile: **test** **Settings** -| Default COS | Default DSCP | Trust | Shape Rate | Qos Service Policy | +| Default COS | Default DSCP | Trust | Shape Rate | QOS Service Policy | | ----------- | ------------ | ----- | ---------- | ------------------ | | - | 46 | dscp | 80 percent | - | diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/qos-profiles.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/qos-profiles.j2 index 93852248fa1..1054fedb518 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/qos-profiles.j2 +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/documentation/qos-profiles.j2 @@ -10,7 +10,7 @@ QOS Profile: **{{ profile }}** **Settings** -| Default COS | Default DSCP | Trust | Shape Rate | Qos Service Policy | +| Default COS | Default DSCP | Trust | Shape Rate | QOS Service Policy | | ----------- | ------------ | ----- | ---------- | ------------------ | {% set cos = qos_profiles[profile].cos | arista.avd.default('-') %} {% set dscp = qos_profiles[profile].dscp | arista.avd.default('-') %}