-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Moving primary ip address for a device to a new device generates Integrity error #11934
Comments
I'm not sure this should be the desired behavior. Primary IPs are explicitly designated, so automatically nullifying their assignments seems dangerous. Rather than handling this automatically, it would be safer to instead raise a validation failure, calling to the user's attention that the IP is assigned as primary for its current parent. |
Per #11905, this also concerns primary IP assignment for virtual machines. |
I wouldn't have a problem with that, we're currently working round this issue by undesignated the ip as primary and then moving the ip. |
Closely related (I think this is what the reporter in #11905 was trying to say):
If you click edit and re-save the device the primary IP will automatically disappear, so this state is not stable. |
somewhere along the line it was a (2) step process from GUI to remove a primary IP and I thought it was kind of annoying. After an upgrade (not sure which) this requirement was removed and I was happy until I started running into this Primary IP still assigned even though the IP was removed from the interface itself! This has been causing quite a few headaches, hopefully it gets fixed before too much longer. |
NetBox version
v3.4.5
Python version
3.8
Steps to Reproduce
We encountered this on our local version (3.4.2) but were able to reproduce on the demo instance (3.4.5)
Expected Behavior
IP address is updated to be set as primary ip for the new device, and assigned to the new interface, and is no longer primary ip address for the old device and is no longer assigned to the old interface.
Observed Behavior
The web server displays:
<class 'django.db.utils.IntegrityError'>
duplicate key value violates unique constraint "dcim_device_primary_ip4_id_key"
DETAIL: Key (primary_ip4_id)=(185) already exists.
The text was updated successfully, but these errors were encountered: