I updated my vsphere from 4.0 to 4.1, tools, my powershell tookit,and i noticed that now I cannot invoke script. Everything has been updated.
Now I have some scripts using Invoke-VMScript that error the same on all installs of PowerCLI, If I type in this command (the vm IS powered on for sure and tools are running, and vsphere client shows its powered and all good):
$vm = Get-VM myVM
Invoke-VMScript -VM $vm -ScriptText "dir" -HostUser root -HostPassword CorrectRootPass -GuestUser administrator -GuestPassword CorrectGuestPass
I get this error:
Invoke-VMScript : 2/1/2011 1:22:50 PM Invoke-VMScript 197B3453-9367-4270-26CF-88A793C3B284 While performing operation 'Wait to connect to guest's VMware tools on VM 'myVM'' the following error occured: 'The virtual machine needs to be powered on'
At line:1 char:16
+ Invoke-VMScript <<<< -VM $vm -ScriptText "dir" -HostUser root -HostPassword CorrectRootPass -GuestUser administrator -GuestPassword CorrectGuestPass
+ CategoryInfo : OperationStopped: (:) [Invoke-VMScript], VimException
+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_VixWaitForJob_VixError,VMware.VimAutomation.Commands.InvokeVmScript
I have a couple of different clients I run the toolkit from and both are failing with the exact same error not matter what command is run.
if I echo $vm it also says the vm is powered on as well.
Was VIX upgraded while you installed the new PowerCLI version on the clients ?
You should see VIX 1.10.0.12331 with PowerCLI 4.1U1.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Was VIX upgraded while you installed the new PowerCLI version on the clients ?
You should see VIX 1.10.0.12331 with PowerCLI 4.1U1.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That was it, I assumed it got updated when I did the toolkit install.
Had that as well, sometimes the VIX update fails.
Most of the time, I uninstall VIX before upgrading PowerCLI.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference