<?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>dbiswas91 Tracker</title>
    <link>https://communities.vmware.com/wbsdv95928/tracker</link>
    <description>dbiswas91 Tracker</description>
    <pubDate>Fri, 17 Nov 2023 23:24:11 GMT</pubDate>
    <dc:date>2023-11-17T23:24:11Z</dc:date>
    <item>
      <title>How to get vm object using moref_id  pyvmomi</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/How-to-get-vm-object-using-moref-id-pyvmomi/m-p/2960229#M2255</link>
      <description>&lt;P&gt;I have vm&amp;nbsp;moref_id, want to retrieve vm object with one query?&amp;nbsp; like in perl&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;my&lt;/SPAN&gt; &lt;SPAN&gt;$vm&lt;/SPAN&gt;&lt;SPAN&gt; = Vim::get_view(mo_ref =&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;$vm_moref&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;need same on python using pyvmomi utility.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Mar 2023 12:13:34 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/How-to-get-vm-object-using-moref-id-pyvmomi/m-p/2960229#M2255</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-03-21T12:13:34Z</dc:date>
    </item>
    <item>
      <title>Facing performance issue using python SDK in case of listing vm w.r.t perl SDK.</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/Facing-performance-issue-using-python-SDK-in-case-of-listing-vm/m-p/2956799#M2241</link>
      <description>&lt;P&gt;Below python SDK script taking about ~4 mili sec (which lists all required attributes).&amp;nbsp;&lt;/P&gt;&lt;P&gt;real 0m4.137s&lt;BR /&gt;user 0m3.021s&lt;BR /&gt;sys 0m0.074s&lt;/P&gt;&lt;P&gt;similar script on perl VMware SDK taking 1 sec. Can someone help me improve the execution to nearly 1 mili sec similar to perl script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[$$]# cat getallvms2.py
#!/usr/bin/env python
# VMware vSphere Python SDK
# Copyright (c) 2008-2021 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Python program for listing the VMs on an ESX / vCenter host
"""

import re
from pyVmomi import vmodl, vim
from tools import cli, service_instance


def print_vm_info(virtual_machine):
    """
    Print information for a particular virtual machine or recurse into a
    folder with depth protection
    """
    vm_config = {}
    summary = virtual_machine.summary
    host_ref = virtual_machine.runtime.host
    if not host_ref:
        print("Can't find host ref")
    accessibility = summary.runtime.connectionState
    extra_config = virtual_machine.config.extraConfig
    vname = summary.config.name

    uuid = summary.config.uuid
    if uuid:
        vm_config.update({ "uuid": uuid })


    iuuid = summary.config.instanceUuid
    if iuuid:
        vm_config.update({ "instanceUuid": iuuid })

    cversion  = virtual_machine.config.version
    if cversion is not None:
        vm_config.update({ "version": cversion })

    change_tracking_enable = virtual_machine.config.changeTrackingEnabled
    if change_tracking_enable is not None:
        vm_config.update({ "changeTrackingEnabled": "1" if change_tracking_enable else "0" })

    change_tracking_support = virtual_machine.capability.changeTrackingSupported
    if change_tracking_support is not None: 
        vm_config.update({ "changeTrackingSupported": "1" if change_tracking_support else "0"})

    ctemplate = summary.config.template
    if ctemplate:
        vm_config.update({ "template": "1" if ctemplate else "0" })

    gfullname = summary.config.guestFullName
    if gfullname:
        vm_config.update({"guestFullName": gfullname})

    devs = virtual_machine.config.hardware.device
    extra_config = virtual_machine.config.extraConfig
    if extra_config: 
        config_name = virtual_machine.config.name
        for entry in extra_config:
            if entry.key == 'unitrends.vm.type':
                if entry.value in ['instant_recovery_audit', 'replica_vm', 'virtual_appliance']:
                    debug_message("Skipping VM  %s since .it was created for VMware IR." % config_name)
                    exclude_vm_from_inventory = 1
                    break

    print("Name       : ", summary.config.name)
    print("Template   : ", summary.config.template)
    print("Path       : ", summary.config.vmPathName)
    print("Guest      : ", summary.config.guestFullName)
    print("Instance UUID : ", summary.config.instanceUuid)
    print("Bios UUID     : ", summary.config.uuid)
    annotation = summary.config.annotation
    if annotation:
        print("Annotation : ", annotation)
    print("State      : ", summary.runtime.powerState)
    if summary.guest is not None:
        ip_address = summary.guest.ipAddress
        tools_version = summary.guest.toolsStatus
        if tools_version is not None:
            print("VMware-tools: ", tools_version)
        else:
            print("Vmware-tools: None")
        if ip_address:
            print("IP         : ", ip_address)
        else:
            print("IP         : None")
    if summary.runtime.question is not None:
        print("Question  : ", summary.runtime.question.text)
    print("")


def main():
    """
    Simple command-line program for listing the virtual machines on a system.
    """

    parser = cli.Parser()
    parser.add_custom_argument('-f', '--find', required=False,
                               action='store', help='String to match VM names')
    args = parser.get_args()
    si = service_instance.connect(args)

    try:
        content = si.RetrieveContent()

        container = content.rootFolder  # starting point to look into
        view_type = [vim.VirtualMachine]  # object types to look for
        recursive = True  # whether we should look into it recursively
        container_view = content.viewManager.CreateContainerView(
            container, view_type, recursive)

        children = container_view.view
        if args.find is not None:
            pat = re.compile(args.find, re.IGNORECASE)
        for child in children:
            if args.find is None:
                print_vm_info(child)
            else:
                if pat.search(child.summary.config.name) is not None:
                    print_vm_info(child)

    except vmodl.MethodFault as error:
        print("Caught vmodl fault : " + error.msg)
        return -1

    return 0


# Start program
if __name__ == "__main__":
    main()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 11:05:52 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/Facing-performance-issue-using-python-SDK-in-case-of-listing-vm/m-p/2956799#M2241</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-02-27T11:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure ssl on system so that i can use ssl option pyvmomi or python vshpere sdk 8.0</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/how-to-configure-ssl-on-system-so-that-i-can-use-ssl-option/m-p/2955708#M2234</link>
      <description>&lt;P&gt;But if ESXi is not connected with any vCenter, where should I get the&amp;nbsp;&lt;SPAN&gt;certification?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 05:34:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/how-to-configure-ssl-on-system-so-that-i-can-use-ssl-option/m-p/2955708#M2234</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-02-21T05:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure ssl on system so that i can use ssl option pyvmomi or python vshpere sdk 8.0</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/how-to-configure-ssl-on-system-so-that-i-can-use-ssl-option/m-p/2955293#M2231</link>
      <description>&lt;P&gt;Thanks a lot,&amp;nbsp;&lt;a href="https://communities.vmware.com/t5/user/viewprofilepage/user-id/1137425"&gt;@doskiran&lt;/a&gt;&amp;nbsp;for the great help,&amp;nbsp; what about the ESXi server, where to down the CA root certificate for ESXi server?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 03:19:04 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/how-to-configure-ssl-on-system-so-that-i-can-use-ssl-option/m-p/2955293#M2231</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-02-18T03:19:04Z</dc:date>
    </item>
    <item>
      <title>how to configure ssl on system so that i can use ssl option pyvmomi or python vshpere sdk 8.0</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/how-to-configure-ssl-on-system-so-that-i-can-use-ssl-option/m-p/2954539#M2227</link>
      <description>&lt;P&gt;this script is from pyvmomi.&lt;/P&gt;&lt;P&gt;*********************************************&lt;/P&gt;&lt;P&gt;# python3 getallvms.py -s xxxxx -u root -p xxxxx&lt;BR /&gt;[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)&lt;BR /&gt;Unable to connect to host with supplied credentials&lt;/P&gt;&lt;P&gt;below is the script i have used&amp;nbsp; to run.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[serverX] [vsphere-automation-sdk-python-master]# cat try.py
import requests
import urllib3
from vmware.vapi.vsphere.client import create_vsphere_client
session = requests.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='x.x.x.x', username='administrator@vsphere.local', password='xxxx', session=session)

# List all VMs inside the vCenter Server
ab=vsphere_client.vcenter.VM.list()
print(ab)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Traceback (most recent call last):
  File "/root/vsphere-automation-sdk-python-master/try.py", line 15, in &amp;lt;module&amp;gt;
    vsphere_client = create_vsphere_client(server='x.x.x.x', username='administrator@vsphere.local', password='xxxx', session=session)
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/vsphere/client.py", line 173, in create_vsphere_client
    return VsphereClient(session=session, server=server, username=username,
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/vsphere/client.py", line 116, in __init__
    session_id = session_svc.create()
  File "/usr/local/lib/python3.9/site-packages/com/vmware/cis_client.py", line 201, in create
    return self._invoke('create', None)
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/bindings/stub.py", line 345, in _invoke
    return self._api_interface.native_invoke(ctx, _method_name, kwargs)
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/bindings/stub.py", line 266, in native_invoke
    method_result = self.invoke(ctx, method_id, data_val)
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/bindings/stub.py", line 199, in invoke
    return self._api_provider.invoke(self._iface_id.get_name(),
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/security/client/security_context_filter.py", line 101, in invoke
    method_result = ApiProviderFilter.invoke(
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/provider/filter.py", line 75, in invoke
    method_result = self.next_provider.invoke(
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/protocol/client/msg/json_connector.py", line 79, in invoke
    response = self._do_request(VAPI_INVOKE, ctx, params)
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/protocol/client/msg/json_connector.py", line 120, in _do_request
    http_response = self.http_provider.do_request(
  File "/usr/local/lib/python3.9/site-packages/vmware/vapi/protocol/client/rpc/requests_provider.py", line 95, in do_request
    output = self._session.request(
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='x,x,x,x', port=443): Max retries exceeded with url: /api (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))&lt;/LI-CODE&gt;&lt;P&gt;Let me know what exact steps to enable ssl for python sdk or pyvmomi.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 05:06:49 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/how-to-configure-ssl-on-system-so-that-i-can-use-ssl-option/m-p/2954539#M2227</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-02-15T05:06:49Z</dc:date>
    </item>
    <item>
      <title>what is the equivalent python sdk module for perl sdk module " Vim::find_entity_view()</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/what-is-the-equivalent-python-sdk-module-for-perl-sdk-module/m-p/2952542#M2217</link>
      <description>&lt;P&gt;Can some one help me on :&amp;nbsp;what is the equivalent python sdk module for perl sdk module " Vim::find_entity_view()&lt;/P&gt;&lt;P&gt;or Pyvim is same as perl Vim module.&lt;/P&gt;&lt;P&gt;&lt;A href="https://vdc-download.vmware.com/vmwb-repository/dcr-public/cfe7121d-0d64-49d9-8e1f-49fdded4bfc4/7168b5b6-7cf2-41ce-8dd5-5535787b8c17/doc/viperl_advancedtopics.5.2.html" target="_blank"&gt;https://vdc-download.vmware.com/vmwb-repository/dcr-public/cfe7121d-0d64-49d9-8e1f-49fdded4bfc4/7168b5b6-7cf2-41ce-8dd5-5535787b8c17/doc/viperl_advancedtopics.5.2.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As like above link want to implement on python, what is the module i will be using on python sdk 8.0.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 03:50:57 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/what-is-the-equivalent-python-sdk-module-for-perl-sdk-module/m-p/2952542#M2217</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-02-04T03:50:57Z</dc:date>
    </item>
    <item>
      <title>Getting error while listing all vms under ESXi 7.0 using python vsphere sdk 8.0</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/Getting-error-while-listing-all-vms-under-ESXi-7-0-using-python/m-p/2952455#M2216</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import requests
import urllib3
import logging

logging.basicConfig(filename='app.log', level=logging.DEBUG ,filemode='w', format='%(name)s - %(levelname)s - %(message)s')
from vmware.vapi.vsphere.client import create_vsphere_client
session = requests.session()
session.verify = False
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# ESxi 7.0
vsphere_client = create_vsphere_client(server='&amp;lt;ESXi 7.0 server ip&amp;gt;', username='root', password='x,x,x,x', session=session)
ab=vsphere_client.vcenter.VM.list()
print(ab)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# python3 list_vm.py&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/root/vsphere-automation-sdk-python/dk_try.py", line 18, in &amp;lt;module&amp;gt;&lt;BR /&gt;vsphere_client = create_vsphere_client(server='xxxxx', username='root', password='xxxxxx', 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 295, in native_invoke&lt;BR /&gt;raise TypeConverter.convert_to_python(method_result.error, # pylint: disable=E0702&lt;BR /&gt;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}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;similar way perl sdk works on single ESXi 6.5, 6.7 to list down vm on ESXi without any vcenter or vsphere server attached to ESXi&lt;/P&gt;&lt;P&gt;but in python it is not working. any one have any idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 17:39:02 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/Getting-error-while-listing-all-vms-under-ESXi-7-0-using-python/m-p/2952455#M2216</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-02-03T17:39:02Z</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>
    <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: Does vsphere-automation-sdk-python require vddk</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/Does-vsphere-automation-sdk-python-require-vddk/m-p/2950369#M2201</link>
      <description>&lt;P&gt;Thanks a lot above error,&lt;/P&gt;&lt;P&gt;[root@vmware-ub-200-251 vsphere-automation-sdk-python-master]# python3 ./samples/vsphere/vcenter/vm/list_vms.py -s x.x.x.x -u root -p QAteams1 --skipverification&lt;BR /&gt;vcenter server = x.x.xx&lt;BR /&gt;vc username = root&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "./samples/vsphere/vcenter/vm/list_vms.py", line 63, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;BR /&gt;File "./samples/vsphere/vcenter/vm/list_vms.py", line 58, in main&lt;BR /&gt;list_vm = ListVM()&lt;BR /&gt;File "./samples/vsphere/vcenter/vm/list_vms.py", line 43, in __init__&lt;BR /&gt;session=session)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/vmware/vapi/vsphere/client.py", line 175, in create_vsphere_client&lt;BR /&gt;hok_token=hok_token, private_key=private_key)&lt;BR /&gt;File "/usr/local/lib/python3.6/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.6/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.6/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.6/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.6/site-packages/vmware/vapi/bindings/stub.py", line 202, in invoke&lt;BR /&gt;ctx)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/vmware/vapi/security/client/security_context_filter.py", line 102, in invoke&lt;BR /&gt;self, service_id, operation_id, input_value, ctx)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/vmware/vapi/provider/filter.py", line 76, in invoke&lt;BR /&gt;service_id, operation_id, input_value, ctx)&lt;BR /&gt;File "/usr/local/lib/python3.6/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.6/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.6/site-packages/requests/models.py", line 940, in raise_for_status&lt;BR /&gt;raise HTTPError(http_error_msg, response=self)&lt;BR /&gt;requests.exceptions.HTTPError: 404 Client Error: Not Found 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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 02:30:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/Does-vsphere-automation-sdk-python-require-vddk/m-p/2950369#M2201</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-01-24T02:30:40Z</dc:date>
    </item>
    <item>
      <title>Does vsphere-automation-sdk-python require vddk</title>
      <link>https://communities.vmware.com/t5/VMware-code-Discussions/Does-vsphere-automation-sdk-python-require-vddk/m-p/2949596#M2194</link>
      <description>&lt;P&gt;As the current vddk8.0 version does not support Perl vsphere automation sdk,&lt;/P&gt;&lt;P&gt;Is it require vddk to be installed on same system for&amp;nbsp; vsphere-automation-sdk-python.&lt;/P&gt;&lt;P&gt;I am new to vmware, plz correct me if my understading wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;facing following error:&lt;/P&gt;&lt;P&gt;[root@vsphere-automation-sdk-python-master]# python3 ./samples/vsphere/vcenter/vm/list_vms.py -s x.x.x.x -u root -p xxxxx&lt;BR /&gt;vcenter server = x.x.x.x&lt;BR /&gt;vc username = root&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 456, in wrap_socket&lt;BR /&gt;cnx.do_handshake()&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1934, in do_handshake&lt;BR /&gt;self._raise_ssl_error(self._ssl, result)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1671, in _raise_ssl_error&lt;BR /&gt;_raise_current_error()&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue&lt;BR /&gt;raise exception_type(errors)&lt;BR /&gt;OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen&lt;BR /&gt;chunked=chunked)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request&lt;BR /&gt;self._validate_conn(conn)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn&lt;BR /&gt;conn.connect()&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 344, in connect&lt;BR /&gt;ssl_context=context)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 358, in ssl_wrap_socket&lt;BR /&gt;return context.wrap_socket(sock)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 462, in wrap_socket&lt;BR /&gt;raise ssl.SSLError('bad handshake: %r' % e)&lt;BR /&gt;ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",)&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send&lt;BR /&gt;timeout=timeout&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen&lt;BR /&gt;_stacktrace=sys.exc_info()[2])&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment&lt;BR /&gt;raise MaxRetryError(_pool, url, error or ResponseError(cause))&lt;BR /&gt;urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='x.x.x.x', port=443): Max retries exceeded with url: /api (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "./samples/vsphere/vcenter/vm/list_vms.py", line 62, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;BR /&gt;File "./samples/vsphere/vcenter/vm/list_vms.py", line 57, in main&lt;BR /&gt;list_vm = ListVM()&lt;BR /&gt;File "./samples/vsphere/vcenter/vm/list_vms.py", line 42, in __init__&lt;BR /&gt;session=session)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/vmware/vapi/vsphere/client.py", line 175, in create_vsphere_client&lt;BR /&gt;hok_token=hok_token, private_key=private_key)&lt;BR /&gt;File "/usr/local/lib/python3.6/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.6/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.6/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.6/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.6/site-packages/vmware/vapi/bindings/stub.py", line 202, in invoke&lt;BR /&gt;ctx)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/vmware/vapi/security/client/security_context_filter.py", line 102, in invoke&lt;BR /&gt;self, service_id, operation_id, input_value, ctx)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/vmware/vapi/provider/filter.py", line 76, in invoke&lt;BR /&gt;service_id, operation_id, input_value, ctx)&lt;BR /&gt;File "/usr/local/lib/python3.6/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.6/site-packages/vmware/vapi/protocol/client/msg/json_connector.py", line 122, in _do_request&lt;BR /&gt;headers=request_headers, body=request_body))&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/vmware/vapi/protocol/client/rpc/requests_provider.py", line 98, in do_request&lt;BR /&gt;cookies=http_request.cookies, timeout=timeout)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request&lt;BR /&gt;resp = self.send(prep, **send_kwargs)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send&lt;BR /&gt;r = adapter.send(request, **kwargs)&lt;BR /&gt;File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 514, in send&lt;BR /&gt;raise SSLError(e, request=request)&lt;BR /&gt;requests.exceptions.SSLError: HTTPSConnectionPool(host='x.x.x.x', port=443): Max retries exceeded with url: /api (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;plz help me on this.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 17:36:14 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Discussions/Does-vsphere-automation-sdk-python-require-vddk/m-p/2949596#M2194</guid>
      <dc:creator>dbiswas91</dc:creator>
      <dc:date>2023-01-19T17:36:14Z</dc:date>
    </item>
  </channel>
</rss>

