Tocano
Enthusiast
Enthusiast

Get-Log: The operation has timed out

Jump to solution

So we have a script that takes an ESXi host and just does:

Connect-Viserver [ESXihostname] -Credential (Import-clixml [credfile])
Get-Log -Bundle -DestinationPath E:\Logs\

However, about exactly 5 min after the execution of Get-Log, the cmdlet consistently errors with:

Get-Log : 3/23/2017 12:05:02 PM    Get-Log        The operation has timed out At line:1 char:1 + Get-Log -Bundle -DestinationPath E:\Logs\ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo: NotSpecified: (:) [Get-Log], ViError     + FullyQualifiedErrorId : Client20_QueryServiceImpl_WaitForUpdates_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetLog

And for the life of me, I cannot find a timeout that extends this.

Set-PowerCliConfiguration -WebOperationTimeoutSeconds -1
$vmHost | Get-AdvancedSettings -Name 'UserVars.ESXiShellTimeOut'  (equals 0)

$vmHost | Get-AdvancedSettings -Name 'UserVars.ESXiShellInteractiveTimeOut'  (equals 900)

There's an old KB about modifying the timeout on the query service, but this applied to vCenter 4, and doesn't seem applicable now. So I'm struggling to find any setting to modify this timeout and allow a Get-Log execution to complete (vSphere client takes just over 15 min to run).

Any help would be appreciated.

Get-Log;operation timed out;weboperationtimeoutsecond

1 Solution

Accepted Solutions
Tocano
Enthusiast
Enthusiast

I did do a Get- after doing the Set- and it showed what I expected. But seeing the $global:DefaultVIServer.ExtensionData.Client.ServiceTimeout still set to 300 is what tipped me off. I then did a Disconnect-VIServer for my existing session I'd been working in and then when I reconnected, this value was updated to -1 and Get-Log did not time out.

So to those that may read this in the future: it appears that Set-PowerCLIConfiguration -WebOperationTimeout does not affect existing PowerCLI vCenter/ESXi connections, only future ones.

Thanks Luc for the hint in the right direction.

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership

Did you do a Get-PowerCLIConfiguration after the Set-?

What value does this show after the Connect-ViServer?

$global:DefaultVIServer.ExtensionData.Client.ServiceTimeout


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

0 Kudos
Tocano
Enthusiast
Enthusiast

I did do a Get- after doing the Set- and it showed what I expected. But seeing the $global:DefaultVIServer.ExtensionData.Client.ServiceTimeout still set to 300 is what tipped me off. I then did a Disconnect-VIServer for my existing session I'd been working in and then when I reconnected, this value was updated to -1 and Get-Log did not time out.

So to those that may read this in the future: it appears that Set-PowerCLIConfiguration -WebOperationTimeout does not affect existing PowerCLI vCenter/ESXi connections, only future ones.

Thanks Luc for the hint in the right direction.

View solution in original post

0 Kudos