Network automation in practice lab 3 of 11

Declarative changes - RESTCONF replace on IOS XE and NX-API deltas on NX-OS

Make two Cisco platforms hold exactly the NTP servers and VLANs in one data file: on IOS XE, see the difference between RESTCONF PATCH (merge) and PUT (replace) on a YANG list; on NX-OS, read structured JSON through NX-API, work out the delta, take a checkpoint, apply only the difference and inspect the rollback patch.

Run this lab

It needs Standard: its 3 nodes are set to 4 vCPU and 12,288 MB in total. It is ready about 15 minutes after you start it. It starts already set up, with nothing to paste before the first task.

In your workspace: Shared, then Network Automation in Practice - multi-vendor professional guided labs, then 03 - Declarative changes - RESTCONF replace on IOS XE and NX-API deltas on NX-OS

Run it on Standard from £5 a day

  • About 15 min to be ready
  • About 70 min of tasks

The free demo isn’t offered for this lab: it is Lite size, with 6 vCPU and 8 GB, and this lab’s nodes need 4 vCPU and 12,288 MB together. Every lab plan includes every guided lab.

Level
Advanced
How you work
CLI-led
Nodes need
4 vCPU, 12,288 MB
Smallest plan
Standard

The scenario

Fenwick Rail's data file says every router and switch uses NTP servers 10.20.0.10 and 10.20.0.11, and the York data-centre switch carries VLANs 10, 20 and 30 with set names. The devices disagree: an old NTP server is still configured everywhere, VLAN 10 has its old name, and a project VLAN that ended last year is still there.

"Declarative" means the device ends up holding what the data says: anything extra goes. You'll do it two ways on two Cisco platforms: with RESTCONF's replace operation on the IOS XE router xe1, and by working out the delta yourself through NX-API on the Nexus switch nx1.

Start-up and waits. Click Start all. nx1's NX-API answers about 7 minutes after Start all, and xe1's RESTCONF about 8. Each boots with its management address, the netops login, its APIs on, and the old settings above. Read the files and write TODO 2 while they boot. Measured on our servers: the whole lab was ready for its first task about 15 minutes after Start all, with every device booted.

What you’ll practise

  • Read and write a YANG list through RESTCONF, and explain PATCH against PUT
  • Remove configuration that isn't in the data, declaratively
  • Use NX-API JSON-RPC for structured show output and configuration
  • Compute and send only the delta when an API has no replace operation
  • Take an NX-OS checkpoint and read the rollback patch for a change

The tasks

  1. Merge is not replace
  2. Replace the list
  3. NX-API: structured data in, commands out
  4. Work out the delta
  5. Checkpoint, apply, inspect

The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.

Topology and devices

The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.

Topology of Declarative changes - RESTCONF replace on IOS XE and NX-API deltas on NX-OS3 nodes and 1 network, 3 links. Every link is listed as text below the diagram.devboxxe1nx1Mgmteth0e0Gi1
3 nodes and 1 network, with the interface names each link uses. On a narrow screen, scroll the diagram sideways.
Nodes in Declarative changes - RESTCONF replace on IOS XE and NX-API deltas on NX-OS, with the image each runs and the vCPU and RAM it’s set to
NodeDeviceImage in Add NodeSet to
devboxCloudLabBox code workstation (Docker)CloudLabBox’s own workstation image, with a browser code editor1 vCPU, 2,048 MB
xe1Cisco CSR 1000vcsr1000vng-universalk9.17.03.08a-serial1 vCPU, 4,096 MB
nx1Cisco Nexus 9000vnxosv9k-9300v-9.3.102 vCPU, 6,144 MB

How to open this lab

  1. Sign in to your workspace at lab.cloudlabbox.com.

  2. In File Manager, open Shared, then the folder Network Automation in Practice - multi-vendor professional guided labs.

  3. Open 03 - Declarative changes - RESTCONF replace on IOS XE and NX-API deltas on NX-OS and start its nodes, then open Lab Tasks for the scenario and the steps.

The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.

More Network automation in practice labs

All Network automation in practice labs

Related labs in other courses

CloudLabBox is independent of Arista Networks, Cisco, Fortinet, Juniper Networks and Palo Alto Networks. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.