cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1437
Views
0
Helpful
5
Replies
bjronmork
Beginner

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

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
Beginner

Anyone pls suggest. Thanks

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

rogaglia
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

View solution in original post

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