Support for offline storage of modules #10949

Open
opened 2025-12-29 21:38:12 +01:00 by adam · 6 comments
Owner

Originally created by @jeremystretch on GitHub (Mar 25, 2025).

NetBox version

v4.2.6

Feature type

Data model extension

Proposed functionality

Add ForeignKeys to Site and Location on the Module model, replicating what exists today on the Device model. If the module is installed within a device, these values will be inherited from the parent device. If not installed within a device, the module can be assigned to a site and (optionally) a location designated for storage.

We should also add an explicit "storage" choice for the status fields on both Device and Module.

Use case

Introducing a relationship between a module and a site/location enables a module to exist outside the context of a parent device. Although modules generally are not considered operational on their own, this is useful for tracking modules for inventory purposes.

Database changes

  • Add site and location ForeignKeys on Module

External dependencies

N/A

Originally created by @jeremystretch on GitHub (Mar 25, 2025). ### NetBox version v4.2.6 ### Feature type Data model extension ### Proposed functionality Add ForeignKeys to Site and Location on the Module model, replicating what exists today on the Device model. If the module is installed within a device, these values will be inherited from the parent device. If not installed within a device, the module can be assigned to a site and (optionally) a location designated for storage. We should also add an explicit "storage" choice for the `status` fields on both Device and Module. ### Use case Introducing a relationship between a module and a site/location enables a module to exist outside the context of a parent device. Although modules generally are not considered operational on their own, this is useful for tracking modules for inventory purposes. ### Database changes - Add `site` and `location` ForeignKeys on Module ### External dependencies N/A
adam added the type: featurenetboxneeds milestonestatus: backlogcomplexity: high labels 2025-12-29 21:38:12 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 31, 2025):

Unfortunately this is going to be more complicated than originally assumed. One of the reasons NetBox currently prohibits moving modules among devices is that the individual components belonging to a module may introduce blocking relationships. For example, interfaces belonging to a module are also assigned to a device; deinstalling the module requires severing that relationship. This is especially involved where those interfaces (or similar components) serve as cable termination points.

Another complicating factor is token-based component names. When a component template is added to a module type, its name can be tokenized to effect automatic naming according to the module bay in which it is installed. "Removing" a module requires reversing that renaming function, however no canonical backward path currently exists.

This is going to require substantially more planning and implementation work than I had hoped. Given that we're due to release the v4.3 beta in just two weeks, I'm going to bump it from that milestone.

@jeremystretch commented on GitHub (Mar 31, 2025): Unfortunately this is going to be more complicated than originally assumed. One of the reasons NetBox currently prohibits moving modules among devices is that the individual components belonging to a module may introduce blocking relationships. For example, interfaces belonging to a module are also assigned to a device; deinstalling the module requires severing that relationship. This is especially involved where those interfaces (or similar components) serve as cable termination points. Another complicating factor is token-based component names. When a component template is added to a module type, its name can be tokenized to effect automatic naming according to the module bay in which it is installed. "Removing" a module requires reversing that renaming function, however no canonical backward path currently exists. This is going to require substantially more planning and implementation work than I had hoped. Given that we're due to release the v4.3 beta in just two weeks, I'm going to bump it from that milestone.
Author
Owner

@alehaa commented on GitHub (Apr 15, 2025):

@jeremystretch should this be a replacement for the netbox-inventory plugin? Right now the communication when using the plugin is that an asset is something in inventory and it becomes a Device when in use. I fear some confusion for users of this plugin if a device or module can have the status "stored" as the line between Asset and Device seems to blur.

@alehaa commented on GitHub (Apr 15, 2025): @jeremystretch should this be a replacement for the [netbox-inventory](https://github.com/ArnesSI/netbox-inventory) plugin? Right now the communication when using the plugin is that an asset is something in inventory and it becomes a `Device` when in use. I fear some confusion for users of this plugin if a device or module can have the status "stored" as the line between `Asset` and `Device` seems to blur.
Author
Owner

@kquinsland commented on GitHub (Jun 22, 2025):

I am a +1 for this as well. I have several spare disks/dimms ... etc that absolutely fit the definition of "module, to be installed in a module-bay" but turning a module-type into an actual module requires specifying a device which defeats the purpose of "module that will be installed in any one of $devices, as soon as $device shows hardware issues".

I didn't understand that the inventory plugin was distinct from the soon-to-be-removed "device inventory items" so I guess that's where i'll look in the mean time.

I fear some confusion for users of this plugin if a device or module can have the status "stored" as the line between Asset and Device seems to blur.

I'd argue that's already starting to happen :D. Even though the docs are clear:

A module is a field-replaceable hardware component installed within a device which...

I just assumed that a module could also be un-installed.

Unfortunately this is going to be more complicated than originally assumed. One of the reasons NetBox currently prohibits moving modules among devices is that the individual components belonging to a module may introduce blocking relationships.

You could avoid a lot of this complexity by having an intermediate type, no?

ModuleType can be "hydrated" to form a new/unique instance of Module. This is where you'd supply serial number and the profile / additional attributes. the Module type can then be converted to an InstalledModule type which then requires the additional device/bay ... etc. info.

stateDiagram-v2
    [*] --> ModuleType: define

    state ModuleType {
        [*] --> Defined
        Defined --> Module: instantiate\n(assign serial number)

        state Module {
            [*] --> Uninstalled
            Uninstalled --> InstalledModule: install\n(assign device, module-bay)
            InstalledModule --> Uninstalled: uninstall\n(remove device, module-bay)
        }
    }

@kquinsland commented on GitHub (Jun 22, 2025): I am a +1 for this as well. I have several spare disks/dimms ... etc that absolutely fit the definition of "module, to be installed in a module-bay" but turning a module-type into an actual module _requires_ specifying a device which defeats the purpose of "module that will be installed in any one of $devices, as soon as $device shows hardware issues". I didn't understand that the [inventory plugin](https://github.com/netbox-community/netbox/issues/19003#issuecomment-2807395322) was distinct from the [soon-to-be-removed "device inventory items"](https://netboxlabs.com/docs/netbox/models/dcim/inventoryitem/) so I guess that's where i'll look in the mean time. > I fear some confusion for users of this plugin if a device or module can have the status "stored" as the line between Asset and Device seems to blur. I'd argue that's already starting to happen :D. Even though the docs are clear: > A module is a field-replaceable hardware component _**installed**_ within a device which... I just _assumed_ that a module could also be _un-installed_. > Unfortunately this is going to be more complicated than originally assumed. One of the reasons NetBox currently prohibits moving modules among devices is that the individual components belonging to a module may introduce blocking relationships. You could avoid a lot of this complexity by having an intermediate type, no? ModuleType can be "hydrated" to form a new/unique instance of Module. This is where you'd supply serial number and the profile / additional attributes. the Module type can then be converted to an InstalledModule type which then requires the additional device/bay ... etc. info. ```mermaid stateDiagram-v2 [*] --> ModuleType: define state ModuleType { [*] --> Defined Defined --> Module: instantiate\n(assign serial number) state Module { [*] --> Uninstalled Uninstalled --> InstalledModule: install\n(assign device, module-bay) InstalledModule --> Uninstalled: uninstall\n(remove device, module-bay) } } ```
Author
Owner

@kquinsland commented on GitHub (Jun 22, 2025):

Related usecase/issue: https://github.com/netbox-community/netbox/issues/15289

@kquinsland commented on GitHub (Jun 22, 2025): Related usecase/issue: https://github.com/netbox-community/netbox/issues/15289
Author
Owner

@TheFlyingCorpse commented on GitHub (Nov 3, 2025):

This is needed for us to move away from Inventory Items, since a module isn't deleted IRL just because it is removed from a Device's Module Bay. We have thousands of SFP's, SIM cards, and whatnot. They shouldn't be deleted just because they are detached from a slot.

@TheFlyingCorpse commented on GitHub (Nov 3, 2025): This is needed for us to move away from Inventory Items, since a module isn't deleted IRL just because it is removed from a Device's Module Bay. We have thousands of SFP's, SIM cards, and whatnot. They shouldn't be deleted just because they are detached from a slot.
Author
Owner

@BartZimmo commented on GitHub (Dec 5, 2025):

I also support this request.
The ability to add modules to NetBox without having to assign them to a module bay but just as spare parts or temporary not in use would be a big upgrade.
Certainly when we know inventory items will be deprecated.

@BartZimmo commented on GitHub (Dec 5, 2025): I also support this request. The ability to add modules to NetBox without having to assign them to a module bay but just as spare parts or temporary not in use would be a big upgrade. Certainly when we know inventory items will be deprecated.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10949