VMware Cloud Community
toha
Enthusiast
Enthusiast

PowerCLI 4.0 update 1, extremely slow startup

I have updated PowerCLI to 4.0 update 1 on couple servers and on both systems PowerCLI shell startup is extremely slow, it takes like 5 minutes to get prompt when it took less than 30 seconds on last version. Both systems are Windows 2003 Standard 32-bit SP 2, .net 3.5 SP 1 and PowerShell 1.0 installed.

Anyone else seeing this?

0 Kudos
33 Replies
SuperSpike
Contributor
Contributor

Hi Everyone,

Thank you for posting the helpful fixes in this thread. I have removed the "Check for publisher's certificate revocation" setting from Internet Settings. We noticed an improvment, but it is still slower than other systems.

For example, prior to making this change, both the 64-bit and 32-bit PowerCLI would start in exactly 35 seconds, every time. After making the change, this dropped to 17 seconds. That's a good improvement, but still slower than other systems in our environment (typically 3-4 seconds).

Here is some information.

Host OS: Windows Server 2008 R2 64-bit

PowerCLI Version: VMware vSphere PowerCLI 4.1 build 264274

Powershell Version: 2.0

Powershell Get-Host info:

Name             : ConsoleHost
Version          : 2.0
InstanceId       : 2983f30f-cae3-4e83-996b-d7e0579b6c67
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : fr-FR
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

This is happening for both of our vCenter servers in our Paris office (hence the CurrentCulture setting of fr-FR). This is NOT occuring in any of our other vCenter servers.

CPU and memory usage is normal. I watch Task Manager while launching PowerCLI and do not observe any significant spikes. The fact that the PowerCLI opens in 17 seconds each and every time leads me to believe it's not a resource issue, but something else.

Any ideas? I would consider changing the CurrentCulture to en-US, but I'm not sure how to do that just yet.

Powershell itself opens immediately. When I add the vmware.vimautomation.core snap-in, however, it takes 17 seconds to load, so it definitely seems to have something to do with PowerCLI (vmware.vimautomation.core) specifically.

@Virtual_EZ
0 Kudos
LucD
Leadership
Leadership

Did you already try the procedure with ngen described in How to speed-up the execution of the first PowerCLI cmdlet ?


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

0 Kudos
SuperSpike
Contributor
Contributor

I did not. My issue is opening the PowerCLI window itself. The window hangs for 17 seconds before I can even type a command. Once it's open the cmdlets are fast. This seems to be related to the vmware.vimautomation.core plugin. Even loading it manually from a normal PoSH window takes 17 seconds before I get back to the prompt.

@Virtual_EZ
0 Kudos
LucD
Leadership
Leadership

Do you have any anti-virus SW running on the client ?

If yes, can you try disabling it and check if the startup still takes that long ?


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

0 Kudos
SuperSpike
Contributor
Contributor

Yes we have anti-virus clients running on all of our vCenter servers. Disabling anti-virus did not show an improvement. Just to clarify again, if I open the native W2K8 Powershell window, it opens immediately. If I type...

add-pssnapin vmware.vimautomation.core

...it takes 17 seconds before the prompt returns.

Since PowerCLI is essentially a Powershell client with the snap-in already in place, it seems this is related directly to the time taken to load the snap-in. The PowerCLI window "opens" immediately, but it's just a black window for 17 seconds. Once loaded the normal prompt appears.

The only difference I have seen between these Paris hosts and the rest of the hosts is internet access. There is no direct internet access in Paris. Is there any reason the vmware.vimautomation.core snap-in would need internet access? What would it be connecting to? We already disabled the check for certificate revocation per the previous suggestions.

@Virtual_EZ
0 Kudos
LucD
Leadership
Leadership

Besides the certificate check none that I know off.

Can't you have a look with for example WireShark, if there is some network delay ?


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

0 Kudos
NatiAviv
Contributor
Contributor

the solution :

Disabled "Check for publisher's certificate revocation" in Internet Explorer and it now starts after 17 seconds.

how can i improve the 17 seconds delay?


0 Kudos
LucD
Leadership
Leadership

Did you run the ngen commands (see blog post that was referenced some replies up) ?


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

0 Kudos
NatiAviv
Contributor
Contributor

yes

for example for :

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe install "VimService41.XmlSerializers, Version=4.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"

i got error :

The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

0 Kudos
LucD
Leadership
Leadership

You probably have a different PowerCLI version installed.

Robert provided a function Function to speed-up the execution of the first PowerCLI cmdlet, that will run version-independent.

Check if that one does the trick.


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

0 Kudos
NatiAviv
Contributor
Contributor

i used Robert script from the powershell command line.

then tried again, and got same error.

"The system cannot find the file specified." (power cli6)

maybe i miss something in the steps?

i did like this :

(robert script is under C:\Windows\System32\WindowsPowerShell\v1.0)

1. >

PowerCLI C:\Windows\System32\WindowsPowerShell\v1.0> .\Install-PowerCLIXmlSerializer.ps1

2.

PowerCLI C:\Windows\System32\WindowsPowerShell\v1.0> Install-PowerCLIXmlSerializer

3. from command line (64 bit server)

C:\Windows\Microsoft.NET\Framework64\v2.0.50727>ngen.exe install "VimService25.XmlSerializers, Version=2.5.0.0, Culture=

neutral, PublicKeyToken=10980b081e887e9f"

missing something?

0 Kudos
NatiAviv
Contributor
Contributor

ok i got

VimService60

i changed it in the command and the "version" too, and get

"Error: Unrecognized option Version=6.0.0.0,"

0 Kudos
LucD
Leadership
Leadership

Are you sure you are running PowerCLI 4.1, as the title of this thread mentions ?

Do a Get-PowerCLIVersion.


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

0 Kudos
NatiAviv
Contributor
Contributor

i run version 6.

fixed all issues,  but still i have the problem that it takes 17 seconds to do Add-PSSnapin "VMware.VimAutomation.Core"

0 Kudos