vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
743 stars 602 forks source link

[VMware.Hv.Helper] Add-HvDesktop timing out #544

Open fjcoop opened 2 years ago

fjcoop commented 2 years ago

Describe the bug

When trying to run the above PowerCLI command we are receiving intermittent timeouts after100 seconds.

Does anyone know how to increase the timeout? We have a relatively large inventory of 5000 VMs which I think may be the cause.

e.g.

Exception calling "VirtualMachine_List" with "2" argument(s): "The request channel timed out while waiting for a reply after 00:01:39.9989887. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout." At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:526 char:3

Add-HVDesktop : Failed to get any Virtual Center machines with the given machines parameter At line:1 char:5

Lines 522-537;

function Get-MachinesByVCenter ($MachineList,$VcId) {

[VMware.Hv.MachineId[]]$machines = $null $virtualMachine_helper = New-Object VMware.Hv.VirtualMachineService $vcMachines = $virtualMachine_helper.VirtualMachine_List($services,$vcId) $machineDict = @{} foreach ($vMachine in $vcMachines) { $machineDict.Add($vMachine.name,$vMachine.id) } foreach ($machineName in $machineList) { if ($machineDict.Contains($machineName)) { $machines += $machineDict.$machineName } } return $machines }

Reproduction steps

1. Add-HVDesktop -PoolName Project_Windows_10 -Machines VWMRXPRJ10DV007 -Vcenter acprdtewwvcs02.*.com -HvServer $hv

Expected behavior

VM added to Horizon Pool

Additional context

No response