vSphere

 View Only
  • 1.  Get ESXi host details with VMware vSphere Automation SDK for Python

    Posted Feb 28, 2022 09:05 PM

    I wrote a script that lists all hosts that are connected to a vCenter. I can even filter hosts within a cluster.

    vsphere_client = create_vsphere_client(server=server, username=user,
    ┆ password=password, session=session)

    if args.cluster:
    cl_names = set([args.cluster])

    host_list = vsphere_client.vcenter.Host.list(
    ┆ ┆ Host.FilterSpec(clusters=cl_names))
    else:
    host_list = vsphere_client.vcenter.Host.list()

    for host in host_list:
    print(host)

    This works nicely. How do I now get details about each host. e.g. IP address, HBA WWNs, CPU, memory ...



  • 2.  RE: Get ESXi host details with VMware vSphere Automation SDK for Python

    Posted Apr 25, 2022 04:30 PM

    The WWPN information is available through 

    host.config.storageDevice.hostBusAdapter[x].portWorldWideName - replace x with respective adapter numbering.


  • 3.  RE: Get ESXi host details with VMware vSphere Automation SDK for Python

    Posted Nov 16, 2022 01:02 PM

    did you found a way to get those details?

    having same issue here, need to get cpu, mem, etc, etc