cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1875
Views
0
Helpful
5
Replies

NSO handling of IOS-XE & IOS devices with different ways of CLI

bjronmork
Level 1
Level 1

Hi Experts;

I need your help to understand; we have a single NED "CISCO-IOS" which caters both IOS & IOSXE command lines; I am concerned for creating l2vpn service.

 

For example ASR920 with IOS-XE image; and uses below command line to create a l2vpn

----------------------

ios:interface GigabitEthernet0/0/1
service instance 121 ethernet
encapsulation dot1q 121
rewrite ingress tag pop 1 symmetric
exit

l2vpn xconnect context GROUPNAME
interworking ethernet
member GigabitEthernet0/0/1 service-instance 121
member 10.20.30.40 123456 encapsulation mpls group GROUPNAME
----------------------

For example Cisco72XX with IOS image; and uses below command line to create a l2vpn

interface GigabitEthernet0/0/1
xconnect 10.20.30.40 34567 encapsulation mpls
no mpls control-word
exit

----------------------

In this case, we need to have multiple inputs in for same type of service

 

Common in both device models..

1. PW-ID

2. DEVICE NAME

3. Interface NUMBER

Additional Requirement in ASR920

4. GROUPNAME

5. dot.q encapsulation & Service Instance ID

-------------------------------------

I need to know; how can it be handled? with in YANG and XML template...

1. Yang should show additional parameters requests only if ASR920 is selected 

2. XML should intelligently use device command lines as device model..

 

Regards,

BjMork

1 Accepted Solution

Accepted Solutions

Hi,

I want to request please share yang example which uses the platform based selection for the same xml code. 

 

<service-policy tags="merge" when=
"{starts-with(/../../ncs:devices/ncs:device[ncs:name=$PE]/ncs:platform/ncs:name,'ios-xe')}">
<output>{/name}-asr1K</output>
</service-policy>
<service-policy tags="merge" when=
"{starts-with(/../../ncs:devices/ncs:device[ncs:name=$PE]/ncs:platform/ncs:name,'ViOS')}">
<output>{/name}-10K</output>
</service-policy>

 

Regards,

BjMork

View solution in original post

5 Replies 5

bjronmork
Level 1
Level 1

Anyone pls suggest. Thanks

You will have to use a conditional to output different configuration for difference device types.

rogaglia
Cisco Employee
Cisco Employee

Hi,

When NSO does a "sync-from", for CLI devices, it will write into the platform operation tree some information such as devices platform and device type. You could use this info in your template:

 

<service-policy tags="merge" when=
"{starts-with(/../../ncs:devices/ncs:device[ncs:name=$PE]/ncs:platform/ncs:name,'ios-xe')}">
<output>{/name}-asr1K</output>
</service-policy>
<service-policy tags="merge" when=
"{starts-with(/../../ncs:devices/ncs:device[ncs:name=$PE]/ncs:platform/ncs:name,'ViOS')}">
<output>{/name}-10K</output>
</service-policy>

 

Roque

Hi,

I want to request please share yang example which uses the platform based selection for the same xml code. 

 

<service-policy tags="merge" when=
"{starts-with(/../../ncs:devices/ncs:device[ncs:name=$PE]/ncs:platform/ncs:name,'ios-xe')}">
<output>{/name}-asr1K</output>
</service-policy>
<service-policy tags="merge" when=
"{starts-with(/../../ncs:devices/ncs:device[ncs:name=$PE]/ncs:platform/ncs:name,'ViOS')}">
<output>{/name}-10K</output>
</service-policy>

 

Regards,

BjMork

hi,

 

The code should work with any YANG service model but with these two caveats:

- I am using the name leaf, you can use whatever you need: {/name}

- The service I am applying the template has two "go back" to reach the devices tree (/../../ncs:devices), if your service is on the root tree, you may only need one "go back" (/../ncs:devices).

 

Regards,

Roque

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: