Open steven-douilliet opened 2 months ago
So this isn't a bug and this particular request is already being done here. The problem is it only does this if there's a single VLAN assigned as Nautobot only supports one VLAN to be assigned to a Prefix. So what it does in create() is that it assigns the first VLAN in the list to that attribute on the Prefix and the rest have a RelationshipAssociation created. Now in the update() method I do see that we're only updating the RelationshipAssociations, so we could potentially try and update the direct VLAN assignment, but I think we'd potentially have difficulty knowing which one we should be assigning there.
Hello,
I believe I initially described the problem incorrectly.
During the Infoblox to Nautobot sync, when a prefix is created, the VLAN is associated with the prefix via the relationship field. However, if we update the VLAN in Infoblox (for example, by modifying the VID), this change is not reflected in Nautobot (the VLAN associated with the prefix remains unchanged).
The code provided in my first post (in the Workaround section) fixes this issue and updates the VLAN field directly instead of the relationship field.
This bug seems fixed after updating to version 2.2.4. I tested adding and modifying the VLAN associated with a prefix from Infoblox, and the synchronization works correctly.
However, when I remove the VLAN from the prefix in Infoblox, Nautobot does not remove the VLAN from the prefix on its side.
Due to wanting to support earlier versions than 2.2.4 we can't update the code to do a M2M assignment of VLANs and Prefixes. When we update to SSoT 3.x and have a more recent version minimum we can look into making this change.
Environment
Expected Behavior
I expected Prefixes synchronization from Infoblox to Nautobot, including the associated VLANs.
During synchronization, Prefixes should be automatically updated or created and linked to VLANs using the VLAN field available in the Location/VLAN Assignment section (which contains fields for Locations, VLAN group, and VLAN).
Observed Behavior
The VLAN field from the Location/VLAN Assignment section is not set.
The SSoT plugin creates a Relationship Prefix -> VLAN and uses this field to associate the Prefix to VLAN, while the Prefix Model has a VLAN field which is a foreign key to the VLAN model.
So, the SSoT will update the relationship field instead of updating the VLAN field.
Workaround
Update VLAN field instead the relation ship: