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 ...