We had a virtual machine running on a VMWare Server host on Windows Server 2003.
The machine is set up with non persistent disks.
We had a windows task schedule set up that ran a batch file to reset the machine each week so that it returned to it's original state.
The batch file that we had running was:
"C:\Program Files\VMware\VMware Server\vmware-cmd" "C:\Virtual Machines\VirtualMachineName\VirtualMachineName.vmx" stop hard
"C:\Program Files\VMware\VMware Server\vmware-cmd" "C:\Virtual Machines\VirtualMachineName\VirtualMachineName1.vmx" start
We have since migrated this machine to the free version of ESXi 4.1.
Can anyone let me know if and how it is possible to schedule such a restart?
You can start, reboot, stop, and suspend virtual machines using vmware-cmd:
If you haven't already done it you will need to enable ssh access on your ESXi host.
Once you have done that you can then put vmware-cmd commands in a script and run them from cron e.g.
would stop and then start the machine "Centos 5" on the current host.
Put this in the root crontab
and you should be good to go.
Edit:
As chopper3 notes the crontab is not persistent across reboots so you will need to edit /etc/local file and add commands to recreate the root crontab e.g.
Could you also perhaps schedule a reboot within the virtual machine itself? Whether it is a Linux or a Windows VM you should be able to use cron or Task Scheduler inside the guest to perform the scheduled reboot.