NVIDIA NVOS User Manual for InfiniBand Switches

NVUE CLI Overview

The NVUE CLI has a flat structure as opposed to a modal structure. This means that you can run all commands from the primary prompt instead of only in a specific mode.

Command Syntax

NVUE commands all begin with nv and fall into one of four syntax categories:

  • Configuration (nv set and nv unset)

  • Monitoring (nv show)

  • Action commands (nv action

  • Configuration management (nv config).

Command Completion

As you enter commands, you can get help with the valid keywords or options using the Tab key. For example, using Tab completion with nv set displays the possible options for the command and returns you to the command prompt to complete the command.

admin@nvos:~$ nv set <<press Tab>>
acl        interface  platform   system

Command Question Mark

You can type a question mark (?) after a command to display required information quickly and concisely. When you type ?, NVUE specifies the value type, range, and options with a brief description of each; for example:

admin@nvos:~$ nv set system config auto-save ?

    [Enter]               
    state                  Enable/Disable configuration automatic save feature

NVUE also indicates if you need to provide specific values for the command:

admin@nvos:~$ nv set interface ?
    <interface-id>         Interface (interface-name)

Command Abbreviation

NVUE supports command abbreviation, where you can type a certain number of characters instead of a whole command to speed up CLI interaction. For example, instead of typing nv show interface, you can type nv sh int.

If the command you type is ambiguous, NVUE shows the reason for the ambiguity so that you can correct the shortcut. For example:

admin@nvos:~$ nv s i 
Ambiguous Command: 
   set interface 
   show interface 

Command Help

As you enter commands, you can get help with command syntax by entering -h or --help at various points within a command entry. For example, to examine the options available for nv set interface, enter nv set interface -h or nv set interface --help.


admin@nvos:~$ nv set interface -h
usage: 
  nv [options] set interface <interface-id>

Description:
  interface             Update all interfaces. Provide single interface or multiple interfaces using ranging (e.g. sw1-2p1-2 -> sw1p1,sw1p2,sw2p1,sw2p2).

Identifiers:
  <interface-id>        Interface (interface-name)

General Options:
  -h, --help            Show help.


Command List

You can list all the NVUE commands by running nv list-commands.

Command History

At the command prompt, press the Up Arrow and Down Arrow keys to move back and forth through the list of commands you entered. When you find a given command, you can run the command by pressing Enter. Optionally, you can modify the command before you run it.

Command Ranges

A single interface or multiple interfaces can be provided using a range such as sw1-2p1-2 -> sw1p1,sw1p2,sw2p1,sw2p2.

Example:

admin@nvos:~$ nv set interface sw1p1s1,sw1p1s2 description TEST
admin@nvos:~$ nv config diff
- set:
    interface:
      sw1p1s1-2:
        description: TEST
        type: nvl
admin@nvos:~$  nv set interface sw1p1-2s1 description TEST
admin@nvos:~$  nv config diff
- set:
    interface:
      sw1p1-2s1,sw2p1-2s1:
        description: TEST
        type: nvl

Command Categories

The NVUE CLI has a flat structure; however, the commands are in four functional categories:

  • Configuration

  • Monitoring

  • Action

  • Configuration Management

Configuration Commands

The NVUE configuration commands modify switch configuration. You can set and unset configuration options.

The nv set and nv unset commands are in the following categories. Each command group includes subcommands. Use command completion (press the Tab key) to list the subcommands.

Command Group

Description

nv set interface <interface-id>
nv unset interface <interface-id>

Configures the switch interfaces. Use this command to configure eth0/eth1/lo/nvl interfaces.

nv set system
nv unset system

Configures the hostname of the switch, pre and post login messages, log level, users, password-hardening policies etc. 

nv set acl
nv unset acl

Configures ACLs.

nv set platform
nv unset platform

Configures the platform firmware configuration.

Monitoring Commands

The NVUE monitoring commands show various parts of the network configuration. For example, you can show the complete network configuration or only interface configuration. The monitoring commands are in the following categories. Each command group includes subcommands. Use command completion (press the Tab key) to list the subcommands.

Command Group

Description

nv show acl

Shows Access Control List configuration.

nv show action

Shows information about the action commands job.

nv show interface

Shows interface configuration.

nv show platform

Shows platform configuration, such as hardware and software components.

nv show system

Shows global system settings, such as the images, tech-support files and log . You can also see system login messages and switch reboot history.

nv show vrf

Shows VRF configuration.

nv show ib

Shows system and MGMT GUIDs and LIDs

If there are no pending or applied configuration changes, the nv show command only shows the running configuration (under operational).


Additional options are available for the nv show commands. For example, you can choose the configuration you want to show (pending, applied, startup, or operational). You can also turn on colored output, and paginate specific output.

Option

Description

--applied

Shows configuration applied with the nv config apply command. For example, nv show interface eth0 --applied .

--brief-help

Shows help about the nv show command. For example, nv show interface sw1p1 --brief-help

--color

Turns colored output on or off. For example, nv show interface eth0 --color on

--help

Shows help for the NVUE commands.

--filter

Filters show command output on column data. For example, the nv show interface --filter mtu=256 shows only the interfaces with operational MTU 256.
To filter on multiple column outputs, enclose the filter types in parentheses; for example, nv show interface --filter "type=ib&mtu=256" shows data for ib interfaces with MTU 256.
You can use wildcards; for example, nv show interface swp1 --filter "link.speed=200*" shows all interfaces that have speed start with 200 .
You can filter on all revisions (operational, applied, and pending); for example, nv show interface --filter "ip.address=1*" --rev=applied shows all IP addresses that start with 1 for in the applied revision.

--hostname

Shows system configuration for the switch with the specified hostname. For example, nv show --hostname leaf01.

--operational

Shows the running configuration (the actual system state). For example, nv show interface eth0 --operational shows the running configuration for eth0. The running and applied configuration should be the same. If different, inspect the logs.

--output

Shows command output in table format (auto), json format or yaml format. For example:
nv show interface eth0 -o auto 
nv show interface eth0 -o json 
nv show interface eth0 -o yaml 

--paginate

Paginates the output. For example, nv show interface eth0 --paginate on .

--pending

Shows configuration that is set and unset but not yet applied or saved. For example, nv show  interface eth0 --pending.

--rev <revision>

Shows a detached pending configuration. See the nv config detach configuration management command below. For example, nv show interface eth0 --rev changeset/admin/2021-06-11_16.16.41_FPKK.

--startup

Shows configuration saved with the nv config save command. This is the configuration after the switch boots.

--tab

Show information in tab format. For example, nv show interface sw1p1 --tab.

--view

Shows different views. A view is a subset of information provided by certain nv show commands. To see the views available for an nv show command, run the command with --view and press TAB.

Action Commands

The NVUE action commands run immediate change in the switch.

The nv action  command is in the following categories. Each command group includes subcommands. Use command completion (Tab key) to list the subcommands.

Command Group

Description

nv action <action> system 

Run some actions on the switch. managing the software image, reboot the system ,generate tech-support etc.

nv action <action> interface

Run some actions on the switch. Clear counters, renew the DHCP-client on eth0 etc.

nv action <action> platform

Run some actions on the platform. turn-on or turn-off the UID led etc.

Configuration Management Commands

The NVUE configuration management commands manage and apply configurations.

Command

Description

nv config apply

Applies the pending configuration (nv config apply) or a specific revision (nv config apply 2) to become the applied configuration. To see the list of revisions you can apply, run nv config apply <<Tab>>.
You can also use these prompt options:

  • --y or --assume-yes to automatically reply yes to all prompts.

  • --assume-no to automatically reply no to all prompts.

NVOS applies but does not save the configuration; the configuration does not persist after a reboot.

You can also use these apply options:
--confirm applies the configuration change but you must confirm the applied configuration. If you do not confirm within ten minutes, the configuration rolls back automatically. You can change the default time with the apply --confirm <time> command. For example, apply --confirm 60 requires you to confirm within one hour.
--confirm-status shows the amount of time left before the automatic rollback.

To save the pending configuration to the startup configuration automatically when you run nv config apply so that you do not have to run the nv config save command, enable auto save.

nv config detach

Detaches the configuration from the current pending configuration. NVOS names the detached configuration pending and includes a timestamp with extra characters. For example: pending_20210128_212626_4WSY

 To list all the current detached pending configurations, run nv config diff <<press tab>.

nv config diff <revision> <revision>

Shows differences between configurations, such as the pending configuration and the applied configuration or the detached configuration and the pending configuration.

nv config find <string> 

Finds a portion of the applied configuration according to the search string you provide. For example to find swp1 in the applied configuration, run nv config find sw1p1.

nv config history

Enables you to keep track of the configuration changes on the switch and shows a table with the configuration revision ID, the date and time of the change, the user account that made the change, and the type of change (such as CLI or REST API). The nv config history <revision> command shows the apply history for a specific revision.

nv config patch <nvue-file>

Updates the pending configuration with the specified YAML configuration file.

nv config replace <nvue-file>

Replaces the pending configuration with the specified YAML configuration file.

nv config revision

Shows all the configuration revisions on the switch.

nv config save

Overwrites the startup configuration with the applied configuration by writing to the /etc/nvue.d/startup.yaml file. The configuration persists after a reboot.

nv config show

Shows the currently applied configuration in yaml format. This command also shows NVUE version information.

nv config show -o commands

Shows the currently applied configuration commands.

nv config diff -o commands

Shows differences between two configuration revisions.


List All NVUE Commands

To show the full list of NVUE commands, run nv list-commands. For example:

admin@nvos:~$ nv list-commands
nv show platform environment
nv show platform environment fan
nv show platform environment fan <fan-id>
nv show platform environment temperature
nv show platform environment temperature <sensor-id>
nv show platform environment psu
nv show platform environment psu <psu-id>
nv show platform environment led
nv show platform environment led <led-id>
nv show platform software
nv show platform software installed
nv show platform software installed <installed-id>
...


You can show the list of commands for a command grouping. For example, to show the list of system commands:

admin@nvos:~$ nv list-commands system 
nv show system
nv show system message
nv show system log
nv show system log file
nv show system log file <file-name>
nv show system log file list
nv show system log file follow
nv show system log component
nv show system log component <component-name>
nv show system log component <component-name> file
nv show system log component <component-name> file list
nv show system log component <component-name> file follow
nv show system log component <component-name> file <file-name>
nv show system reboot
nv show system reboot reason
...


Use the Tab key to get help for the command lists you want to see. For example, to show the list of command options available for the interface eth0, run:


admin@nvos:~$ nv list-commands interface eth0 <<press Tab>>
ip      link    pluggable

Search for a Specific Configuration

To search for a specific portion of the NVUE configuration, run the nv config find <search string> command. The search shows all items above and below the search string. For example, to search the entire NVUE object model configuration for any mention of ptm:

admin@nvos:~$ nv config find system
 - set:
    system:
      aaa:
        authentication:
          restrictions:
            fail-delay: 0
            lockout-state: disabled
        user:
          admin:
            password: '*'
      timezone: Asia/Jerusalem

Clear Switch Configuration

Users can apply an empty configuration by running the following command:

admin@nvos:~$ nv config apply empty

The above clears the current configuration, essentially returning settings to default values.

ACL assignments to interfaces depend on user configuration and can be removed as needed. Applying an empty configuration using nv config apply empty will clear all ACL assignments, rather than restoring them to their default state. To restore the default ACL assignment, run nv unset interface acl followed by nv config apply, or perform a full factory reset using nv action reset system factory-default.

Example Configuration Commands

This section provides examples of how to configure a NVOS switch using NVUE commands.

Configure the System Hostname

The example below shows the NVUE commands required to change the hostname for the switch to nvos:


admin@nvos:~$ nv set system hostname nvos
admin@nvos:~$ nv config apply

Configure an Interface

The example below shows the NVUE commands required to bring up sw1p1.

admin@nvos:~$ nv set interface sw1p1s1 link state up
admin@nvos:~$ nv config apply  


Example Monitoring Commands

This section provides monitoring command examples.

Show Installed Software

The following example command lists the software installed on the switch:


admin@nvos:~$ nv show platform software installed
Installed software                        description                                                                                   package                                   version
----------------------------------------  --------------------------------------------------------------------------------------------  ----------------------------------------  ------------------------------
acl                                       access control list - utilities                                                               acl                                       2.2.53-10
adduser                                   add and remove users and groups                                                               adduser                                   3.118
apparmor                                  user-space parser utility for AppArmor                                                        apparmor                                  2.13.6-10
apt                                       commandline package manager                                                                   apt                                       2.2.4
apt-transport-https                       transitional package for https support                                                        apt-transport-https                       2.2.4
audisp-tacplus                            audisp module for TACACS+ accounting                                                          audisp-tacplus                            1.0.2
auditd                                    User space tools for security auditing                                                        auditd                                    1:3.0-2
base-files                                Debian base system miscellaneous files                                                        base-files                                11.1+deb11u3
base-passwd                               Debian base system master password and group files                                            base-passwd                               3.5.51
bash                                      GNU Bourne Again SHell                                                                        bash                                      5.1-2+b3
bash-completion                           programmable completion for the bash shell                                                    bash-completion                           1:2.11-2
bash-tacplus                              Bash TACACS+ plugin for per-command TACACS+ authorization.                                    bash-tacplus                              1.0.0
bridge-utils                              Utilities for configuring the Linux Ethernet bridge                                           bridge-utils                              1.7-1
bsdextrautils                             extra utilities from 4.4BSD-Lite                                                              bsdextrautils                             2.36.1-8+deb11u1
bsdmainutils                              Transitional package for more utilities from FreeBSD                                          bsdmainutils                              12.1.7+nmu3
bsdutils                                  basic utilities from 4.4BSD-Lite                                                              bsdutils                                  1:2.36.1-8+deb11u1
busybox                                   Tiny utilities for small and embedded systems                                                 busybox                                   1:1.30.1-6+b3
ca-certificates                           Common CA certificates                                                                        ca-certificates                           20210119 
...


Show Interface Configuration

The following example command shows the running, applied, and pending sw1p1s1 interface configuration.


admin@nvos::~$ nv show interface sw1p1s1
                      operational          applied  
--------------------  -------------------  --------
link                                                         
  auto-negotiate      on                   on          
  duplex                                   full       
  speed                                    auto         
  counters                                                   
    in-bytes          0 Bytes                                
    in-pkts           0                                      
    in-drops          0                                      
    in-errors         0                                      
    out-bytes         0 Bytes                                
    out-pkts          0                                      
    out-drops         0                                      
    out-errors        0                                      
    in-symbol-errors  0                                      
    out-wait          0                                      
  [diagnostics]                                              
  mtu                                      4096        
  op-vls                                   VL0-VL7 
  lanes                                    1X,2X,4X
  state               down                 up            
  supported-speed     800G                    
  max-supported-mtu   4096                                   
  physical-state      Polling                                
  logical-state       Down                                   
  supported-lanes     1X,2X,4X                               
  vl-capabilities     VL0-VL7                                                    
 type                 nvl                  nvl          

Reset NVUE Configuration to Default Values

To reset the NVUE configuration on the switch back to the default values, run the following command:

admin@nvos:~$ nv config replace /usr/lib/python3/dist-packages/cue_config_v1/initial.yaml
admin@nvos:~$ nv config apply

Add Configuration Apply Messages

When you run the nv config apply command, you can add a message that describes the configuration updates you make. You can see the message when you run the nv config history command.

To add a configuration apply message, run the nv config apply -m <message> command. If the message includes more than one word, enclose the message in quotes.

admin@nvos:~$ nv config apply -m "this is my message"

Configure Auto Save

By default, when you run the nv config apply command to apply a configuration setting, NVUE applies the pending configuration to become the applied configuration and automatically saves the changes to the startup configuration file (/etc/nvue.d/startup.yaml).

To disable auto save so that NVUE does not save applied configuration changes, run the nv set system config auto-save enable off command:

admin@nvos:~$ nv set system config auto-save enable off
admin@nvos:~$ nv config apply

When you disable auto save, you must run the nv config save command to save the applied configuration to the startup configuration so that the changes persist after a reboot.

Example Configuration Management Commands

This section provides examples of how to use the configuration management commands to apply, save, and detach configurations.

Apply and Save a Configuration

The following example command configures the front panel port interfaces sw1p1 state. The configuration is only in a pending configuration state. The configuration is not applied. NVUE has not yet made any changes to the running configuration.


admin@nvos:~$ nv set interface sw1p1s1 link state down


To apply the pending configuration to the running configuration, run the nv config apply command. The configuration does not persist after a reboot.

admin@nvos:~$ nv config apply


To save the applied configuration to the startup configuration, run the nv config save command. The configuration persists after a reboot.


admin@nvos:~$ nv config save

Detach a Pending Configuration

The following example configures the IP address of the eth0 interface, then detaches the configuration from the current pending configuration. NVOS saves the detached configuration to a file with a numerical value to distinguish it from other pending configurations.


admin@nvos:~$ nv set interface eth0 ip address 10.10.10.1
admin@nvos:~$ nv config detach

View Differences Between Configurations

To view differences between configurations, run the nv config diff command.

To view differences between two detached pending configurations, run the nv config diff «TAB» command to list all the current detached pending configurations, then run the nv config diff command with the pending configurations you want to diff:


admin@nvos:~$ nv config diff <<press Tab>> 
1        2        3        4        5        6        applied  empty    startup  
admin@nvos:~$ nv config diff 1 2
- set:
    system:
      security:
        password-hardening:
          state: disabled



To view differences between the applied configuration and the startup configuration:

admin@nvos:~$ nv config diff applied startup

Replace and Patch a Pending Configuration

The following example replaces the pending configuration with the contents of the YAML configuration file called nv-02/13/2021.yaml located in the /deps directory:

admin@nvos:~$ nv config replace /deps/nv-02/13/2021.yaml


The following example patches the pending configuration (runs the set or unset commands from the configuration in the nv-02/13/2021.yaml file located in the /deps directory):

admin@nvos:~$ nv config patch /deps/nv-02/13/2021.yaml

Passwords and Special Characters

If you use certain special characters in a password, you must quote or escape (with a backslash) these characters so that the system understands that they are part of the password.

The following table shows if you need to quote or escape a special character.

  • Normal Use indicates that you can use the special character without quotes or a backslash.

  • Single Quotes and Double Quotes indicate that the entire password needs to be enclosed in quotes.

Special Character

Normal Use

Single Quotes ('')

Double Quotes ("")

Escape (\)

backtick (`)

x

1

exclamation point (!)

x

x

semicolon (;)

x

ampersand (&)

x

question mark (?)

x

x

tilde (~)

x

at-sign (@)

hash sign (#)

x

dollar sign ($)

x

x

percent sign (%)

caret (^)

asterisk (*)

parentheses (())

x

dash (-)

underscore (_)

equals sign (=)

plus sign (+)

vertical bar

x

brackets ([])

braces ({})

colon (:)

single quote ()

x

x

double quote ()

x

x

comma (,)

angle brackets (<>)

x

slash (/)

dot (.)

2

2

2

2

white space

x

x

3

x

  1. Requires escape (\) in addition to the double quotes ("").

  2. You cannot use this character at the beginning of a word.

  3. A word cannot consist entirely of white space, even inside double quotes.

The following example shows a password that includes a question mark (?):

nvos@admin:~$ nv set system aaa user nvos password “Hello?world123”

The following example shows a password that includes a dot (.):

nvos@admin:~$ nv set system aaa user nvos password “Hello.world.123”

The following example shows a password that includes a dot (.) and tilde (~):

nvos@admin:~$ nv set system aaa user nvos password “Hello.world\~123”

You might need to encode special characters in a password, for example in a URL. The following table shows the special character encoding.

  •  indicates that encoding is not needed.

  • %xx indicates that you need to replace the special character with %xx.

Symbol

Normal

Single Quotes ('')

Double Quotes ("")

Escape (\)

backtick (`)

%60

%60

exclamation point (!)

%21

%21

semicolon (;)

%3B

ampersand (&)

%26

question mark (?)

%3F

%3F

%3F

%3F

tilde (~)

at-sign (@)

hash sign (#)

%23

%23

%23

%23

dollar sign ($)

%24

%24

percent sign (%)

caret (^)

asterisk (*)

left parenthesis (()

%28

right parenthesis ())

%29

dash (-)

underscore (_)

equals sign (=)

plus sign (+)

vertical bar

%7C

left bracket ([)

%5B

%5B

%5B

%5B

right bracket (])

%5D

%5D

%5D

%5D

braces ({})

colon (:)

single quote ()

%27

%27

double quote ()

%22

%22

comma (,)

left angle bracket (<)

%3C

right angle bracket (>)

%3E

slash (/)

%2F

%2F

%2F

%2F

dot (.)

white space

%20

The following example fetches an image stored on a device with IP address 10.0.1.251 using the password Pass#pass1 for user1:

nvos@admin:~$ nv action fetch system image scp://user1:Pass1%23pass1@10.0.1.251/host/nos-images/nvos-amd64-25.02.1857.bin


Last updated: