Configuring Virtual Port Channels

This section contains payload examples to demonstrate how to use the NX-API REST API to configure virtual port channels on the Cisco Nexus 3000 and 9000 Series switches.

Configuring a vPC Domain

Configuring a vPC Domain
POST http://<IP_Address>/api/node/mo/sys/vpc/inst/dom.json
{
  "vpcDom": {
    "attributes": {
      "autoRecovery": "enabled",
      "delayRestoreSVI": "333",
      "excludeSVI": "555",
      "grcflCnstncyChck": "enabled",
      "id": "1",
      "peerGw": "enabled",
      "peerSwitch": "enabled",
      "rolePrio": "222",
      "sysMac": "00:03:00:04:00:05",
      "sysPrio": "111"
    },
    "children": [
      {
        "vpcKeepalive": {
          "attributes": {
            "destIp": "192.0.20.11"
}}}]}}

This example:

  • Ensures that VLAN interface 555 does not go down on the vPC secondary device when the vPC peer link fails
  • Enables graceful consistency checking
  • Configures vPC peer devices to act as peer gateways
  • Configures a pure vPC peer switch topology
  • Manually configures the VPC peer device role
  • Manually configures a VPC domain MAC address
  • Manually configures the system priority


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

vpc domain 1
auto-recovery
delay restore interface-vlan 333
dual-active exclude interface-vlan 555
graceful consistency-check
peer-gateway
peer-switch
role priority 222
system-mac 3.4.5
system-priority 111
peer-keepalive destination 192.0.20.11

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Creating the vPC Peer Link
POST http://<IP_Address>/api/node/mo/sys/vpc/inst/dom.json
{
  "vpcKeepalive": {
    "children": [
      {
        "vpcPeerLink": {
          "attributes": {
            "id": "po10"
          }
        }
      }
    ]
  }
}

Configures the selected port channel as the vPC peer link.

Prerequisites:

  • The port-channel must already exist. See Configuring Port Channels for detailed information about port channels.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

interface port-channel 10
vpc peer-link

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Moving Other Port Channels into a vPC

Moving Other Port Channels into a vPC
POST http://<IP_Address>/api/node/mo/sys/vpc/inst/dom/if-20.json
{
  "vpcIf": {
    "attributes": {
      "id": "20"
    },
    "children": [
      {
        "vpcRsVpcConf": {
          "attributes": {
            "tDn": "sys/intf/aggr-[po10]"
          }
        }
      }
    ]
  }
}

This example configures the selected port channel into the vPC to connect to the downstream device.

Prerequisites:

  • The port-channel must already exist. See Configuring Port Channels for detailed information about port channels.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

interface port-channel 10
vpc 20

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Address Synchronization

Configuring Address Synchronization
POST http://<IP_Address>/api/node/mo/sys/intf/aggr-[po13].json
{
  "pcAggrIf": {
    "attributes": {
      "id": "po13"
    }
  }
}

IPv4 and IPv6 ND address synchronization supports faster convergence of address tables between the vPC peers.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

ip arp synchronize

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring a vPC Role Priority

Configuring a vPC Role Priority
POST http://<mgmt0_IP>/api/mo/sys/vpc/inst.json
{
  "vpcInst": {
    "children": [
      {
        "vpcDom": {
          "attributes": {
            "id": "123",
            "rolePrio": "123"
}}}]}}
{
    "imdata": []
}
<System>
  <vpc-items>
    <inst-items>
      <dom-items>
        <id>123</id>
        <rolePrio>123</rolePrio>
      </dom-items>
    </inst-items>
  </vpc-items>
</System>

Note:
Change will take effect after user has performed one of the following:

  • Triggered "vpc role preempt" (non-disruptive - no traffic loss on STP root switch)
  • Re-initd the vPC peer-link (disruptive)

Warning:
vPCs will be flapped on current primary vPC switch while attempting option 2.


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

vpc domain 123
 role priority 123

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html

Deleting a vPC Role Priority

Deleting a vPC Role Priority
POST http://<mgmt0_IP>/api/mo/sys/vpc/inst.json
{
  "vpcInst": {
    "children": [
      {
        "vpcDom": {
          "attributes": {
            "id": "123",
            "rolePrio": "32667"
}}}]}}
{
    "imdata": []
}
<System>
  <vpc-items>
    <inst-items>
      <dom-items>
        <id>123</id>
        <rolePrio>32667</rolePrio>
      </dom-items>
    </inst-items>
  </vpc-items>
</System>

Note:
Change will take effect after user has performed one of the following:

  • Triggered "vpc role preempt" (non-disruptive - no traffic loss on STP root switch)
  • Re-initd the vPC peer-link (disruptive)

Warning:
vPCs will be flapped on current primary vPC switch while attempting option 2.


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

vpc domain 123
 no role priority

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html

Configuring How Frequently to Print the Syslog

Configuring How Frequently to Print the Syslog
POST http://<mgmt0_IP>/api/mo/sys/vpc/inst.json
{
  "vpcInst": {
    "children": [
      {
        "vpcDom": {
          "attributes": {
            "id": "123",
            "l3PeerRouterSyslog": "enabled",
            "l3PeerRouterSyslogInterval": "123"
}}}]}}
{
    imdata:[]
}
<System>
  <vpc-items>
    <inst-items>
      <dom-items>
        <id>123</id>
        <l3PeerRouterSyslog>enabled</l3PeerRouterSyslog>
        <l3PeerRouterSyslogInterval>123</l3PeerRouterSyslogInterval>
      </dom-items>
    </inst-items>
  </vpc-items>
</System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

vpc domain 123
 layer3 peer-router syslog interval 123

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html

Deleting a Layer 3 Protocol Syslog

Deleting a Print Layer 3 Protocol Syslog
POST http://<mgmt0_IP>/api/mo/sys/vpc/inst.json
{
  "vpcInst": {
    "children": [
      {
        "vpcDom": {
          "attributes": {
            "id": "123",
            "l3PeerRouterSyslog": "disabled",
            "l3PeerRouterSyslogInterval": "3600"
}}}]}}
{
    imdata:[]
}
<System>
  <vpc-items>
    <inst-items>
      <dom-items>
        <id>123</id>
        <l3PeerRouterSyslog>disabled</l3PeerRouterSyslog>
        <l3PeerRouterSyslogInterval>3600</l3PeerRouterSyslogInterval>
      </dom-items>
    </inst-items>
  </vpc-items>
</System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

vpc domain 123
 no layer3 peer-router syslog

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html

Configuring No Change for TTL of Packets Destined to the Peer

Configuring No Change for TTL of Packets Destined to the Peer
POST http://<mgmt0_IP>/api/mo/sys/vpc/inst.json
{
  "vpcInst": {
    "children": [
      {
        "vpcDom": {
          "attributes": {
            "id": "123",
            "l3PeerRouter": "enabled"
}}}]}}
{
    imdata:[]
}
<System>
  <vpc-items>
    <inst-items>
      <dom-items>
        <id>123</id>
        <l3PeerRouter>enabled</l3PeerRouter>
      </dom-items>
    </inst-items>
  </vpc-items>
</System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

vpc domain 123
 layer3 peer-router

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html

Disabling No Change for TTL of Packets Destined to the Peer

Disabling No Change for TTL of Packets Destined to the Peer
POST http://<mgmt0_IP>/api/mo/sys/vpc/inst.json
{
  "vpcInst": {
    "children": [
      {
        "vpcDom": {
          "attributes": {
            "id": "123",
            "l3PeerRouter": "disabled"
}}}]}}
{
    imdata:[]
}
<System>
  <vpc-items>
    <inst-items>
      <dom-items>
        <id>123</id>
        <l3PeerRouter>disabled</l3PeerRouter>
      </dom-items>
    </inst-items>
  </vpc-items>
</System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

vpc domain 123
 no layer3 peer-router

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html

Enabling Fast Convergence on a vPC Domain

Enabling Fast Convergence on a vPC Domain
POST http://<mgmt0_IP>/api/mo/sys/vpc/inst.json
{
  "vpcInst": {
    "children": [
      {
        "vpcDom": {
          "attributes": {
            "fastConvergence": "enabled",
            "id": "5"
}}}]}}
{
    imdata:[]
}
<System>
  <vpc-items>
    <inst-items>
      <dom-items>
        <fastConvergence>enabled</fastConvergence>
        <id>5</id>
      </dom-items>
    </inst-items>
  </vpc-items>
</System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

vpc domain 5
 fast-convergence

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html

Disabling Fast Convergence on a vPC Domain

Disabling Fast Convergence on a vPC Domain
POST http://<mgmt0_IP>/api/mo/sys/vpc/inst.json
{
  "vpcInst": {
    "children": [
      {
        "vpcDom": {
          "attributes": {
            "fastConvergence": "disabled",
            "id": "5"
}}}]}}
{
    imdata:[]
}
<System>
  <vpc-items>
    <inst-items>
      <dom-items>
        <fastConvergence>disabled</fastConvergence>
        <id>5</id>
      </dom-items>
    </inst-items>
  </vpc-items>
</System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

vpc domain 5
 no fast-convergence

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/media/dme/index.html

Querying the vPC Domain

Querying the vPC Domain
HTTP GET http://<IP_Address>/api/node/mo/sys/vpc/inst/dom.json
{
  "totalCount": "1",
  "imdata": [
    {
      "vpcDom": {
        "attributes": {
          "adminSt": "enabled",
          "autoRecovery": "disabled",
          "autoRecoveryIntvl": "240",
          "batchedVpcInv": "",
          "childAction": "",
          "compatQual": "1102512194",
          "compatQualStr": "Consistency Check Not Performed",
          "compatSt": "fail",
          "deadIntvl": "200",
          "delayPeerLinkBringup": "0",
          "delayRestoreSVI": "10",
          "delayRestoreVPC": "30",
          "dn": "sys/vpc/inst/dom",
          "dualActiveSt": "false",
          "excludeSVI": "",
          "grcflCnstncyChck": "disabled",
          "id": "1",
          "ipv4CfsSync": "disabled",
          "ipv6CfsSync": "disabled",
          "issuFromVer": "",
          "issuToVer": "",
          "lacpRole": "election-not-done",
          "localMAC": "74:26:AC:EC:91:87",
          "localPrio": "0",
          "modTs": "2016-10-13T13:42:24.010+00:00",
          "monPolDn": "",
          "name": "",
          "oldRole": "election-not-done",
          "operRole": "election-not-done",
          "operSt": "configured-master",
          "orphanPortList": "0",
          "peerGw": "enabled",
          "peerIp": "0.0.0.0",
          "peerMAC": "00:00:00:00:00:00",
          "peerPrio": "0",
          "peerSt": "down",
          "peerStQual": "success",
          "peerSwitch": "disabled",
          "peerVersion": "23",
          "persistentOnReload": "true",
          "rolePrio": "3",
          "status": "",
          "summOperRole": "election-not-done",
          "sysMac": "00:03:02:02:01:01",
          "sysPrio": "11",
          "track": "0",
          "type2CompatQual": "1102512194",
          "type2CompatQualStr": "Consistency Check Not Performed",
          "type2CompatSt": "fail",
          "vIpAnnounceDelay": "45",
          "virtualIp": "0.0.0.0",
          "vpcCfgFailedBmp": "",
          "vpcCfgFailedTs": "00:00:00:00.000",
          "vpcCfgState": "0",
          "vpcMAC": "00:00:00:00:00:00",
          "vpcPrio": "32667"
}}}]}

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Suspend when the vPC Secondary Peerlink Goes Down 
POST http://<mgmt0_IP>/api/mo/sys.json
{
  "topSystem": {
    "children": [
      {
        "interfaceEntity": {
          "children": [
            {
              "l1PhysIf": {
                "attributes": {
                  "id": "eth1/8",
                  "medium": "p2p"
                }
              }
            }
          ]
        }
      },
      {
        "vpcEntity": {
          "children": [
            {
              "vpcInst": {
                "children": [
                  {
                    "vpcOrphanPort": {
                      "attributes": {
                        "id": "eth1/8"
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}
{
    imdata:[]
}
<System>
  <intf-items>
    <phys-items>
      <PhysIf-list>
        <id>eth1/8</id>
        <medium>p2p</medium>
      </PhysIf-list>
    </phys-items>
  </intf-items>
  <vpc-items>
    <inst-items>
      <orphan-items>
        <OrphanPort-list>
          <id>eth1/8</id>
        </OrphanPort-list>
      </orphan-items>
    </inst-items>
  </vpc-items>
</System>

Note: This example was added in Release 9.2(3).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

interface ethernet 1/8
 medium p2p
  vpc orphan-port suspend

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

For detailed information about classes and attributes in the payload, see the NX-API DME Model Reference:
https://developer.cisco.com/media/dme/index.html

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Deleting Suspend when the vPC Secondary Peerlink Goes Down 
POST http://<mgmt0_IP>/api/mo/sys.json
{
  "topSystem": {
    "children": [
      {
        "interfaceEntity": {
          "children": [
            {
              "l1PhysIf": {
                "attributes": {
                  "id": "eth1/8",
                  "medium": "p2p"
                }
              }
            }
          ]
        }
      },
      {
        "vpcEntity": {
          "children": [
            {
              "vpcInst": {
                "children": [
                  {
                    "vpcOrphanPort": {
                      "attributes": {
                        "id": "eth1/8",
                        "status": "deleted"
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}
{
    imdata:[]
}
<System>
  <intf-items>
    <phys-items>
      <PhysIf-list>
        <id>eth1/8</id>
        <medium>p2p</medium>
      </PhysIf-list>
    </phys-items>
  </intf-items>
  <vpc-items>
    <inst-items>
      <orphan-items>
        <OrphanPort-list xc:operation="delete">
          <id>eth1/8</id>
        </OrphanPort-list>
      </orphan-items>
    </inst-items>
  </vpc-items>
</System>

Note: This example was added in Release 9.2(3).


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

interface ethernet 1/8
 medium p2p
  no vpc orphan-port suspend

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

For detailed information about classes and attributes in the payload, see the NX-API DME Model Reference:
https://developer.cisco.com/media/dme/index.html

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html