Inability to install multiple of the same module that has compenents #8518

Closed
opened 2025-12-29 20:37:43 +01:00 by adam · 4 comments
Owner

Originally created by @Mailstorm-ctrl on GitHub (Aug 26, 2023).

NetBox version

v3.5.8

Python version

3.8

Steps to Reproduce

  1. Create a device with 2 module bays (such as PSU1 and PSU2)
  2. Create a module type (such as 800W PSU)
  3. Add a power port to the module type (Can do {module} or not as the name...doesn't matter)
  4. Attempt to populate PSU1 and PSU2 with the same module type
  5. Watch how you can't add PSU2 because PSU1 already exist?

Expected Behavior

I expected the second module to be installed and an additional powerport to be made on the device representing the power port of the second PSU

This might also be a misunderstanding but this doesn't seem like intended behavior

Observed Behavior

Error PowerPort PSU1 already exist

Originally created by @Mailstorm-ctrl on GitHub (Aug 26, 2023). ### NetBox version v3.5.8 ### Python version 3.8 ### Steps to Reproduce 1. Create a device with 2 module bays (such as PSU1 and PSU2) 2. Create a module type (such as 800W PSU) 3. Add a power port to the module type (Can do {module} or not as the name...doesn't matter) 4. Attempt to populate PSU1 and PSU2 with the same module type 5. Watch how you can't add PSU2 because PSU1 already exist? ### Expected Behavior I expected the second module to be installed and an additional powerport to be made on the device representing the power port of the second PSU This might also be a misunderstanding but this doesn't seem like intended behavior ### Observed Behavior Error PowerPort PSU1 already exist
adam closed this issue 2025-12-29 20:37:43 +01:00
Author
Owner

@pv2b commented on GitHub (Aug 26, 2023):

Hi!

I think this is a usage error, not a bug. Please refer to the chapter on Automatic Device Renaming in the Module Types documentation.

It's not clear to me what you're doing exactly, but you'll need to:

  1. Populate the "position" field in the module bay with unique values. For example, "1" and "2".
  2. Set the name of the Power Port Template to "PSU{module}".

The {module} string will be replaced with the value of the position of the Module Bay. If you're not setting the position values on the module bay, it won't work though.

If I'm wrong though, and this is a bug, please provide a minimal example of all steps required to create, from scratch, a device template, module template, and power port template that exhibits this behaviour.

@pv2b commented on GitHub (Aug 26, 2023): Hi! I think this is a usage error, not a bug. Please refer to the [chapter on Automatic Device Renaming](https://demo.netbox.dev/static/docs/core-functionality/modules/#automatic-component-renaming) in the Module Types documentation. It's not clear to me what you're doing exactly, but you'll need to: 1. Populate the "position" field in the module bay with unique values. For example, "1" and "2". 2. Set the name of the Power Port Template to "PSU{module}". The `{module}` string will be replaced with the value of the *position* of the Module Bay. If you're not setting the position values on the module bay, it won't work though. If I'm wrong though, and this is a bug, please provide a minimal example of all steps required to create, from scratch, a device template, module template, and power port template that exhibits this behaviour.
Author
Owner

@kkthxbye-code commented on GitHub (Aug 26, 2023):

As pv2b says this is not a bug. Component names are unique and that is intended.

@kkthxbye-code commented on GitHub (Aug 26, 2023): As pv2b says this is not a bug. Component names are unique and that is intended.
Author
Owner

@Mailstorm-ctrl commented on GitHub (Aug 27, 2023):

I guess I wasn't clear so I'll go over it from the beginning.

For device template, I'm using the HPE ProLiant DL560 Gen10 from the device library. I import that exactly as it appears. The following components get created within:

  1. 3 Module Bays
    • FlexLOM w/ position of FlexLOM
    • PSU1 w/ position of PSU1
    • PSU2 w/ position of PSU2
  2. 5 Interfaces
    • Gig-E 1
    • Gig-E 2
    • Gig-E 3
    • Gig-E 4
    • iLO
  3. 2 Console Ports
    • Serial
    • VGA

I create a Module Type with the following information:

  • Manufacturer HPE

  • Model: 800W PSU

  1. After creation, I add a component of type Power Port and assign it to the module type I just made (800W PSU). For testing...I just made the name PSU-{module}
  2. I now go to a device I made using the DL560 as the device type.
  3. I attach my module to PSU1 slot (from the Module Bays tab in the device) and do Replicate components.
  4. When I go to the device power ports I now see an entry for PSU-PSU1
  5. I go back to Module bays and repeat step 3 with Module Bay PSU2.
  6. I get an error saying PowerPort - PSU-PSU1 already exist.

Now that I'm thinking about it...it's almost like it's just ignoring my Module bay choice. Because it seems like its trying to make PowerPort - PSU-PSU1 when really it should be making PowerPort - PSU-PSU2.

@Mailstorm-ctrl commented on GitHub (Aug 27, 2023): I guess I wasn't clear so I'll go over it from the beginning. For device template, I'm using the HPE ProLiant DL560 Gen10 from the device library. I import that exactly as it appears. The following components get created within: 1. 3 Module Bays - FlexLOM w/ position of FlexLOM - PSU1 w/ position of PSU1 - PSU2 w/ position of PSU2 2. 5 Interfaces - Gig-E 1 - Gig-E 2 - Gig-E 3 - Gig-E 4 - iLO 3. 2 Console Ports - Serial - VGA I create a Module Type with the following information: - Manufacturer HPE - Model: 800W PSU 1. After creation, I add a component of type Power Port and assign it to the module type I just made (800W PSU). For testing...I just made the name PSU-{module} 2. I now go to a device I made using the DL560 as the device type. 3. I attach my module to PSU1 slot (from the Module Bays tab in the device) and do Replicate components. 4. When I go to the device power ports I now see an entry for PSU-PSU1 5. I go back to Module bays and repeat step 3 with Module Bay PSU2. 6. I get an error saying PowerPort - PSU-PSU1 already exist. Now that I'm thinking about it...it's almost like it's just ignoring my Module bay choice. Because it seems like its trying to make PowerPort - PSU-PSU1 when really it should be making PowerPort - PSU-PSU2.
Author
Owner

@Mailstorm-ctrl commented on GitHub (Aug 27, 2023):

Now that I'm thinking about it...it's almost like it's just ignoring my Module bay choice. Because it seems like its trying to make PowerPort - PSU-PSU1 when really it should be making PowerPort - PSU-PSU2.

Well howdy ho this is what it was. In the yaml file the position of PSU2 is PSU1...so that's what my issue was.

@Mailstorm-ctrl commented on GitHub (Aug 27, 2023): > Now that I'm thinking about it...it's almost like it's just ignoring my Module bay choice. Because it seems like its trying to make PowerPort - PSU-PSU1 when really it should be making PowerPort - PSU-PSU2. Well howdy ho this is what it was. In the yaml file the position of PSU2 is PSU1...so that's what my issue was.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8518