Automating the process of starting and stopping virtual machines on Vcenter/ESXi
search cancel

Automating the process of starting and stopping virtual machines on Vcenter/ESXi

book

Article ID: 390139

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This article explains how to configure the virtual machines to start and stop automatically when powering an ESXi 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.

Environment

VMware vSphere 6.x

VMware vSphere 7.x

VMware vSphere 8.x

Resolution

Important Note:

  • Automatic Startup and Shutdown settings for virtual machines are only used when the ESXi host is actually being shutdown 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.
  • 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 vSphere HA enabled. 

  • Log into your vSphere client and select the ESXi host you want to configure. 
  • Go to the Configure Tab.
  • Select "Virtual Machine Startup/Shutdown" under Virtual Machines.
  • Click "Edit" on the right hand side.
  • Select Automatically start and stop the virtual machines with the system
  • Configure the default shutdown behavior

Set options (optional):

  1. Start Delay: Define a delay before the VM starts after the ESXi host boots up. 
  2. Stop Action: Choose how to shut down the VM (e.g., "Guest Shutdown", "Power Off"). 
  3. Wait for Heartbeat: Option to wait for a signal from the guest operating system before shutting down. 
  • Save the settings.
  • You have option to select all VMs under Manual startup & Move to Automatic Startup.