Hallo, I 'm trying to set up an alarm in vcenter 6.7, to start a VM if it is powered off or somebody has shutdown it.
Sometimes users shutdown this VM (used as virtual desktop win10), and than they call me to power on VM again.
I set an alarm on VM, but it doesn't work. If I shutdown this VM, than it does not turn on again after shutdown, even if I set this alarm/rule.
I have created alarm with this options:
If guest OS shutdown, then trigger alarm and show as warning > PowerOn VM > enable
If VM powered off, then trigger alarm and show as warning > PowerOn VM > enable
no results. VM remains powered off.
Moderator: Moved to vSphere Discussions - not specific to ESXi
Thank you for your suggestion, but I need to act in that way. GPO is not a solution in this case.
Sometimes it is correct that user have to shutdown VM.
But I need to control in this way. I have asked why I am not able to trigger this function via alarm.
I believe your alarm isn’t working as your users are not carrying out a “Guest OS shutdown” task through vSphere - they’re doing that directly through Windows and vSphere has no idea why the VM goes to a powered off state.
Perhaps the answer is to have a script running which sends a PING to the FQDN of the guest OS and it does not get a response it sends a VM power on request to your vCenter Server. This may be possible with PowerCLI, would you like me to move this thread to the PowerCLI area here? (As a moderator)
An alternative (I think) is to deploy something like Horizon and use desktop pools, it can keep track of the number of available VMs and manage them for you.
I understood that, mentioned why I think your alarm isn't working, and have offered a couple of suggestions - what else are you expecting exactly?
My guess is that the action cannot be carried out because the guest is still shutting down and the power state of the VM is still "on".
This should help - try changing the alarm trigger to VM powered off: https://kb.vmware.com/s/article/1026818
It works with VM powered off option.
I have made a shutdown from windows 10 guest OS, and after power off, vm is started again.
After this automated triggered start, if I try to shut down VM again, it shuts down but it doesn't restart automatically.
In vcenter console, I see yellow warning. I can acnowledge it or reset to green, but VM stay off.
I have to manually start it.
It seems this alarm setting, works only one time