Interface name constraint #19710
nw-freakix
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
when adding a NIC as a module to a device netbox ( or rather the database) will complain when the interface name of the network card module type is colliding with a interface name of the device. I know that this can be circumvented when adding the {module} to the interface name in the module type definition. Unfortunately this does not work when you add a NIC to another Module first which is in a device. Netbox apparently then requries that you define {module} twice in the type definition. Which apparently on the other hand limits to always exact two levels for this Card.
device > module > NIC -> {module}-{module}-ge0 is required.
device > NIC -> {module}-ge0 is required and it does not work with {module}-{module}-ge0 anymore.
Anyway I looked around and found that a database is constraint is enforcing the interface-name - device uniqueness. I then went ahead and modified the constraint to include device_id, module_id and name which made my problem go away and can now have duplicate network interface names for a device as long as they are from different modules.
So the question is: Is this a safe change to extend the constraint? I mean it works for me right now, but not sure what breaks because of this. If there is no risk with that change can this change be the new default?
But maybe there is also a better approach which automatically resolves duplicates when a module is added, independend from adding it to a device or a module?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions