Netbox Plugin Enhancements
-
Hi All,
first of all I am pretty new to XCP-NG and Xen Orchestra, but so far I like it
Now I wanted to put some more features in the netbox plugin and I have a few questions:
- Are PR's generally welcome or do I have to follow some steps beforehand besides contribution guidlines?
- development wise
- can I just edit "/opt/xo/xo-server/node_modules/xo-server-netbox/src/index.js" for example if I installed from source?
- or do I have to "build" it everytime?
Regarding the Enhancements what I have in mind so far:
- ignore IP ranges ( already in the works for RFC1918 #6306 )
- don't delete existing netbox interfaces
- virtual interfaces ( wireguard for example will otherwise be deleted every sync )
- maybe work with tags?
- sync Hosts
- don't duplicate VMs if they were moved to other pool
- any thoughts if this should be toggleable?
Feel free to suggest anything else
KR
Pete -
Hi!
@pdonias will answer all the rest, but in terms of contributions, yes, PR are very welcome! (and it's not in contradiction with https://xen-orchestra.com/docs/contributing.html#contributing)
-
Hi @peterbaumert,
if you want to contribute to XO, you need to fork and clone the repo so that you can edit the source files and then open a PR. You shouldn't edit the files in
node_modules
which are a built version of the sources. Let us know if you need help with the process.Regarding the features you're talking about:
- ignore IP ranges: this is indeed a work in progress.
- don't delete existing netbox interfaces: I'm not sure what you mean. When does this happen? The plugin should delete the interfaces only if they've been removed in XO.
- sync Hosts: what do you mean by that? The hosts should be synced already, do you have issues with that?
- don't duplicate VMs if they were moved to other pool: they shouldn't be duplicated if both pools are being synchronized by the plugin. But they're deleted on one side and re-created on the other side which can cause some issues. This is also a work in progress to improve that. See: #6135.
-
@pdonias First of all thanks for the answers.
To your questions:
- yes if I have interfaces in netbox which are not interfaces in XO, everytime I sync they get deleted
- hosts are not synced for me only Pools <> Clusters, I will check if I can find any errors
- ok yes sorry for my wording about the duplicating, didnt see #6135 before sounds good
KR
Pete -
- Why do you have those interfaces? Could you explain your use case and why they're not visible in XO?
- Sorry, you're right, hosts are not synced for a simple reason: there is no such thing as host types in Netbox (or did we miss something?). So we only group VMs by pools (clusters) and that's it.
-
In each cluster you can assign devices (hosts), I do this manually after syncing over the pool. My hypervisors are pre-configured before this. It would be nice to have some information pre-populated like CPU model, NICs, IP addresses. Though I wouldn't want the hosts to be removed if I removed them from a Pool as they'd likely still be physically in my rack.
-
So basically, you can add existing hosts (created manually in Netbox) in a Cluster.
We do that in our prod, but I wonder how we should deal with this with netbox sync, without overwriting anything
-
@pdonias said in Netbox Plugin Enhancements:
- Why do you have those interfaces? Could you explain your use case and why they're not visible in XO?
- Sorry, you're right, hosts are not synced for a simple reason: there is no such thing as host types in Netbox (or did we miss something?). So we only group VMs by pools (clusters) and that's it.
Those interfaces are for example wireguard interfaces or any other virtual interfaces. Obv they are not in xo because they are virtual, but in netbox they are needed because I deploy all my wireguard stuff with them.
The host thing already was answered, there are devices which you then can link to Pools.
KR
Peter