netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.08k stars 2.58k forks source link

Ability to assign a Tenant to a Device Component #7801

Closed erdems closed 2 years ago

erdems commented 2 years ago

NetBox version

v3.0.9

Feature type

Change to existing functionality

Proposed functionality

Add ability to assign a tenant to various device components, mainly:

Use case

In a Datacenter Provider environment, some host customer equipment and/or allocate / rent device bays to multiple tenants. A similar scenario goes in case of logical routers where one or more ports are allocated to a logical router that is left for the tenant to manage as they please.

Another scenario is the use of some security-related USB dongles where the provider essentially rents ports for tenant dongles. At the moment, netbox can't plan or keep track of those without potentially excessive use of tags with the same tenant slug. Even so, this approach won't make those ports/dongles/whatever show in tenant's summary page.

Database changes

Add a tenant_id field for device components, defaulting to NULL.

External dependencies

None.

jeremystretch commented 2 years ago

This doesn't make any sense to me. Tenancy in NetBox implies ownership. It's not practical to have multiple tenants own different parts of a device. I'm afraid you're trying to extend the concept of tenancy beyond its intended purpose. It seems like tags and/or custom fields would better serve your use cases.

erdems commented 2 years ago

Understood. However, especially in case of Blade Chassis or GNF or similar devices that support the concept of multi-tenancy within a single chassis, a tenant is solely and directly allocated a blade or a logical router, for instance. Although I understand this may not imply ownership in the generic sense of netbox, as in the tenant can't come and collect that linecard etc., that particular part/component still is theirs in terms of usage and management.

Do you think it would make sense to enhance the tenant's page to include / report custom fields or tags? IMHO, this would complicate things more.

DanSheps commented 2 years ago

Understood. However, especially in case of Blade Chassis or GNF or similar devices that support the concept of multi-tenancy within a single chassis, a tenant is solely and directly allocated a blade or a logical router, for instance. Although I understand this may not imply ownership in the generic sense of netbox, as in the tenant can't come and collect that linecard etc., that particular part/component still is theirs in terms of usage and management.

In a blade or chassis configuration, the chassis should be modeled separately from the the blades. The chassis should be owned by the provider (you) and the tenant shoudl be the owner of the blade which is slotted into one of the bays within the chassis. ONAP/GNF, you should probably be modelling as a virtual device with the appropriate tenant defined.

erdems commented 2 years ago

Thanks Dan; indeed I agree blade/chassis configuration could (and possibly should) be handled that way. In case of a GNF for instance, the 'router' is in fact one or more line-cards that are often leased to the tenant but sometimes even owned by them. There's also the case of USB dongles plugged to an UTN device where the dongles literally belong to the tenant. I guess it would be possible to treat the dongles as devices slotted in the ports, I'll give this a try.

Still, GNF's case looks problematic to me, maybe I'm missing a point.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

github-actions[bot] commented 2 years ago

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.