Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow creation of cables between sites #2897

Closed
candlerb opened this issue Feb 14, 2019 · 6 comments
Closed

Disallow creation of cables between sites #2897

candlerb opened this issue Feb 14, 2019 · 6 comments

Comments

@candlerb
Copy link
Contributor

Environment

  • Python version: 3.5.2
  • NetBox version: 2.5.6

Steps to Reproduce

  1. Create device A in site 1
  2. Create device B in site 2
  3. Create a cable between device A and device B

Expected Behavior

This should be forbidden - "circuits" exist for site-to-site links.

As far as I can see, it used to be forbidden way back (#49).

Observed Behavior

Inter-site cable can be created.

This is a Bad Thing™. Suppose you have 100 similar POPs, and you want to record a cable between pop1-rtr1 and pop1-sw2. Netbox lets you accidentally add a cable between pop1-rtr1 and pop2-sw2.

@tb-killa
Copy link
Contributor

I think this depends on usage of netbox :

How you choose to use sites will depend on the nature of your organization, but typically a site will equate to a building or campus.

I think it should be allowed to build this type of connections.

@candlerb
Copy link
Contributor Author

Fair enough. I don't mind a global switch, similar to ENFORCE_GLOBAL_UNIQUE for IP addresses.

Less good would be a dialog box ("You are about to create a cable between two different sites, are you sure?"). But with that I'd have to run a periodic report to check for violations.

Rackgroups could be another way to represent buildings on a campus - but I can see you might be using it for some other purpose (like rooms within a building)

@candlerb
Copy link
Contributor Author

Aha, I found the commit at which adding connections between sites was allowed: 900ba14

So this needs to change from "bug report" to "feature request".

@candlerb
Copy link
Contributor Author

Environment

  • Python version: 3.5.2
  • NetBox version: 2.5.6

Proposed Functionality

Simplest: Add a global switch to prevent creation of cables between devices in different sites.

More complex variants are possible (e.g. having a flag at Region level which allows cables to be created between sites in that Region).

Use Case

Reducing the possible cable endpoints reduces data errors.

Suppose you have 100 similar POPs, and you want to record a cable between pop1-rtr1 and pop1-sw2. At the moment, Netbox lets you accidentally add a cable between pop1-rtr1 and pop2-sw2.

This is a subtle error and may not go noticed for some time (although it could be identified by suitable application of the Reports feature)

Database Changes

None

External Dependencies

None

@jeremystretch
Copy link
Member

As others have pointed out, this depends entirely on how you choose to use sites. NetBox doesn't make any assumptions in that regard.

I also don't see any need for a switch for this. You're filtering by site or device name when you create a cable anyway. It would be yet another layer of arbitrary validation we would need to hotwire in various places.

@candlerb
Copy link
Contributor Author

You're filtering by site or device name when you create a cable anyway.

Not by default. When I click on the "Connect" button next to an interface, this is what I get:

image

That is, I can enter any part of a device's name. (Aside: requires unique device names, ref #2669)

However, if I click the "Select" tab, then it prompts for the site (and rack).

image

When using this tab, it's not as easy to make a mistake. However if the "Site" and "Rack" from the A side were already selected as defaults, this would be even better. (Most of the time you're connecting within the rack, and even when not, you still have to select the rack and/or site)

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants