tag:blogger.com,1999:blog-2269516327950490847.post8166890632288578944..comments2023-03-28T08:39:06.775-04:00Comments on vNugglets: Speed Up First PowerCLI 5 cmdlet -- Precompile XMLSerializersAC (@allen_crawford)http://www.blogger.com/profile/05360032132878174436noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-2269516327950490847.post-15903234494966366912016-02-09T08:07:57.033-05:002016-02-09T08:07:57.033-05:00I have the same problem. To resolve it I have turn...I have the same problem. To resolve it I have turned off in "Internet Options" snap-in checking of certificates and also a have precompiled all VMware Serializers as described. No results. The problem still the same.<br /><br />And I think that there is no solution for speed-up that pssnapins.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-85497918684671301662015-11-03T05:05:14.180-05:002015-11-03T05:05:14.180-05:00i have the same problem with powershell.
i reduced...i have the same problem with powershell.<br />i reduced the time from 1 minutes to 17 seconds <br />(my problem is in the Add-PSSnapin "VMware.VimAutomation.Core" step).<br />any ides?Anonymoushttps://www.blogger.com/profile/12411140354249370543noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-90666319822541134532015-03-09T20:15:56.169-04:002015-03-09T20:15:56.169-04:00Hello, CBaum-
Hm, connection speed, eh? This pre...Hello, CBaum-<br /><br />Hm, connection speed, eh? This pre-compiling business was to help with the speed of the first PowerCLI cmdlet after having connected to some VIServer (not with the Connect-VIServer call itself, AFAIK).<br /><br />However, there has been some recent conversation about the speed of Connect-VIServer itself. Do you happen to be using passthrough authentication (you are not specifying credentials via -Credential or -User params to Connect-VIServer)?<br /><br />If so, how does the speed compare to when you _do_ specify credentials (even if the same credentials as the user as which you are running the PowerShell session)?<br /><br />I ask as I have seen a wide difference as of late when connecting in these two different ways. The PowerCLI team has logged this behavior as a bug to investigate (as of about Sep 2014). Let us knowMattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-73455182098226019022015-03-04T14:07:39.577-05:002015-03-04T14:07:39.577-05:00Any suggestion on what to try if this fix produces...Any suggestion on what to try if this fix produces no measurable change in powerCLI connection speed? I am running powercli 5.5 and changed the lines to VimServer55 and the Version=5.5.0.0 and still see the same ~52 second connection speed. Tried it for .net 2 and .net 4 on 64-bit OS Server 2012 R2. CBaumhttps://www.blogger.com/profile/04672287205966274449noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-85438206726659564892013-04-25T11:29:57.846-04:002013-04-25T11:29:57.846-04:00The third ngen call should have said:
C:\Windows\...The third ngen call should have said:<br /><br />C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe install "VimService51, Version=5.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"<br /><br />Mike Gerber<br />LEITWERK AG<br />mgerber@leitwerk.deMike Gerbernoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-1083533488052237322013-04-25T11:26:13.102-04:002013-04-25T11:26:13.102-04:00@Genoan
I'm seeing this issue, too, with Powe...@Genoan<br /><br />I'm seeing this issue, too, with PowerShell 3.0 (.NET 4.0) and PowerCLI 5.1. After some searching, I noticed that the native images for .NET 4.0 aren't getting compiled, i.e. no Vim* directories in the native image directories for .NET 4.0:<br /><br /> ls C:\Windows\assembly\NativeImages_v4*/Vim*<br /><br />But there's a trick to make ngen work here: Force the CLR to 4.0, then use ngen and disable the force of .NET 4.0 again:<br /><br /><br />reg add hklm\software\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1<br />reg add hklm\software\wow6432node\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1<br /> <br />C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe install "VimService51.XmlSerializers, Version=5.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"<br />C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe install "VimService51.XmlSerializers, Version=5.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"<br /> <br />reg delete hklm\software\microsoft\.netframework /v OnlyUseLatestCLR /f <br />reg delete hklm\software\wow6432node\microsoft\.netframework /v OnlyUseLatestCLR /f<br /><br /><br />You might want to compile VimService51, too, i.e.<br /><br /><br />C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe install "VimService51.XmlSerializers, Version=5.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f"<br /><br /><br />(I've tried a lot of things, so send me an email if that doesn't work. I might have missed something.) After that you should see Vim* directories in the native image directory:<br /><br /><br />PS C:\Users\Administrator> ls C:\Windows\assembly\NativeImages_v4*/Vim*<br /><br /><br /> Directory: C:\Windows\assembly\NativeImages_v4.0.30319_64<br /><br /><br />Mode LastWriteTime Length Name<br />---- ------------- ------ ----<br />d---- 25.04.2013 17:00 VimService51<br />d---- 25.04.2013 17:05 VimService51.XmlSer#<br /><br /><br />This reduced my Connect-Viserver time to a few seconds.<br /><br />However, I believe .NET 4.0 is not even supported by VMware. But we're using the SANsymphony-V cmdlets in the same scripts, so we don't have much of a choice (.NET 4.0 64bit only there.)<br /><br />Mike Gerber<br />LEITWERK AG<br />mgerber@leitwerk.deMike Gerbernoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-90354926898926827492013-04-01T12:42:32.458-04:002013-04-01T12:42:32.458-04:00I have seen some latency caused by running under t...I have seen some latency caused by running under the 64bit version of powershell. This lag (16 seconds) only affected the first connect-viserver command, and subsequent commands where executed in an acceptable amount of time (1-4 seconds).<br /><br />I did validate that all vmware software was precompiled with the 64bit version of ngen. <br /><br />Eventually I found somewhere that VMWare acknowledged they needed to work on their 64bit software. I worked around the problem by explicitly launching the 32bit version of powershell (C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe). By using this work around you might not have access to the new workflow functionality built into powershell v3.Anonymoushttps://www.blogger.com/profile/14666402655165245912noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-47312148257413212312013-04-01T12:41:23.322-04:002013-04-01T12:41:23.322-04:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/14666402655165245912noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-38314351403316623102013-03-08T20:19:25.053-05:002013-03-08T20:19:25.053-05:00Hello, Genoan-
Hmm. I assume that you are gettin...Hello, Genoan-<br /><br />Hmm. I assume that you are getting an error when trying to run the command -- is that true? If so, what error message(s) do you get? And, is this on the same machine on which the commands previously worked? I am getting at: does this machine still have the 2.0 version of the .NET Framework installed (and, so, is that path to ngen.exe still valid)?MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-84731196715117928052013-03-08T20:16:52.990-05:002013-03-08T20:16:52.990-05:00Hello, Tim-
You are welcome for the update. As fo...Hello, Tim-<br />You are welcome for the update. As for uninstalling earlier serializers versions, that is a good question. My understanding has been that leaving them is acceptable, that doing so should harm nothing.MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-79534590181948923022013-02-13T18:40:01.161-05:002013-02-13T18:40:01.161-05:00Hello
After I've installed Powershell 3.0 and...Hello<br /><br />After I've installed Powershell 3.0 and PowerCLI v5.1 Release 2 this stopper working, was working great with Realease 1.<br />I've run the commands as admin again, but it didn't help.<br />I'm doing something wrong or do I need to run a different command?<br /><br />Regards<br />GenoanGenoannoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-1049787667782594992013-01-08T16:14:38.590-05:002013-01-08T16:14:38.590-05:00Thanks for the updated post. Should you also un-i...Thanks for the updated post. Should you also un-install the earlier i.e. pre 5.1 serializers or are they still required?<br />e.g. on my machine<br />>ls c:\windows\assembly\GAC_MSIL\VimService*.XmlSerializers<br /><br />VimService25.XmlSerializers<br />VimService40.XmlSerializers<br />VimService41.XmlSerializers<br />VimService50.XmlSerializers<br />VimService51.XmlSerializers<br />Timnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-73397278862149028642012-03-28T22:46:06.833-04:002012-03-28T22:46:06.833-04:00Thanks, Akos. Glad that it helped. Nice speed-up...Thanks, Akos. Glad that it helped. Nice speed-up!MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-56035439176591940122012-03-28T05:17:08.345-04:002012-03-28T05:17:08.345-04:00Awesome article, really helpful! It made the start...Awesome article, really helpful! It made the startup over 5 times as fast, so I'm a happy camper.Akos Batorfihttps://www.blogger.com/profile/00364624149127262720noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-34885513757083177552012-02-19T21:16:38.480-05:002012-02-19T21:16:38.480-05:00Very nice, Robert. Thanks for writing that functi...Very nice, Robert. Thanks for writing that function -- useful each time there is a new version of the XMLSerializers, or when installing PowerCLI on a new machine (when there are many versions of the XMLSerializers to compile). Thanks for sharing here!MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-18056278609949140142012-02-18T13:15:39.485-05:002012-02-18T13:15:39.485-05:00You can use my PowerShell Install-PowerCLIXmlSeria...You can use my PowerShell Install-PowerCLIXmlSerializer function to pre-compile the PowerCLI XML Serializers every time you install a new PowerCLI version:<br />http://rvdnieuwendijk.com/2012/02/18/function-to-speed-up-the-execution-of-the-first-powercli-cmdlet/Robert van den Nieuwendijkhttp://rvdnieuwendijk.com/noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-27711940945313557122012-02-16T23:37:22.245-05:002012-02-16T23:37:22.245-05:00Glad to have provided a little help, Robert!Glad to have provided a little help, Robert!MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-74980627521031704892012-02-16T13:06:36.356-05:002012-02-16T13:06:36.356-05:00Thanks for posting this. I never realised untill n...Thanks for posting this. I never realised untill now, that for a new version of PowerCLI you have to run these commands again for the new version.Anonymousnoreply@blogger.com