Reload
This section explains the reload configuration support in SONiC switches.
Reload Configuration
This command is used to clear the current configuration and import a new configuration from the input file or from /etc/sonic/config_db.json. This command stops all services before clearing the configuration and then restarting those services.
Follow the step below to reload the configuration.
|
Step |
Command |
Description |
|---|---|---|
|
1 |
config reload [OPTIONS] [FILENAME] |
Configure reload options.
|
The example below shows the command used to configure reload options.
|
admin@sonic: ~$ sudo config reload |
|
running |
|
admin@sonic: ~$ sudo config reload -y |
|
running |
|
admin@sonic: ~$ |
Configure Load
This command reads the specified JSON file and writes it to the config database for addition and replacement as running settings. This command loads the configuration from the input file (if the user specifies the optional filename, the command will use that input file; otherwise, it will use the default /etc/sonic/config_db.json file as the input file) into CONFIG_DB.
The configuration present in the input file is applied on top of the already running configuration. This command does not flush the config DB before loading the new configuration; if the configuration present in the input file is same as the current running configuration, nothing happens. If the config present in the input file is not present in running configuration, it will be added. If the config present in the input file differs (when the key matches) from that of the running configuration, it will be modified per the new values for those keys.
Follow the step below to load the configuration.
|
Step |
Command |
Description |
|---|---|---|
|
1 |
config load [OPTIONS] [FILENAME] |
Configure load options.
|
The example below shows the command used to load the configuration.
|
admin@sonic: ~$ sudo config load -y |
|
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/config_db.json –write-to-db |
|
admin@sonic: ~$ sudo config load |
|
Load config from the default config file(s) ? [y/N]: y |
|
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/config_db.json –write-to-db |
|
admin@sonic: ~$ |