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

Netbox plugin: vm duplicates at plugin sync #6038

Closed
TristisOris opened this issue Dec 3, 2021 · 3 comments · Fixed by #6950
Closed

Netbox plugin: vm duplicates at plugin sync #6038

TristisOris opened this issue Dec 3, 2021 · 3 comments · Fixed by #6950

Comments

@TristisOris
Copy link

TristisOris commented Dec 3, 2021

Describe the bug
items with same UID duplicated.

To Reproduce

  1. have 2 pools. 1st pool was disabled\unavailable for sync, and all VM migrated to 2nd.
  2. after syncing all VM appear at NB second time on 2nd pool.

Expected behavior
move VM from 1st pool to 2nd based on unique VM ID.

Screenshots
изображение

Desktop (please complete the following information):

  • Node: [e.g. 16.12.1]
  • xo-server 5.84.1
  • xo-web 5.90.0
  • hypervisor: XCP-ng 8.2.0

Additional context
NetBox version 3.0.11

@pdonias
Copy link
Member

pdonias commented Dec 6, 2021

Hi, I'm not sure this is something that we should do because:

  • if the 1st pool is supposed to come back to life soon, then it will be synchronized and the old VMs will be removed from Netbox
  • if the pool has been permanently deleted/disconnected, then you should manually delete the cluster from Netbox

We're also trying to avoid deleting things from a pool that isn't reachable in case you need to retrieve some information about that pool using Netbox.

@TristisOris
Copy link
Author

well, we have vm's UUID, so 99% we know that they now exist on another pool, no matter why. And if transfer already happens, problem only to confirm it and move data, instead create a clone.
No need to remove pool or another core objects, but VM migration its a usual action.

pool can be disabled for a weeks, if h\w replacement required.

@pdonias
Copy link
Member

pdonias commented Dec 9, 2021

VM migration is a usual action indeed, but removing an entire pool isn't. And the behavior you described only happens if you remove/disconnect a pool. If the 2 pools are still there, the old VMs will be removed from Netbox. You can also manually trigger a Netbox synchronization right before disabling the pool to remove the VMs from Netbox.

julien-f pushed a commit that referenced this issue Jul 27, 2023
Fixes #6038, Fixes #6135, Fixes #6024, Fixes #6036
See https://xcp-ng.org/forum/topic/6070
See zammad#5695
See https://xcp-ng.org/forum/topic/6149
See https://xcp-ng.org/forum/topic/6332

Complete rewrite of the plugin. Main functional changes:
- Synchronize VM description
- Fix duplicated VMs in Netbox after disconnecting one pool
- Migrating a VM from one pool to another keeps VM data added manually
- Fix largest IP prefix being picked instead of smallest
- Fix synchronization not working if some pools are unavailable
- Better error messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants