Configuring the Export and Import of the Switch Configurations for RMA
A switch contains fabric configuration information and local configuration information such as port settings. When a switch is replaced, removed, or otherwise disrupted, you can restore the local configuration information if the configuration was saved earlier.
The information that is saved and restored on the local switch includes the following:
- VNETs with vNET manager running on the switch
- Port VLAN associations
- Network services running on the switch
To display a full list of the current configuration details on a switch, use the running-config-show command.
To save and restore the switch configuration, the following process is involved:
- Exporting (saving) the configuration
- Importing the saved configuration on the replaced (new) switch.
Note: Pluribus recommends you to take periodic backup of the switch by exporting the configurations. In the event of a hardware failure, the exported configuration can be imported onto a new replaced switch.
Exporting the Configuration
To save or export the switch configuration to a file, use the following command:
CLI (network-admin@Leaf1) > switch-config-export
switch-config-export |
Use this command to export the switch configuration |
Specify any of the following: |
|
export-file switch-config export-file |
Specify a file name for the exported configuration file. See Note below for more details. |
upload-server upload-server-string |
Specify this parameter to upload or save the configuration file to an SCP server (that is, on a server outside the switch). The syntax for the upload-server parameter is: <username>@<servername>:/<path to directory on server>/. See the example below. |
The file created from the above command is a tar file, which includes a number of configuration files for the switch. The file is created under /nvOS/export directory.
Configuration File Naming
If you run the switch-config-export command without including any additional parameters, the file created is in the format: <switch-name-fabric-name.timestamp.tar.gz>. However, if you mention the filename for the configuration file, for example, switch-config-export export-file switch-config export-file command, then the configuration file format is: filename followed by timestamp format.
For example, to export the configuration on a switch (Leaf1), which is part of a fabric (multi-VRF), use the command:
CLI (network-admin@Leaf1) > switch-config-export
Exported configuration to /nvOS/export/Leaf1-multi-vrf.2020-10-11T23.46.38.tar.gz
where, Leaf1 is the switch name and multi-vrf is the already configured fabric name.
To export the configuration specifying the filename, use the command:
CLI (network-admin@Leaf1) > switch-config-export export-file Leaf1
Exported configuration to /nvOS/export/Leaf1.2020-10-11T23.48.49.tar.gz
Exporting the Configuration to an External Server using Direct Command:
Use the switch-config-export command with the upload-server parameter to upload (save) the configuration file to an external SCP server by using the command syntax:
CLI (network-admin@Leaf1) > switch-config-export export-file <file-name> upload-server <username>@<servername>:/<path to directory on server>/
For example, to save the configuration file with a name (here, leaf1-config), to the root directory of an external server (here server-test1), use the command and enter the password:
CLI (network-admin@Leaf1) > switch-config-export export-file leaf1-config upload-server root@server-test1:/root/
server password:
Uploaded configuration to server at /root/
Note: If you specify the upload-server parameter while exporting the configuration file, you do not have to follow the secure FTP (SFTP) process described below to upload the file to an external server.
Pluribus recommends to use the switch-config-export command with the upload-server parameter as this process is faster, easier, and also safer during a switch failure.
To export the configurations from all the nodes (switches) in the fabric, use the switch * switch-config-export upload-server command. For example, if you have six switches in a fabric, use this command to export the configurations from all six nodes to /build/diags/<name>/tmp directory :
CLI (network-admin@switch) > switch * switch-config-export upload-server root@server:/build/diags/<name>/tmp
server password:
switch-config-export [switch-leaf1]: switch-leaf1: Uploaded configuration to server at /build/diags/<name>/tmp
server password:
switch-config-export [switch-leaf2]: switch-leaf2: Uploaded configuration to server at /build/diags/<name>/tmp
server password:
switch-config-export [switch-leaf3]: switch-leaf3: Uploaded configuration to server at /build/diags/<name>/tmp
server password:
switch-config-export [switch-leaf4]: switch-leaf4: Uploaded configuration to server at /build/diags/<name>/tmp
server password:
switch-config-export [switch-leaf4]: switch-leaf4: Uploaded configuration to server at /build/diags/<name>/tmp
To view the details of the saved configuration file, use the following command:
CLI (network-admin@Leaf1) > switch-config-show
switch export-file
------ -------------------------------
Leaf1 leaf1.2020-10-11T23.48.49.tar.gz
To view the software version installed on the switch, use the command:
CLI (network-admin@Leaf1) > software-show
version: 6.0.1-6000116966
Copying the Configuration to an External Server using SFTP
For any reason if you had missed using the switch-config-export command with the upload-server parameter to upload the file to an external server, you can still copy the configuration file to a different server using SFTP (secure FTP). You must enable the transfer protocol client first before copying the files:
Note: Pluribus recommends to use the direct command as described in the Exporting the Configuration to an External Server using Direct Command section.
To enable SFTP, use the following command:
CLI (network-admin@Leaf1) > admin-sftp-modify enable
password: *******
password: *******
CLI (network-admin@Leaf1)
sftp-user: sftp
enable: yes
CLI (network-admin@Leaf1)
Then copy the configuration file to a backup server by using the following command:
backup-user@backupserver:~$ sftp network-admin@Leaf1
Connecting to Leaf1
Password:
sftp> cd /nvOS/export
sftp> ls
leaf1.2020-10-11T23.48.49.tar.gz
sftp> get leaf1.2020-10-11T23.48.49.tar.gz
sftp> bye
backup-user@backupserver:~$
Note: Whenever you reset a switch by using the switch-config-reset command, Netvisor takes a back-up the configuration file and the file is stored in the same location (/nvOS/export).
Importing the Saved Configuration on the Replaced (new) Switch
After the switch configuration is exported (see above section) , you can import or retrieve the configuration by using the switch-config-import command. Before importing the saved configuration, you must copy (upload) the file back from the backup location.
Note: Please ensure to install the same software version (that was available on the replaced switch) onto the new switch.
To copy the configuration file from the backup location, use the following command:
backup-user@backupserver:~$ sftp network-admin@Leaf1
Connecting to Leaf1
Password:
sftp> cd /nvOS/import
sftp> put leaf1.2020-10-11T23.48.49.tar.gz
sftp> ls
leaf1.2020-10-11T23.48.49.tar.gz
sftp> bye
This command copies the configuration tar file from the backup location to the /nvOS/import directory. Once in the /nvOS/import directory, by using the switch-config-import command, you can import the previously saved switch configuration.
Import the previously saved configuration on the new switch by using the switch-config-import command:
CLI (network-admin@Leaf1) > switch-config-import import-file <file-name>
switch-config-import |
Use this command to import the previously saved (exported) switch configuration |
import-file switch-config import-file |
Specify the filename of the configuration file that you want to import. |
Specify Optional parameters: |
|
apply-system-config|ignore-system-config |
This is an optional parameter. Choose:
|
For example, if you want to import the previously saved configuration file (leaf1.2020-10-11T23.48.49.tar.gz) on the switch Leaf1, use the command:
CLI (network-admin@Leaf1) > switch-config-import import-file leaf1.2020-10-11T23.48.49.tar.gz
New configuration imported. Restarting nvOS...
Connected to Switch Leaf1; nvOS Identifier:0xb000011; Ver: 6.0.1-6000116966