VMware Cloud Community
miw61
Contributor
Contributor

Get all VMware Horizon machines via API call very slow

According discussion:

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Discussion-Automation-Api-s-vs-PowerCL...

An API call should be faster then a PowerCLI call, but i observe following when i want to get all machines via Powershell in a VMware Horizon 8 environment.

it takes one minute if i use the 'inventory/v2/machines' method to get all machines in my environment, and it takes two seconds if i use 'Get-HVMachineSummary' to get all my machines.

Can someone explain this,

Regards Wim

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

The Get-HVMachineSummary cmdlet uses the Horizon QueryService, a SOAP method.
While inventory/v1/machines is a REST method.
These REST methods are built differently, and apparently their implementation results in a slower result than the SOAP method in this case.



Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
miw61
Contributor
Contributor

Thanks for your quick response.
That's a pity, the intention was to monitor pool occupancy in Solarwinds via Rest API methods.
But it takes too much time to run this script.

Reply
0 Kudos
LucD
Leadership
Leadership

Perhaps talk to your TAM, he might mention this discrepancy to the Dev Team


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos