-
Notifications
You must be signed in to change notification settings - Fork 69
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
Problem choosing primary IP for VirtualMachine when IP and interface changes #179
Comments
Hi, I'm sorry. I don't really understand what you mean with quarantine the IP. So the IP is not deleted? Currently it seems the same IP iss assigned to two different VMs with active (enabled) interfaces. The script can't determine which own was desired to be the correct one. |
What I mean by "quarantine" is exactly that the old IP is not deleted yet when it disappears on the VMWare side. I have this setting:
Oh and I should add that this old IP was mistakenly assigned to a new VirtualMachine a few days after it was taken down on the primary VirtualMachine. This was a mistake on the human side as NetBox was not consulted 1st. So the WARNING message above is not about the ambiguity between two IPs (and interfaces), one of them orphaned, still being assigned to the same VirtualMachine and consequently preventing the logic to select the primary IP for that VM? I thought it was just that and not the fact that the same old IP was reused on another VM prematurely. So old IP (and interface) is kept assigned to the primary VirtualMachine, but it is marked with tag |
Hi, long time since I wrote last. I'm finally getting around to fix some bugs again. To understand your issue/workflow correctly:
|
It was a long time ago, but If I remember correctly what I meant was that I do the following manually on the VMWare side:
What netbox-sync does to data in Netbox after those two changes in VMWare is the following:
What should happen instead of warning is that netbox-sync chooses interface and address B as the new primary IP for the virtual machine and not even consider the |
Hi, I just pushed another commit which should fix exactly this use case. Can you check out the |
Hey @plevart: just pushed another commit to |
Just give me a little time since currently I don't have a VM to play with (remove and add interfaces). I'll have to create one. |
Hi, sure, would be great if you could confirm the fix and then I could close this issue. Trying to release a new version soon. Thank you |
any updates? |
Let me try it now... |
Here we go...
All well. Then I powered down VM, switched the NIC to VLAN 128 and booted up the VM which initialized some other IP from VLAN 128. Then I ran netbox-sync again...
All well this time too. Previous IP gets orphaned, new IP gets assigned to the VM and primary IP address of VM gets set correctly. As far as my problems are concerned, this version fixes them. Thanks for being patient with me. Regards, Peter |
Ahh, great news. Thanks for the testing effort. Will close this issue. |
Hi, I'm getting following warnings while synchronizing a VMWare VirtualMachine which was modified to change interface and IP:
While I would like to keep the old IP in "quarantine" for 30 days (marked with tag Netbox-synced: Orphaned), I would also like the change of primary IP of the VirtualMachine to be picked up immediately. Wouldn't it be better for Primary IP selection logic to ignore orphaned IPs in situations where they cause ambiguities?
The text was updated successfully, but these errors were encountered: