I am trying to get the all VM list of VMWare vSphere 7 platform. but got failed with "Unknown interface: com.vmware.cis.session".
Platform: VMWare vSphere 7 platform with Free license
Language: Python
SDK: sphere-automation-sdk-python-master SDK version via GIT
Error Information:
call create_vsphere_client to create the client...
Traceback (most recent call last):
File "build.py", line 20, in <module>
main()
File "build.py", line 15, in main
vm_object = vm_vsphere('192.168.121.79', 'root', '***********')
File "D:\Project\BuildAutomation\WebApp\controller\vm.py", line 42, in __init__
self.client = create_vsphere_client(server='192.168.121.79',
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\vmware\vapi\vsphere\client.py", line 170, in create_vsphere_client
return VsphereClient(session=session, server=server, username=username,
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\vmware\vapi\vsphere\client.py", line 113, in __init__
session_id = session_svc.create()
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\com\vmware\cis_client.py", line 199, in create
return self._invoke('create', None)
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\vmware\vapi\bindings\stub.py", line 345, in _invoke
return self._api_interface.native_invoke(ctx, _method_name, kwargs)
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\vmware\vapi\bindings\stub.py", line 295, in native_invoke
raise TypeConverter.convert_to_python(method_result.error, # pylint: disable=E0702
com.vmware.vapi.std.errors_client.OperationNotFound: {messages : [LocalizableMessage(id='vapi.provider.interface.unknown', default_message='Unknown interface: com.vmware.cis.session', args=['com.vmware.cis.session'], params=None, localized=None)], data : None, error_type : None}
Exception ignored in: <function VsphereClient.__del__ at 0x000001D2A852B820>
Traceback (most recent call last):
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\vmware\vapi\vsphere\client.py", line 138, in __del__
if hasattr(self, 'session'):
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\vmware\vapi\bindings\stub.py", line 443, in __getattr__
return getattr(self._stub_factory, name)
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\vmware\vapi\bindings\stub.py", line 443, in __getattr__
return getattr(self._stub_factory, name)
File "C:\Users\fliu\AppData\Local\Programs\Python\Python38\lib\site-packages\vmware\vapi\bindings\stub.py", line 443, in __getattr__
return getattr(self._stub_factory, name)
[Previous line repeated 995 more times]
RecursionError: maximum recursion depth exceeded
Simple Code:
session = requests.session()
session.verify = False
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
print("call create_vsphere_client to create the client...")
self.client = create_vsphere_client(server='192.168.121.79',
username='root',
password='ACDSee2015!',
session=session)
Any advice or solution would be great...
Thanks