I'm using the SDK to retrieve all powered on machines and I added mapping from VM id to IP address using the following code:
vsphere_client.vcenter.vm.guest.Identity.get(vm=vm_id).ip_address
How can I add more information such as cluster and folder for each VM?
Solved it by iterating over the clusters using the "vsphere_client.vcenter.Cluster.list()" to retrieve the cluster id and add it as a filter to the VM.FilterSpec().
Environment
sdk package version:
python version: 3.8
vSphere version: 7.0
Hi,
I'm using the SDK to retrieve all powered on machines and I added mapping from VM id to IP address using the following code:
vsphere_client.vcenter.vm.guest.Identity.get(vm=vm_id).ip_address
How can I add more information such as cluster and folder for each VM?Thank you