<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue with running invoke-vmscript multiple times on the same VM in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584292#M87698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I upped it to 60 seconds and the issue remains. I could go higher, but 60+ seconds is an eternity for a timeout. I have yet to find a doc that lists the timeout. Is there a way to force close this connection, without disconnecting from vCenter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2012 16:17:52 GMT</pubDate>
    <dc:creator>pizzim13</dc:creator>
    <dc:date>2012-07-09T16:17:52Z</dc:date>
    <item>
      <title>Issue with running invoke-vmscript multiple times on the same VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584290#M87696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following is a test command I am running&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="_mcePaste"&gt;$PCCreds = Get-Credential&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;$VM = Get-VM -Name "Test-VM"&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;while ($VM -ne $null) &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $VM | Invoke-VMScript -GuestCredential $PCCreds -ScriptType Bat -ScriptText 'whoami' &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start-Sleep -Seconds 10&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/DIV&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While in this infinite loop I will receive a mixture of successes and failures&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN&gt;ScriptOutput
----------------------------------------------------------------------------------------------------------------------
Test-VM\user
|&amp;nbsp; 
----------------------------------------------------------------------------------------------------------------------
Invoke-VMScript : 7/9/2012 11:22:12 AM&amp;nbsp;&amp;nbsp;&amp;nbsp; Invoke-VMScript&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; While performing operation 'Connect to host service '
&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://vcenter.local/sdk"&gt;https://vcenter.local/sdk&lt;/A&gt;&lt;SPAN&gt;' at port 902' the following error occured: 'Unknown error'&amp;nbsp;&amp;nbsp;&amp;nbsp; 
At line:15 char:45
+ while ($VM -ne $null) {$VM | Invoke-VMScript &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;nbsp; -GuestCredential $PCCreds -ScriptType Bat -ScriptText 'whoami'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Start-Sleep -Seconds 60}
&amp;nbsp;&amp;nbsp;&amp;nbsp; + CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : OperationStopped: (:) [Invoke-VMScript], VimException
&amp;nbsp;&amp;nbsp;&amp;nbsp; + FullyQualifiedErrorId : Client20_VmGuestServiceImpl_VixWaitForJob_VixError,VMware.VimAutomation.ViCore.Cmdlets. 
&amp;nbsp;&amp;nbsp; Commands.InvokeVmScript
 
ScriptOutput
----------------------------------------------------------------------------------------------------------------------
Test-VM\user
|&amp;nbsp; 
----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using that same code with an array of vm objects appears to work without issue. These vms are spread across multiple hosts.&lt;/P&gt;&lt;P&gt;My guess is that this has something to do with sequential connections to same host, reaching a max connection limit, and the connection not being terminated after a successful execution of the cmdlet. Anyone seen this issue before?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 15:56:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584290#M87696</guid>
      <dc:creator>pizzim13</dc:creator>
      <dc:date>2012-07-09T15:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with running invoke-vmscript multiple times on the same VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584291#M87697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could it be a timing issue on the closing of the socket on port 902 ?&lt;/P&gt;&lt;P&gt;Did you play with the length of the sleep ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 16:02:12 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584291#M87697</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2012-07-09T16:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with running invoke-vmscript multiple times on the same VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584292#M87698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I upped it to 60 seconds and the issue remains. I could go higher, but 60+ seconds is an eternity for a timeout. I have yet to find a doc that lists the timeout. Is there a way to force close this connection, without disconnecting from vCenter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 16:17:52 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584292#M87698</guid>
      <dc:creator>pizzim13</dc:creator>
      <dc:date>2012-07-09T16:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with running invoke-vmscript multiple times on the same VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584293#M87699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As mentioned earlier, if $vm is an array of vm objects (the array I am testing has 20 vms in it), the cmdlet will run multiple times without issue. But if I change the code to run with a foreach-object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;while ($VM -ne $null) {$VM |% {$_ | Invoke-VMScript -GuestCredential $PCCreds -ScriptType Bat -ScriptText 'whoami'; Start-Sleep -Seconds 10}}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will receive the same error after the 1st or 2nd vm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 18:22:31 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584293#M87699</guid>
      <dc:creator>pizzim13</dc:creator>
      <dc:date>2012-07-09T18:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with running invoke-vmscript multiple times on the same VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584294#M87700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Against which vSphere version are you running this ?&lt;/P&gt;&lt;P&gt;And do you use PowerCLI 5.0.1 ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 07:03:34 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584294#M87700</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2012-07-10T07:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with running invoke-vmscript multiple times on the same VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584295#M87701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;vSphere version 4.1 Update 2&lt;/P&gt;&lt;P&gt;VMware vSphere PowerCLI 5.0.1 build 581491&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 12:18:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584295#M87701</guid>
      <dc:creator>pizzim13</dc:creator>
      <dc:date>2012-07-10T12:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with running invoke-vmscript multiple times on the same VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584296#M87702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I only have vSphere 5 to test against, and the way Invoke-VMScript works has changed in vSphere 5.&lt;/P&gt;&lt;P&gt;Just for info, I could not reproduce the behaviour you are seeing with vSphere 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could have a look in the vmware.log files for one of the VMs where the Invoke-VM fails.&lt;/P&gt;&lt;P&gt;There should be traces of the VIX activity in those logs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 12:57:49 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584296#M87702</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2012-07-10T12:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with running invoke-vmscript multiple times on the same VM</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584297#M87703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Following your train of thought, I downgraded to VMware-PowerCLI-4.1.1-332441 and it is working without issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 16:06:52 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Issue-with-running-invoke-vmscript-multiple-times-on-the-same-VM/m-p/2584297#M87703</guid>
      <dc:creator>pizzim13</dc:creator>
      <dc:date>2012-07-10T16:06:52Z</dc:date>
    </item>
  </channel>
</rss>

