vsphere-automation-sdk-python
vsphere-automation-sdk-python copied to clipboard
how to get vms in folder
I am trying to get VMs from specific folder and subfolders. I've opened issue 85, but the solution doesn't provide with vms in subfolder. Is it not possible to get vms in subfolders ?
The API currently doesn't include vms in subfolders. I just checked the API doc and it doesn't mention this behavior. I will file a bug to fix the doc. I will also file a feature request to add the recursive capability to the API.
any idea on when this feature will be made available?
It seems like you can already do it now with client.vcenter.VM.list(VM.FilterSpec(folders=folder_id))
https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/VM/FilterSpec/