03-20-2020 03:31 PM
Hi All
I created an NSO Packages to modify following ios configuration on l2vpn istance, (for example 7609 )
interface GigabitEthernet9/1 description porta per TEST NSO mtu 9216 service instance 150 ethernet encapsulation dot1q 150 rewrite ingress tag pop 1 symmetric xconnect 172.16.12.1 250150 encapsulation mpls backup peer 1.1.1.1 4562 mtu 9202
In my package, I created an xml template similiar like that
<interface xmlns="urn:ios"> <GigabitEthernet when="{$remotePortType = 'GigabitEthernet'}"> <name>{$remotePortId}</name> <service> <instance> <id>{$remoteServiceInstance}</id> <xconnect tags="merge"> <address>{$localL9New}</address> <vcid>{$pwIdNew}</vcid> <backup> <peer> <peer-router-ip-addr>{$neighborRemoteBk}</peer-router-ip-addr> <vcid>{$pwIdRemoteBk}</vcid> </peer> </backup> <mtu>{$remoteMtu}</mtu> </xconnect> </instance> </service> </GigabitEthernet>
After Packages Reload, I don't have error o log, but when I commit a packages I see different problem
service instance 150 ethernet xconnect 172.16.12.2 4545656 encapsulation mpls !
devices device A1-MDR config ios:interface GigabitEthernet9/1 description porta per TEST NSO no switchport service instance 150 ethernet encapsulation dot1q 150 rewrite ingress tag pop 1 symmetric xconnect 172.16.12.1 250150 encapsulation mpls backup peer 1.1.1.1 4562 no mpls control-word mtu 9202 exit exit
I tried to use different tags on xml xconncet section or xml mtu section, create, merge, replace, without solution.
I tried to use xconnect with tag "delete" and section with tag "create" but without to reach a goal.
Do you have any idea?
Thanks a lot for any indication
Bye Bye
Maurizio
03-23-2020 01:01 AM
Hi,
Do the following and re-post:
1) Do a show running of the interface in NSO before committing the service.
2) Try to debug your problem via:
#commit dry-run | debug template
3) When the service is committed, try to run:
#show running myservice myserviceinstance | show service-meta
The second will give more insights into the insights of NSO.
Regards,
Roque
03-23-2020 07:51 AM
Hi Roque
Thanks a lot for your replay.
I maked your steps and this is the results
1) Do a show running of the interface in NSO before committing the service.
interface GigabitEthernet9/1 description porta per TEST NSO Valerio mtu 9216 service instance 150 ethernet encapsulation dot1q 150 rewrite ingress tag pop 1 symmetric xconnect 172.16.12.1 250150 encapsulation mpls mtu 9202
2) Try to debug your problem via:
#commit dry-run | debug template
In following code, section about IOS template, in attached file "Debug", all log
Context node: /services/movePWService:movePWService[name='mau2'] Result: "A1-MDR" Operation 'merge' on existing node: /devices/device[name='A1-MDR'] (from file "OPM-Feeder-IOS.xml", line 45) Evaluating conditional expression "boolean($remotePortType = 'GigabitEthernet')" (from file "OPM-Feeder-IOS.xml", line 73) Context node: /services/movePWService:movePWService[name='mau2'] Result: true - continuing Evaluating "$remotePortId" (from file "OPM-Feeder-IOS.xml", line 74) Context node: /services/movePWService:movePWService[name='mau2'] Result: "9/1" Operation 'merge' on existing node: /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1'] (from file "OPM-Feeder-IOS.xml", line 74) Evaluating "$remoteServiceInstance" (from file "OPM-Feeder-IOS.xml", line 77) Context node: /services/movePWService:movePWService[name='mau2'] Result: "150" Operation 'merge' on existing node: /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1']/service/instance[id='150'] (from file "OPM-Feeder-IOS.xml", line 77) Operation 'merge' on existing node: /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1']/service/instance[id='150']/xconnect (from file "OPM-Feeder-IOS.xml", line 78) Operation 'replace' on node: /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1']/service/instance[id='150']/xconnect/address (from file "OPM-Feeder-IOS.xml", line 79) Evaluating "$localL9New" (from file "OPM-Feeder-IOS.xml", line 79) Context node: /services/movePWService:movePWService[name='mau2'] Result: "172.16.12.2" Setting /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1']/service/instance[id='150']/xconnect/address to "172.16.12.2" Operation 'replace' on node: /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1']/service/instance[id='150']/xconnect/vcid (from file "OPM-Feeder-IOS.xml", line 80) Evaluating "$pwIdNew" (from file "OPM-Feeder-IOS.xml", line 80) Context node: /services/movePWService:movePWService[name='mau2'] Result: "4545656" Setting /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1']/service/instance[id='150']/xconnect/vcid to "4545656" Evaluating conditional expression "boolean($neighborRemoteBk != 'None')" (from file "OPM-Feeder-IOS.xml", line 81) Context node: /services/movePWService:movePWService[name='mau2'] Result: false - skipping siblings Operation 'merge' on existing node: /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1']/service/instance[id='150']/xconnect/mtu (from file "OPM-Feeder-IOS.xml", line 87) Fetching literal "9202" (from file "OPM-Feeder-IOS.xml", line 87) Setting /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/1']/service/instance[id='150']/xconnect/mtu to "9202"
3) When the service is committed, try to run:
#show running myservice myserviceinstance | show service-meta
nso@ncs# show running-config services movePWService mau2 | display service-meta-data services movePWService mau2 mdrSrcName OPM-9K1-F1 mdrSrcIf GigabitEthernet0/4/1/7 peSrcName OPM-RGJIT001 peSrcIf xe-1/0/0 peSrcUnit 250 peSrcSvlan 250 peSrcCvlan 1000 mdrDstName OPM-9K1-F2 mdrDstIf TenGigE0/6/0/4 peDstName OPM-RGJIT001 peDstIf xe-1/0/0 peDstUnit 250 ! nso@ncs#
You can see IOS Template in attached rar file,
Grazie
Bye
Maurizio
03-23-2020 10:43 AM
hi,
I shoudl have say that you need to get the device configuration service meta data:
nso@ncs# show running-config device device Mydevice config ios:interface | display service-meta-data
However, I believe NSO is working as designed. NSO will return the the original configuration when deleted, which in this case is the MTU configured.
Service "redeploy reconcilate" will allow you to change the behavior. It is well explained in the developer guides.
Roque
03-25-2020 02:28 AM
@rogaglia wrote:hi,
I shoudl have say that you need to get the device configuration service meta data:
No problems, logs are free... :-)
nso@ncs# show running-config device device Mydevice config ios:interface | display service-meta-data
Service-meta-data log on IOS device by NSO showing this configuration
nso@ncs# show running-config devices device A1-MDR config ios:interface GigabitEthernet 9/1 | display service-meta-data devices device A1-MDR config ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau2'] ] ios:interface GigabitEthernet9/1 description porta per TEST NSO Valerio no switchport ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau2'] ] service instance 150 ethernet encapsulation dot1q 150 rewrite ingress tag pop 1 symmetric service-policy input IN service-policy output OUT ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau2'] ] xconnect 172.16.12.2 753159 encapsulation mpls no mpls control-word ! Refcount: 2 ! Originalvalue: 9202 mtu 9202 exit exit
I’m going to read the developers guide, but the service re-deploy reconcilate doesn’t seem to work.
nso@ncs# services movePWService mau2 re-deploy reconcile Error: no registration found for callpoint movePWService-servicepoint/service_create of type=external nso@ncs# *** ALARM service-activation-failure: no registration found for callpoint movePWService-servicepoint/service_create of type=external ! nso@ncs(config)# services movePWService mau2 re-deploy reconcile Error: no registration found for callpoint movePWService-servicepoint/service_create of type=external nso@ncs(config)#
So, Thanks a lot for your response and I'll write in this post if i find some solution/indication
Have a nice day
Ciao
Maurizio
03-25-2020 07:13 AM
Hi Maurizio,
Two points
1) You have a problem with your package as a callback is not found. You probably need to check it for errors and do a "package reload".
2) If you seem you have one Backpointer and RefCount=2. This means that when the service will be deleted, the values will be left as they are or returned to its original value, instead of deleting them.
Try your service by first deleting the target config in the device. There, the RefCount will be =1 and the config will be deleted when deleting the service.
Roque
03-29-2020 09:21 AM
Hi Roque
Sorry for delay response and thanks for continou feedback to solve a problem
I followed your indication but i don't found a solution or one key to solve a problem.
I checked my packages, I verified python section about IOS apply template and controlled my template but i don't know if.... "there is light at the end of the tunnel" :-(
So,
I created a Case report pdf file to aggregate all steps on this test
- Clear all services
- Start config with MTU 9202
- Config service
- Commit dryrun with debug template
- commit
- Verify RefCount ( Not change, RefCount remain on value "2")
- Rollback
For all detail, please see the attached pdf file.
At the same time, I showed the IOS-XR configuration about same services, and I found RefCount ugual 1
nso@ncs# show running-config devices device OPM-9K1-F2 config cisco-ios-xr:interface TenGigE 0/6/0/4.251 | display service-meta-data devices device OPM-9K1-F2 config ! Refcount: 1 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau3'] ] cisco-ios-xr:interface TenGigE 0/6/0/4.251 l2transport encapsulation dot1q 2 second-dot1q 251 no shutdown ! Refcount: 1 rewrite ingress tag pop 2 symmetric exit !
Test Nr 2 - Modify backup xconnect configuration
To clear all doubts about IOS template, I created a second template to modify backup xconnect configuation
IOS CLI Configuration
interface GigabitEthernet9/1 description porta per TEST NSO Valerio mtu 9216 service instance 250 ethernet encapsulation dot1q 250 rewrite ingress tag pop 1 symmetric xconnect 172.16.12.7 7777250 encapsulation mpls backup peer 172.16.12.1 250250 mtu 9202
IOS BK XML Template
---- Part of XML BACKUP IOS TEMPLATE ----
<interface xmlns="urn:ios"> <GigabitEthernet when="{$remotePortType = 'GigabitEthernet'}"> <name>{$remotePortId}</name> <service> <instance> <id>{$remoteServiceInstance}</id> <xconnect> <address>{$neighborRemote}</address> <vcid>{$pwIdRemote}</vcid> <encapsulation>mpls</encapsulation> <backup tags="delete"> </backup> <backup> <peer> <peer-router-ip-addr>{$localL9New}</peer-router-ip-addr> <vcid>{$pwIdNew}</vcid> </peer> </backup> <mtu>9202</mtu> </xconnect> </instance> </service> </GigabitEthernet>
I execute the same services, but this time I don't have any problem, BackUp are correctly modified and MTU are not erased
I verified also the service-meta-data and also in this case, I have a RefCount egual to "2"
devices device A1-MDR config ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau3'] ] ios:interface GigabitEthernet9/1 description porta per TEST NSO Valerio no switchport ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau3'] ] service instance 250 ethernet encapsulation dot1q 250 rewrite ingress tag pop 1 symmetric service-policy input IN service-policy output OUT ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau3'] ] xconnect 172.16.12.7 7777250 encapsulation mpls ! Refcount: 2 ! Originalvalue: 172.16.12.1 backup peer 172.16.12.2 999999 no mpls control-word ! Refcount: 2 ! Originalvalue: 9202 mtu 9202 exit exit
Test Nr 3 - Clear all service instance and recreate with same number configuration
I tried also with delete the service instance on xml template and create but the problem remain the same.
nso@ncs# show running-config devices device A1-MDR config ios:interface GigabitEthernet 9/1 | display service-meta-data devices device A1-MDR config ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau2'] ] ios:interface GigabitEthernet9/1 description porta per TEST NSO Valerio no switchport ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau2'] ] service instance 150 ethernet encapsulation dot1q 150 rewrite ingress tag pop 1 symmetric service-policy input IN service-policy output OUT ! Refcount: 2 ! Backpointer: [ /ncs:services/movePWService:movePWService[movePWService:name='mau2'] ] xconnect 172.16.12.2 1234567 encapsulation mpls no mpls control-word ! Refcount: 2 ! Originalvalue: 9202 mtu 9202 exit exit
Last Test - New packages IOS
I created a new packages, without python logic and only with 1 template xml. This packages remove only shutdown configuration on a GIgabitEthernet interface.
The goal of this are to verify RefCount value
<config-template xmlns="http://tail-f.com/ns/config/1.0" servicepoint="port-turn-up"> <devices xmlns="http://tail-f.com/ns/ncs"> <device> <name>{/device}</name> <config> <interface xmlns="urn:ios"> <GigabitEthernet> <name>{/interface_id}</name> <shutdown tags="delete"></shutdown> </GigabitEthernet> </interface> </config> </device> </devices> </config-template>
When I lanch the services, debug template are simply this
nso@ncs(config-port-turn-up-TestRFCOUNT)# commit dry-run | debug template Evaluating "/device" (from file "port-turn-up-template.xml", line 10) Context node: /services/port-turn-up:port-turn-up[name='TestRFCOUNT'] Result: For /services/port-turn-up:port-turn-up[name='TestRFCOUNT'], it evaluates to "A1-MDR" Operation 'merge' on existing node: /devices/device[name='A1-MDR'] (from file "port-turn-up-template.xml", line 10) The device /devices/device[name='A1-MDR'] does not support namespace 'http://tail-f.com/ned/cisco-ios-xr' for node "interface" (from file "port-turn-up-template.xml", line undefined) Skipping... Evaluating "/interface_id" (from file "port-turn-up-template.xml", line 20) Context node: /services/port-turn-up:port-turn-up[name='TestRFCOUNT'] Result: For /services/port-turn-up:port-turn-up[name='TestRFCOUNT'], it evaluates to "9/5" Operation 'merge' on existing node: /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/5'] (from file "port-turn-up-template.xml", line 20) Operation 'delete' on node: /devices/device[name='A1-MDR']/config/ios:interface/GigabitEthernet[name='9/5']/shutdown (from file "port-turn-up-template.xml", line 21) cli { local-node { data devices { device A1-MDR { config { ios:interface { GigabitEthernet 9/5 { - shutdown; } } } } } services { + port-turn-up TestRFCOUNT { + device A1-MDR; + interface_type GigabitEthernet; + interface_id 9/5; + } } } }
After commit, the RefCount on this interface are..
nso@ncs# show running-config devices device A1-MDR config ios:interface GigabitEthernet 9/5 | display service-meta-data devices device A1-MDR config ! Refcount: 2 ! Backpointer: [ /ncs:services/port-turn-up:port-turn-up[port-turn-up:name='TestRFCOUNT'] ] ios:interface GigabitEthernet9/5 no switchport no ip address no shutdown exit ! ! nso@ncs#
Maybe I will make a mistake, but it would seem that ned IOS always sets RefCount to 2
I hope all tests are clear
Regards
Maurizio
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide