-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Bug] VLAN is assigned to group Default netbox-ssot vlan group (scope: None); cannot also assign to site Foo. #358
Comments
Actually Example : Vlan{ID: 90, Name: VM Network, Vid: 10, Status: active, Site: 13}
Vlan{ID: 96, Name: VM Network, Vid: 10, Status: active, Site: 14} From |
@bb-Ricardo can you please confirm this is the current implementation in |
It seems to come from here https://github.com/bl4ko/netbox-ssot/blob/main/internal/netbox/inventory/add_items.go#L695 IMHO |
Oh, I see this is a limitation on the netbox's side. If a vlan is assigned to vlangroup, and vlangroup is not assigned to a site, this vlan can't be assigned a site, because site isn't the same as vlangroup's one. So I guess to implement this feature, I need to change the logic of assigning vlangroup to vlans. If vlan is a assigned a site than the vlangroup for this vlan should also be part of the site... |
Hi, indeed, the Interface, IP and VLAN syncing is not trivial for vCenter objects: The logic is implemented here: https://github.com/bb-Ricardo/netbox-sync/blob/3c07a4c001443f50d95ae4668c931599e41efeae/module/sources/common/source_base.py#L234 this function is used on each interface of a Host or VM:
This has been done to comply to the object relations and constrains within NetBox |
Yes, the VLAN Group needs to be defined with the site constrain and matched accordingly. To give the user the flexibility to configure this, these config options have been added: |
And I forgot: After all sources are synced, then the IP address assignment for active and non active interfaces are reevaluated and set accordingly. Only after you have discovered all objects and interfaces you are able to tell for sure if an IP address has been moved from one object/interface to another. And if this was the primary IP then this primary IP has to be first removed from the object, then the IP needs to be assigned to the new object interface and then the primary can be defined to the newly assigned object. Otherwise NetBox will complain all the time. |
Hi, thanks for all of the resources. I see this is a quite complex problem. And this logic must not only be implemented for vcenter, but also for other sources, so I will try to create common functions that can be shared. I will dive into it. |
I know, this took a lot of iterations to get to this state (still believe it's missing some edge cases). I also moved this to the common source section as it is indeed, a common concept of assigning relations. |
Is this urgent?
Yes, it's critical
How are you running netbox-ssot?
From source (Go)
What is the version of netbox-ssot
Running version unknown built on unknown (commit unknown)
Which module has the issue?
General (not module-specific)
Share your configuration
What is the problem?
VLAN is not created in Netbox.
Steps to reproduce
netbox-ssot -config ./config.yml
What did you expect to happen?
It should work
What actually happened?
Share DEBUG-level logs (remove sensitive information)
Share your environment details
No response
The text was updated successfully, but these errors were encountered: