XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Netbox Plugin Enhancements

    Scheduled Pinned Locked Moved Xen Orchestra
    8 Posts 4 Posters 1.3k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • peterbaumertP Offline
      peterbaumert
      last edited by

      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

      pdoniasP 1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by olivierlambert

        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)

        1 Reply Last reply Reply Quote 1
        • pdoniasP Offline
          pdonias Vates 🪐 XO Team @peterbaumert
          last edited by pdonias

          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.
          peterbaumertP 1 Reply Last reply Reply Quote 0
          • peterbaumertP Offline
            peterbaumert @pdonias
            last edited by

            @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

            pdoniasP 1 Reply Last reply Reply Quote 0
            • pdoniasP Offline
              pdonias Vates 🪐 XO Team @peterbaumert
              last edited by

              • 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.
              G peterbaumertP 2 Replies Last reply Reply Quote 0
              • G Offline
                gsrfan01 @pdonias
                last edited by

                @pdonias

                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.

                87856392-9f01-4bb2-85be-b35936f4d1cd-image.png

                3451562e-43a2-4c54-b91e-e00985c35a89-image.png

                1 Reply Last reply Reply Quote 0
                • olivierlambertO Offline
                  olivierlambert Vates 🪐 Co-Founder CEO
                  last edited by

                  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 🤔

                  1 Reply Last reply Reply Quote 0
                  • peterbaumertP Offline
                    peterbaumert @pdonias
                    last edited by

                    @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

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post