Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Synced tags from vCenter are pruned due to #359 #401

Open
david-sieg opened this issue Jul 8, 2024 · 8 comments
Open

FR: Synced tags from vCenter are pruned due to #359 #401

david-sieg opened this issue Jul 8, 2024 · 8 comments
Labels
awaiting reply Awaiting reply from issue owner
Milestone

Comments

@david-sieg
Copy link

Hi Ricardo,

we switched from NetBox Sync 1.3.0 to 1.6.1 and surprisingly all our Tags on our VMs are reset to defaults.

Due to #359 tags are now pruned.
Is there any switch to sync tags but keep existing tags in NetBox?

@bb-Ricardo
Copy link
Owner

Hi,

and sorry for the long wait.

I don't really understand your scenario. You have tags on a VM in NetBox which are not exiting in vcenter anymore and these get deleted?

Can you describe the issue a bit more detailed?

Thank you

@david-sieg
Copy link
Author

Hi Ricardo,

we set tags to VMs in NetBox which aren't in vCenter.
NetBox- sync overwrites existing tags in NetBox (from vCenter).

David

@bb-Ricardo
Copy link
Owner

Hi, If they are the same tag, then this is possible, yes

@fiskn
Copy link

fiskn commented Nov 7, 2024

I think I may have observed a bug relating to this behaviour as well. It seems the sync will mark a unused tag for deletion at the start of the sync, even if this tag is then assigned a bit later in the process to a VM the tag is still deleted at the end, resulting in a missing tag.

Steps to reproduce:

  1. Sync a VM with a tag that only exists on a single VM
  2. Remove tag in Netbox from VM manually
  3. Run another sync
  4. The sync process detects tag is missing from the VM and reassigns it, as seen in the logs
  5. At the end of the log "Deleting unused tag" is seen, which deletes the tag, thus removing it from the VM.

If I run the sync again, it then see's the tag is missing and then recreates it and assigns it to the VM again

@bb-Ricardo
Copy link
Owner

Hi,

Thank you for this description. Yes, this is indeed the case and needs to be fixed. This should be an easy one.

@bb-Ricardo
Copy link
Owner

Hi @fiskn,

I adde a check for your described issue and pushed a new commit to the development branch. would you be able to check it out?

thank you

@bb-Ricardo
Copy link
Owner

Hi @david-sieg,

I still don't really get the issue.

tags which are set in NetBox and not used in vCenter are just ignored by the script. Just tested it again (in case of regressions).

would you be able to describe the setup more precisely so I can test it myself?

thank you

@bb-Ricardo bb-Ricardo added the awaiting reply Awaiting reply from issue owner label Nov 20, 2024
@bb-Ricardo bb-Ricardo added this to the v1.8.0 milestone Nov 22, 2024
@david-sieg
Copy link
Author

Hi Ricardo,

I will test it again on wednesday, I'll give feedback.

David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting reply Awaiting reply from issue owner
Projects
None yet
Development

No branches or pull requests

3 participants