cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
717
Views
2
Helpful
7
Replies

Single Site, different switch models

elemzy
Level 1
Level 1

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?

1 Accepted Solution

Accepted Solutions

Torbjørn
Spotlight
Spotlight

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.

Happy to help! Please mark as helpful/solution if applicable.
Get in touch: https://torbjorn.dev

View solution in original post

7 Replies 7

Torbjørn
Spotlight
Spotlight

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.

Happy to help! Please mark as helpful/solution if applicable.
Get in touch: https://torbjorn.dev

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.

 

Worked like a charm. Same site, same profile, different templates with unique characteristics, different tags based on a chosen device identifier.

Thanks.

Preston Chilcote
Cisco Employee
Cisco Employee

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.

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

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

Screenshot 2023-10-26 at 11.19.51 AM.png

 

Will try this out.

Thanks.