Skip to content

Commit

Permalink
[vs] add information about features to config db (sonic-net#7857)
Browse files Browse the repository at this point in the history
vs has components from swss, bgp, teamd and nat. This table is needed by this change sonic-net/sonic-utilities#1554.

Because sonic-net/sonic-utilities#1554 requires "config warm_restart enable FEATURE" and the FEATURE has to be in feature table.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak authored and Carl Keene committed Aug 7, 2021
1 parent ad7f8f9 commit a822d05
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions platform/vs/docker-sonic-vs/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ COPY ["files/sonic_version.yml", "/etc/sonic/"]
COPY ["port_breakout_config_db.json", "/etc/sonic/"]
COPY ["database_config.json", "/etc/default/sonic-db/"]
COPY ["hostname.j2", "/usr/share/sonic/templates/"]
COPY ["init_cfg.json.j2", "/usr/share/sonic/templates/"]
COPY ["default_chassis_cfg.json", "/etc/default/sonic-db/"]
COPY ["asic_table.json", "/etc/sonic/"]
COPY ["buffermgrd.sh", "/usr/bin/"]
Expand Down
17 changes: 17 additions & 0 deletions platform/vs/docker-sonic-vs/init_cfg.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"DEVICE_METADATA": {
"localhost": {
"mac": "{{ system_mac }}",
"buffer_model": "traditional"
}
},
{% set features = ["swss", "bgp", "teamd", "nat", "database"] %}
"FEATURE": {
{% for feature in features %}
"{{ feature }}": {
"state": "enabled"
}{% if not loop.last %},{% endif %}
{% endfor %}
}
}

2 changes: 1 addition & 1 deletion platform/vs/docker-sonic-vs/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mkdir -p /var/run/redis/sonic-db
cp /etc/default/sonic-db/database_config.json /var/run/redis/sonic-db/

SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'", "buffer_model": "traditional"}}}' $CHASS_CFG --print-data > /etc/sonic/init_cfg.json
sonic-cfggen -t /usr/share/sonic/templates/init_cfg.json.j2 -a "{\"system_mac\": \"$SYSTEM_MAC_ADDRESS\"}" $CHASS_CFG > /etc/sonic/init_cfg.json

if [ -f /etc/sonic/config_db.json ]; then
sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --print-data > /tmp/config_db.json
Expand Down

0 comments on commit a822d05

Please sign in to comment.