10-10-2018 11:28 AM - edited 10-10-2018 11:31 AM
Hi,
I was wondering if anybody here can come up with some good ideas on how to achieve the following:
The customer wants to push some Config from a VPN service...so far so good. That works fine.
He then wants to do a ping test (from PE router to CE Router or even all the way to CR Router). If this ping test is succesful he wants to deploy the service again (with a minimally different config template from the first time, autostate on an interface needs to be enabled in some cases, thats the only difference from the first time).
How can this be achieved in "one go"?
I have the code etc. here for initial deployment of the VPN service, for the ping test (from NSO code) as well as the deployment of the slightly different Template.
My problem is that cb_create runs before NSO talks to the devices, so here I can really only do the initial applyTemplate call. Then cb_create finishes and thereafter the template (with values) gets applied/pushed to the device.
As far as I see there is no callback where I can now do the ping test and (on success) call applyTemplate again. I had been hoping to use the post_modification callback but as far as I could tell that is also executed before NSO pushes the Config to the device.
One idea for a (far from ideal) workaround is to use the NSO scheduler, i.e. at the end of the cb_create callback code programmatically schedule (now+approx 2-3mins) a ping test (in an Action) and a redeployment of the original service instance (in same Action). Is it even possible to instantiate a service instance from an Action? I am aware that this workaround could cause problems when it comes to deleting/modifying the service instance as code in Actions should deal more with one off stuff, rather than do Service stuff.
Another option would be to add 3rd party solutions (i.e. Itential) where I know the desired use case could be achieved quite easily (as it offers proper Workflow functionality). But that isnt really an option I would currently (!) like to propose to the customer if it can be achieved with NSO on its own.
Any good ideas would be greatly appreciated. Thanks in advance for any ideas that lead to a solution.
10-11-2018 01:14 AM
This is exactly what the Reactive FastMap (RFM) pattern is about, and why there is a self-test action in the YANG service templates. Look for 'reactive' in examples.ncs/getting-started/developing-with-ncs/4-rfs-service . You may also want to have a look at examples.ncs/getting-started/developing-with-ncs/25-service-progress-monitoring .
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