You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to update the untagged or tagged VLANs of a virtual machine interface through the API, the request fails with an internal server error. This can be easily replicated in pynetbox, e.g.:
iface=nb.dcim.interfaces.get(<IDofVirtualMachineInterface>)
iface.untagged_vlan=<IDofvalidVLAN># or: iface.tagged_vlans = [<VLAN ID 1>, <VLAN ID 2>, ...]iface.save()
The reason behind this can be easily found within the source code, where the newly assigned VLANs are being compared against device.site - however in case of a virtual machine interface, the device attribute is always None, which leads to AttributeError: NoneType object has no attribute site.
The text was updated successfully, but these errors were encountered:
The reason behind this can be easily found within the source code
That links to the DCIM interface serializer. VM interfaces utilize a different set of serializers. As @vink78 points out, the mode, untagged_vlan, and tagged_vlan fields are missing from the virtualization serializers.
I've the same issue with the webui.
This would need to be addressed under a separate issue.
Issue type
[ ] Feature request
[X] Bug report
[ ] Documentation
Environment
Description
When trying to update the untagged or tagged VLANs of a virtual machine interface through the API, the request fails with an internal server error. This can be easily replicated in pynetbox, e.g.:
The reason behind this can be easily found within the source code, where the newly assigned VLANs are being compared against device.site - however in case of a virtual machine interface, the device attribute is always None, which leads to AttributeError: NoneType object has no attribute site.
The text was updated successfully, but these errors were encountered: