Menu
InformatiWeb Pro
  • Index
  • System admin
  • Virtualization

Login

Registration Password lost ?
FR
  • Windows Server
    • WMS 2012
    • WS2012 R2
    • WS2016
  • Citrix
    • Citrix NetScaler Gateway
    • Citrix XenApp / XenDesktop
    • Citrix XenServer
  • VMware
    • VMware vSphere
    • VMware Workstation
  • Microsoft
    • Hyper-V
  • InformatiWeb Pro
  • Virtualization
  • VMware
  • Put the VMware ESXi 6.7 server in maintenance and manage the automatic shutdown and startup of VMs
  • VMware
  • VMware ESXi, VMware vSphere
  • 30 September 2022 at 13:46 UTC
  • InformatiWeb

Put the VMware ESXi 6.7 server in maintenance and manage the automatic shutdown and startup of VMs

When you need to perform maintenance on the physical server hosting your VMware ESXi hypervisor, it's important to take some precautions before shutting down your VMware ESXi hypervisor.

  1. Manually put the VMware ESXi hypervisor into maintenance mode
    1. Stop virtual machines
    2. Enable maintenance mode
    3. Stop Your VMware ESXi hypervisor
    4. Disable maintenance mode
  2. Automatically stop and start virtual machines with VMware ESXi hypervisor
    1. Enable automatic startup and shutdown of virtual machines
    2. Configure the boot order of virtual machines
    3. Stop VMware ESXi
    4. Automatic start of your virtual machines

1. Manually put the VMware ESXi hypervisor into maintenance mode

The first and safest possibility is to enable maintenance mode on your VMware ESXi hypervisor before stopping it.
Indeed, this will allow you to be sure that no more virtual machines are running and that none of them will be able to start on this physical server.

However, in order to enable maintenance mode on your VMware ESXi hypervisor, you will first need to shut down the virtual machines running on it.

1.1. Stop virtual machines

Cleanly shut down your virtual machines using the "Shut down" option.

Once you have clicked on "Stop", this option will be replaced by "Power off".
Wait while the virtual machine's guest operating system shuts down.

Once the virtual machines are stopped, continue to the next step.

1.2. Enable maintenance mode

To put your VMware ESXi hypervisor in maintenance, go to "Host" and click on : Actions -> Enter maintenance mode.

As indicated in the displayed message, when maintenance mode is enabled, you will not be able to create or start (power on) virtual machines.
In the event that your VMware ESXi hypervisor will be linked to a VMware vCenter Server, this will also prevent that server from migrating virtual machines to your hypervisor.

As specified here, you will also need to power off any virtual machines on your hypervisor before going into maintenance mode.
What you just did.

Confirm the activation of this maintenance mode by clicking on Yes.

If virtual machines are still running, a warning "Entering maintenance mode delayed" will appear.

Plain Text

VMs are still powered on. Maintenance mode will not be entered until all VMs are either migrated or powered down/suspended.

Click OK to hide this warning.
However, if you look in the "Recent tasks" block located at the bottom of the page, you will see that an "Enter Maintenance Mode" task has been started and that it will continue to run while waiting for you to shut down all the VMs on your device. hypervisor.

If all virtual machines are stopped, your VMware ESXi hypervisor will enter maintenance mode.

1.3. Stop Your VMware ESXi hypervisor

Now that your VMware ESXi hypervisor is in maintenance mode, you can safely shut it down.

Confirm the host shutdown.

You will be logged out automatically and the "The host is shutting down" message will be displayed.

1.4. Disable maintenance mode

Once the physical maintenance is complete, you can restart your server.
Once it has started, don't forget to disable the maintenance mode, since it will have remained enabled.

To do this, in "Host", click on "Actions -> Exit maintenance mode".

Now, his status is "Normal" again.

2. Automatically stop and start virtual machines with VMware ESXi hypervisor

In case you have a lot of virtual machines and especially virtual machines that can depend on each other, you can use another feature present in VMware ESXi.
With the "Autostart" feature of VMware ESXi, you can configure the automatic shutdown of running virtual machines and configure the boot order of them.

2.1. Enable automatic startup and shutdown of virtual machines

For this tutorial, we created 2 virtual machines on Windows Server 2016 (the version doesn't matter) :

  • the "WS 2016 - AD" virtual machine is an Active Directory domain controller (AD).
  • the "WS 2016 - File server" virtual machine is a file server linked to the Active Directory domain created on the above virtual machine.
    This virtual machine therefore depends on the 1st VM (WS 2016 - AD).

When starting our hypervisor, it will therefore be important that the "WS 2016 - AD" virtual machine is started first.
Then, that the virtual machine "WS 2016 - File server" be started, only when the virtual machine "WS 2016 - AD" has finished starting. Otherwise, it will not be able to connect to our Active Directory domain controller and this will notably cause authentication problems in it.

To enable and configure the automatic start and stop of virtual machines on VMware ESXi, go to : Host -> Manage -> System -> Autostart.
Then, click on : Edit settings.

The "Change autostart configuration" window appears.
As you can see, by default this feature is disabled.

Enable this feature by selecting "Enabled : Yes" and choose how the virtual machines should be shut down.

  • Power off (strongly discouraged) : corresponds to the fact of suddenly disconnecting the power outlet of the virtual machine
  • Suspend : allows you to pause virtual machines that are currently running
  • Shut down (recommended) : allows you to properly shut down the guest operating system of each virtual machine using VMware Tools that you will have previously installed in them

To manage the automatic startup and shutdown of virtual machines, you can :

  • Enabled : allows you to enable or disable the automatic startup and shutdown of your virtual machines when shutting down and starting your VMware ESXi hypervisor.
  • Start delay : choose the delay in seconds to wait between each virtual machine startup.
    Indeed, it's well known, a virtual machine consumes much more resources when it starts up than when it's already started.
    This delay therefore makes it possible to avoid unnecessarily saturating the resources of your hypervisor when it starts up. However, this can also greatly lengthen the return to service of these virtual machines.
    Either way, you can change these values for each virtual machine to start and stop later in this tutorial.
  • Stop delay : same, but when shutting down virtual machines.
  • Stop action : allows you to choose how the virtual machines should be stopped when your hypervisor is stopped. Preferably choose "Shut down" or "Suspend".
  • Wait for heartbeat : allows you to wait or not until VMware Tools has started in the virtual machine before moving on to the next virtual machine.
    Source : Need Help Understanding Virtual Machines Autostart Options In vSphere.

Then, click on : Save.

The "Host Autostart configuration was successfully updated" message is displayed.

2.2. Configure the boot order of virtual machines

By default, no virtual machine will be configured to start automatically when your hypervisor starts.
For a virtual machine to start automatically after starting your VMware ESXi hypervisor, you will need to select it from the list and click "Enable".

In our case, we are going to select our "WS 2016 - AD" virtual machine and click on "Enable".

By default, the values used for the automatic shutdown of the virtual machine, the waiting time for starting and stopping, ... will be inherited from the global settings configured previously.
If you want to change these values for this virtual machine, select it and click : Configure.

As you can see, this virtual machine will be started 1st in the boot sequence.

In our case, we changed the delays (for the tutorial).
For the 2 other settings where the value selected is "System default", this means that the values used will be the same as those defined globally (and which are displayed at the top of the page).
Then, click on : Save.

The "Autostart configuration for [VM name] was successfully updated" message will appear.

We select our 2nd virtual machine (WS 2016 - File server) and we click on "Enable".

As expected, it appears second in the autostart order and inherits globally defined values.

If you want to change the boot order of your virtual machines, select the desired virtual machine and click "Start earlier" or "Start later" to have it start earlier or later than another virtual machine.
Then, refer to the numbers indicated in the "Autostart order" column.

For the "Actions" option, this simply corresponds to the "Actions" menu for the selected virtual machine.

2.3. Stop VMware ESXi

At the moment, our 2 virtual machines are running.

We go to "Host" and we click on "Shut down" to shut down our hypervisor, as well as our virtual machines thanks to the settings configured previously.

Confirm VMware ESXi shutdown.

The "The host is shutting down" message appears.

2.4. Automatic start of your virtual machines

Once the physical maintenance on your server is finished, start it and go to the "Virtual Machines" section.
Then, open the "Recent Tasks" block located at the bottom of the page and you will see that an "Auto Start Power On" task is running.
This task is caused by configuring automatic startup of your virtual machines in your VMware ESXi hypervisor settings.

As expected, this task first starts our "WS 2016 - AD" virtual machine and waits for it to finish starting.

Then, once the VMware Tools have started, the name of the host in the operating system will be communicated to your VMware ESXi hypervisor.
Since we had configured the autostart to wait for the heartbeat signal (from VMware Tools), the "Auto Start Power On" task therefore passes to the virtual machine configured previously in the autostart order.

A 2nd "Power On VM" task therefore appears in recent tasks and our 2nd virtual machine (WS 2016 - File server) starts.

Once all the desired virtual machines have been started, the "Auto Start Power On" task will be completed.

Share this tutorial

Partager
Tweet

To see also

  • VMware ESXi 6.7 - DirectPath I/O (PCI passthrough)

    VMware 10/19/2022

    VMware ESXi 6.7 - DirectPath I/O (PCI passthrough)

  • VMware ESXi 6.7 - Enable virtualization-based security (VBS)

    VMware 1/27/2023

    VMware ESXi 6.7 - Enable virtualization-based security (VBS)

  • VMware ESXi 6.7 - Virtualize Hyper-V (nested virtualization)

    VMware 11/9/2022

    VMware ESXi 6.7 - Virtualize Hyper-V (nested virtualization)

  • VMware ESXi 6.7 - VMRC console (VMware Remote Console) presentation

    VMware 11/23/2022

    VMware ESXi 6.7 - VMRC console (VMware Remote Console) presentation

Comments

You must be logged in to post a comment

Share your opinion

Pinned content

  • Software (System admin)
  • Linux softwares
  • Our programs
  • Terms and conditions
  • Share your opinion

Contact

  • Guest book
  • Technical support
  • Contact

® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.

Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.