Cisco Catalyst Center Template Labs – DayN Templates, Part4


Overview

In this episode of our ongoing Catalyst Center Automation Series, our focus is on DayN Automation utilizing Templates for operations and setting up a lab or production environment to enable this capability. The third and fourth labs in the series aim to understand the various concepts required to support device configuration after onboarding. The labs within this series allow for use in the DCLOUD environment; however, you may equally utilize them as part of a Proof of Concept setup at a customer’s lab. You may use these procedures to ensure that all the necessary steps are complete before onboarding any devices within Catalyst Center. These procedures may also help form part of a deployment or implementation.

Within this series, we cover the following;

  1. PnP Preparation – explains the overall Plug and Play set up steps
  2. Onboarding Templates – explains in-depth how to deploy Day 0 templates
  3. Day N Templates – dives into Day N template constructs with both regular and composite templates and use cases
  4. Application Policys – explores Application Policys and SD-AVC in Catalyst Center and their use
  5. Telemetry – explains how to deploy Telemetry for assurance
  6. Advanced Automation – explores Advanced Automation techniques
  7. Dynamic Automation – a deployment lab for dynamic automation

Each of the Labs builds on the concepts that we cover in the series. These labs have a prerequisite of completing the previous two labs. The focus of the first three labs is on setting up the environment and onboarding the device using plug and play into Catalyst Center. The following two labs focus on using regular and composite templates within Catalyst Center to configure network devices in an ongoing manner. These labs will go through the flow surrounding building the supporting settings within Catalyst Center to support DayN configuration. The labs will also allow you to deploy a template for a Catalyst switch through Catalyst Center using DayN workflows as both regular templates and composite to deploy intent. To prepare the environment, make sure you complete the steps outlined in our first, second, and third blogs in the series.

What will I learn in the DayN Templates Labs?

In the Wired Automation lab, customers will start by building using both a regular template and composite template. Regular templates allow us to build out complex configurations for deployment. Composite templates allow for the reuse of multiple regular templates, which will enable us to modularize our code for reuse. Composite templates also allow us one place to make changes that affect a broader set of devices. Thus, if we upgrade one regular template applied to multiple composite templates, we may effect change on a more comprehensive set of devices. This also allows us to reduce the duplication of efforts and minimize the administrator’s amount of effort.

Other considerations surround the use of the UI-centric approach and the impact that it has on a typical configuration. For example, a configuration could include some lines of code, which may be delivered through the UI-centric settings. If these Design components are used, we need to understand the impact that may have on simplifying our configuration and how easy that may make the network maintain.

Composite Templates add the capability of tracking sub-components for compliance, and the ability to abort the automation if a failure occurs.

Regular Templates

As a regular template may include the device’s entire configuration, it’s essential to realize that the more configuration within a regular template, the harder it may be to fault-find. Additionally, small, succinct configuration examples are easier to reuse, and this aids us later on in making small changes less radical overall. The Wired Automation lab in the series, delves into the practical application of how to set up Catalyst Center to prepare a regular template for DayN delivery. It also lightly explains some of the various philosophies surrounding how we might deploy configuration.

Composite Templates

While you might think to include the entire configuration for a traditional network device, there is a better way. We are better served by composite templates for large configuration constructs. Again, this allows for compliance tracking,  modularization and reuse, and simplification of operations. In addition, while we utilize regular templates to apply complex configuration, keeping them small and making them reusable aids in making ongoing changes after initial deployment. Lastly, in the Wired Automation lab, through Composite Templates, we enable you with an example of a composite template that reuses multiple regular templates in its construction.

As we learn more about building templates it makes sense to start trying various concepts covered within the Tutorial sections about writing with templates with both Velocity and Jinja2 scripting languages. You can find additional resources within the GitHub repo here:

 

Velocity Language

  • Velocity Variables – This section explains Template Variables in depth, and how and where to use them
  • Velocity Scripting – This section will dive into Velocity Language Template Scripting constructs and use cases
  • Advanced Velocity Scripting – This section will dive into Advanced Velocity Language Template examples

Jinja2 Language

  • Jinja2 Variables – This section explains Template Variables in depth, and how and where to use them
  • Jinja2 Scripting – This section will dive into Jinja2 Language Template Scripting constructs and use cases
  • Advanced Jinja2 Scripting – This section will dive into Advanced Jinja2 Language Template examples

Lab Topics

We will gain a practical understanding of the steps associated with setting up Catalyst Center and an environment to support DayN regular templates to deliver device configuration during these labs. The labs aim to aid engineers in rapidly beginning using Catalyst Center automation and help them work towards a template strategy. Additionally, these labs will give customers a permanent place to try out the regular and composite templates and include configurations for various use cases. Finally, this environment will enable engineers to reduce the time and effort needed to instantiate the network.

  1. Creating a DayN Template by importing a JSON file
  2. Building a Project by importing a JSON file
  3. Designing and modifying a Composite Template sequence.
  4. Modifying a Network Profile
  5. Provisioning the device
  6. Resyncing the device

Template Import and Export

In these labs, we will use JSON files to Import and Export templates to Catalyst Center to reduce the time required to deploy. This capability also includes all the elements edited in the form editor, so all the various settings are sent with the logical cli constructs. This results in a valuable tool for moving templates from test environments to production.

Project Import and Export

In these labs, we will use JSON files to Import and Export entire projects. This includes regular templates, composite templates, and settings to Catalyst Center to reduce the time required to deploy. This capability also includes all the elements edited in the form editor, so all the various settings are sent with the logical cli constructs. This results in a helpful tool for moving entire projects from test environments to production.

Project Import

Creating a Composite Template

In these labs, we will use JSON files to Import composite templates, and then we will modify it to include multiple regular templates for provisioning. Composite templates allow for the reuse of multiple regular templates, which will enable us to modularize our code for reuse, thereby using smaller chunks of configuration. Composite templates also allow us one place to make changes that affect a broader set of devices. Thus, if we upgrade one regular template applied to multiple composite templates, we may effect change on a broader set of devices. This also allows us to reduce the duplication of efforts and minimize the administrator’s amount of effort.

Composite Template

Template Examples

In this lab, we provide JSON files, examples of templates that you may Import to Catalyst Center to reduce the time required to deploy. This alleviates the guesswork involved in figuring out how a variable might be set up, as all the form editor elements are also included within the JSON file.

Template example

Lab Flexibility

While using these labs you may modify them in any way to support your use case. We use a layer two trunk across a port-channel for connectivity within our examples. Equally, you could test out other connectivity methods for layer three routed access. Also, please note that the examples given may be used outside DCLOUD within a customer on-prem lab or production after user modification.

How can I get started?

Within DCLOUD, several sandbox-type labs are available. These self-contained environments are there to allow you to use them as you please within the time scheduled. In addition, this allows us a place to start practicing various concepts without fear of impacting production environments.

As a result, we hope to demystify some of the complexities of setting up automation and help guide customers through the caveats. Therefore, to aid customers in the transition toward automation, we have put together a set of small helpful labs within a GitHub repository. In this way, these self-guided labs provide a glimpse into the fundamentals of building velocity templates and offer examples that you can download and expand from. In addition, the sample templates and JSON files supplied are for easy import into Catalyst Centers’ template editor for quicker adoption. Lastly, some scripts are ready-made excerpts of code that allow you to build the environment to test.

First, in a practical lab guide, we step by step delve into the concepts of building templates and methodologies for using both Onboarding and DayN templates. Second, we provide answers and explanations to many of the questions that come up during automation workshops. Our hope is that you find the information both helpful and informative. We hope to give a well-rounded explanation of automation methods and concepts you can expand upon for production purposes. Finally, the Wired Automation lab the DayN Template content explains the overall DayN device configuration setup steps.

Where can I test and try these labs?

DCLOUD Lab Environment

To help customers succeed with Cisco Catalyst Center automation, you may utilize the above labs as they have been designed to work within DCLOUD’s Cisco Enterprise Networks Hardware Sandbox Labs in either:

  1. Cisco Enterprise Networks Hardware Sandbox West DC
  2. Cisco Enterprise Networks Hardware Sandbox East DC

The DCLOUD labs allow you to run these labs and gives an environment to try the various code samples. You may choose to develop and export your code for use in production environments. Also, this gives you an environment where you can safely POC/POV methods and steps without harming your production environments. The DCLOUD environment also negates the need for shipping equipment, lead times, and licensing issues needed to get moving rapidly. Please do adhere to the best practices for the DCLOUD environment when using it.

Lab Connectivity

The environment allows for use with a web-based browser client for VPN-less connectivity, access as well as AnyConnect VPN client connectivity for those who prefer it. You may choose from labs hosted out of our San Jose Facilities by selecting US West. Choose the Cisco Enterprise Network Sandbox. To access this or any other content, including demonstrations, labs, and training in DCLOUD please work with your Cisco Account team or Cisco Partner Account Team directly. Your Account teams will schedule the session and share it for you to use. Once booked follow the guide within GitHub to complete the tasks adhering to the best practices of the DCLOUD environment.

Content

The Wired Automation lab content is located within the existing DNAC-TEMPLATES repository to give a one-stop-shop for all the necessary tools, scripts, templates, and code samples. Within it are six modules, which build upon the tutorials to test the methods in a lab environment. The repository was featured in a previous post on Cisco Blogs about Catalyst Center Templates earlier in May 2021.

Additional Information

Catalyst Center Template Labs

The previously named DNAC Template LABS within the DNAC-TEMPLATES GitHub repository aim to guide you through the typical steps required to enable the various automation tasks delivered by Catalyst Center. This lab will give examples of templates used in Catalyst Center that we can modify for our use and test on equipment within the LAB environment. Additional information within the lab provides a well-rounded explanation of Automation methods with Templates. Lastly, the lab allows for customers to use Catalyst Center workflows to practice deploying Onboarding, DayN Templates, and Application Policy automation on both Wired and Wireless Platforms.

This lab’s goal is to be a practical aid for engineers developing a template strategy. Secondarily, to aid those engineers in rapidly adopting Catalyst Center automation.  Additionally, customers will gain a permanent place to try out the templates and include configurations for various use cases. Finally, this environment will enable engineers to reduce the time and effort needed to instantiate the network.

As a result, you will gain experience in setting up Plug and Play onboarding and templates. Additionally, you will use advanced templating methods and troubleshooting tools. These may help during faultfinding to determine what is failing in a deployment.

Catalyst Center Labs

Please use this menu to navigate the various sections of this GitHub repository. Within the multiple folders are examples and explanation readme files for reference. There are now two sets of labs, and these are being continually expanded upon.

New Catalyst Center Lab Content

Please use this menu to navigate the various sections of this GitHub repository. Within the multiple folders are examples and explanation readme files for reference. There are now two sets of labs, and these are being continually expanded upon.

This newer and more modular lab approach is designed to deal with and includes concepts from the legacy labs in a newer more modular format.

  1. Lab 1 Wired Automation – Covers green and brown field use cases (allow 4.0 hrs)
  2. Lab 2 Wireless Automation – Covers traditional wireless automation (allow 4.0 hrs)
  3. Lab 4 Rest-API Orchestration – Covers automation of Cisco Catalyst Center via Postman with Rest-API (allow 2.0 hrs)
  4. Lab 7 CICD Orchestration – Covers Python with JENKINS orchestration via REST-API (allow 4.0 hrs)

We will share additional labs and content in an ongoing effort to fulfill all your automation needs with Catalyst Center.

In conclusion, if you found this set of labs and repository 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 on social!

Check out our Cisco Networking video channel

Subscribe to the Networking blog

 

Share:



Source link