-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Discovery of VMware vSphere device has error vim.dvs.PortConnection is not JSON serializable #75
Comments
Unfortunately I don't have a DVS on my lab so I cannot debug this issue. Can you debug /opt/netbox/venv/lib/python3.10/site-packages/netdoc/discoverers/json_vmware_vsphere.py ? |
This is the debug output, not sure if it helpful INFO:nornir.core:Running task 'multiple_tasks' with args {} on 1 hosts
INFO:netbox.scripts.NetDoc.Discover:Database changes have been reverted due to error. |
Try replacing line 272 in "/opt/netbox/venv/lib/python3.9/site-packages/netdoc/discoverers/json_vmware_vsphere.py" |
Thank you. Let me fix a major issue then I'll merge your suggestion. |
Merged with #80 |
Its worked with 3.5.6 but my enviroment unable to get vswitch/portgroup, seem we need to define on netbox first Another thing is the connected interface/device of host physical adapter via pyVmomi cdp neighbor information, it would be greate if netdoc can make this connection |
Currently I'm using the NetBox data structure to store clusters, hosts and VMs. I'm not completely satisfied because all network information are lost. NetBox does not have the vSwitch concept. Regarding host CDP, if you can modify the discover script, to grab those info, I can modify the ingest script. |
In case, open a new issue to track improvements. |
When running discovery vcenter/esxi-host with admin credential, I am facing issue with netdoc 3.5.3 or 0.10.33, any idea?
An exception occurred: TypeError: Object of type vim.dvs.PortConnection is not JSON serializable
Traceback (most recent call last):
File "/opt/netbox/netbox/extras/scripts.py", line 504, in _run_script
script.output = script.run(data=data, commit=commit)
File "/opt/netbox/netbox/scripts/netdoc_scripts.py", line 262, in run
output = discovery(
File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/tasks.py", line 111, in discovery
module.discovery(filtered_devices, filters=filters, filter_type=filter_type)
File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/discoverers/json_vmware_vsphere.py", line 272, in discovery
raw_output=json.dumps(result.result),
File "/usr/lib/python3.10/json/init.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python3.10/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.10/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.10/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type vim.dvs.PortConnection is not JSON serializable
The text was updated successfully, but these errors were encountered: