DNA Center Templates 
Overview
DNA Center is maturing into a very robust tool for the network administrator. The lessons learned over a decade from Prime guided us toward a tool that will transform the future of networks. Prime has served many organizations for over a decade; DNA Centers’ capabilities and unique UI make it a robust successor. Additionally, DNA Center can easily accomplish various network automation tasks that would ordinarily take days to achieve. Lastly, to aid in understanding DNA Center’s capabilities, we provide a helpful DNA Center template tutorial.
Secondly, an area where DNA Center excels is in the area of automation. DNA Center uses a simple hierarchical workflow mechanism that enables the deployment of network settings, credentials, images, and templates to the network. DNA Center’s hierarchical approach to intent automates and provides policy continuity.
Finally, many will probably find the whole prospect of change and the development of automation templates a daunting task. It may seem cumbersome to revisit today’s methods to build configurations. As a result, reviewing their construction and changing their deployment approach may feel a little overwhelming.
In this ongoing DNA Center Automation Series, our focus is on using multiple approaches to automating the network. This will help enable you, the network administrator, with the capability to solve more types of configuration issues from DNA Center and to deal with the dynamics of an enterprise network.
Within this series, we cover the following;
- PnP Preparation – explains the overall Plug and Play set up steps
- Onboarding Templates – explains in-depth how to deploy Day 0 templates
- Day N Templates – dives into Day N template constructs with both regular and composite templates and use cases
- Application Policys – explores Application Policys and SD-AVC in DNAC and their use
- Telemetry – explains how to deploy Telemetry for assurance
- Advanced Automation – explores Advanced Automation techniques
- Dynamic Automation – a deployment lab for dynamic automation
How?
To aid customers in the transition toward automation, we have put together a set of small helpful tutorials within a Github repository. As a result, we hope to demystify some of the complexities of setting up plug-and-play and help guide customers through the complexities. In this way, the tutorial provides a glimpse into the fundamentals of building Velocity and Jinja2 templates and provides examples that you can download and expand from. These sample templates and JSON files are supplied for easy import into DNA Centers’ template editor for quicker adoption.
Firstly, we delve into the concepts of building templates and methodologies for using both Onboarding and DayN templates at length. Secondly, answers to many of the questions that come up during automation workshops are explained. The hope is that you find the information both helpful and informative. Thus, information is included, which will hopefully give a well-rounded explanation of automation methods and concepts.
The DNAC-TEMPLATES repository includes scripts and samples of:
- Velocity Scripting
- Jinja2 Scripting
- Variables
- Binding Variables
- Composite Templates
These samples build a tutorial that aims to be a practical guide to aid engineers to rapidly begin using DNA Center automation and help them work towards a template strategy. This will enable engineers to reduce the time and effort needed to instantiate the network.
As a result, the tutorial also does an in-depth flyby about setting up Plug and Play onboarding and templates. Additionally, it has a section on advanced Velocity and Jinja2 templating and troubleshooting tools which may help during faultfinding to determine what is failing in a deployment.
In order to keep this repository relevant, new content is added frequently to the repository DNAC-TEMPLATES, so stay tuned…
Furthermore, the repository is also directly available from Github at DNAC-TEMPLATES.
Intent-Based Networking
To deploy Intent, we use combinations of either one or multiple templates and the Design Settings and Policies within the UI. Lastly, Day N methods allow for one or multiple templates by using composite templates that combine many regular templates into one logical flow.
Additionally:
- Intent is a combination of configuration templates, configuration, policy, code, and settings.
- Logical constructs modify or choose between various results via decision (‘IF’) statements.
- Looping structures within the template allow for repetition of configuration
- Variables may be used when the device is being onboarded or provisioned
Sections
Please use this menu to navigate the various sections of this Github repository. Within the various folders are examples, explanation readme files for reference. These sections build on the concepts mentioned in posts written by Adam Radford, a Distinguished System Engineer. Adam’s selection of posts can be found by following this link to blogs on cisco.com.
Workflows
- PnP Workflow – This section explains the overall Plug and Play Methodology
- Onboarding Templates – This section will explain Onboarding Templates in DNAC and their use
- DayN Templates – This section will explain how to use templates for ongoing changes to the network
Templating
- Building Templates – This section will explain how to build a template on DNAC
Velocity Language
- Velocity Variables – This section explains Variables in depth and how and where to use them
- Velocity Scripting – This section will dive into Velocity Scripting constructs and use cases
- Advanced Velocity Scripting – This section will dive into Advanced Velocity examples
Jinja2 Language
- Jinja2 Variables – This section explains Variables in depth and how and where to use them
- Jinja2 Scripting – This section will dive into Jinja2 Scripting constructs and use cases
- Advanced Jinja2 Scripting – This section will dive into Advanced Jinja2 examples
Advanced Use Cases
- Embedded Event Manager – This section will dive into EEM Scripting and various use cases
- System Variables – This section explains DNA Centers System Variables
Fault-Finding
- Troubleshooting – This section will dive into Troubleshooting
Examples
For more examples and in-depth explanations, please take a look at Adam Radford’s blogs on cisco.com.
Additionally, specific examples of Templates are available in the following folders:
- PnP Onboarding – Examples of PnP/ZTP Templates explained in Onboarding Templates
- DayN – Examples of DayN Templates explained in DayN Templates
In order to deploy these samples, we first must satisfy two conditions:
- Deploy a PnP Discovery method and DHCP scope – see PnP Workflow.
- Build the template with detailed methods – see Creating Templates.
In conclusion, if you found this repository or any section helpful, please fill in comments and feedback on how it could be improved.
We’d love to hear what you think. Ask a question or leave a comment below.
And stay connected with Cisco DevNet on social!
Twitter @CiscoDevNet | Facebook | LinkedIn
Visit the new Developer Video Channel
Hi
I am starting out with VTL and have a very basic question that I can’t find an answer to on any of these blogs. I need to create some vlans on a switch on onboarding template but cant work out how this can be done in DNAC VTL. In my case users supply a list of vlan ids and then the template creates the vlans on the switch. For example the user is prompted to enter a list of vlan ids (222,333,444) which then creates the vlans on the switch as below
vlan 222
vlan 333
vlan 444
Cheers
Hi Mike,
Please see the content within the repository…
https://github.com/kebaldwi/DNAC-TEMPLATES/tree/master/LABS#dnac-template-labs
There is a Composite Lab there https://github.com/kebaldwi/DNAC-TEMPLATES/blob/master/LABS/LAB4-Composite-Template/README.md#Composite
In that location see the Template folder and either the zip file, or the 2125 Template folder with JSON files for import.
There is an example code with the JSON file https://github.com/kebaldwi/DNAC-TEMPLATES/blob/master/LABS/LAB4-Composite-Template/templates/2125templates/Platinum_PortAssign_Template.json
Hope that helps… I will be creating a series of Blogs over the next few weeks to advertise this a bit better… These JSON files are also in the DAYN folder in the repository.