1

I am using ESXi 6.5 (free licence). Occasionally, one of my virtual servers (ubuntu 18.04) running on the esxi host freezes. Symptoms: the server is no longer accessible via http(s) or ssh and doesn't respond to ping. It is also not accesible via the console. The vmware tools status goes from 'Yes' to 'Installed but not running'). The vm remains 'powered on'. The esxi host and the other vms running on it all remain fully functional. There are no obvious resource issues. I can manually restart the vm via the esxi web interface or remote-restart the failed virtual machine via the vSphere Mobile app.

Obviously I need to investigate the reason why this one vm periodically fails, but that is a separate question, and not what this post is about.

My question is this: is there a watchdog function I can enable to restart the linux virtual machine automatically? Failing an inbuilt watchdog function (I can't find any via the web interface), is there a way of achieving this by connecting to the esxi host ssh service and restarting the vm with a scripted cli command? (I can use ping for monitoring)

Thanks, Jon

ebahn
  • 33
  • 6

1 Answers1

2

vSphere is capable of restarting VMs when the VMware tools are unresponsive with it's HA functionality:

enter image description here

The free version of ESXi is not capable of this.


Basically you can restart a VM via SSH using the vim-cmd command.

~ # vim-cmd vmsvc/power.reset
Insufficient arguments.
Usage: power.reset vmid

Reset the specified virtual machine.

You can get the vmid with this command:

vim-cmd vmsvc/getallvms

I am however not quite certain if this is allowed in the free license of ESXi. The license puts heavy restrictions on the features of the host and I don't have a host with a free license handy right now to test it.

If it is allowed you can use it to restart the VM with external monitoring.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
  • Thanks, Gerald, brilliant! The vmsvc/power.reset works, and I can confirm that the functionality is enabled on free-licenced vmware esxi 6.5. – ebahn Sep 19 '18 at 17:30