This message was posted by a user wishing to remain anonymous
I have used templating extensively on an SSR conductor running 5.4.5. As of yet I haven't deployed any production routers using templates although I have developed and tested tools using the liquid template REST APIs to assist in deploying routes. For my use case, I intend to render one router at a time as new sites are brought online so the notion of iteratively rendering multiple routers in one pass, does not apply in my case.
My experience with templates involved converting older templates designed for use with netconf to json and liquid, so I did not import configuration from an existing router and templatize it. All of the templates I worked with are advanced mode templates. There is a way to create a GUI wizard to enter variables for an advanced template, but I have not explored that as I am using a python script to drive the conductors via the templating REST APIs. That said, I did do a lot of manual testing of advanced templates by pasting different data into the variables window and rendering the template.
I think the SSR templating feature is an awesome addition to the product as one can take a single router that has been working in a lab or prototype production environment, import it's configuration, define the variable components and create a template to be used over and over without much effort.
As always there is some room for improvement, and in my experience there is a need for improvement in template debugging. The json format required for liquid templates uses a strict syntax so an open brace towards the top of a file might be missing a closing brace hundreds of lines down. My experience with the GUI is that it reports json parse error at the offending character and not line. This makes it difficult if not impossible to find within the GUI (I may have missed some GUI controls, but my approach is to copy the json output into a text editor and advance by the number of characters reported in the GUI),. Additionally, the error messages returned by the template rendering engine and the config engine can be confusing to first time users (after a little bit you'll learn what the error messages are referring to).
Using advanced template mode with REST APIs can be a bit tricky. I ended up deleting the template name, ignoring the return code for whether it existed or not, and then creating it. I would have preferred a mechanism to force an overwrite of the exiting configuration.
One feature request for the templating feature would be to have the conductor consult an MSR (Master System of Record) to obtain the variable data for a given site. I believe the lack of this capability will drive many users to use the REST APIs over the GUI as they can write scripts to query their REST APIs. This is unfortunate as were some of the issues with debugging in the GUI to be resolved it would be a great way for administrators not familiar with devops / scripting to deploy new sites.
In summary SSR templating is a really useful feature which greatly improves the administrator experience of configuring multiple sites with configuration that varies only by a few variables. Over time I'm sure it will evolve and become even better.
Original Message:
Sent: 05-20-2022 13:30
From: Justin Melloni
Subject: Feature Friday: Configuration Templates in the SSR
Hey everyone, Happy Friday!
On Fridays, we want to bring to your attention a Juniper SD-WAN feature that you may not be familiar with. Today let's take a look at Config Templates in the Session Smart Router (SSR).
Config Templates are a tool that allow you to easily deploy thousands of SSRs with just a few clicks. All you need to do is:
- Create a template
- Find a golden config of yours and click the button to copy to template
- Select the fields you want to templatize
When you are ready to use the template, just go to your template, select CREATE AN INSTANCE and fill in the values. Lastly, just select Generate Configuration for Selected and voilà, your router configuration is in your Candidate config (still need to Commit).
Here's a demo showing how that is done: Session Smart Routing Demo: Configuration Template
Now, what I described is still pretty manual, so if you need to scale, the SSR has ways of doing that too. You can use Liquid templating language and conditional statements and loops to make it easy to create thousands of instances with few clicks.
My friend @Preetham made a guide to help you learn how to do some advanced templating. You can find that here: Intro to Templating in 128T
He broke down templating into 5 pieces:
- Basic Templating
- Using if-else conditions and loops within the template
- Deleting config elements.
- Emulating a dictionary within the template
- Using network filters to determine IPs in a network
So yea, that's Configuration Templating with the SSR in a nutshell. Now, we want to hear from you:
- Have you used templating before?
- How many routers have you deployed and did you do it using templates?
- Have you had a chance to try out any of the advanced templating features?
- What do you think of the SSR Configuration Templates feature?
Comment down below and let us know what you think!
One last thing before I leave you, here are some more useful resources on Configuration Templating:
Talk to you soon!
Justin
#FeatureFriday #templates #SSR #SessionSmartRouter
------------------------------
Justin Melloni
------------------------------