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

linking vms to ipam module #336

Open
sharkless opened this issue Aug 14, 2023 · 5 comments
Open

linking vms to ipam module #336

sharkless opened this issue Aug 14, 2023 · 5 comments

Comments

@sharkless
Copy link

I noticed that after I got and IP address tied to a vm and when the sync runs it wipes all that out. I dont know if that is because it is recreating the vms or if the sync just wipes out that data. Is there a way to stop this from happening?

@bb-Ricardo
Copy link
Owner

Can you please describe of what you are doing in NetBox with linking the IPAM module? Haven't done that before.

@sharkless
Copy link
Author

Under the IPAM module you can go into an IP address and then Interface Assignment and attach that IP address to a VM. I am using it for our public IPs so I can link it to an internal NAT and what server that NAT is tied to. But seems when the sync happens it will wipe out that assignment.

@kamils85
Copy link

I believe this is the same issue I am facing. I have few VMs that cannot run vm-tools and they won't expose the IP addresses to the hypervisor.
If I manually assign the IP address as @sharkless mentioned the next time the script runs it overrides the data and de-assign the IP address.

2023-08-29 07:41:42,345 - INFO: IP address is no longer assigned to vNIC 1 (vlan23) (mms.somedomain.com) and therefore removed from this interface
2023-08-29 07:41:42,345 - INFO: Setting attribute 'primary_ip4' for 'mms.somedomain.com' to None
2023-08-29 07:41:42,345 - INFO: Setting attribute 'assigned_object_id' for '1.1.1.18/30' to None
2023-08-29 07:41:42,346 - INFO: Setting attribute 'assigned_object_type' for '1.1.1.18/30' to None
2023-08-29 07:41:42,987 - INFO: IP address is no longer assigned to vNIC 1 (vlan23) (sip.somedomain.com) and therefore removed from this interface
2023-08-29 07:41:42,988 - INFO: Setting attribute 'primary_ip4' for 'sip.somedomain.com' to None
2023-08-29 07:41:42,988 - INFO: Setting attribute 'assigned_object_id' for '1.1.1.22/30' to None
2023-08-29 07:41:42,991 - INFO: Setting attribute 'assigned_object_type' for '1.1.1.22/30' to None
2023-08-29 07:41:48,135 - INFO: Parsing objects which were marked to be reevaluated
2023-08-29 07:41:48,199 - INFO: Updating changed data in NetBox
2023-08-29 07:41:48,200 - INFO: Updating NetBox 'virtual machine' object 'mms.somedomain.com' with data: {'primary_ip4': None}
2023-08-29 07:41:48,813 - INFO: Updating NetBox 'virtual machine' object 'sip.somedomain.com ' with data: {'primary_ip4': None}
2023-08-29 07:41:49,452 - INFO: Updating NetBox 'IP address' object '1.1.1.18/30' with data: {'assigned_object_id': None, 'assigned_object_type': None}
2023-08-29 07:41:49,519 - INFO: Updating NetBox 'IP address' object '1.1.1.22/30' with data: {'assigned_object_id': None, 'assigned_object_type': None}

I would be good to have the option to exclude specific hosts from auto-assigning the IP address.

@kamils85
Copy link

Apologies, just noticed this was already mentioned in #326.

@sharkless
Copy link
Author

sharkless commented Aug 29, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants