-
How to collect all VMs by a resource pool and its child pools? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@lugerlee Take a look here: https://github.com/vmware/govmomi/blob/main/examples/virtualmachines/main.go govmomi/examples/virtualmachines/main.go Lines 39 to 42 in 252e157 If you replace |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help! |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help! |
Beta Was this translation helpful? Give feedback.
@lugerlee Take a look here:
https://github.com/vmware/govmomi/blob/main/examples/virtualmachines/main.go
govmomi/examples/virtualmachines/main.go
Lines 39 to 42 in 252e157
If you replace
c.ServiceContent.RootFolder
with a ManagedObjectReference to the resource pool it should return the VirtualMachine values from the specified pool recursively.