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

Orphaned VMs #437

Closed
johankh92 opened this issue Feb 3, 2025 · 13 comments
Closed

Orphaned VMs #437

johankh92 opened this issue Feb 3, 2025 · 13 comments
Labels
awaiting reply Awaiting reply from issue owner
Milestone

Comments

@johankh92
Copy link

johankh92 commented Feb 3, 2025

As I understand it, virtual machines are synchronized by name. And after renaming a virtual machine it becomes like a new one, and the virtual machine that was renamed becomes orphaned. Is it possible to add a new key so that it synchronizes and deletes with the "orphaned" tag at the same time?

@bb-Ricardo
Copy link
Owner

hi, where do you rename the VM? In NetBox or in vCenter?

@johankh92
Copy link
Author

in vCenter, and in general, such an option could be useful

@bb-Ricardo
Copy link
Owner

Well, there is a mechanism implemented to find the VM by the MAC addresses of the interfaces. If they have changed as well then the script is unable to find the original VM in NetBox.

@johankh92
Copy link
Author

johankh92 commented Feb 5, 2025

Even if I renamed the virtual machine, the netbox should have known that it was the same virtual machine by its MAC address? Should I specify this somewhere in the settings? MAC addresses are not synchronized now (issue #436)

@bb-Ricardo
Copy link
Owner

Then is is the issue. netbox-sync is currently not compatible with NetBox 4.2 because the API has changed, again.

Therefore you would need to wait until I fixed the issue. But it will take some time. Sorry.

This is just a hobby project and can only occasionally work on it in my free time.

@bb-Ricardo
Copy link
Owner

Hi,

I just pushed a commit to the development branch. Would you be able to check it out and test it?

Thank you very much

@bb-Ricardo bb-Ricardo added the awaiting reply Awaiting reply from issue owner label Feb 19, 2025
@bb-Ricardo bb-Ricardo added this to the v1.8.0 milestone Feb 24, 2025
@bb-Ricardo
Copy link
Owner

With NetBox 4.1 the serial field got added to VMs. Now when you rename a VM it should properly identify the existing VM in NetBox.

@johankh92
Copy link
Author

Everything is fine. Thank you!
There is a suggestion to give the option not to delete hosts in the purge function. Sometimes when updating the netbox we use this function, but then the hosts also disappear. On hosts where the ESXi is, we import it via netbox sync. Therefore, we will have to reconfigure the racks.

@bb-Ricardo
Copy link
Owner

Great, thank you for testing.

Can you describe in steps the issue with the hosts? Currently don't really understand what you are trying to do.

@johankh92
Copy link
Author

I'm trying to delete virtual machines with the "purge" command. Not only virtual machines are deleted, but also ESXi hosts imported by the script. I'd like to have a choice whether to delete virtual machines together with hosts or not.

@bb-Ricardo
Copy link
Owner

This is quite difficult actually.. because it's not just the host. Also the IP addresses, mac addresses, interfaces vlans and so on. Would first need to to a lookup on all of these.

I believe it would be mich easier to do this in bulk in the UI.

@bb-Ricardo
Copy link
Owner

Is it ok to close this issue for now?

@johankh92
Copy link
Author

This is quite difficult actually.. because it's not just the host. Also the IP addresses, mac addresses, interfaces vlans and so on. Would first need to to a lookup on all of these.

I believe it would be mich easier to do this in bulk in the UI.

I understand. Not problem.

Is it ok to close this issue for now?

Yes, thank you.

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

2 participants