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

Setting Primary IP does not work #425

Open
patschi opened this issue Nov 16, 2024 · 1 comment
Open

Setting Primary IP does not work #425

patschi opened this issue Nov 16, 2024 · 1 comment

Comments

@patschi
Copy link

patschi commented Nov 16, 2024

I have some odd behavior where the sync script is not properly setting the Primary IP on almost half of the VMs existent in netbox. The output seems to be fine:

$ /opt/netbox-vmware-sync/.venv/bin/python3 /opt/netbox-vmware-sync/netbox-sync.py --config /opt/netbox-vmware-sync/settings.ini
2024-11-16 23:40:02,800 - INFO: Starting NetBox Sync v1.7.0 (2024-10-21)
2024-11-16 23:40:02,846 - INFO: Successfully connected to NetBox '127.0.0.1'
2024-11-16 23:40:02,846 - INFO: Initializing sources
2024-11-16 23:40:02,916 - INFO: Successfully connected to vCenter SDK 'vc1'
2024-11-16 23:40:02,998 - INFO: Successfully connected to vCenter API 'vc1'
2024-11-16 23:40:03,238 - INFO: Successfully connected to vCenter SDK 'vc2'
2024-11-16 23:40:03,352 - INFO: Successfully connected to vCenter API 'vc2'
2024-11-16 23:40:03,352 - INFO: Querying necessary objects from NetBox. This might take a while.
2024-11-16 23:40:08,920 - INFO: Finished querying necessary objects from NetBox
2024-11-16 23:40:08,943 - INFO: Query data from vCenter: 'vc1'
2024-11-16 23:40:29,100 - INFO: Parsing objects which were marked to be reevaluated
2024-11-16 23:40:29,100 - INFO: Query data from vCenter: 'vc2'
2024-11-16 23:41:14,147 - INFO: Parsing objects which were marked to be reevaluated
2024-11-16 23:41:14,221 - INFO: Updating changed data in NetBox
2024-11-16 23:41:14,273 - INFO: Pruning orphaned data in NetBox
2024-11-16 23:41:14,356 - INFO: Completed NetBox Sync in 1 minute, 11 seconds

I have cleared cache/ folder, just to rule out the cache messing up things.

In the settings, I do have configured the setting set_primary_ip to always:

; define how the primary IPs should be set
; possible values:
;
;   always:     will remove primary IP from the object where this address is
;               currently set as primary and moves it to new object
;
;   when-undefined:
;               only sets primary IP if undefined, will cause ERRORs if same IP is
;               assigned more then once to different hosts and IP is set as the
;               objects primary IP
;
;   never:      don't set any primary IPs, will cause the same ERRORs
;               as "when-undefined"
;set_primary_ip = when-undefined
set_primary_ip = always

On both vCenters:

$ grep "^set_primary_ip" settings.ini
set_primary_ip = always
set_primary_ip = always

But still, I do have 37 VMs without a Primary IP set:
image

Any ideas?

@bb-Ricardo
Copy link
Owner

Hi,

Have you tried setting log level to debug2 with -l DEBUG2. It should let you know what's going on.

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

2 participants