netbox-inventory icon indicating copy to clipboard operation
netbox-inventory copied to clipboard

implement asset groups (was: expand inventory item groups to cover all asset types)

Open matejv opened this issue 9 months ago • 1 comments

Expand inventory item groups to be able to contain all kinds of assets.

The plan is to add option for inventory item groups to specify (0 or more) device types, module types, rack types and inventory item types. Assets that match will be considered included in the group. Each device,... type can belong to multiple inventory item groups (Many To Many relations).

Since inventory item groups can be nested, any asset contained in a child group should also be considered to belong to parent groups (even in parent group does not explicitly specify the matching type).

We could possibly allow to set an arbitrary list of assets to belong to a group, though I'm not sure yet if I additional code complexity is worth it.

We might also rename inventory item group to something like asset group to better reflect the change in functionality.

One possible use case:

A network admin wants to see all hist network switches no matter the model or manufacturer. They would create a group called "network switches" and add all device types to it. This group would show all assets that are network switches and a breakdown by asset status.

Similarly a server admin can create a group for all their servers.

This will be a breaking change for anyone that uses API endpoints related to inventory item types and inventory item groups and also custom scripts or export templates.

related issues: #153 (probably), #225 (inventory items in netbox are going away)

matejv avatar Mar 26 '25 07:03 matejv

After thinking on this a bit more I've decided to leave inventory item groups as they are. I'll add "asset groups" as a new feature parallel to inventory item groups. I'll add a migration tool from existing inventory item groups to asset groups and encourage users to migrate.

This way we can have both feature side by side for a few releases and remove inventory item groups sometime in the feature - possibly when (if) inventory items are removed from netbox itself.

This way we don't have a breaking change release and no need for a complex django migration that could possibly break some exotic installations.

matejv avatar Oct 22 '25 12:10 matejv