New-VM PowerCLI command times out after upgrade to vCenter 8
search cancel

New-VM PowerCLI command times out after upgrade to vCenter 8

book

Article ID: 414859

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

After upgrading to vCenter 8, the New-VM PowerCLI command times out after 5 minutes with the message below:

  • Severity : Error
    TargetSite :
    Message : New-VM A task was canceled.
    Data : {[ParameterValues, VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.CmdletParametersDictionary]}
    InnerException : System.Threading.Tasks.TaskCanceledException: A task was canceled.
  • The task in vCenter completes successfully. 
  • After configuring the timeout to be greater than 5 minutes with Set-PowerCLIConfiguration -WebOperationTimeoutSeconds ###, the task will still timeout after 5 minutes. 

Environment

vSphere 8.x

Resolution

Set timeout to infinite, then set back to a specific timeout period: 

Set-PowerCLIConfiguration -WebOperationTimeoutSeconds -1 

Now configure the timeout to a set time above 5 minutes:

Set-PowerCLIConfiguration -WebOperationTimeoutSeconds 600

The above command sets the timeout to 10 minutes. Now the New-VM command should not timeout after 5 minutes. 

Additional Information