HewlettPackard / HewlettPackard/morpheus-netbox-plugin
When there are duplicate IP Subnets IPs are not syncing
- Dominant language
- Groovy
- Stars
- 1
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
When there are same IP prefixes and IPs exists in these prefixes (differens VRFs) there is issue with data sync to Morpheus:
```
2025-05-23_12:37:50.69737 - Field error in object 'com.morpheus.NetworkPoolIp' on field 'ipAddress': rejected value [10.10.20.1]; codes [com.morpheus.NetworkPoolIp.ipAddress.unique.error.com.morpheus.NetworkPoolIp.ipAddress,com.morpheus.NetworkPoolIp.ipAddress.unique.error.ipAddress,com.morpheus.NetworkPoolIp.ipAddress.unique.error.java.lang.String,com.morpheus.NetworkPoolIp.ipAddress.unique.error,networkPoolIp.ipAddress.unique.error.com.morpheus.NetworkPoolIp.ipAddress,networkPoolIp.ipAddress.unique.error.ipAddress,networkPoolIp.ipAddress.unique.error.java.lang.String,networkPoolIp.ipAddress.unique.error,com.morpheus.NetworkPoolIp.ipAddress.unique.com.morpheus.NetworkPoolIp.ipAddress,com.morpheus.NetworkPoolIp.ipAddress.unique.ipAddress,com.morpheus.NetworkPoolIp.ipAddress.unique.java.lang.String,com.morpheus.NetworkPoolIp.ipAddress.unique,networkPoolIp.ipAddress.unique.com.morpheus.NetworkPoolIp.ipAddress,networkPoolIp.ipAddress.unique.ipAddress,networkPoolIp.ipAddress.unique.java.lang.String,networkPoolIp.ipAddress.unique,unique.com.morpheus.NetworkPoolIp.ipAddress,unique.ipAddress,unique.java.lang.String,unique]; arguments [ipAddress,class com.morpheus.NetworkPoolIp,10.10.20.1]; default message [must be unique]
```
It is normal behavior to have same IP prefixes (IP Pools) and IPs for different customers in different VRFs.
Example:
We have 2 different network pools that are used in separate customers. Each of the pools have same subnet details (10.10.20.0/24) in each of these pools we have 10.10.20.1 IP address.
So from pool perspective there is only one IP address, from Global view there are 2 different polls each of them having 10.10.20.1.
As these are different objects in NetBox that should not be a problem (phpIPAM handles that properly).

Plugin needs to be adjusted to be able to manage these "duplications" and not fail.
The problem is that NetBox do not hold direct relation between IP and IP prefix (IP Pool).
Proposal to have Prefix + VRF to define unique pair (not just IP itself).
In NetBox VRF can "enforce-unique-space" (optional). When uniquenessin VRF is not selected then in general in NetBox itself cannot handle duplicate prefixes and IPs properly.
Having VRF + prefix as unique will solve 99% of cases. If uniqueness is not selected and there are duplicates then it would be ok for plugin to behave as it behaves now (but these cases will be edge cases)
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names no files or tests. Start by tracing the plugin's NetBox-to-Morpheus IP data-sync path and how IP uniqueness is validated, paying attention to the missing direct IP-to-prefix relationship. Done means duplicate IPs in distinct VRF and prefix contexts sync successfully without the reported uniqueness error, while the described edge cases remain understood.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100