- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 10:29 PM
Hi,
I have a site in DNAc for which I have created and assigned a network profile for DayN provisioning. This site, however, has multiple switch models, 9300-48 and 9300-24. Knowing that I can assign only one profile to a site, how can I have different templates to assign to the different switch models?
On a general note, how do you assign different templates to different devices in a single site, given Cisco's approach of a single profile with a single template to a site?
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 11:36 PM - edited 10-25-2023 11:43 PM
When you create the templates you can specify the specific device models it should apply to under "Properties> Device Type Details > Add Device Details, select Device Models". Using this you can create versions of templates for different switch models. When you add model-specific templates to the network profile they will only apply to the model specified in the template.
It might make more sense to apply templates by tags instead of device model. If so you can apply tags to the devices in your inventory and select which tags your template should apply to under "Additional Details > Device Tags" on your template.
EDIT: Just noticed that you are looking at different versions of the "same switch". To achieve what you want you will need apply templates by tags. The device model filtering isn't granular enough to specify different port-counts.
Get in touch: https://torbjorn.dev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 11:36 PM - edited 10-25-2023 11:43 PM
When you create the templates you can specify the specific device models it should apply to under "Properties> Device Type Details > Add Device Details, select Device Models". Using this you can create versions of templates for different switch models. When you add model-specific templates to the network profile they will only apply to the model specified in the template.
It might make more sense to apply templates by tags instead of device model. If so you can apply tags to the devices in your inventory and select which tags your template should apply to under "Additional Details > Device Tags" on your template.
EDIT: Just noticed that you are looking at different versions of the "same switch". To achieve what you want you will need apply templates by tags. The device model filtering isn't granular enough to specify different port-counts.
Get in touch: https://torbjorn.dev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 08:31 AM
Thanks, Torbjorn,
I can't find a detailed document describing how tag works, the cisco documents only described howto create them, but I'll play around it and let you know the result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 02:49 PM
Worked like a charm. Same site, same profile, different templates with unique characteristics, different tags based on a chosen device identifier.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 08:06 AM
How different are the templates? If they only really differ in the number of ports, I would plan to use the same template for both, and leverage the built in system variable for product ID to have DNA tell me which model it is, then a "for" loop to generate configs for the correct number of interfaces. Having a single template to edit when you need to make network wide changes should help keep things simpler in the future, since you only have to make the change in one place.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 08:34 AM
Hi Preston,
This sounds like a good idea. Can you point me to a sample document on how to use for loop? Or even a simple example.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 11:23 AM
Something like this:
#set ($int_count = $platform.split("-").get(1))
#if ($int_count.contains("24"))
#set ($int_count = 24)
#elseif ($int_count.contains("48"))
#set ($int_count = 48)
#end
#foreach ($x in [1..$int_count])
interface GigabitEthernet1/0/$x
description test
#end
attached is how to configure the "platform" variable to use a Bind to Source to retrieve the platform ID from the DNA Inventory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 02:49 PM
Will try this out.
Thanks.
