Hi,
I created an alarm that trigger a powershell script.
Here is the script triggered: "C:\PowerOnSpareWeb.bat"
date /t > c:\PowerOnSpareWeb.log
time /t >> c:\PowerOnSpareWeb.log
powershell.exe -command "C:\PowerOnSpareWeb.ps1" >> c:\PowerOnSpareWeb.log
date /t >> c:\PowerOnSpareWeb.log
time /t >> c:\PowerOnSpareWeb.log
Here is the powershell script: "C:\PowerOnSpareWeb.ps1" (its purpose is to poweron VMimages in a specific ressource pool)
Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer -server localhost -User administrator -Password admin
Get-ResourcePool StandbyWebServers | Get-VM | Start-VM
The problem i have is the following:
As soon as the alarm is triggered here is what i see:
- The script is properly triggered because i can see that a file called PowerOnSpareWeb.log appeared in the c: directory with the date and time
- I can see in my task manager that powershell.exe is starting but then nothing is happening for 5 minutes approx.
- After 5 min. I have an error message in vCenter: A general system error occured: failed to run script: Script timed out, terminated
- As soon as the error message appear, my VM images are powered on as expected
What is strange is that if i run my .bat script in command line, everything is running smoothly without any problem
So it seems like vCenter is trying to do something and after it timed out it runs the script.
As anybody faced it already and has a solution ?
Any help would be really appreciated
Thanks