vatesfr / xen-orchestra

The global orchestration solution to manage and backup XCP-ng and XenServer.
https://xen-orchestra.com
Other
795 stars 265 forks source link

XO NetBox plugin - Xen Description overwriting contents of NetBox Comments field #7498

Open magoseli42 opened 8 months ago

magoseli42 commented 8 months ago

Are you using XOA or XO from the sources?

XOA

Which release channel?

stable

Provide your commit number

5.91.2 - XOA build: 20210823

Describe the bug

Updated XOA to version 5.91.2 - XOA build: 20210823. Discovered that the NetBox Comments field is getting overwritten not appended with the Xen Orchestra server description for VMs. This comments field has been used historically to track important notes about the VM, and the Xen descriptions are typically shorter labels about what a server is. There appears to be no option to stop this aspect of the synch short of modifying a plugin script it's using which would get overwritten during the next update, and no option to chose or modify what field in NetBox it should be syncing to.

Error message

No response

To reproduce

  1. Update XOA to version 5.91.2 - XOA build: 20210823
  2. Turn on NetBox sync plugin
  3. Chose VM, verify contents of Description
  4. Go to NetBox and find the related VM entry and verify Comments field now has Xen VM description
  5. Look and Netbox entry change history and verify changed value was done by XO Netbox plugin sync user

Expected behavior

Potentials solutions include:

Screenshots

No response

Node

18.17.1

Hypervisor

XCP-ng 8.2.1

Additional context

No response

rabrice commented 7 months ago

I had the same issue after my last XO update, had to recuperate the Comments and platform data from the change logs. Is there any plan from XO to review and fix this issue?

pdonias commented 7 months ago

Hi, thanks for your feedbacks :) I'm trying to understand your use case for this: so you synchronize your VMs with Netbox, then you edit the comments of a VM within Netbox and then it gets overwritten on the next synchronization, that's correct?

If so, why not editing it from XO instead? Because from XO's point of view, I think it makes sense to overwrite it, the same way it overwrites everything else: if you change a VM's name in Netbox, for instance, it will be overwritten next time you synchronize it. And that makes sense, we want Netbox to be up-to-date with XO. So how would it know what to overwrite and what not without having a configuration checkbox for each entry?

Or maybe it's because you don't agree to synchronize a VM's description with the VM's comments in Netbox, since you said that you were using them differently?

magoseli42 commented 7 months ago

Use case: was running an older version of XO's NetBox plugin before all the recent updates, and were syncing only the very basic information from XO that plugin supported. Description in XO was used to list the machine name and sometimes a single sentence description. Comments in NetBox was used to list interested parties, historical use cases, networking, security specials cases, etc. It's a free form large text input field, so people used it to put important information about VMs front and center without input limits or having to dig through journal logs.

When we upgraded, all of that history about those devices in the Comments field was overwritten with basic descriptions about the machine from XO. We had to go back into the history of NetBox and restore the comments to a custom field as a stop gap.

We could explore modifying the script to block this part of the sync, or maybe even explore mapping the XO description to the NetBox description field but that would get wiped out on the next update. We also can't chose to suspend this part of the new synch, it's all or nothing, there's currently no tuning of what information gets synced and how it gets mapped.

As you point out, part of the issue is you're looking a XO as a source of truth for all things VM, and NetBox just syncs everything. For people who use NetBox as their source of truth and historically synced in just basic VM information from XO, dramatically expanding those mappings that with overwrite in NetBox and the mapping of a limited character description to a text free-form comment field was a work stopping event that took hours to do data recovery from NetBox's ability to track every change and who did it, and fixing it with breaking a script or remapping is a permanent work around we'd have to maintain on each subsequent update or face future work stopping events.

rabrice commented 7 months ago

There is a 'Description' field in NetBox that could be used to bring that data from the 'Description' field in XO, I don't understand why using the 'Comments' field in NetBox witch is a long text kind of field very useful for users.

mattv337 commented 7 months ago

This is a huge issue for my organization as well.

We have over 10k devices and VM in Netbox, and the comments field often contains years of information. I am amazed that you didnt synchronize the "description" field in XO to the "description" field in Netbox. The comments field is much more than a single line of information. This needs to be fixed or at least allow us to select to not sync this (or to sync to a different netbox field)

olivierlambert commented 7 months ago

Hi @mattv337

This needs to be fixed

Can you open a support ticket, so we can see how to prioritize this? (and what would be the best approach)

mattv337 commented 7 months ago

Hi @mattv337

This needs to be fixed

Can you open a support ticket, so we can see how to prioritize this? (and what would be the best approach)

Hi there, I have never opened a support ticket with XO before and dont see an option on your webpage.

mattv337 commented 7 months ago

Nevermind, figured it out and ticket opened.

Danp2 commented 7 months ago

Ticket#7723974