<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Failed to get vmlist using vsphere-automation-sdk-python 8.0 in vSphere Management SDK Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Failed-to-get-vmlist-using-vsphere-automation-sdk-python-8-0/m-p/2951855#M14750</link>
    <description>&lt;P&gt;Above problem was seen due to incompatible ESXI server which is 6.5 version, but python SDK support only 7.0+.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Feb 2023 07:51:36 GMT</pubDate>
    <dc:creator>dbiswas91</dc:creator>
    <dc:date>2023-02-01T07:51:36Z</dc:date>
    <item>
      <title>Failed to get vmlist using vsphere-automation-sdk-python 8.0</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Failed-to-get-vmlist-using-vsphere-automation-sdk-python-8-0/m-p/2951463#M14749</link>
      <description>&lt;P&gt;I am using&amp;nbsp;vsphere-automation-sdk-python 8.0 in centos 7&lt;/P&gt;&lt;P&gt;with python version 3.7&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question 1:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Does this python SDK work on vspehere or vcenter or ESXI?&lt;/P&gt;&lt;P&gt;As I have provided the &lt;STRONG&gt;ESXI ip&lt;/STRONG&gt; to the below script to list down the vms facing issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;[root@v ~]# pip list&lt;BR /&gt;Package Version&lt;BR /&gt;---------------------------------- ---------&lt;BR /&gt;&lt;STRONG&gt;certifi 2022.12.7&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;cffi 1.15.1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;charset-normalizer 2.0.12&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;cryptography 36.0.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;idna 3.4&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;lxml 4.9.2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;nsx-policy-python-sdk 4.0.1.0.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;nsx-python-sdk 4.0.1.0.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;nsx-vmc-aws-integration-python-sdk 4.0.1.0.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;nsx-vmc-policy-python-sdk 4.0.1.0.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;pip 22.3.1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;pycparser 2.21&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;pyOpenSSL 22.0.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;pyvmomi 7.0.3&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;requests 2.27.1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;setuptools 62.0.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;six 1.16.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;urllib3 1.26.14&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;vapi-client-bindings 4.0.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;vapi-common-client 2.37.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;vapi-runtime 2.37.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;vmc-client-bindings 1.61.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;vmc-draas-client-bindings 1.20.0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;vSphere-Automation-SDK 1.80.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[root@v~]# cat /etc/centos-release&lt;BR /&gt;RecoveryOS release 7.9.2009 (Core)&lt;BR /&gt;[root@v~]#&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Tried to list vm using SDK sample code, which is not working.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# cat tt.py
import requests
import urllib3
from vmware.vapi.vsphere.client import create_vsphere_client
session = requests.session()
print(session)

# Disable cert verification for demo purpose.
# This is not recommended in a production environment.
session.verify = False

# Disable the secure connection warning for demo purpose.
# This is not recommended in a production environment.
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

# Connect to a vCenter Server using username and password
vsphere_client = create_vsphere_client(server='&amp;lt;ESXi server ip&amp;gt;', username='xxxx', password='xxxxx', session=session)

# List all VMs inside the vCenter Server
vsphere_client.vcenter.VM.list()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/root/tt.py", line 16, in &amp;lt;module&amp;gt;&lt;BR /&gt;vsphere_client = create_vsphere_client(server='x.x.x.x', username='xxxx', password='xxxxx', session=session)&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/vsphere/client.py", line 173, in create_vsphere_client&lt;BR /&gt;return VsphereClient(session=session, server=server, username=username,&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/vsphere/client.py", line 116, in __init__&lt;BR /&gt;session_id = session_svc.create()&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/com/vmware/cis_client.py", line 201, in create&lt;BR /&gt;return self._invoke('create', None)&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/bindings/stub.py", line 345, in _invoke&lt;BR /&gt;return self._api_interface.native_invoke(ctx, _method_name, kwargs)&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/bindings/stub.py", line 266, in native_invoke&lt;BR /&gt;method_result = self.invoke(ctx, method_id, data_val)&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/bindings/stub.py", line 199, in invoke&lt;BR /&gt;return self._api_provider.invoke(self._iface_id.get_name(),&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/security/client/security_context_filter.py", line 101, in invoke&lt;BR /&gt;method_result = ApiProviderFilter.invoke(&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/provider/filter.py", line 75, in invoke&lt;BR /&gt;method_result = self.next_provider.invoke(&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/protocol/client/msg/json_connector.py", line 79, in invoke&lt;BR /&gt;response = self._do_request(VAPI_INVOKE, ctx, params)&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/vmware/vapi/protocol/client/msg/json_connector.py", line 127, in _do_request&lt;BR /&gt;http_response.data.raise_for_status()&lt;BR /&gt;File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status&lt;BR /&gt;raise HTTPError(http_error_msg, response=self)&lt;BR /&gt;requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: &lt;A href="https://x.x.x.x/api" target="_blank"&gt;https://x.x.x.x/api&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Anyone one has any suggestion to resolve above issue.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 02:20:33 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Failed-to-get-vmlist-using-vsphere-automation-sdk-python-8-0/m-p/2951463#M14749</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-01-30T02:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to get vmlist using vsphere-automation-sdk-python 8.0</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Failed-to-get-vmlist-using-vsphere-automation-sdk-python-8-0/m-p/2951855#M14750</link>
      <description>&lt;P&gt;Above problem was seen due to incompatible ESXI server which is 6.5 version, but python SDK support only 7.0+.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 07:51:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Failed-to-get-vmlist-using-vsphere-automation-sdk-python-8-0/m-p/2951855#M14750</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-02-01T07:51:36Z</dc:date>
    </item>
  </channel>
</rss>

