dellemc.enterprise_sonic.sonic_qos_wred module – Manage QoS WRED profiles configuration on SONiC

Note

This module is part of the dellemc.enterprise_sonic collection (version 2.5.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic.

To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_qos_wred.

New in dellemc.enterprise_sonic 2.5.0

Synopsis

  • This module provides configuration management of QoS WRED profiles for devices running SONiC

Parameters

Parameter

Comments

config

list / elements=dictionary

QoS WRED profile configuration

ecn

string

ECN setting for colored packets

Choices:

  • "green"

green

dictionary

WRED configuration for green packets

drop_probability

integer

Drop probablity percentage rate for green packets

Range 0-100

enable

boolean

Enable or disable WRED for green packets

Choices:

  • false

  • true

max_threshold

integer

Maximum threshold set for green packets in bytes

Range 1000-12480000

min_threshold

integer

Minimum threshold set for green packets in bytes

Range 1000-12480000

name

string / required

Name of the WRED profile

state

string

The state of the configuration after module completion.

Choices:

  • "merged" ← (default)

  • "deleted"

  • "overridden"

  • "replaced"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.

  • Supports check_mode.

Examples

# Using Merged
#
# Before state:
# -------------
#
# sonic# show qos wred-policy
# (No qos wred-policy configuration present)

- name: Merge QoS WRED policy configuration
  dellemc.enterprise_sonic.sonic_qos_wred:
    config:
      - name: profile1
        ecn: green
        green:
          enable: True
          min_threshold: 1000
          max_threshold: 5000
          drop_probability: 25
    state: merged

# After state:
# ------------
#
# sonic# show qos wred-policy
# ---------------------------------------------------
# Policy                 : profile1
# ---------------------------------------------------
# ecn                    : ecn_green
# green-min-threshold    : 1           KBytes
# green-max-threshold    : 5           KBytes
# green-drop-probability : 25
#
#
# Using Replaced
#
# Before state:
# -------------
#
# sonic# show qos wred-policy
# ---------------------------------------------------
# Policy                 : profile1
# ---------------------------------------------------
# ecn                    : ecn_green
# green-min-threshold    : 1           KBytes
# green-max-threshold    : 5           KBytes
# green-drop-probability : 25

- name: Replace QoS WRED policy configuration
  dellemc.enterprise_sonic.sonic_qos_wred:
    config:
      - name: profile1
        green:
          drop_probability: 75
    state: replaced

# After state:
# ------------
#
# sonic# show qos wred-policy
# ---------------------------------------------------
# Policy                 : profile1
# ---------------------------------------------------
# green-drop-probability : 75

# Using Overridden
#
# Before state:
# -------------
#
# sonic# show qos wred-policy
# ---------------------------------------------------
# Policy                 : profile1
# ---------------------------------------------------
# ecn                    : ecn_green
# green-min-threshold    : 1           KBytes
# green-max-threshold    : 5           KBytes
# green-drop-probability : 25

- name: Override QoS WRED policy configuration
  dellemc.enterprise_sonic.sonic_qos_wred:
    config:
      - name: profile2
        ecn: green
        green:
          enable: False
          min_threshold: 3000
          max_threshold: 9000
          drop_probability: 75
    state: overridden

# After state:
# ------------
#
# sonic# show qos wred-policy
# ---------------------------------------------------
# Policy                 : profile2
# ---------------------------------------------------
# ecn                    : ecn_green
# green-min-threshold    : 3           KBytes
# green-max-threshold    : 9           KBytes
# green-drop-probability : 75
#
#
# Using deleted
#
# Before state:
# -------------
#
# sonic# show qos wred-policy
# ---------------------------------------------------
# Policy                 : profile1
# ---------------------------------------------------
# ecn                    : ecn_green
# green-min-threshold    : 1           KBytes
# green-max-threshold    : 5           KBytes
# green-drop-probability : 25
# ---------------------------------------------------
# Policy                 : profile2
# ---------------------------------------------------
# ecn                    : ecn_green
# green-min-threshold    : 3           KBytes
# green-max-threshold    : 9           KBytes
# green-drop-probability : 75

- name: Delete QoS WRED policy configuration
  dellemc.enterprise_sonic.sonic_qos_wred:
    config:
      - name: profile1
      - name: profile2
        green:
          enable: False
          min_threshold: 3000
          max_threshold: 9000
    state: deleted

# After state:
# ------------
#
# sonic# show qos wred-policy
# ---------------------------------------------------
# Policy                 : profile2
# ---------------------------------------------------
# ecn                    : ecn_green
# green-drop-probability : 75

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

list / elements=string

The resulting configuration module invocation.

Returned: when changed

Sample: ["The configuration returned will always be in the same format as the parameters above.\n"]

after(generated)

list / elements=string

The generated configuration module invocation.

Returned: when check_mode

Sample: ["The configuration returned will always be in the same format\n as the parameters above.\n"]

before

list / elements=string

The configuration prior to the module invocation.

Returned: always

Sample: ["The configuration returned will always be in the same format as the parameters above.\n"]

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: always

Sample: ["command 1", "command 2", "command 3"]

Authors

  • Shade Talabi (@stalabi1)