This article explains how to configure the virtual machines to start and stop automatically when powering an ESX Server host on and off. These settings are set on a per host basis. If you vMotion the virtual machine off the host, the settings are not retained.
Note: Automatic Startup- and Shutdown settings for virtual machines are only used when the ESXi host is actually being shut down or started. The feature does not trigger for maintenance mode. When you attempt to set an ESXi host into maintenance mode, you will need to manually shutdown the VMs for the task to be finished. Likewise, after the host has left maintenance mode, you need to manually startup the virtual machines, as they won't be automatically started.
Note: The Virtual Machine Startup and Shutdown (automatic startup) feature is disabled for all virtual machines residing on hosts that are in (or moved into) a VMware HA enabled cluster. Automatic startup is not supported when the virtual machine is HA enabled. As a result, starting with vCenter Server 5.0 Update 1, the Allow virtual machines to start and stop automatically with the system is available though enabling this feature has no affect at this time.
VMware vCenter server 4.x, 5.x, and 6.0 includes the ability to configure startup ordering. To configure these startup options:
Startup Order
categories:You can manage startup and shutdown options using the VMware Infrastructure or vSphere client.
To manage virtual machine startup and shutdown options:
Virtual Machine Startup/Shutdown
, configure your virtual machine startup options, as required.Starting with ESX Server 2.1, the Management Interface provides start and stop options for virtual machines. The script vmstartstop.pl was also removed and the functions provided by that script were incorporated into vmware-cmd.
For more information, see Setting Startup and Shutdown Options for a Virtual Machine in the ESX Server 2.5 Administration Guide.
The VMware Scripting API User's Manual discusses vmware-cmd command syntax. For more information, see Scripting API Developer Documentation.
To automatically start virtual machines, add one of these configuration options to the virtual machine's configuration (.cfg or .vmx) file:
autostart = true
autostart = poweron
autostart = resume
true
and poweron
settings are treated the same.resume
setting if you have suspended the virtual machine and want it to resume automatically.The vmware init script calls /usr/sbin/vmstartstop.pl
script. This script looks for virtual machines listed in vm-list that contain one of the preceding options in the configuration files.
If you want to automatically shut down or suspend the virtual machine as well, add one of these configuration options to the virtual machine's configuration file:
autostop = suspend
autostop = poweroff
To stagger the startup of virtual machines, add this option to each virtual machine's configuration file:
autostart.delay = n
where n
is the number of seconds ESX host waits after powering on this virtual machine before it proceeds to the next virtual machine.
Example: If you add the option autostart delay = 60
, ESX waits one minute after it starts this virtual machine before starting the next virtual machine.
The same is true for automatically stopping the virtual machines. Use this configuration option:
autostop.delay = n
Notes:
/usr/sbin/vmstartstop.pl
file.