-
Notifications
You must be signed in to change notification settings - Fork 28
Plugin dont work after update netbox to 2.9.1 #129
Comments
Same here, even after a cleanup, collect seem to work and stop with unexpected behavior. also it seem not working properly with vcenter/esxi 7.0 which have been updated on API level. |
Probably related to netbox-community/netbox#3703 |
2020-08-24 10:00:02,237 [INFO] Verifying all prerequisite objects exist in NetBox. `HTTP 200 OK { |
Yes so this script is incompatible with Netbox >= 2.9.0 due to changes in the way tags are created. |
@synackray can you help ? |
Not just the tags, but also the API changes in 2.9.0 for ipam.IPAddress cause the mapping between IP & virtual-machine to not work anymore.
|
this will fix the tag issue: https://github.com/bb-Ricardo/vcenter-netbox-sync/commit/2d3052fd14bc3947b24e1da3927e93e4e44b6355 Will have a look at ip |
Well, we got some progress: https://github.com/bb-Ricardo/vcenter-netbox-sync/commit/9447109a12e18703954cd843c7bc2a6adb936285 Now all my items sync again as before. Please check it out. All changes are also in #132 |
also, as you can see in the screenshot, some virtual servers are in their clusters, but the main part has moved to Standalone |
That's very interesting as I didn't touch this part of code: https://github.com/bb-Ricardo/vcenter-netbox-sync/blame/9447109a12e18703954cd843c7bc2a6adb936285/run.py#L557 "Standalone ESXi Host" is used if the hosts cluster name is the same as the hosts name: cluster = obj.parent.name
# We throw the cluster away if it matches the ESXi host
# name as it is standalone.
if cluster == obj_name:
# Store the host so that we can check VMs against it
self.standalone_hosts.append(cluster)
cluster = "Standalone ESXi Host" and Line: https://github.com/bb-Ricardo/vcenter-netbox-sync/blob/develop/run.py#L647 elif vc_obj_type == "virtual_machines":
# Virtual Machines
log.debug(
"Collecting info for virtual machine '%s'", obj_name
)
# Cluster
cluster = obj.runtime.host.parent.name
if cluster in self.standalone_hosts:
log.debug(
"VM is assigned to a standalone ESXi host. Setting "
"cluster to 'Standalone ESXi Host'."
)
cluster = "Standalone ESXi Host" In my opinion the whole sync needs a complete rewrite. Unfortunately this code is only used in a test environment. It was a POC and after the last NetBox API FU I'm not sure if I'm willing to spend my time on changing code and adapting APIs every time a new NetBox major release is issued. I have loads of ideas but (https://github.com/bb-Ricardo/vcenter-netbox-sync/issues) but not sure if time allows it. |
@bb-Ricardo I keep getting errors like this: |
You're on NetBox version 2.9.X? |
I am on 2.9.4 |
@MarcSN311 Not sure if it the exact same problem I ran into, but I had to delete the vCenter and Synced tag before running it. |
I am on a fresh install, I did not have any tags before running the sync. EDIT: Nevermind, I found the issue on my end. |
do you have a problem with clusters? like mine #129 (comment) or don't you use them? |
@SerhiiZahuba I did not run into that issue. It placed all the VMs in the correct cluster and also the ESXi servers. |
Strange, I don’t understand what I’m doing wrong. All my virtual machines are migrated to the Standalone ESXi Host section. |
Any progress on this issue? |
currently trying to rewrite this whole process. Hope I get all of this covered in here: https://github.com/bb-Ricardo/netbox-sync |
I went down a rabbit hole and finally can see the light at the end of the tunnel again. This took way longer then expected (as usual). Here you go: https://github.com/bb-Ricardo/netbox-sync please test as much as you can: Debug logs are very welcome. |
Just gave it a first try and looks very promising! Only thing I've noticed so far is my vlans in vmware are named "123-name-10.0.0.0/24" and they get imported into netbox with the url encoded %2f instead of a / (when looking at the name column on the VM interface) |
Great to hear. Can you please open an issue for that. Would like to have a look at it. Thank you. |
Environment
Python version: 3.6.8
NetBox version: 2.9.1
vCenter version: 6.7.0 -->
Steps to Reproduce
[root@netbox]# /bin/python3.6 /opt/vcenter-netbox-sync/run.py >/var/log/vcentersync.log
2020-08-23 15:56:17,690 [INFO] Created new HTTP Session for NetBox.
2020-08-23 15:56:17,785 [INFO] Detected NetBox API v2.9.
2020-08-23 15:56:17,786 [INFO] Verifying all prerequisite objects exist in NetBox.
2020-08-23 15:56:17,838 [INFO] NetBox manufacturers object 'VMware' match current values. Moving on.
2020-08-23 15:56:17,866 [INFO] NetBox platforms object 'VMware ESXi' match current values. Moving on.
2020-08-23 15:56:17,895 [INFO] NetBox platforms object 'Windows' match current values. Moving on.
2020-08-23 15:56:17,919 [INFO] NetBox platforms object 'Linux' match current values. Moving on.
2020-08-23 15:56:18,032 [INFO] NetBox sites object 'vCenter' do not match current values.
Traceback (most recent call last):
File "/opt/vcenter-netbox-sync/run.py", line 1601, in
main()
File "/opt/vcenter-netbox-sync/run.py", line 244, in main
nb.verify_dependencies()
File "/opt/vcenter-netbox-sync/run.py", line 1540, in verify_dependencies
self.obj_exists(nb_obj_type=dep_type, vc_data=dep)
File "/opt/vcenter-netbox-sync/run.py", line 1105, in obj_exists
set(vc_data["tags"] + nb_data["tags"])
TypeError: unhashable type: 'dict'
Expected Behavior
Observed Behavior
The text was updated successfully, but these errors were encountered: