Closed RWL-Dittrich closed 1 year ago
Hello,
Whenever I add an extra interface to one of the hosts that gets updated by proxbox the plugin fails with an error that relates to the MTU that's missing. When I add an MTU to the interface it gets another error.
To be sure, it's when you add the interface in netbox ? I didn't test this in our setup as I didn't have fully imported the components of our nodes in netbox.
I think the problem is here : https://github.com/netdevopsbr/netbox-proxbox/blob/v0.0.5/netbox_proxbox/proxbox_api/updates/node.py#L104
We can go with something like this :
'mtu' : int(iface.mtu) if iface.mtu else 1500
So after adding another interface (idrac) and giving it an MTU I get the following error: [...]
This one is fairly simple, here : https://github.com/netdevopsbr/netbox-proxbox/blob/v0.0.5/netbox_proxbox/proxbox_api/updates/node.py#L219
ntb_iface = list(nb.dcim.interfaces.filter(device_id=netbox_node.id, name=iface['name']))
should be
ntb_iface = list(nb.dcim.interfaces.filter(device_id=netbox_node.id, name=iface))
BUT, we should check if the interface is a management only interface and skip the deletion.
Yes. Because the imported nodes are missing the management interface and the virtual bridges / bonds I add these myself. But when I add these interfaces manually and run the plugin again it crashes out with the logs I sent earlier
I just tried the changes and they seem to work! Though the interfaces I create manually do get deleted if they are not marked as management interfaces.
Would it be possible to manually add some non-management interfaces. Maybe by creating a custom field with a flag that marks the interfaces as not-managed by the netbox-proxbox plugin?
Hum, this should do the trick :
Add a custom field as following Required values (must be equal)
And change the line
if not ntb_iface[0].mgmt_only:
to
if not ntb_iface[0].mgmt_only or not ntb_iface[0].custom_fields.get('proxmox_keep_interface', False):
Should I implement this myself and create a pull request or can you add that to your PR?
I've added it to the PR but it's based on the develop branch.
Ah good I see now! I'll keep using that branch for now. When the changes get merged in I'll switch back to develop/master 😄
Thank you!
Ah good I see now! I'll keep using that branch for now. When the changes get merged in I'll switch back to develop/master 😄
Thank you!
It just got merged!
When setting up the devices to include the idrac interfaces and virtual bridges the actual physical proxmox nodes have, the plugin started crashing.
Whenever I add an extra interface to one of the hosts that gets updated by proxbox the plugin fails with an error that relates to the MTU that's missing. When I add an MTU to the interface it gets another error.
Is adding extra network interfaces to the proxbox nodes unsupported or is this a bug?
So after adding another interface (idrac) and giving it an MTU I get the following error: