Professional Documents
Culture Documents
Tecnms 4175 PDF
Tecnms 4175 PDF
TECNMS-4175
Cisco Webex Teams
Questions?
Use Cisco Webex Teams to chat
with the speaker after the session
How
1 Find this session in the Cisco Events Mobile App
2 Click “Join the Discussion”
3 Install Webex Teams or go directly to the team space
4 Enter messages/questions in the team space
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 3
The bridge between Network
Automation and Business
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 4
Agenda
• Introduction
• Network Automation challenges
• NSO Architecture
• Device Management + Lab
• YANG
• Service Manager
• Package Manager
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 5
Sunpreetsingh Arora Hector Oses
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
Network Automation
Challenges
Business Challenges
*
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 8
The automation drive
+ +
DIGITAL
EFFICIENCY AGILITY TRANSFORMATION
IT COST REDUCTION ABILITY TO MEET SLAS TIME TO PROVISION STRATEGIC ALLOCATION REVENUE GROWTH
IT SERVICES OF IT BUDGET
77% 72% 87% 200% 11%
Source: Source: IDC InfoBrief, sponsored by Cisco, Cloud Going Mainstream. All Are Trying, Some Are Benefiting; Few Are Maximizing Value. September 2016
10
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
Tie Islands of Automation Together
End-to-End Automation Delivers Business Value
Multiple Operating Systems and platforms (>10) Scripts (>10,000) Orchestration software, cross-
team collaboration
Different Types of Automation Tools (>50) Manual Activity (>1,000)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 11
Network Management Challenges
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 12
Simplifying complexity and improving quality
Full Service Automation
Lifecycle Management
Model Driven
Rich Set of
Northbound API’s
Speed Flexibility
Network-wide
Unified (CLI)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 13
Orchestration Architecture
Network devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 14
Quick History
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 15
Addressing Network Management Challenges
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 16
KP
Solutions ecosystem
NGENA
SERENO SP-NAC MVSO
NFVO
ULTRA
NSO WAE
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
NSO Architecture
NSO Network Abstraction
Device
Models Network Services
Device Management Layer Global Device View
Orchestrator
Network Element Driver (NED) NED NED NED Southbound APIs
Multivendor
Physical and/or
Virtual Device
Environment
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 19
NSO Architectural Components
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 20
NSO components
Cisco NSO Core Engine
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 22
CDB
/ (root)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 23
Device Manager
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 24
NSO CLI
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 25
Device
Configuration
Management
Synchronizing from Device
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 27
Synchronizing to Device
Change device
configuration over CLI.
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 28
Check Sync
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 29
Comparing Configuration
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 30
Displaying Configuration
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 31
Displaying Configuration (Cont.)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 32
Configuring Devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 33
Displaying Configuration
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 34
Rollbacks
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
Rollbacks – Examples
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 36
Configured Devices
--------------------------------------------------------
NAME ADDRESS DESCRIPTION NED ID ADMIN STATE
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 37
Device Connection
Management
Device States
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 39
Oper State
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 40
Admin State
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 41
Adding a Device
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 42
Lab Exercise 1
Netsim
YANG ConfD
NSO normally
Uses YANG model and ConfD in reverse
Device
• Model Java for managing a device as
to simulate a device’s CLI SSH if it were real
CLI
CLI over SSH Config
Java for
• ! Netsim is not a replacement for real SSH srv. Netsim
Netsim simulating
devices !
ConfD
device’s
CLI
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 44
Starting Simulated Devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 45
Netsim Options
• Netsim supports creating, adding and deleting simulated devices on the fly
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 46
KP
Access Simulated Devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 47
Introduction to YANG
YANG
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 49
YANG Characteristics
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 50
Modeling a Football team in Yang
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 51
YANG Model Hierarchy and Modularity
acme.yang sirius.yang
module acme { module sirius {
namespace A; namespace B; ▪ Imported fragments are just
import sirius; ... referenced, not included
▪ Used to group reusable definitions
include aurora; } that can be reused by many other
include orion; modules
▪ Similar to libraries in programing
... languages
}
include include
▪ Useful to split large modules into smaller
orion.yang
more manageable files
submodule orion {
aurora.yang ▪ Submodule can never be included in any
submodule aurora { other module
... ▪ Module and submodules share the same
...
namespace
}
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 52
Yang Data Types
YANG Data Types
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 54
YANG Supports a Number of Data Types
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 55
Derived Type Restrictions
typedef acl-num-type {
• Range: type int32 {
range "1..199 | 1300..2699";
• Applies to integer and decimal types }
}
• "x .. y" typedef std-acl-num-type {
• "min .. x” , ”x .. max”. type acl-num-type {
range "min..99 | 1300..1999";
}
• Length: }
typedef ext-acl-num-type {
• For string type type acl-num-type {
range "100..199 | 2000..max";
• Same syntax }
}
• Pattern: typedef acl-name-type {
type string {
• For string type length "1..50";
pattern "[a-zA-Z][a-zA-Z0-9-_]*";
• Uses regular expressions }
}
• Fraction-digits: typedef std-acl-name-type { type acl-name-type; }
typedef ext-acl-name-type { type acl-name-type; }
• Applies to decimal type typedef const-type {
type decimal64 {
fraction-digits 4;
range "2.7182 .. 3.1415";
}
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 56
Combined Derived Types
typedef intf-ip-addr-type {
• Enumeration: type union {
type inet:ip-address;
• Defines a set of names type enumeration {
enum "none";
enum "unnumbered";
• Union: enum "dhcp";
}
• Used to define a type with a combination of two or more }
other types }
typedef acl-id-type {
type union {
type acl-num-type;
type acl-name-type;
}
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 57
YANG Types Example
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 58
YANG Data
Definitions
Basic YANG Statements Defining Data Nodes
Leaf-List Array Contains a list of values of the same type List 11 25 Leaf
11 22
Container Record Contains a single structure containing zero
or more values or other statements 11 Leaf- List 22 Leaf- List
(hierarchy) Key leaf
(list index)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 60
Modeling Cisco IOS commands in Yang
container
interface
list list
id ip id ip
interface FastEthernet 1/2 key key
ipaddress ipaddress
leaf leaf
mask mask
leaf leaf
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 61
Modeling Cisco IOS commands in Yang (Cont)
container interface {
list Loopback { container
key id;
leaf id {
type uint16 { interface
range "1..65535";
} list
} list
container ip {
container address { Loopback FastEthernet
leaf ipaddress {
type string;
}
leaf mask { container container
type string;
} id ip id ip
}
} key key
}
list FastEthernet {
key id; address address
leaf id {
type string; container container
}
container ip {
container address {
leaf ipaddress { ipaddress ipaddress
type string;
}
leaf mask { leaf leaf
type string;
}
} mask mask
}
} leaf leaf
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 62
Leaf
YANG (data model) XML (data) YANG (data model) XML (data)
leaf id { <interface> leaf mask{ <interface>
type uint16 { type string;
range "1..65535"; <Loopback> } <Loopback>
} <id>1</id> <id>1</id>
}
</Loopback> <ip>
</interface> <address>
<ipaddress></ipaddress>
<mask>255.255.255.255</mask>
</address>
</ip>
</Loopback>
</interface>
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 63
Leaf Attributes
Attribute Description
config Whether this leaf is a configurable value ("true") or operational
value ("false"). Inherited from parent container if not specified
default Specifies default value for this leaf. Implies that leaf is optional
mandatory Whether the leaf is mandatory ("true") or optional ("false")
must XPath constraint that will be enforced for this leaf
type The data type (and range etc) of this leaf
when Conditional leaf, only present if XPath expression is true
description Human readable definition and help text for this leaf
reference Human readable reference to some other element or spec
units Human readable unit specification (e.g. Hz, MB/s, ℉)
status Whether this leaf is "current", "deprecated" or "obsolete"
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 64
Container
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 65
List
2 10.0.0.2 255.255.255.255 }
}
}
XML (data)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 66
List: Single Key
L user
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 67
List: Combined Key
L route
203.0.113.0 24 172.31.11.1 50
XPath:
/ route [prefix='198.51.100.0'][length='24'] / next-hop = 192.168.31.5
/ route [prefix='198.51.100.0'][length='24'] / metric = 40
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 68
Leaf-list
L vlan
XPath:
10 vlan
30
240
330
YANG (data model) XML (data)
leaf-list vlan { <vlan>10</vlan>
type uint16 { <vlan>20</vlan>
range "0..2147483647"; <vlan>240</vlan>
} <vlan>330</vlank>
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 69
List and Leaf-List Attributes
Attribute Description
max-elements Max number of elements in a list
min-elements Min number of elements in a list
ordered-by List entries are sorted by "system" or "user". System
means elements are sorted in a natural order
(numerically, alphabetically, etc). User means the order
the operator entered them in is preserved.
leaf-list domain-search {
type string; system order user order
ordered-by user; cisco.com example.com
min-elements 1;
example.com
≠ cisco.com
max-elements 2;
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 70
Grouping
G Grouping
YANG (data model)
grouping app { address port
leaf address {
type inet:ip-address;
}
leaf port {
type inet:port-number;
}
} C http-server
container http-server {
uses app { port (default: 80)
refine port { address
default 80;
}
} C smtp-server
}
container smtp-server { address port (default: 25)
uses app {
refine port {
default 25;
}
}
} 10.1.1.1 80 XPath:
10.1.2.1 25 / http-server
/ http-server / address
/ http-server / port
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 71
Leafref
L services C app
the key(s) if referring to a leaf-list or leafs within a list (all key leafs must be referenced)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 72
YANG Module Structure
acme.yang
module acme {
namespace "http://acme.example.com/module";
prefix acme; Header Information
organization "ACME Inc.";
description "Module describing the ACME products";
revision 2007-06-09 { description "Initial revision."; } Revision Information
import ietf-yang-types { prefix yang; }
include acme-system; Imports & Includes
typedef percentage-type {
type uint8 { range "1..100"; } Type Definitions
}
grouping ifdata {
leaf ipv4-address {
type inet:ipv4-address;
}
leaf ipv4-mask { Reusable Node
type inet:ipv4-address; Declarations
}
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 73
YANG Module Structure(Cont.)
list loopback-interface {
key "Loopback";
leaf Loopback {
type string; Configuration & Operational
} Data Declarations
uses ifdata;
}
notification link-failure {
description "A link failure has been detected";
leaf if-name { type string; }
leaf if-admin-status { type uint8; }
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 74
NSO and YANG
container devices {
tailf:info "The managed devices and device communication
settings"; uses connect-grouping {
augment "connect/input" {
leaf-list device {
tailf:info "Only connect to these
devices."; type leafref { path
'/devices/device/name'; }
}
}
}
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 75
Devices and Device YANG Models
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 76
The bridge between Network
Automation and Business
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 77
KP
Service Manager
Service Manager
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 79
NSO Service through CLI (Cisco Style)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 80
Comparing Configurations: Service or Device
CDB
Get Modifications Device 1 S1 S1
configuration
S1 Device 1
Service instance
configuration S2
Device 2
S2 S2
configuration Compare
Device 2
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 81
Templates
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 82
Mapping Logic
Service
Parameters
• Transforms the service models to device models
• When templates are not enough: Java or Python
• External call-outs can be made code (optional)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 83
Mapping Logic (Cont.)
firewall filter ip
to destination
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 84
FastMap
FASTMAP
create operation)
Mapping Logic
Device Device
Models Manager FASTMAP CDB
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 86
Example: Create a New Service Instance
admin@nso# config
Entering configuration mode terminal
admin@ncs(config)# services l2vpn ACME
admin@ncs(config-l2vpn-ACME)# pw-id 102
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 87
Example: Create a New Service
admin@ncs(config)# commit dry-run
device PE11
config {
ios:interface {
GigabitEthernet 0/5 {
+
xconnect {
address 10.1.1.15; • NED device model governs device
+ vcid 102;
+
}
encapsulation mpls; configuration parameters
}
} }
device PE12
• XML, Java or Python map service
config {
ios:interface { parameters to device configurations
GigabitEthernet 0/9 {
xconnect {
+ address 10.1.1.11;
+ vcid 102; Service parameters
+ encapsulation mpls;
} mapped to device
}
} configuration
admin@ncs(config)# commit dry-run outformat native
device PE11
interface GigabitEthernet0/5
xconnect 10.1.1.12 102 encapsulation mpls
• CLI NED's YANG model also
exit
exit
contains additional information that
device PE12
interface GigabitEthernet0/9
governs mapping of YANG
xconnect 10.1.1.11 102 encapsulation mpls
exit
statements to CLI commands
exit
Can display native
admin@ncs(config)# commands in case
of CLI NED
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 88
FASTMAP: Service Create
CDB / Device
/services /devices
: service mapping & diff & remember reverse Configuration sent to devices
diff
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 89
Modify and Existing Service: Example 1
admin@nso# config
Entering configuration mode terminal
admin@ncs(config)# services l2vpn ACME
admin@ncs(config-l2vpn-ACME)# pw-id 122
admin@ncs(config-link-PE12)# top
admin@ncs(config)# commit dry-run
device PE11
config {
ios:interface {
GigabitEthernet 0/5 {
xconnect {
}
}
• CDB shows only minimal diff changes
device PE12
config {
ios:interface {
admin@nso# config
GigabitEthernet 0/9 {
• Changed parameter affects both
Entering configuration
-
xconnectmode
admin@ncs(config)#vcid
{ terminal
102; l2vpn ACME
services devices
+ vcid 122;
admin@ncs(config-l2vpn-ACME)# pw-id 122
}
admin@ncs(config-link-PE12)# top
admin@ncs(config)# commit dry-run outformat native
device PE11
interface GigabitEthernet0/5
xconnect 10.1.1.12 122 encapsulation mpls
exit
exit
device PE12
interface GigabitEthernet0/9
xconnect 10.1.1.11 122 encapsulation mpls
exit
exit
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 90
Modify and Existing Service: Example 2
admin@nso# config
Entering configuration mode terminal
admin@ncs(config)# services l2vpn ACME
admin@ncs(config-l2vpn-ACME)# link Site1
admin@ncs(config-l2vpn-ACME)# remote 10.1.1.12
admin@ncs(config-link-PE12)# top
admin@ncs(config)# commit dry-run
device PE11 • Only one parameter changed
config {
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 91
Delete a Service Instance
admin@nso# config
Entering configuration mode terminal
admin@ncs(config)# no services l2vpn ACME
admin@ncs(config)# commit dry-run
device PE11
config {
ios:interface {
GigabitEthernet 0/6 {
xconnect {
- address 10.1.1.12;
-
-
vcid 122;
encapsulation mpls; • Only one parameter changed
}
}
}
}
• CDB shows only minimal diff changes
device PE12
config {
ios:interface {
GigabitEthernet 0/9 {
admin@nso# config xconnect {
• Reverse diff used to undo the
-
Entering configuration
-
admin@ncs(config)#
address
mode 10.1.1.11;
vcid 122;
services
terminal
l2vpn mpls;
ACME
configuration changes of the service
-
}
}
encapsulation
admin@ncs(config-l2vpn-ACME)#
admin@ncs(config-l2vpn-ACME)#
link Site1
intf 0/6
instance
}
admin@ncs(config-link-PE12)# top
admin@ncs(config)# commit dry-run outformat native
device PE11
interface GigabitEthernet0/6
no xconnect 10.1.1.12 122 encapsulation mpls
exit
device PE12
interface GigabitEthernet0/9
no xconnect 10.1.1.11 122 encapsulation mpls
exit
exit
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 92
Handling Services Sharing Resources
• Multiple service instances configuring the same shared prerequisite
configuration
CDB NSO maps service
Service Instances Device Changes parameter to device
configuration
L2 VPN a1 xconnect a1
Refcount=1 NSO counts owners of each
Backpointer=l2vpn[name='A1'] configuration element
Operator loopback 1
creates service Refcount=1 NSO remembers owners of
Backpointer=l2vpn[name='A1'] each configuration element
instance
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 93
Handling Services Sharing Resources
• Second L2VPN service uses the same Loopback interface
CDB
Service Instances Device Changes
L2 VPN a1 xconnect a1
Refcount=1
Backpointer=l2vpn[name='A1']
Backpointer=l2vpn[name='a1']
L2 VPN a2
xconnect a2
Refcount=1
Backpointer=l2vpn[name='a2']
NSO increases the count of
owners of shared
Operator loopback 1 configuration elements
creates another
Refcount=2
service instance Backpointer=l2vpn[name='a1'],
NSO updates the list of
l2vpn[name='a2'] owners of shared
configuration elements
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 94
Handling Services Sharing Resources
• Deleting first L2VPN does not delete Loopback interface configuration
CDB
Service Instances Device Changes NSO only deletes those
elements whose reference
L2 VPN a1 xconnect a1
count is 1
Refcount=1
Backpointer=l2vpn[name='A1']
Backpointer=l2vpn[name='a1']
L2 VPN a2
xconnect a2
Refcount=1
Backpointer=l2vpn[name='a2']
NSO decrements reference
count on those elements that
Operator were not deleted
deletes one loopback 1
service instance Refcount=1 NSO updates the list of
Backpointer=l2vpn[name='a2']
owners of shared
configuration elements
Cisco Network Services Orchestrator 36
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 95
Handling Services Sharing Resources
• Deleting last L2VPN does delete Loopback interface configuration
CDB
Service Instances Device Changes NSO only deletes those
elements whose reference
count is 1
L2 VPN a2
xconnect a2
Refcount=1
Backpointer=l2vpn[name='a2'] NSO deletes shared element
Operator as well
deletes last loopback 1
service instance Refcount=1
Backpointer=l2vpn[name='a2']
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 96
Reactive FASTMAP
Example: Virtual Network Function (VNF)
1. Service Request arrives Service Order Request
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 97
Northbound API
and Integration
options
Northbound APIs
• Human interaction:
• NSO CLI
Network
• WebUI OSS/BSS
Engineer
EMS/NMS
• Automation integration:
• NETCONF NSO NETCONF REST CLI WebUI SNMP
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 99
Human Interaction
Cisco NSO CLI Overview
admin@ncs# ?
Possible completions:
alarms - Alarm management
autowizard - Automatically query for mandatory elements
cd - Change working directory
clear - Clear parameter
cluster - Cluster configuration
compare - Compare running configuration to another configuration or a file
complete-on-space - Enable/disable completion on space
compliance - Compliance reporting
config - Manipulate software configuration information
describe - Display transparent command information
devices - The managed devices and device communication settings
display-level - Configure show command display level
...
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 100
Human Interaction
Cisco NSO CLI for Configuration
Cisco Style Juniper Style
admin@nso# admin@nso> configure
admin@nso# config Entering configuration mode
admin@nso(config)# private [ok][2016-01-27 11:14:12]
admin@nso(config)# devices device PE11
... [edit]
admin@nso(config-device-PE11)# top admin@nso% set devices device PE11
admin@nso(config)# exit | commit | abort ... admin@nso% exit | commit | revert
admin@nso# [ok][2016-01-27 11:15:44]
admin@nso# show running-config admin@nso> show configuration
cluster authgroup default cluster {
default-map same-user authgroup default {
default-map same-pass default-map {
umap admin same-user;
same-user same-pass;
... }
...
switch cli
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 101
Human Interaction
Graphical User Interface
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 102
NSO Automation Integration
Cisco NSO NETCONF API
• Use cases:
• Integration with other OSS/NMS systems Any NETCONF client
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 103
NSO Automation Integration
Cisco NSO Web Integration
• Use cases:
Integration with
• Integrate with existing EMS / NMS systems existing WebUI
• Integrate with existing web-based management portals EMS / NMS / Web Portal
Web Server
• APIs: JavaScript
REST API
(JSON/RPC)
• JSON RPC for more complex integration requiring maintenance of Data
session state JSON XML Format
MAAPI
• REST/RESTCONF for simple single transactions
CDB
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 104
NSO Automation Integration
Cisco NSO REST API Example
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 107
Package Structure
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 108
Package Management
• Develop package:
• Use a text editor or an appropriate IDE to develop the package by modifying and creating the necessary files
(YANG, Java, Python, XML templates)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 109
Create a Package Skeleton
• Options:
• Specify a destination directory
• Etc.
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 110
Compile Packages
root@nso:/var/opt/ncs/packages$ cd cisco-ios/src
root@nso:/var/opt/ncs/packages/cisco-ios/src$ make
cd java && ant -q all
BUILD SUCCESSFUL
Total time: 0 seconds
cd ../netsim && make all
make[1]: Entering directory
`/var/opt/ncs/packages/cisco-ios/netsim' make[1]:
Nothing to be done for `all'.
make[1]: Leaving directory `/var/opt/ncs/packages/cisco-ios/netsim‘
root@nso:/var/opt/ncs/packages/cisco-ios/src$
• Compile packages to ensure they are compiled by the correct version of the
compiler
• You may also do make clean and then make to perform a complete recompile of the
package
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 111
Reload Packages
admin@ncs#
• Depending on the number of packages it may take some time for the
package upgrade process to complete
• It may take even longer in case a package upgrade is performed in a live
system with multiple service packages with many service instances
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 112
Verifying Packages
admin@ncs#
• Check if all the required packages are loaded using the show packages
command
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 113
Network Element Drivers
NETCONF REST CLI SNMP
• Used to communicate southbound NSO
Service Templates
Service
Models Manager
• Model driven: Mapping Logic
Device Device
FASTMAP
• YANG device models Models Manager CDB
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 114
Service Package
Creating a Service Package
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 116
Step 1: Create a Package Skeleton
cisco@nso:~/nso-run$ cd packages/
cisco@nso:~/nso-run/packages$ ncs-make-package –-help
Usage: ncs-make-package [options] package-name
ADDITIONAL OPTIONS
--dest DIR
--build
--verbose
-h | --help
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 117
Step 2: Check the YANG File
cisco@nso:~/nso-run/packages$ ncs-make-package --service-skeleton template
loopbackbasic
cisco@nso:~/nso-run/packages$ cd loopbackbasic/
cisco@nso:~/nso-run/packages/loopbackbasic$ ls -al
total 24
drwxrwxr-x 5 cisco cisco 4096 Nov 15 06:48 .
drwxrwxr-x 3 cisco cisco 4096 Nov 15 06:48 ..
-rw-rw-r-- 1 cisco cisco 380 Nov 15 06:48 package-meta-data.xml
drwxr-xr-x 3 cisco cisco 4096 Nov 15 06:48 src
Create a package
drwxr-xr-x 2 cisco cisco 4096 Nov 15 06:48 templates
drwxr-xr-x 3 cisco cisco 4096 Oct 25 08:09 test
cisco@nso:~/nso-run/packages/loopbackbasic$ cd src/
cisco@nso:~/nso-run/packages/loopbackbasic/src$ ls -al
total 16
drwxr-xr-x 3 cisco cisco 4096 Nov 15 06:48 .
drwxrwxr-x 5 cisco cisco 4096 Nov 15 06:48 ..
-rw-rw-r-- 1 cisco cisco 722 Nov 15 06:48 Makefile
drwxr-xr-x 2 cisco cisco 4096 Nov 15 06:48 yang
cisco@nso:~/nso-run/packages/loopbackbasic/src$ cd yang/
cisco@nso:~/nso-run/packages/loopbackbasic/src/yang$ ls -al
total total 12
drwxr-xr-x 2 cisco cisco 4096 Nov 15 06:48 .
drwxr-xr-x 3 cisco cisco 4096 Nov 15 06:48 ..
Edit service model
-rw-rw-r-- 1 cisco cisco 597 Nov 15 06:48 loopbackbasic.yang
cisco@nso:~/nso-run/packages/loopback/src/yang$ vi loopbackbasic.yang
• Preferably use an IDE for YANG which has syntax highlighting and YANG validation
capability (e.g. Eclipse, Visual Studio Code)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 118
Step 3: Check the Template XML File
cisco@nso:~/nso-run/packages/loopbackbasic/src/yang$ cd ..
cisco@nso:~/nso-run/packages/loopbackbasic/src$ cd ..
cisco@nso:~/nso-run/packages/loopbackbasic$ cd templates/
cisco@nso:~/nso-run/packages/loopbackbasic/templates$ ls -al
total 12
drwxr-xr-x 2 cisco cisco 4096 Nov 15 06:48 .
drwxrwxr-x 5 cisco cisco 4096 Nov 15 06:48 ..
-rw-rw-r-- 1 cisco cisco 739 Nov 15 06:48 loopbackbasic-template.xml
cisco@nso:~/nso-run/packages/loopbackbasic/templates$ vi loopbackbasic-template.xml
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 119
Things to Learn?
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 120
Simple Example – Loopback Service
• Note: This example is used throughout the remainder of this lesson to illustrate how to create a simple template-
based service model.
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 121
Informal Service Model Defining Service
Parameters
Loopback
IP Address
Device Subnet Mask
IP Address
Subnet Mask
IP Address
Subnet Mask
/device
/device/loopback-number
/device/loopback-number/ip-address
/device/loopback-number/mask
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 122
Creating a Service Package
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 123
Example: Configure a Loopback Interface
admin@ncs(config)# devices device ios0 config ios:interface Loopback 0 ip address 1.1.1.1 255.255.255.255
admin@ncs(config)# top
admin@ncs(config)# devices device iosxr0 config cisco-ios-xr:interface Loopback 0 ipv4 address 2.2.2.2 255.255.255.255
admin@ncs(config)# top
admin@ncs(config)# devices device junos0 config junos:configuration interfaces interface lo0 unit 0 family inet address 3.3.3.3/32
• Notice that the NEDs for Cisco IOS, Cisco IOS XR, and Juniper Junos expose slightly
different syntax due to different device CLIs
• Central point of management prepends another layer to the configuration hierarchy:
devices
• Repeat the service configuration step for each type of device in your environment
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 124
Example: Check Candidate Configuration
admin@ncs% commit dry-run
cli {
local-node {
data devices {
device ios0 {
config {
ios:interface {
Loopback 0 {
ip {
address {
• Display candidate configuration +
+
primary {
address 1.1.1.1;
mask 255.255.255.255;
changes }
}
}
}
}
• “+” indicates configuration items that }
}
device iosxr0 {
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 125
Example: Check Native Configuration
• Any one of the verification stages failing will result in all changes being
reverted on all devices that were part of the same transaction
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 126
Example: Check Native Configuration Cont.
admin@ncs% commit dry-run outformat native
native { device {
device { name junos0
name ios0 data <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
data interface Loopback0 message-id="1">
ip address 1.1.1.1 255.255.255.255 <edit-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
exit <target>
} <candidate/>
device { </target>
name iosxr0 <test-option>test-then-set</test-option>
data interface Loopback 0 <error-option>rollback-on-error</error-option>
ipv4 address 2.2.2.2 <config>
255.255.255.255 <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm">
exit <interfaces>
} <interface>
<name>lo0</name>
<unit>
<name>0</name>
<family>
<inet>
<address>
<name>3.3.3.3/32</name>
</address>
</inet>
</family>
</unit>
</interface>
</interfaces>
</configuration>
</config>
</edit-config>
</rpc>
}
}
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 127
Example: Check XML Configuration
• Display changes in XML format as a starting point for the service template
admin@ncs% commit dry-run outformat xml <device>
result-xml { <name>junos0</name>
local-node { <config>
data <devices xmlns="http://tail-f.com/ns/ncs"> <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm">
<device> <interfaces>
<name>ios0</name> <interface>
<config> <name>lo0</name>
<interface xmlns="urn:ios"> <unit>
<Loopback> <name>0</name>
<family>
<name>0</name>
<ip> Device Types → <inet>
<address>
<address>
<primary> Different NEDs → Different <name>3.3.3.3/32</name>
</address>
<address>1.1.1.1</address>
<mask>255.255.255.255</mask> XML namespaces </inet>
</family>
</primary> </unit>
</address> </interface>
</ip> </interfaces>
</Loopback> </configuration>
</interface> </config>
</config> </device>
</device> </devices>
<device> }
<name>iosxr0</name> }
<config>
<interface xmlns="http://tail-f.com/ned/cisco-ios-xr">
<Loopback>
<id>0</id>
<ipv4>
<address>
<ip>2.2.2.2</ip>
<mask>255.255.255.255</mask>
</address>
</ipv4>
</Loopback>
</interface>
</config>
</device>
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 128
Creating a Service Package
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 129
Creating the Service Template
cisco@nso:~/ncs-run$ cd packages/
cisco@nso:~/ncs-run/packages$ cd loopbackbasic
cisco@nso:~/ncs-run/packages/loopbackbasic$ cd templates 1. Edit the skeleton XML service
cisco@nso:~/ncs-run/packages/loopbackbasic/templates$ ls -l
total 4 template file
-rw-rw-r-- 1 cisco cisco 739 Nov 15 06:48 loopbackbasic-
template.xml
cisco@nso:~/ncs-run/packages/loopbackbasic/templates$ more loopbackbasic-
template.xml
2. Define variables in curly
<config-template xmlns="http://tail-f.com/ns/config/1.0"
servicepoint="loopbackbasic"> brackets: {variable}
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<!--
Select the devices from some data structure in the service
model. In this skeleton the devices are specified in a leaf-list.
3. Variables are mapped to the
-->
Select all devices in that leaf-list:
service model:
<name>{/device}</name>
<config>
<!--
Add device-specific parameters here. 4. Use the path based on the
In this skeleton the service has a leaf "dummy"; use that
to set something on the device e.g.:
<ip-address-on-device>{/dummy}</ip-address-on-device>
informal service model
-->
</config>
</device>
hierarchy
</devices>
</config-template>
cisco@nso:~/ncs-run/packages/loopback/templates$ vi loopbackbasic-template.xml
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 130
Example: Convert XML Configuration to Template
• IOS:
admin@ncs% commit dry-run outformat xml <config-template xmlns="http://tail-f.com/ns/config/1.0"
result-xml { servicepoint="loopbackbasic">
local-node { <devices xmlns="http://tail-f.com/ns/ncs">
data <devices xmlns="http://tail-f.com/ns/ncs"> <device>
<device> <name>{/device}</name>
<name>ios0</name> <config>
<config>
<interface xmlns="urn:ios"> Variable <interface xmlns="urn:ios">
<Loopback> <Loopback>
<name>0</name> <name>{/loopback-number}</name>
<ip> <ip>
<address> Variable <address>
<primary> <primary>
<address>1.1.1.1</address> <address>{/ip-address}</address>
<mask>255.255.255.255</mask> <mask>255.255.255.255</mask>
</primary> Fixed </primary>
</address> </address>
</ip> </ip>
</Loopback> </Loopback>
</interface> </interface>
</config>
</device>
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 131
Example: Convert XML Configuration to Template
• IOS XR:
<device>
<name>iosxr0</name>
<config>
<interface xmlns="http://tail-f.com/ned/cisco-ios-xr"> <interface xmlns="http://tail-f.com/ned/cisco-ios-xr">
<Loopback> Variable <Loopback>
<id>0</id> <id>{/loopback-number}</id>
<ipv4> <ipv4>
<address> Variable <address>
<ip>2.2.2.2</ip> <ip>{/ip-address}</ip>
<mask>255.255.255.255</mask> <mask>255.255.255.255</mask>
</address> Fixed </address>
</ipv4> </ipv4>
</Loopback> </Loopback>
</interface> </interface>
</config>
</device>
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 132
Example: Convert XML Configuration to Template
• JUNOS:
<device>
<name>junos0</name>
<config>
<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"> <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm">
<interfaces> <interfaces>
<interface> <interface>
<name>lo0</name> <name>lo{/loopback-number}</name>
<unit> Variable <unit tags="replace">
<name>0</name> <name>0</name>
<family> <family>
<inet> <inet>
<address> Variable <address>
<name>3.3.3.3/32</name> <name>{/ip-address}/32</name>
</address> </address>
</inet> Fixed </inet>
</family> </family>
</unit> </unit>
</interface> </interface>
</interfaces> </interfaces>
</configuration> </configuration>
</config>
</device> </config>
</devices> </device>
</devices>
</config-template>
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 133
Template Options (Cont.)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 134
Creating a Service Package
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 135
Step 1: Creating the Service Model:
Start with Skeleton Model
namespace "http://com/example/loopbackbasic";
prefix loopbackbasic; 1. Change directory to ../src/yang
import ietf-inet-types { prefix inet; }
import tailf-ncs { prefix ncs; }
augment /ncs:services {
list loopbackbasic
2. Edit the skeleton service model
{ key name;
uses ncs:service-data;
ncs:servicepoint
3. The module augments the Cisco NSO
services module
"loopbackbasic";
leaf name {
type string;
}
// may replace this with other ways of refering to the devices.
leaf-list device {
4. Devices are already references
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
5. Replace the dummy leaf with your
// replace with your own stuff here
leaf dummy {
type inet:ipv4-address;
service model
} Replace this section with
}
}
} your service model.
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 136
Step 2: Creating the Service Model:
Informal Service Model
ios0
iosxr0
junos0
C services
L loopbackbasic
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 137
Step 2: Creating the Service Model:
Top Level List
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 138
Step 3: Creating the Service Model:
Service Instance ID
uses ncs:service-data;
ncs:servicepoint
"loopbackbasic";
• One implicit requirement: name is
mandatory as it is the key
leaf name {
tailf:info "Service Instance Name";
type string;
}
...
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 139
Step 3: Creating the Service Model:
Implement Service Model
L loopbackbasic
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 140
Step 3: Creating the Service Model:
Implement Service Model (Cont.)
L loopbackbasic
...
list loopbackbasic {
...
leaf loopback-number {
tailf:info "Loopback Interface Number";
mandatory true;
type uint32;
}
...
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 141
Step 3: Creating the Service Model:
Implement Service Model (Cont.)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 142
Regular Expressions – Quick Overview
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 143
Regular Expressions - Example
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 144
Step 4: Creating the Service Model:
Final Service Model
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 145
Creating a Service Package
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 146
Compile and Deploy the Service Model
cisco@nso:~/ncs-run/packages/loopbackbasic/src/yang$ cd ..
cisco@nso:~/ncs-run/packages/loopbackbasic/src$ make
mkdir -p ../load-dir
/Users/rereich/NCS_Builds/./nso-4.5.2/bin/ncsc `ls loopbackbasic-ann.yang > /dev/null 2>&1 && echo "-a loopbackbasic-ann.yang"` \
-c -o ../load-dir/loopbackbasic.fxs yang/loopbackbasic.yang
cisco@nso:~/ncs-run/packages/loopbackbasic/src$
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 147
Parameter Restrictions Enforced Already in GUI
and CLI
YANG data types and
constraints are validated
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 148
KP
LAB Exercise 2
Q&A
Summary
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 151
TUE WED THU
BRKOPS-2700
Opening Keynote NSO Access Control
09:00
08:30
BRKOPS-3339
NSO Reconciliation
BRKOPS-2695 11:00 BRKOPS-2418 11:00
NSO Use Cases & Migration to BRKOPS-2383 11:15
Features Segment Routing NSO LSA
100K+ devices
BRKNMS-2733 12:15
NSO&Ansible with BRKOPS-1456
Business Process Orch 14:45
Camunda Workflow
Automation Platform
Guest Keynote
17:00
Automation &
18:30
OPS
Orchestration with Operations Track
Cisco NSO
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 152
Continue Your Education
• Related sessions
• The 3 Stages of Network Automation and Orchestration - PSOSPG-2941
• Automated NSO Delivery with CI/CD - LTRNMS-2984
• DevNet
• Quick Wins of using NSO - DEVLIT-4019
• Get Started Automating Your Network with Cisco NSO - DEVNET-4805
• Lab
• Introduction to Cisco Network Service Orchestrator (NSO) - LABNMS-2011
• Real-time Services Automation with NSO and Model-Driven Telemetry - LABOPS-2320
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 153
Call to Action – We want you to…
© 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public
The bridge between Network
Automation and Business
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 155
Complete your
online session
survey • Please complete your session survey
after each session. Your feedback
is very important.
• Complete a minimum of 4 session
surveys and the Overall Conference
survey (starting on Thursday) to
receive your Cisco Live t-shirt.
• All surveys can be taken in the Cisco Events
Mobile App or by logging in to the Content
Catalog on ciscolive.com/emea.
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 156
Continue your education
Demos in the
Walk-In Labs
Cisco Showcase
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 157
Thank you
Backup Slides
Network Automation
Challenges (extra)
NSO Architecture
(extra)
Automatic Service Package Upgrade
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 163
Device Configuration Management
(extra)
Cloning a Device
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 165
Create a Device Using Templates
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 166
Load Using “ncs_load“ Command
Make sure you use the -m option to merge the XML contents with
the CDB. The default action is replace which would delete the
entire CDB and replace it with the XML contents!
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 167
Meta Configuration – Single Device
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 168
Meta Configuration – All Devices
Possible completions:
commit-queue - Enables and configures the commit-queue
commit-retries - Retry commits on transient errors
connect-timeout - Timeout in seconds for new connections
ned-settings - Control which device capabilities ncs uses
out-of-sync-commit-behaviour - Specifies the behaviour of a commit operation involving a device that
is
out of sync with ncs.
read-timeout - Timeout in seconds used when reading data
report-multiple-errors - By default, when the ncs device manager commits data southbound and
when
there are errors, we only report the first error to the operator,
this flag makes ncs report all errors reported by managed devices
session-pool - Control how sessions to related devices can be
pooled. ssh-keep-alive - Controls SSH keep alive settings
trace - Trace the southbound communication to devices
trace-dir - The directory where trace files are stored
write-timeout - Timeout in seconds used when writing data
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 169
Device Action – All Devices
admin@nso# devices ?
Possible completions:
check-sync - Check if the NCS config is in sync with the device
check-yang-modules - Check if NCS and the devices have compatible YANG modules
clear-trace - Clear all trace files
commit-queues - List of queued commits
connect - Set up sessions to all unlocked devices
device - The list of managed devices
device-group - Groups of devices
disconnect - Close all sessions to all devices
sync - DEPRECATED - use sync-to or sync-from instead
sync-from - Synchronize the config by pulling from the devices
sync-to - Synchronize the config by pushing to the devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 170
Introduction to YANG
(extra)
Service Manager
(extra)
Service Configuration Maintenance Tools
CDB
Check Sync Device 1 S1 S1
configuration
S1 Device 1
Service instance
configuration S2 Device 2
S2
configuration S2
Deep Check Sync
Device 2
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 173
FastMap
(extra)
FASTMAP: Create a Service Instance
Undo
Service NSO stores the device level undo
Service Instance information (reverse-diff) for
Model
each service instance as a binary
• Create Database APIs object inside the service instance
Create
Model-to-
• Modify model mapping
Device
Models Device Changes
To
devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 175
FASTMAP: Modify a Service Instance
Undo
Service Update the undo
Service Instance
Model information for the
Undo
Database APIs modified service instance
Create
Delete
Delete Create the
existing modified instance
instance
Database APIs
• Create
• Modify
Device
Models Device Changes
To • Delete
devices
Only send differences
to devices.
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 176
FASTMAP: Service Modify (1)
CDB / Device
/services /devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 177
FASTMAP: Service Modify (2)
CDB / Device
/services /devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 178
Modify and Existing Service: Example 3
admin@nso# config
Entering configuration mode terminal
admin@ncs(config)# services l2vpn ACME
admin@ncs(config-l2vpn-ACME)# link Site1
admin@ncs(config-l2vpn-ACME)# intf 0/6
admin@ncs(config-link-PE12)# top
admin@ncs(config)# commit dry-run
device PE11
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 179
Modify and Existing Service: Example 3 (Cont.)
admin@nso# config
Entering configuration mode terminal • Changed parameter affects only one
admin@ncs(config)# services l2vpn ACME
admin@ncs(config-l2vpn-ACME)# link Site1 device
admin@ncs(config-l2vpn-ACME)# intf 0/6
admin@ncs(config-link-PE12)# top
admin@ncs(config)# commit dry-run outformat native • CLI NED may have additional
device PE11
interface GigabitEthernet0/5 dependencies between configuration
no xconnect 10.1.1.12 122 encapsulation mpls
exit
interface GigabitEthernet0/6
options (e.g. multiple parameters in a
xconnect 10.1.1.12 122 encapsulation mpls single line)
exit
exit
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 180
FASTMAP: Service Modify (3)
CDB / Device
/services /devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 181
FASTMAP: Delete a Service Instance
Undo
Service Instance
Model
Delete
Apply the undo
• Modify configuration
Database APIs
• Delete
Device
Models Device Changes
To
devices
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 182
FASTMAP: Service Delete
CDB / Device
/services /devices
./device[name='PE11'] PE11
./config interface GigabitEthernet0/6
no xconnect 10.1.1.12 122 encapsulation mpls
./interface !
./GigabitE[name='0/6']
PE12
interface GigabitEthernet0/9
no xconnect 10.1.1.11 122 encapsulation mpls
!
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 183
Northbound API and Integration options
(extra)
Cisco NSO Server User Interfaces
root@NCS:/opt/ncs/ncs-4.1.1/# ls -l
total 368
Shell drwxr-xr-x 2 root root 4096 Jun 28 12:46 bin
SSH on port 22 -rw-r--r-- 1 root root 140956 Jun 28 12:47 CHANGES
drwxr-xr-x 4 ro ot root 4096 Jun 27 21:36 doc
CLI SSH on port 2024 admin@ncs# show ncs-state version3 ro
drwxr-xr-x ot root 4096 Jun 28 12:46 erlang
version 4.1.1; drwxr-xr-x 3 ro ot root 4096 Jun 28 12:45 etc
admin@ncs# drwxr-xr-x 10 ro ot root 4096 Jun 28 12:50 examples.ncs
WebUI drwxr-xr-x 2 root root 4096 Jun 28 12:46 include
Cisco NSO HTTP on port 8080
drwxr-xr-x 3 root root 4096 Jun 28 12:45 java
Server
drwxr-xr-x 5 root root 4096 Jun 28 12:48 lib
-rw-r--r-- 1 root root 128459 Jun 28 12:47 LICENSE
drwxr-xr-x 5 root root 4096 Jun 27 21:34 man
-rw-r--r-- 1 root root 541 Jul 4 14:10 ncsrc
-rw-r--r-- 1 root root 509 Jul 4 14:10 ncsrc.tcsh
drwxr-xr-x 3 root root 4096 Jul 4 14:10 netsim
drwxr-xr-x 17 root root 4096 Oct 28 10:40 packages
-rwxr--r-- 1 root root 17694 Jun 28 12:47 README
drwxr-xr-x 4 root root 4096 Jun 28 12:46 scripts
drwxr-xr-x 3 root root 4096 Jun 28 12:45 src
drwxr-xr-x 4 root root 4096 Jun 28 12:47 support
drwxr-xr-x 3 root root 4096 Jun 28 12:45 var
-rw-r--r-- 1 root root 220 Jun 28 12:47 VERSION
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 185
Cisco NSO REST API Example (Cont.)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 186
Package Manager
(extra)
NETCONF NED
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 188
CLI NED
CLI CLI
Config
over SSH
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 189
Generic NED
protocol Service
Models
Service
Manager
Templates
Mapping Logic
• Array of operations in the form of DOM* Device
Models
Device
Manager FASTMAP
(Document Object Model) manipulations
CDB
Generic
(JAVA) are sent to the device
NETCONF CLI SNMP
NED
NED NED NED
XML
Config
YANG
Device
Model Java for
Protocol X
Protocol
X Config
*The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the
page so that programs can change the document structure, style, and content. The DOM represents the
document as nodes and objects. That way, programming languages can connect to the page.
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 190
Installing NEDs
• Local Installation
• System Installation • Extract the package to the /packages
• Extract the package to /var/opt/ncs/packages unless subdirectory of the running directory
you used a non-default location • Alternatively, link to the lab-grade packages in
the installation directory
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 191
Using Existing Packages
• Existing packages:
• NEDS ($NCS_DIR/packages/neds)
• Services ($NCS_DIR/packages/services)
• Tools ($NCS_DIR/packages/tools)
• Copy or softlink packages from the NSO installation or another location where the
packages are stored:
or
cisco@nso:/var/opt/ncs/packages$ sudo ln -s $NCS_DIR/packages/neds/cisco-iosxr packages/cisco-ios
cisco@nso:/var/opt/ncs/packages$ sudo ln -s $NCS_DIR/packages/neds/cisco-iosxr packages/cisco-iosxr
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 192
Activate NED Packages
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 193
NED Development Process
NED Delivery
NED Delivery NED Delivery
Development/
Sales Analysis /
Testing
Acceptance /
Preparation Support
Iterations (1+n)
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 194
Service Package
Template Options
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 196
System Requirements
System Requirements: Operating System
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 198
System Configuration and Installation Type
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 199
System Installation Local Installation
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 200
Cisco NSO Local Installation Directory Structure
datacenter/ ncs-cdb/
ncs-run/ ncs- cdb/
ncs.conf
Running Directory ncs.conf
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 201
Cisco NSO System Installation Directory
Structure
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 202
Other
Alarm Manager
TECNMS-4175 © 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public 204