02-05-2018 12:49 AM - edited 03-01-2019 04:05 AM
Hi,
Where is the logic of deletion of service instance?
Issue that I am facing is: I used cisco-ios ned and configured net flow related configuration using service model. When i try to delete, it tries to clear the config with below clis : Here it tries to delete interface also which is incorrect and it fails here.
native {
device {
name ISR
data flow monitor MONITOR
no exporter NTOP-EXPORTER
!
no flow exporter NTOP-EXPORTER
interface GigabitEthernet0/0/0
no ip flow monitor MONITOR input
no ip flow monitor MONITOR output
exit
no flow monitor MONITOR
no flow record RECORD
no interface GigabitEthernet0/0/0 <<<<<
}
}
So i would like to know where can I comment out "no interface GigabitEthernet0/0/0" in the ios ned?
Solved! Go to Solution.
02-05-2018 01:36 AM
The beauty of FastMap is that there is no delete code. And no modify code either. NSO will figure it out. The way NSO figures this out is by recording what your create() code did, and undo exactly that. So if NSO is deleting the interface as part of the service, that means the interface was created by the service.
So ensure interfaces are not created by your service. If your service uses a template, that usually means adding a tags="nocreate" on the interface, then a tags="merge" on the content inside the interface that should be created by the service instance.
02-05-2018 01:36 AM
The beauty of FastMap is that there is no delete code. And no modify code either. NSO will figure it out. The way NSO figures this out is by recording what your create() code did, and undo exactly that. So if NSO is deleting the interface as part of the service, that means the interface was created by the service.
So ensure interfaces are not created by your service. If your service uses a template, that usually means adding a tags="nocreate" on the interface, then a tags="merge" on the content inside the interface that should be created by the service instance.
02-05-2018 02:57 AM
Thanks Jan.
What I was missing was doing a sync-from from device, Hence NSO was trying to create the interface and then eventually delete. When I did sync-from, everything is working fine.
02-05-2018 05:41 AM
Good that you pinpointed the problem! My comment still applies, however. You should ensure that your template has tags="nocreate" on the interface and any other elements that you don't want to belong to the service, and (usually) tags="merge" on what belongs to the service instance. Get into the habit of using the template tags correctly. Not being precise about these things may bite you again later.
05-16-2019 05:31 AM
On a related note. One issue we are facing with certain device platform (nbe200) where if an access-list rule is deleted for ACL in device, it deletes the complete ACL itself. So I was wondering, if there's any way to tell NSO that create a service, but don't allow "no" of that service. Basically to prevent the situation we see in this particular device. Can pre_mod solve the problem here?
05-16-2019 07:52 AM
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