Skip to content

Commit da42bd7

Browse files
Volodymyr Samotiylguohan
Volodymyr Samotiy
authored andcommitted
[config]: Apply CRM default config to DB on start (#1534)
Signed-off-by: Volodymyr Samotiy <[email protected]>
1 parent 9f3d3f1 commit da42bd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

files/build_templates/sonic_debian_extension.j2

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ sudo bash -c "echo dhcp_as_static=true >> $FILESYSTEM_ROOT/etc/sonic/updategraph
165165
{% else %}
166166
sudo bash -c "echo enabled=false > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
167167
{% endif %}
168-
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_bgp_status\": {% if shutdown_bgp_on_start == "y" %}\"down\"{% else %}\"up\"{% endif %}, \"default_pfcwd_status\": {% if enable_pfcwd_on_start == "y" %}\"enable\"{% else %}\"disable\"{% endif %} } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
168+
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_bgp_status\": {% if shutdown_bgp_on_start == "y" %}\"down\"{% else %}\"up\"{% endif %}, \"default_pfcwd_status\": {% if enable_pfcwd_on_start == "y" %}\"enable\"{% else %}\"disable\"{% endif %} } },
169+
{%- print ' \\"CRM\\": { \\"Config\\": { \\"polling_interval\\": \\"300\\", ' %}
170+
{%- for crm_res in ["ipv4_route", "ipv6_route", "ipv4_nexthop", "ipv6_nexthop", "ipv4_neighbor", "ipv6_neighbor", "nexthop_group_member", "nexthop_group", "acl_table", "acl_group", "acl_entry", "acl_counter", "fdb_entry"] -%}
171+
\"{{crm_res}}_threshold_type\": \"percentage\", \"{{crm_res}}_low_threshold\": \"70\", \"{{crm_res}}_high_threshold\": \"85\"{% if not loop.last %}, {% endif %}
172+
{%- endfor %} } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
169173

170174
# Copy SNMP configuration files
171175
sudo cp $IMAGE_CONFIGS/snmp/snmp.yml $FILESYSTEM_ROOT/etc/sonic/

0 commit comments

Comments
 (0)