Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traverse folders in vmlist #507

Closed

Conversation

austinlparker
Copy link

This is a resubmit of #328 as I could really use that functionality in master and the original contributor seems to not be around any more. I was able to test locally that it did indeed work, although it takes some time to to traverse the folders (for instance, on a vCenter instance with about 600 VMs and quite a few folders, it took 3 minutes to traverse the folder structure and then inspect 3 VMs snapshot status)

Austin Parker and others added 2 commits May 6, 2016 09:32
Merge pull request vmware#506 from austinlparker/add-snapshot-delete
@austinlparker
Copy link
Author

Actually, turns out my filter is just garbage - it only took around 40s to traverse all the folders and build the VirtualMachineList

@dougm
Copy link
Member

dougm commented May 10, 2016

@austinlparker thanks, I keep meaning to revisit this. It should be possible to compose the PropertyCollector query such that recursion happens on the server (VC) side. When this code was originally written we were only hitting ESX directly. I've been spending some time with the PropertyCollector recently, so I'll try to get this sorted out soon.

@austinlparker
Copy link
Author

@dougm Do you have any sort of ETA? I can use my fork in the meantime - I tested this out again today when the app was sitting behind the firewall and it ran much quicker. When I was testing last week, I was running over VPN through a spotty cell connection. It's certainly not much slower than what I'm using in pyvmomi.

@dougm
Copy link
Member

dougm commented May 10, 2016

@austinlparker hopefully later this week or early next

@ErezHorev
Copy link

+1
Need this as well

@austinlparker
Copy link
Author

@dougm Any update here?

@dougm
Copy link
Member

dougm commented Aug 2, 2016

@austinlparker apologies for the long delay. This is very high on my list, but other things keep getting in the way. I still want to look at supporting recursion for types other than VirtualMachine, have an option to enable/disable, tests, etc.

@austinlparker
Copy link
Author

Thanks for letting me know! If there's anything I can specifically do to help, mention me and I can take a crack at implementing some stuff to help out.

@dougm
Copy link
Member

dougm commented Oct 14, 2016

Still haven't gotten to this yet, but getting closer.

@rdeusser
Copy link

@dougm I could also use this. Have you made any progress?

dougm added a commit to dougm/govmomi that referenced this pull request Feb 11, 2017
Prior to this change, the Finder behaved like the 'ls' command and
as such required a Folder name or wildcard in the path argument to
find resources within folders.  The original "list" mode of the Finder
is maintained, but will now switch to "find" mode if the path argument
does not contain a "/".  See find/doc.go for details.

The public Finder method signatures remain the same, with the exception of
ManagedObjectListChildren which now takes an optional (variadic) list of
types.

No new public methods or types have been added.

The 'list.Recurser' type is no longer exported and has moved to an unexported
type within the find package.  This part of the change assumes that 'list.Recurser'
was not used directly outside of the govmomi repo.

The tests depend on the Go based vCenter simulator, which currently lives
in the vmware/vic repo, but will be moving to the govmomi repo at some point.

Fixes vmware#190
Fixes vmware#519
Fixes vmware#540

Closes vmware#507
Closes vmware#593
@dougm
Copy link
Member

dougm commented Feb 11, 2017

Apologies again for the long delay. Please review #663 - the change applies the same behavior to all resource types, rather than just the VirtualMachine type in this PR.

dougm added a commit to dougm/govmomi that referenced this pull request Feb 11, 2017
Prior to this change, the Finder behaved like the 'ls' command and
as such required a Folder name or wildcard in the path argument to
find resources within folders.  The original "list" mode of the Finder
is maintained, but will now switch to "find" mode if the path argument
does not contain a "/".  See find/doc.go for details.

The public Finder method signatures remain the same, with the exception of
ManagedObjectListChildren which now takes an optional (variadic) list of
types.

No new public methods or types have been added.

The 'list.Recurser' type is no longer exported and has moved to an unexported
type within the find package.  This part of the change assumes that 'list.Recurser'
was not used directly outside of the govmomi repo.

The tests depend on the Go based vCenter simulator, which currently lives
in the vmware/vic repo, but will be moving to the govmomi repo at some point.

Fixes vmware#190
Fixes vmware#519
Fixes vmware#540

Closes vmware#507
Closes vmware#593
dougm added a commit to dougm/govmomi that referenced this pull request Feb 11, 2017
Prior to this change, the Finder behaved like the 'ls' command and
as such required a Folder name or wildcard in the path argument to
find resources within folders.  The original "list" mode of the Finder
is maintained, but will now switch to "find" mode if the path argument
does not contain a "/".  See find/doc.go for details.

The public Finder method signatures remain the same, with the exception of
ManagedObjectListChildren which now takes an optional (variadic) list of
types.

No new public methods or types have been added.

The 'list.Recurser' type is no longer exported and has moved to an unexported
type within the find package.  This part of the change assumes that 'list.Recurser'
was not used directly outside of the govmomi repo.

The tests depend on the Go based vCenter simulator, which currently lives
in the vmware/vic repo, but will be moving to the govmomi repo at some point.

Fixes vmware#190
Fixes vmware#519
Fixes vmware#540

Closes vmware#507
Closes vmware#593
@dougm dougm closed this in #663 Feb 13, 2017
dougm added a commit that referenced this pull request Feb 13, 2017
Prior to this change, the Finder behaved like the 'ls' command and
as such required a Folder name or wildcard in the path argument to
find resources within folders.  The original "list" mode of the Finder
is maintained, but will now switch to "find" mode if the path argument
does not contain a "/".  See find/doc.go for details.

The public Finder method signatures remain the same, with the exception of
ManagedObjectListChildren which now takes an optional (variadic) list of
types.

No new public methods or types have been added.

The 'list.Recurser' type is no longer exported and has moved to an unexported
type within the find package.  This part of the change assumes that 'list.Recurser'
was not used directly outside of the govmomi repo.

The tests depend on the Go based vCenter simulator, which currently lives
in the vmware/vic repo, but will be moving to the govmomi repo at some point.

Fixes #190
Fixes #519
Fixes #540

Closes #507
Closes #593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants