d0f16c0d79
Treat devices that are ToRRouters (ToRRouters and BackEndToRRouters) the same when rendering templates Except for BackEndToRRouters belonging to a storage cluster, since these devices have extra sub-interfaces created Treat devices that are LeafRouters (LeafRouters and BackEndLeafRouters) the same when rendering templates Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
28 lines
851 B
Django/Jinja
28 lines
851 B
Django/Jinja
{# the range of hash_seed is 0-15 #}
|
|
{# set default hash seed to 0 #}
|
|
{% set hash_seed = 0 %}
|
|
{% set hash_seed_offset = 0 %}
|
|
{% if DEVICE_METADATA.localhost.type %}
|
|
{% if "ToRRouter" in DEVICE_METADATA.localhost.type %}
|
|
{% set hash_seed = 0 %}
|
|
{% elif "LeafRouter" in DEVICE_METADATA.localhost.type %}
|
|
{% set hash_seed = 10 %}
|
|
{% elif "SpineRouter" in DEVICE_METADATA.localhost.type %}
|
|
{% set hash_seed = 25 %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if DEVICE_METADATA.localhost.namespace_id %}
|
|
{% set hash_seed_offset = DEVICE_METADATA.localhost.namespace_id | int %}
|
|
{% endif %}
|
|
{% set hash_seed_value = hash_seed_offset + hash_seed %}
|
|
[
|
|
{
|
|
"SWITCH_TABLE:switch": {
|
|
"ecmp_hash_seed": "{{ hash_seed_value }}",
|
|
"lag_hash_seed": "{{ hash_seed_value }}",
|
|
"fdb_aging_time": "600"
|
|
},
|
|
"OP": "SET"
|
|
}
|
|
]
|