I'm still researching, but it looks like a latency issue between VMware and AD.
I have submitted a request to the VMware admins to review the following KB articles:
- Using the lw-measure tool to detect latency between vCenter Server and Active Directory domain controllers (79317)
- Using checkADConfig to detect connectivity and DNS issues between vCenter Server and Active Directory (79323)
Unfortunately, I don't know if or when they will get around to checking.
So, I'm back to looking at if I can get some performance data via the RestAPI.
My issue is this, I have a Lamda in AWS that lets me call a PowerShell script, but it is limited to 7 seconds of wall time. That means I must ensure the script finishes in 7 seconds or less. Hence, the desire to reduce how long it takes to authenticate.
In any case, assuming that the same vSphere metrics are available in the vStats Rest API, I attempted the following using this PowerCLI script as a reference:
$results = Get-Stat -Entity "VM-85" -Start $start -Finish $end -Stat "cpu.usage.average"
But when I attempted the same thing with Rest API, I got no results:
curl -X GET 'https://vcenter.lcl/api/stats/data/dp?cid=cpu.usage.PCPU&metric=cpu.usage&resources=type.VM=vm-85' -H 'vmware-api-session-id: token'
I guess I am asking if my assumption is valid that I can get the same metrics via RestAPI that I can get with PowerCLI? And if so, am I pursuing the correct API resource?
Am I out in left field on this?