netbox-ssot
netbox-ssot copied to clipboard
[Bug] Primary IP selection with VMware
Is this urgent?
Yes, it's critical
How are you running netbox-ssot?
From source (Go)
Which version of netbox are you using
4.2.6
Which version of netbox-ssot are you running
1.11.4
Which module has the issue?
VMware
Share your configuration
---
logger:
level: 3
dest: ""
netbox:
apiToken: "foo"
hostname: "netbox.foo.corp"
httpScheme: http
port: 80
timeout: 30
sourcePriority: ["vcenter67.corp"]
removeOrphans: false
source:
- name: vcenter67.corp
type: vmware
hostname: vcenter67.corp
username: [email protected]
password: "password"
clusterSiteRelations:
- .* = Foo
hostSiteRelations:
- .* = Foo
clusterTenantRelations:
- .* = ACME
hostTenantRelations:
- .* = ACME
vmTenantRelations:
- .* = ACME
hostRoleRelations:
- .* = Hypervisor ESX
vmRoleRelations:
- .* = Virtual Machine ESX
vlanTenantRelations:
- .* = ACME
vlanSiteRelations:
- .* = Foo
What is the problem?
netbox-ssot picks the wrong primary ip address
Steps to reproduce
- create a vm with 2 ip addresses
- run
netbox-ssot - the wrong primary ip address is assigned to the virtual machine in netbox
What did you expect to happen?
The right primary ip address is assigned to the virtual machine in netbox
What actually happened?
the wrong primary ip address is assigned to the virtual machine in netbox
Share DEBUG-level logs (remove sensitive information)
Share your environment details
No response
I think we should use vmwareVM.Guest.IpAddress and vmwareVM.Guest.Net to get VM ip addresses (like netbox-sync: https://github.com/bb-Ricardo/netbox-sync/blob/main/module/sources/vmware/connection.py#L2432) :
2025/03/27 23:29:02 vmware_sync.go:1263 DEBUG (vcenter.corp): FOO: foo.corp => 10.3.26.251 # vmwareVM.Guest.IpAddress (this is the real primary ip address)
2025/03/27 23:29:02 vmware_sync.go:1271 DEBUG (vcenter.corp): FOO: foo.corp => [10.3.26.251 10.3.26.248 10.3.26.243 10.3.26.154 10.3.26.249 10.3.26.247 10.3.26.228 fe80::20c:29ff:fe35:e1f2] # vmwareVM.Guest.Net
2025/03/27 23:29:02 vmware_sync.go:1263 DEBUG (vcenter.corp): FOO: bar.corp => 10.3.26.152 # vmwareVM.Guest.IpAddress (this is the real primary ip address)
2025/03/27 23:29:02 vmware_sync.go:1271 DEBUG (vcenter.corp): FOO: bar.corp => [10.3.26.152 10.3.26.3 fe80::250:56ff:febe:363d] # vmwareVM.Guest.Net
Hey nice find, I agree. Logic for selecting primary IP was never properly implemented.
@bl4ko hi there! any news?
@bl4ko hi there! any news? this issue is blocking us 😢 thank you!
@bl4ko hi there! any news? this issue is really blocking us to the point I'm thinking to rollback to netbox-sync (because we generate Icinga configuration from Netbox inventory and not having the right primary address leads to manual modifications which is really painful) 😢 thank you!
Hi, sorry for late reply. Currentlly I don't have much time to maintain this anymore 🙁. It also looks like, that SRC-doo won't be making changes to this in the near future, so I guess currently your best bet is to rollback to netbox-sync.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 5 days with no activity.