VMware Cloud Community
Sivaramsharmar
Enthusiast
Enthusiast

Powercli is not working frequently

Hi All,

After enabling vCloud in powercli issue started for me, it posts different types of errors after some days. Some times I cannot connect to vCenter itself. like below it shows some other initializer.

I have formatted the same system one month back and again issue started now.

Previously I was not using vCloud cmdlets and I haven't faced any issue at that time.

Please do let me know if I need to provide any additional details.

Now I am getting this error.

get-vm : The type initializer for 'VMware.VimAutomation.Logging.SoapInterceptor.LoggingHelper' threw an exception. At C:\Users\sivaram\Projects\Virtual Infra Live Reports\VMware\vCenter Access\vCenter_Roles_Permission.ps1:19 char:7 + $vm = get-vm + ~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-VM], TypeInitializationException + FullyQualifiedErrorId : System.TypeInitializationException,VMware.VimAutomation.ViCore.Cmdlets.

Script I am using for permission and roles:

connect-viserver $size -user domain\sivaram -password password

Get-VIPermission |

Select Principal,Role,@{n='Entity';E={$_.Entity.Name}},@{N='Entity Type';E={$_.EntityId.Split('-')[0]}},@{N='vCenter';E={$_.Uid.Split('@:')[1]}} |

Export-csv "C:\Users\sivaram\Projects\'Admin Login'\Reports\Perm.csv" -notypeinformation

$gvip = get-vipermission | group Role | select Name

%{get-virole -name $gvip.name | select Name,@{N='PrivilegeList';E={[string]::Join([char]10,$_.PrivilegeList)}} } | Export-csv "C:\Users\sivaram\Projects\'Admin Login'\Reports\roles.csv" -notypeinformation

disconnect-viserver $size -confirm:$false

Powershell Details:

Name                           Value

----                           -----

PSVersion                      4.0

WSManStackVersion              3.0

SerializationVersion           1.1.0.1

CLRVersion                     4.0.30319.34209

BuildVersion                   6.3.9600.17090

PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}

PSRemotingProtocolVersion      2.2

PowerCLI Version:

----------------

   VMware vSphere PowerCLI 6.0 Release 1 build 2548067

---------------

Component Versions

---------------

   VMWare AutoDeploy PowerCLI Component 6.0 build 2358282

   VMWare ImageBuilder PowerCLI Component 6.0 build 2358282

   VMware License PowerCLI Component 6.0 build 2315846

   VMware vSphere PowerCLI Component 6.0 build 2548068

Reply
0 Kudos
14 Replies
LucD
Leadership
Leadership

There were a few "issues" in v6R1, can you upgrade to the latest version ?


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

Reply
0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Hi Lucd,

Thanks for your time, I have tried to upgrade to latest version 6.3 R1, but I am getting error(PFA).

I have tried to uninstall the current version and it also got failed,

Rebooted the server and also tried to upgrade it but failed again.

Reply
0 Kudos
LucD
Leadership
Leadership

That seems to indicate that there might be something wrong with the station.

Do you have the same issues on another station ?


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

Reply
0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

On another server we do have Powercli 5 Version with 2008 R2 server and not seen any issues, as we are in plan of migrating to 2012 server so we are testing powercli as well and in this station we have only Powercli installed, smoothly works for 3-4 weeks on Fresh OS Installation post problem will arise. already we have re-provisioned this server due to powercli issue.

Reply
0 Kudos
LucD
Leadership
Leadership

Afaik Windows 2012 is not in the compatibility matrix for PowerCLI.

Could that be explaining the issues you are seeing ?

os-compat.jpg


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

Reply
0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Its a typo mistake, I am using 2012 R2 SP1. Please let me know is there any solution for this issue.

Reply
0 Kudos
LucD
Leadership
Leadership

I have never encountered a PowerCLI installation that stops working after a couple of weeks.

Was that station frozen during that time ?

In other words were there OS changes made between the PowerCLI installation and the time it starts going wrong ?

These could be patches, additional roles/features, other application installations ...

Did you check the Windows eventlogs when PowerCLI starts giving errors ?


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

Reply
0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Station is not getting hung when script is executing.

I have checked event logs and not found any thing wrong.

I am facing problem only while executing the script.

Reply
0 Kudos
LucD
Leadership
Leadership

Does it happen with one specific script, or with all scripts ?


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

Reply
0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Hi Lucd,

It will happen with all scripts, Even I have tried connect-viserver vcenter.domain.com -user domain\user -password password in powercli console and this command itself returning that exception. I am not aware how to dig into this issue.

Reply
0 Kudos
LucD
Leadership
Leadership

There is something fundamentally wrong with that station.

You mentioned earlier that the PowerCLI update failed as well.

Did you reboot the station in the mean time ?

Can you do an uninstall of the current PowerCLI installation, reboot and then try to install the latest version ?


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

Reply
0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Hi Lucd,

I tried to reboot the station and tried uninstall and upgrade previously but that didn't helped me.

pastedImage_0.png

While uninstalling I am getting this error and I have navigated to this path and looked for *.ipi file in hidden file as well but no luck file itself is not there.

I have googled it and tried like granted permission etc but even though not able to uninstall powercli

This server is re-provisioned one month back due to similar issue with powercli.

Reply
0 Kudos
LucD
Leadership
Leadership

I'm not so sure this is a PowerCLI issue, this looks more like a Windows Installer issue.

There are tons of suggestions out there to fix this issue, but no specific diagnosis procedure it seems.

To name just a few I found:

  • If the installation file is on a network share, try copying it to a local drive, and install from there
  • run the installation "As Administrator"
  • stop your anit-virus service during the installation
  • reinstall Windows Installer
  • Missing permissions on folders
  • ...


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

Reply
0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Thank you so much for your efforts Lucd, I have already tried the methods you posted but still having same issue.

I will try to find some more and if it got solved I will post it.

Thanks once again Lucd

Reply
0 Kudos