NVIDIA MLNX-OS Configuration Management - 夜莺博客

NVIDIA MLNX-OS Configuration Management

Source: NVIDIA MLNX-OS User Manual (Switch Software Documentation)

This article covers how to manage configuration files on NVIDIA Spectrum switches running MLNX-OS (Onyx), including loading configuration, restoring factory defaults, BIN and text configuration files, and automated backups.

Loading a Configuration File

By default, or after a system reset, the system loads the default "initial" configuration file. To load a different configuration file and make it the active configuration:

switch > enable
switch # configure terminal
switch (config) # configuration switch-to myconfig
switch (config) #

On director switch systems with dual management modules, load the configuration on the top CPU that serves as the chassis master. If the configuration file is loaded on a different CPU than the SM HA master (the SM HA master that serves the VIP), the SM configuration is overwritten.

Restoring Factory Default Configuration

If system configuration becomes corrupted, restore the factory default configuration. On a single management module system:

switch (config) # reset factory keep-basic

On a dual management module system: connect to a remote console/serial connection, remove the slave management module, run reset factory keep-basic and wait for reboot, log in as "admin" and run the Configuration Wizard, insert the slave module, remove the master module (a takeover makes the slave the new master), repeat reset factory keep-basic on the new master, insert the other module, and power cycle the system.

Managing Configuration Files

BIN Configuration Files

BIN configuration files are not human readable; they are encrypted and contain integrity verification preventing them from being edited. Key commands:

switch (config) # configuration new my-filename                    # create new (empty) BIN file
switch (config) # configuration upload my-filename scp://myusername@my-server/path/to/my/
switch (config) # configuration fetch scp://myusername@my-server/path/to/my/
switch (config) # show configuration files                          # list available files
switch (config) # configuration switch-to my-filename               # load (requires reboot)

A BIN configuration file uploaded from the switch is encrypted and has integrity verification — if modified in any manner, the fetch to the switch fails.

Text Configuration Files

Text configuration files are text-based and editable, similar in form to the output of show running-config expanded:

switch (config) # configuration text generate active running save my-filename
switch (config) # configuration text file my-filename apply
switch (config) # configuration text file my-filename upload scp://root@my-server/root/tmp/my-filename
switch (config) # configuration text fetch scp://root@my-server/root/tmp/my-filename

Applying a text-based configuration file appends to the existing configuration; only new or changed configuration is added and no reboot is required. Applying it to an existing/running data port configuration may result in unpredictable behavior, so it is suggested to first clear the configuration or reset to factory default.

Automated Configuration File Backup

Auto-Upload on Configuration Write

switch (config) # configuration auto-upload remote-url "scp://root:password@my-server/path/to/upload/to"
switch (config) # show configuration auto-upload
switch (config)# configuration write

This uploads the active configuration file on every "configuration write". Use no configuration auto-upload remote-url to disable.

Automated Periodic Backup with Scheduled Jobs

switch (config) # job 1
switch (config) # job 1 command 1 "configuration upload timestamp active scp://root:password@my-server/path/to/upload/to"
switch (config) # job 1 schedule periodic interval 18h0m0s
switch (config) # job 1 enable

Scheduled jobs give you a simple way to perform automated periodic backups of the active configuration.

原文链接:https://networking-docs.nvidia.com/mlnxosum/3126200lts/configuration-management