object.collect return LIMIT ? #3501
Replies: 4 comments 2 replies
-
Can you share your vCenter build number and add We did change to collecting in batches (#3408), but it is expected you'll see the same set of results. With exception of the known issue linked above. |
Beta Was this translation helpful? Give feedback.
-
will try to get trace.log here is version and build number:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @dikobrazsd , can see in the log: <WaitForUpdatesExResponse xmlns="urn:vim25">
<returnval>
<version>0_1</version>
...
<truncated>true</truncated>
</returnval>
</WaitForUpdatesExResponse> When % grep -c /WaitForUpdatesExResponse gistfile1.txt
1 When truncated=true, govc object.collect's callback returns govmomi/govc/object/collect.go Lines 467 to 469 in fc7056a The value of filter.Truncated is supposed to be propagated from WaitForUpdatesEx response to the caller here: Lines 312 to 314 in fc7056a I bisected this to PR #3331 - in that refactor, WaitOptions was changed to pass by value, rather than reference. Patch below fixes. diff --git a/property/collector.go b/property/collector.go
index 263621a0..9ee78d0d 100644
--- a/property/collector.go
+++ b/property/collector.go
@@ -276,7 +276,7 @@ func (p *Collector) RetrieveOne(ctx context.Context, obj types.ManagedObjectRefe
// propagation.
func (p *Collector) WaitForUpdatesEx(
ctx context.Context,
- opts WaitOptions,
+ opts *WaitOptions,
onUpdatesFn func([]types.ObjectUpdate) bool) error {
if !p.mu.TryLock() {
diff --git a/property/wait.go b/property/wait.go
index 07ea3cb5..dae7bf38 100644
--- a/property/wait.go
+++ b/property/wait.go
@@ -123,7 +123,7 @@ func WaitForUpdates(
return err
}
- return pc.WaitForUpdatesEx(ctx, filter.WaitOptions, onUpdatesFn)
+ return pc.WaitForUpdatesEx(ctx, &filter.WaitOptions, onUpdatesFn)
}
// WaitForUpdates waits for any of the specified properties of the specified
@@ -166,5 +166,5 @@ func WaitForUpdatesEx(
}()
- return pc.WaitForUpdatesEx(ctx, filter.WaitOptions, onUpdatesFn)
+ return pc.WaitForUpdatesEx(ctx, &filter.WaitOptions, onUpdatesFn)
} |
Beta Was this translation helpful? Give feedback.
-
@dikobrazsd fix included in the v0.40 release |
Beta Was this translation helpful? Give feedback.
-
After version 0.32 object.collect returns MAX 100(200 lines) items, how to increase it? I can't find any argument for pagination or smth.
Example:
Beta Was this translation helpful? Give feedback.
All reactions