Loading

×Sorry to interrupt
This page has an error. You might just need to refresh it.
[NoErrorObjectAvailable] Uncaught ReferenceError: addCTracking is not defined
Failing descriptor: {markup://c:KM_ArticleThemeLayout}

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

My Subscriptions

Loading

Knowledge Base

Automating the process of starting and stopping virtual machines on VMware ESX\ESXi (850)

Last Updated: 4/12/2024Categories: How toTotal Views: 32621Language:
Chinese (Simplified)JapaneseEnglish

41 like this article

Subscribe to get an email
newsletter with new updates

41 people found this helpful Please provide article feedback:

Learn how VMware Skyline Advisor and Skyline Health Diagnostics work together to provide proactive intelligence and self-service log analysis.

Use Skyline Advisor to avoid issues before they occur across VCF, vSphere, vSAN, NSX, vROps & Horizon. Skyline Findings are based on top KBs, VMSAs/CVEs and design best practices.

Use Skyline Health Diagnostics to root cause vSphere & vSAN logs when an issue occurs. Skyline Health Diagnostic Findings are based on top KBs and VMSA/CVEs. You can use the Skyline Health Diagnostics tool in online or offline mode.

If you require additional help from technical support, please use Skyline Advisor to initiate a Log Assist to reduce time to upload logs. TSEs can also initiate logs to reduce effort.

Details

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.

Solution

ESX 4.x, ESXi 5.x, and 6.0

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:

Access the settings:

Give focus to the host in vCenter.

Click the Configuration tab.

Select Virtual Machine Startup / Shutdown under Software.

Click Properties in the upper right hand side of the window.

Select the options you want:

In order to be able to configure any options, enable Allow virtual machines to start and stop automatically with the system.

Enter a value for the Default Startup Delay, in order to delay the startup activity for a period of time after the boot process completes.

Note: It may be required to shutdown the virtual machine to apply this setting if you receive the error:

The attempted operation cannot be performed in the current state (Powered on)

Enter a value for the Default Shutdown Delay, in order to delay the shutdown activity for a period of time. Select the Shutdown Action to be performed:

Guest Shutdown, to shut down the guest gracefully. This requires an updated version of VMware Tools to be installed in the guest.

Power off, to abruptly stop power to the virtual machine, such as pulling the power cord on a physical machine.

Suspend, to pause the virtual machine at that moment in time, like hibernating a physical machine.

To start up the virtual machines in a particular order, configure the three Startup Order categories:

Automatic: This category allows you to choose the sequence, by moving machines into this category, then arranging them in order.

Any order: In this category, the machines are started in whatever sequence the host prefers (more or less randomized).

Manual: In this category, the default, the machines are not automatically restarted. You must power them on manually.

Click OK when finished.

VMware ESX 3.0 and 3.5

You can manage startup and shutdown options using the VMware Infrastructure or vSphere client.

To manage virtual machine startup and shutdown options:

Log into the client and select an ESX host from the inventory.

Click the Configuration tab.

Under Virtual Machine Startup/Shutdown, configure your virtual machine startup options, as required.

Using vmware-cmd for ESX Server 2.1 and 2.5

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.

Using vmstartstop.pl for ESX Server 2.0.1 and earlier versions

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

Notes:

The true and poweron settings are treated the same.

Use the 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:

You can set a maximum delay of two minutes (120 seconds) between stopping each virtual machine.

The stop script loops for up to a maximum of five minutes, until all virtual machines are stopped.

This information is documented in the comments in the /usr/sbin/vmstartstop.pl file.

Additional Information

For translated versions of this article, see:

日本語: VMware ESX\ESXi 上の仮想マシンの起動と停止のプロセスを自動化する (2080679)

简体中文: 自动执行在 VMware ESX 上启动和停止虚拟机的过程 (2085834)

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)JapaneseEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

Result 1 of 1

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

VMware ESX Server

Related Versions:

VMware vSphere ESXi 6.0

VMware vSphere ESXi 5.5

VMware vSphere ESXi 5.1

VMware vSphere ESXi 5.0

VMware ESXi 4.1.x Installable

VMware ESXi 4.1.x Embedded

VMware ESXi 4.0.x Installable

VMware ESXi 4.0.x Embedded

VMware ESXi 3.5.x Installable

VMware ESXi 3.5.x Embedded

VMware ESX Server 3.5.x

VMware ESX Server 3.0.x

VMware ESX Server 2.5.x

VMware ESX Server 2.1.x

VMware ESX Server 2.0.x

VMware ESX Server 1.x

VMware ESX Server 1.5.x

VMware ESX 4.1.x

VMware ESX 4.0.x

view all

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant