Device Group
Device groups provide a mechanism for applying consistent configurations across multiple NX-OS devices, sitting in the middle of the configuration hierarchy (Global → Device Group → Device) to enable shared settings that can still be overridden per device. Each device group is identified by a name and contains a list of member devices, with support for variables and template assignments that are inherited by all group members. Device groups are particularly effective for organizing devices by role (spine, leaf, border), location, or function, reducing configuration duplication while maintaining the flexibility to customize individual devices as needed.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”device_groups (nxos)
Section titled “device_groups (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes | ||
| devices | List | String | No | |
| variables | Map | No | ||
| templates | List | String | No |
Examples
Section titled “Examples”Example 1: Basic device groups organizing switches by role
nxos: device_groups: - name: SPINES devices: - SPINE1 - SPINE2
- name: LEAFS devices: - LEAF1 - LEAF2Example 2: Leaf group with shared VXLAN VTEP, BGP, and anycast gateway configuration
nxos: device_groups: - name: LEAFS configuration: fabric_forwarding: anycast_gateway_mac: 20:20:00:00:10:12 interfaces: loopbacks: - id: 1 interface_groups: [LOOPBACK_INTERFACE] ip_address: ${vtep_ip}/32 ethernets: - id: 1/1 interface_groups: [FABRIC_INTERFACE] - id: 1/2 interface_groups: [FABRIC_INTERFACE] nve: shutdown: false advertise_virtual_rmac: true host_reachability_protocol: bgp source_interface_type: loopback source_interface_id: "1" routing: bgp: asn: "65000" peer_templates: - name: SPINE-PEERS remote_as: "65000" update_source_interface_type: loopback update_source_interface_id: "0" address_families: - address_family: l2vpn-evpn send_community_standard: true send_community_extended: true neighbors: - ip: 10.1.100.1 inherit_peer: SPINE-PEERS - ip: 10.1.100.2 inherit_peer: SPINE-PEERSExample 3: Spine group with anycast RP, BGP route reflector, and fabric interfaces
nxos: device_groups: - name: SPINES configuration: interfaces: loopbacks: - id: 100 interface_groups: [LOOPBACK_INTERFACE] ip_address: 10.1.101.1/32 ethernets: - id: 1/1 interface_groups: [FABRIC_INTERFACE] - id: 1/2 interface_groups: [FABRIC_INTERFACE] routing: pim: anycast_rps: - address: ${anycast_ip} set_address: ${lo0_ip} bgp: asn: "65000" peer_templates: - name: LEAF-PEERS remote_as: "65000" update_source_interface_type: loopback update_source_interface_id: "0" address_families: - address_family: l2vpn-evpn send_community_standard: true send_community_extended: true neighbors: - ip: 10.1.100.3 inherit_peer: LEAF-PEERS - ip: 10.1.100.4 inherit_peer: LEAF-PEERS