RSS

PowerCLI VUM 5.5: Get-baseline stackoverflow error

24 Sep

Update: PowerCLI VUM 6.0 seemed to have solved this problem

I ran in the following error when trying to get baseline via PowerCLI VUM

get-baseline -entity "clustername"

Powershell will then crash with stackoverflow error

A bit of search doesn’t reveal any solution or fixed to it, but one post seems to solve the problem for me, even though its talking about Windows 7/8 and I am running powershell on a Windows 2008R2 server. Apparently, this behaviour has been on-going since VUM 5.1.

http://www.virten.net/2012/10/stackoverflowexception-with-update-manager-powercli-and-wmf-v3/

The solution is to run powershell in version 2 compatible mode. However, if you try to amend the PowerCLI shortcut, you will find that it already has maxed out the number of character allowed and you cannot add anymore parameters. The solution is simply to create a CMD file, copy and paste the PowerCLI launch commands and add “-version 2” to the parameters. Remember to add “-version 2” immediately after the EXE and not at the end of the rest of the parameters.

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -version 2 -psc "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\""

Here is my powershell environment and after running in version 2

I have PowerCLI 5.8 installed with VUM 5.5 U2 PowerCLI.:

  • VMware-UpdateManager-Pscli-5.5.0-1302474.exe
  • VMware-PowerCLI-5.8.0-2057893
Get-PSSnapin | ft
 
Name                           PSVersion            Description
----                           ---------            -----------
Microsoft.PowerShell.Diagno... 3.0                  This Windows PowerShell sna...
Microsoft.PowerShell.Core      3.0                  This Windows PowerShell sna...
Microsoft.PowerShell.Utility   3.0                  This Windows PowerShell Sna...
Microsoft.PowerShell.Host      3.0                  This Windows PowerShell sna...
Microsoft.PowerShell.Manage... 3.0                  This Windows PowerShell Sna...
Microsoft.PowerShell.Security  3.0                  This Windows PowerShell Sna...
Microsoft.WSMan.Management     3.0                  This Windows PowerShell sna...
VMware.VimAutomation.Core      2.0                  This Windows PowerShell sna...
VMware.VimAutomation.Vds       2.0                  This Windows PowerShell sna...
VMware.VumAutomation           2.0                  This Windows PowerShell sna...
VMware.VimAutomation.License   2.0                  This Windows Powershell sna...
VMware.DeployAutomation        2.0                  Cmdlets for Rule-Based-Depl...
VMware.ImageBuilder            2.0                  This Windows PowerShell sna...
VMware.VimAutomation.Storage   2.0                  This Windows PowerShell sna...

$psversiontable (After running in version 2)

Name                           Value
----                           -----
CLRVersion                     2.0.50727.5485
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1


$psversiontable (Before running in version 2)

Name                           Value
----                           -----
WSManStackVersion              3.0
PSCompatibleVersions           {1.0, 2.0, 3.0}
SerializationVersion           1.1.0.1
BuildVersion                   6.2.9200.16398
PSVersion                      3.0
CLRVersion                     4.0.30319.1026
PSRemotingProtocolVersion      2.2

Advertisements
 
Leave a comment

Posted by on September 24, 2015 in powershell, Scripts, vmware

 

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: