dellemc.enterprise_sonic.sonic_qos_scheduler module – Manage QoS scheduler configuration on SONiC

Note

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

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_scheduler.

New in dellemc.enterprise_sonic 2.5.0

Synopsis

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

Parameters

Parameter

Comments

config

list / elements=dictionary

QoS scheduler configuration

name

string / required

Name of scheduler policy

schedulers

list / elements=dictionary

Schedulers configuration for the scheduler policy

cbs

integer

Committed burst size measured in bytes

Range 0-125000000

cir

integer

Committed information rate measured in bps

Range 0-400000000000

meter_type

string

Metering method used by the scheduler

Choices:

  • "packets"

  • "bytes"

pbs

integer

Excess burst size measured in bytes

Range 0-125000000

pir

integer

Peak information rate measured in bps

Range 0-400000000000, must be greater than or equal to cir

scheduler_type

string

Specifies the type of scheduler

Strict priority scheduling cannot be configured with weight

Choices:

  • "dwrr"

  • "wrr"

  • "strict"

sequence

integer / required

Sequence number of the scheduler

Range 0-7 for interface queues

Range 0-47 for CPU queues

Specify 255 for port queues

weight

integer

Weight of the scheduler

Range 1-100

state

string

The state of the configuration after module completion

Choices:

  • "merged" ← (default)

  • "deleted"

  • "replaced"

  • "overridden"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.

  • Supports check_mode.

Examples

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

- name: Merge QoS scheduler configurations
  dellemc.enterprise_sonic.sonic_qos_scheduler:
    config:
      - name: policy1
        schedulers:
          - sequence: 0
            scheduler_type: dwrr
            weight: 10
            meter_type: packets
            cir: 32000
            pir: 40000
            cbs: 30000
            pbs: 35000
    state: merged

# After state:
# ------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
#   Queue: 0
#              type: dwrr
#              weight: 10
#              meter-type: packets
#              cir: 32000       Pps
#              cbs: 30000       Packets
#              pir: 40000       Pps
#              pbs: 35000       Packets
#
#
# Using Replaced
#
# Before state:
# -------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
#   Queue: 0
#              type: dwrr
#              weight: 10
#              meter-type: packets
#              cir: 32000       Pps
#              cbs: 30000       Packets
#              pir: 40000       Pps
#              pbs: 35000       Packets

- name: Replace QoS scheduler configurations
  dellemc.enterprise_sonic.sonic_qos_scheduler:
    config:
      - name: policy1
        schedulers:
          - sequence: 0
            weight: 12
    state: replaced

# After state:
# ------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
#   Queue: 0
#              weight: 12
#
#
# Using Overridden
# Before state:
# -------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
#   Queue: 0
#              type: dwrr
#              weight: 10
#              meter-type: packets
#              cir: 32000       Pps
#              cbs: 30000       Packets
#              pir: 40000       Pps
#              pbs: 35000       Packets
#   Queue: 1
#              type: dwrr
#              weight: 14
#              meter-type: packets

- name: Override QoS scheduler configurations
  dellemc.enterprise_sonic.sonic_qos_scheduler:
    config:
      - name: policy2
        schedulers:
          - sequence: 0
            scheduler_type: wrr
            weight: 5
            meter_type: bytes
            cir: 50000
            pir: 60000
            cbs: 800000
            pbs: 900000
    state: overridden

# After state:
# ------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy2
#   Queue: 0
#              type: wrr
#              weight: 5
#              meter-type: bytes
#              cir: 50          Kbps
#              cbs: 800000      Bytes
#              pir: 60          Kbps
#              pbs: 900000      Bytes
#
#
# Using deleted
#
# Before state:
# -------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
#   Queue: 0
#              type: dwrr
#              weight: 10
#              meter-type: packets
#              cir: 32000       Pps
#              cbs: 30000       Packets
#              pir: 40000       Pps
#              pbs: 35000       Packets
#   Queue: 1
#              type: dwrr
#              weight: 14
#              meter-type: packets
# Scheduler Policy: policy2
#   Queue: 0
#              type: wrr
#              weight: 5
#              meter-type: bytes
#              cir: 50          Kbps
#              cbs: 800000      Bytes
#              pir: 60          Kbps
#              pbs: 900000      Bytes

- name: Delete QoS scheduler configurations
  dellemc.enterprise_sonic.sonic_qos_scheduler:
    config:
      - name: policy1
        schedulers:
          - sequence: 0
            cir: 32000
            pir: 40000
            cbs: 30000
            pbs: 35000
          - sequence: 1
      - name: policy2
    state: deleted

# After state:
# -------------
#
# sonic# show qos scheduler-policy
# Scheduler Policy: policy1
#   Queue: 0
#              type: dwrr
#              weight: 10
#              meter-type: packets

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)