Change DeviceType Source to Avoid Duplicate DeviceTypes
emdeefive opened this issue · 5 comments
Environment
- Nautobot version: 2.3.2
- nautobot-ssot version: 3.1.0
Proposed Functionality
It would be nice if the DeviceTypes were pulled from the DeviceTypes repo rather than the yml files included in this repo. Having the DeviceType yml files in two different locations can cause them to get out of sync and can result in duplicate DeviceTypes within Nautobot resulting in a major headache.
Use Case
Perhaps the desired DeviceTypes could be specified in the PLUGINS_CONFIG settings rather than the yml files and then the requested DeviceTypes could be pulled from the DeviceTypes repo. Perhaps something like this:
PLUGINS_CONFIG = {
"nautobot_ssot": {
"aci_devicetypes": [
"N2K-C2348TQ-10GE",
"N2K-C2348UPQ-10GE",
"N9K-C93108LC-EX"
]
}
}
I'm assuming this is in reference to the ACI integration. In the future, please try to be more specific about the issue/feature you're discussing.
Hi, yes, thank you Justin. For clarification, yes this enhancement/feature request is regarding the DeviceType template files for the ACI integration.
So in regards to your request, upon further review, I'm not quite sure why you'd want to pull them from the GitRepo directly. They're identical to what's used in the App. The App doesn't actually use all the data from the template. If you look at the code you'll see that it's only actually pulling the model, manufacturer_name, part_number, comments, and u_height keys from the DeviceType template.
What I think you're asking for is to have the templates used in the GitRepo to be compatible with what's pulled from within the App. Unfortunately, that's not possible as the templates in the GitRepo contain interfaces and other pieces of data that will cause the SSoT portion to bomb out as it's unaware of interfaces and other parts of the DeviceType. It builds those during the data loading process.
Hi Justin, thank you for the quick response. I'm reporting this issue on behalf of another user so bear with me. I do believe the code loads the Interfaces (rather than InterfaceTypes) from the files here, doesn't it?
So if, for example, a user had already used the Welcome Wizard app to import APIC-L3 DeviceType from this library and then ran ACI SSOT it would duplicate and create a second DeviceType using this similar (but different) template file which has a different model name and interface list.
The user also provided this example, if the ACI SSOT Integration is importing the Interface list from the template file (if I understand the code snipped above correctly) these interfaces are all different types depending on which template file is loaded so if using Welcome Wizard and ACI SSOT Integration might conflict?
ACI SSOT Integration Template File 93180YC-EX
DeviceType Library Template File 93180YC-EX
The concern as I understand it is that the two different apps (Welcome Wizard and SSOT ACI Integration) are both creating DeviceTypes for the same model but with different configurations like the examples above.
Please review and me know what you think.
@emdeefive It uses a combination of data from ACI and from the template to load into the Interface DiffSync model. It appears to only be using the Interface names and the rest is from ACI. That's not the problem though. I'm quite familiar with the issue being discussed as it's common to SSoT. The problem is that the DeviceType that is created once the template from the GitRepo is imported any Device that is created from that DeviceType template will be created with all relevant pieces, including Interfaces, console ports, etc. The problem occurs with the SSoT integration not being AWARE of those additional parts. The only information it's aware of is what is loaded from ACI and there is an assumption that Devices that are created do NOT contain any additional parts. If there is an Interface that is already created on a Device, say from the DeviceType template, then it will error when it tries to "create" that same Interface from the data it's been supplied. The DeviceType templates that are in the Welcome Wizard are NOT compatible with the ACI integration and you can NOT use both at the same time without causing this problem.
We quite specifically call this issue out in the Warning at the bottom of the Developing Jobs documentation.