VMware Cloud Community
jwnchoate
Contributor
Contributor
Jump to solution

Invoke-VMScript fails after system updates.

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.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
jwnchoate
Contributor
Contributor
Jump to solution

That was it, I assumed it got updated when I did the toolkit install.  

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos