Hi Rajesh, I have seen System.OutOfMemoryException thrown on Windows Server 2008 R2 which has not yet had windows updates applied. I don't know PowerCli so i don't know if it requires large memory allocation (winrm sets quotas on memory, cpu etc - see https://msdn.microsoft.com/en-us/library/ee309367(v=vs.85).aspx - so it is possible you might need to increase one or more quota settings.
Also it might be worth trying vmware_guest module and connecting from your ansible controller to vSphere directly, rather than going via a windows host. Hope this helps, Jon On Tuesday, December 6, 2016 at 11:13:20 AM UTC, Rajesh N wrote: > > Folks, > I have an Ansible server and a Windows PowerShell server with PowerCli. > I encapsulate PowerCli commands within PowerShell scripts and call them in > Ansible. > > It works on one Windows server and doesn't on another. > Getting error as below > "Connect-VIServer Exception \r\nof type > 'System.OutOfMemoryException' was thrown. > NotSpecified: (:) [Connect-VIServer], ViError\r\n+ FullyQualifiedErrorId : > Client20_ConnectivityServiceImpl_Reconnect_Excep > \r\ntion,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer\r\n\r\nGet-Datacenter > > : Get-Datacenter > You are not \r\ncurrently connected to any servers. Please connect first > using a Connect \r\ncmdlet" > > Is there any requirements that I need to follow? > I'm able to run normal powershell scripts via ansible on both windows > servers and am able to run powercli commands within the windows servers. > > Kindly suggest. > > Regards, > Rajesh > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d0a47ed7-0f3f-494c-83f0-39ecda64c866%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
