Cumulus Linux NVUE CLI: Configuration Workflow Guide - 夜莺博客

Cumulus Linux NVUE CLI: Configuration Workflow Guide

NVUE is the object-model CLI shipped with Cumulus Linux on NVIDIA Spectrum switches. It is flat rather than modal - you never enter an interface submode - and it separates editing from applying, which is the feature that makes it safe for remote work. The rules below cover the whole operational model in one pass.

Four Command Families

Family Purpose
nv set / nv unset Edit the pending configuration
nv show Read operational or applied state; --pending and --applied select which
nv config Apply, diff, save, history, patch, replace
nv action Imperative actions: clear counters, reboot, images

Tab completion and ? work everywhere, and every command accepts -h. nv list-commands dumps the object model, which is the fastest way to discover a path you have not used before.

The Golden Rule: Never Mix NVUE With Linux Edits

When you apply with NVUE, it writes to /etc/network/interfaces, /etc/frr/frr.conf, /etc/snmp/snmpd.conf and others. If you also edit those files by hand or with Ansible templates, NVUE will overwrite your work on the next apply and vice versa. Two supported ways out:

  • Configure everything through NVUE and treat the underlying files as read-only output.
  • Tell NVUE to leave specific files alone: nv set system config apply ignore /etc/ptp4l.conf, then apply.

Pending, Applied and Saved - Three Different Things

nv set interface swp1 bridge domain br_default access 10
nv config diff              # pending vs applied
nv config apply             # applied; auto-save is on by default
nv config show              # saved/applied config in YAML
nv config history

With auto-save on (the default), nv config apply also persists to /etc/nvue.d/startup.yaml. Teams that want a separate save step disable it with nv set system config auto-save state disabled, after which nv config save becomes mandatory or changes vanish at reboot.

What Makes It Safe: Commit Confirm

nv config apply --confirm 5m
nv config apply --confirm-status
nv config apply --assume-yes

Applying with --confirm requires you to confirm afterwards; if you do not, the configuration rolls back automatically when the timer expires. This is the single most valuable habit for remote changes on a switch you are reaching in-band - it converts a lockout into a five-minute wait.

A Worked Access-Port Change

nv set bridge domain br_default
nv set bridge domain br_default vlan 10
nv set interface swp1
nv set interface swp1 bridge domain br_default access 10
nv set interface swp1 link mtu 9216
nv config diff
nv config apply --confirm 3m
nv show interface swp1 bridge domain
nv show interface swp1 link
nv config apply --confirm-status      # or just wait for the timer

BGP and MLAG in Three Objects

nv set router bgp autonomous-system 65101
nv set router bgp router-id 10.0.0.1
nv set vrf default router bgp neighbor swp2 remote-as external
nv set vrf default router bgp neighbor swp2 type peering
nv config apply

nv set interface bond1 bond member swp3-4
nv set interface bond1 bond mlag id 1
nv set interface bond1 bridge domain br_default
nv set mlag mac-address 44:38:39:BE:EF:AA
nv set mlag peer-ip linklocal
nv set mlag backup 10.10.10.2
nv config apply

Note the pattern: NVUE expresses topology (what connects to what) plus intent, and generates the FRR and interfaces configuration from it. That is why an automation pipeline targeting NVUE pushes YAML or nv config patch rather than templating Linux files directly.

Troubleshooting Shortlist

nv show platform environment
nv show interface counters
nv show interface <if> pluggable
nv config find br_default
nv config diff --expand
nv show interface bond1 mlag

If the applied and operational views disagree, suspect a feature that is not in the NVUE object model yet - the answer is an NVUE snippet rather than a hand-edited file. For fabric-wide design context, see spine-leaf oversubscription and ECMP design.

原文链接:https://docs.nvidia.com/networking-ethernet-software/cumulus-linux/System-Configuration/NVIDIA-User-Experience-NVUE/NVUE-CLI