UNABLE TO ADD SAME MODULE AGAIN IN SAME DEVICE #6574

Closed
opened 2025-12-29 19:42:33 +01:00 by adam · 5 comments
Owner

Originally created by @adarshharisree on GitHub (Jun 18, 2022).

NetBox version

v3.2.4

Python version

3.8

Steps to Reproduce

  1. CREATE A MODULE TYPE AND REAR PORT AND FRONT PORT
  2. CREATE A DEVICE TYPE WITH MORE THAN ONE MODULE BAY
  3. ADD A DEVICE OF THIS TYPE AND ADD THIS MODULE TO BAY ONE AGAIN ADD THE SAME MODULE TO BAY 2 THE ERROE OCCURS
image ERROR

Expected Behavior

We need to be able to add multiple modules of the same in a device.

Observed Behavior

I am getting error when adding the second module because of rear port name is the same.

Originally created by @adarshharisree on GitHub (Jun 18, 2022). ### NetBox version v3.2.4 ### Python version 3.8 ### Steps to Reproduce 1. CREATE A MODULE TYPE AND REAR PORT AND FRONT PORT 2. CREATE A DEVICE TYPE WITH MORE THAN ONE MODULE BAY 3. ADD A DEVICE OF THIS TYPE AND ADD THIS MODULE TO BAY ONE AGAIN ADD THE SAME MODULE TO BAY 2 THE ERROE OCCURS <img width="937" alt="image" src="https://user-images.githubusercontent.com/49467928/174449632-9a0706c5-ffaf-42e5-9db1-40203df91fb3.png"> ERROR ### Expected Behavior We need to be able to add multiple modules of the same in a device. ### Observed Behavior I am getting error when adding the second module because of rear port name is the same.
adam closed this issue 2025-12-29 19:42:33 +01:00
Author
Owner

@ekrichbaum commented on GitHub (Jun 18, 2022):

This occurs when you have items on your module with static naming. Example being a card with eth0 and con0. You add the first fine, but the second fails because there is already eth0 and con0. Realistically, the ports are not named like that in most cases. The module-type for slot 4 should have eth{module}/0 and con{module}/0 (from my example) yielding eth4/0 and con4/0 when added to the slot (assuming 4 is the position). This would occur for any type of element on the module-type.

@ekrichbaum commented on GitHub (Jun 18, 2022): This occurs when you have items on your module with static naming. Example being a card with eth0 and con0. You add the first fine, but the second fails because there is already eth0 and con0. Realistically, the ports are not named like that in most cases. The module-type for slot 4 should have eth{module}/0 and con{module}/0 (from my example) yielding eth4/0 and con4/0 when added to the slot (assuming 4 is the position). This would occur for any type of element on the module-type.
Author
Owner

@adarshharisree commented on GitHub (Jun 19, 2022):

Ya, I understand that, we need the option to add as you said. I can't find that in netbox

@adarshharisree commented on GitHub (Jun 19, 2022): Ya, I understand that, we need the option to add as you said. I can't find that in netbox
Author
Owner

@PieterL75 commented on GitHub (Jun 19, 2022):

as @ekrichbaum says :
When you create a module template, don't use static interface names (like gi1/1/1 or MPO_PORT), but a the 'module' variable in the template, so that the interfaces look like Gi{module}/1/1 or MPO_PORT{module}.
All ports that are part of a module will be added to the device itself, and two interfaces cannot have the same name on one device.
That {module} variable will make sure that all interfaces will have a different name per module.
Make sure that each module has a unique position value, as that value will be used for the {module} variable.

https://docs.netbox.dev/en/stable/release-notes/version-3.2/#modules-module-types-7844
https://docs.netbox.dev/en/stable/core-functionality/modules/#module-types

PS: don't use caps, you're kind of shouting now...

@PieterL75 commented on GitHub (Jun 19, 2022): as @ekrichbaum says : When you create a module template, don't use static interface names (like gi1/1/1 or MPO_PORT), but a the 'module' variable in the template, so that the interfaces look like Gi{module}/1/1 or MPO_PORT{module}. All ports that are part of a module will be added to the device itself, and two interfaces cannot have the same name on one device. That {module} variable will make sure that all interfaces will have a different name per module. Make sure that each module has a unique position value, as that value will be used for the {module} variable. https://docs.netbox.dev/en/stable/release-notes/version-3.2/#modules-module-types-7844 https://docs.netbox.dev/en/stable/core-functionality/modules/#module-types PS: don't use caps, you're kind of shouting now...
Author
Owner

@adarshharisree commented on GitHub (Jun 19, 2022):

Hi All,

@ekrichbaum @PieterL75 Thanks a lot for the support.

I got it and working

@adarshharisree commented on GitHub (Jun 19, 2022): Hi All, @ekrichbaum @PieterL75 Thanks a lot for the support. I got it and working
Author
Owner

@jeremystretch commented on GitHub (Jun 19, 2022):

In the future please don't use all caps when opening an issue. It's very annoying.

@jeremystretch commented on GitHub (Jun 19, 2022): In the future please don't use all caps when opening an issue. It's _very_ annoying.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6574