VMware vSphere

 View Only
  • 1.  remote restart of a virtual machine

    Posted Jul 11, 2013 01:28 PM

    Is it possible to set up a remote restart of a Virtual Machine via a web? Recently I was asked to help with IT support for a business that uses ESXi v4.1 to run two windows 2008 OSs. I discovered that employees tend to hard restart the ESXi server each time something goes wrong. One of their virtual machines running Windows Server 2008 does crash time to time and requires a reboot. I'd like to set up a mechanism that will allows employes to restart the guest virtual machine without restarting ESXi server. Is it possible?



  • 2.  RE: remote restart of a virtual machine

    Posted Jul 11, 2013 01:45 PM

    Yes, use the vSphere client.  If there is no vCenter then you can point the vSphere client directly at the ESXi host.

    If you have vCenter and the ESXi host is licensed for HA then you can monitor the Virtual Machine and get it to automatically restart if it crashes.



  • 3.  RE: remote restart of a virtual machine

    Posted Jul 11, 2013 03:51 PM

    As a alternative you can point the web browser to the vCenter/ESXi host and login and then restart the VM's



  • 4.  RE: remote restart of a virtual machine

    Posted Jul 12, 2013 12:47 AM

    thank you for your suggestions. They don't have vCenter and if I type IP of ESXi host in a web browser I get "VMware ESXi 4 Welcome" page, which has an option to access "Web-Based Datastore Browser" but it does not seem to have an option to access restarting functions for virtual machines. I'd like to avoid giving users access to vSphere client if possible.

    "VMware ESXi 4 Welcome" page has vSphere Remote Command Line and vSphere Web Services SDK. Is there an existing script or an app that can be used to restart virtual machines remotely without logging in into a vSphere client?



  • 5.  RE: remote restart of a virtual machine

    Posted Jul 12, 2013 02:33 AM

    You can use the command line option by ssh into ESXi. and then use the  kb http://kb.vmware.com/kb/1038043



  • 6.  RE: remote restart of a virtual machine

    Posted Jul 12, 2013 11:19 AM

    Even without vCenter you can lock down the vSphere client to restrict what the user can do in it, although the granularity is not as great as it is when you have vCenter with 4.1.  I can't remember what privileges you can set with ESX 4.1 and don't have access to a 4.1 server at the moment.

    If you wanted to do it at a command line you could use PowerCLI with the following command that you could save in a .ps1 script file

    Connect-VIServer -Server <name-of-your-esx-server>

    Restart-VM -VM <name-of-your-vm>

    Disconnect-ViServer -Server <name-of-your-esx-server>

    e.g.

    Connect-ViServer -Server esx01

    Restart-VM -VM server01

    Disconnect-VIServer -Server esx01

    This will do a reset of the VM and not a clean shutdown so should work if the VM has crashed and the VMware Tools are not responding