Some installation and update operations that use live install require the host to be in maintenance mode.

Maintenance mode is required when an update operation requires a reboot. However, you only put the host in maintenance mode manually when you use esxcli commands for update and upgrade operations.

To determine whether an upgrade operation requires the host to be in maintenance mode, see Determine Whether an Update Requires a Host to Be in Maintenance Mode or to Be Rebooted

Note: If the host is a member of a vSAN cluster, and any virtual machine object on the host uses the "Number of failures to tolerate=0" setting in its storage policy, the host might experience unusual delays when entering maintenance mode. The delay occurs because vSAN has to evacuate this object from the host for the maintenance operation to complete successfully.

When you specify a target server by using --server=<server_name>, the server prompts you for a user name and password. Other connection options, such as a configuration file or session file, are supported. For a list of connection options, see Getting Started with ESXCLI, or run esxcli --help at the ESXCLI command prompt.

Prerequisites

Install ESXCLI. See Getting Started with ESXCLI. For troubleshooting, run esxcli commands in the ESXi Shell.

Procedure

  1. Check whether the host is in maintenance mode.
    esxcli --server=<server_name> system maintenanceMode get
  2. Power off each virtual machine running on the ESXi host.
    Note: You can list all running virtual machines and retrieve the World ID of each one by running the following command.
    esxcli --server=<server_name> vm process list
    Option Command
    To shut down the guest operating system and then power off the virtual machine
    esxcli --server=<server_name> vm process kill --type soft --world-id <vm_ID>
    To power off the virtual machine immediately
    esxcli --server=<server_name> vm process kill --type hard --world-id <vm_ID>
    To force the power off operation
    esxcli --server=<server_name> vm process kill --type force --world-id <vm_ID>

    Alternatively, to avoid powering off virtual machines, you can migrate them to another host. See the topic Migrating Virtual Machines in the vCenter Server and Host Management documentation.

  3. Place the host in maintenance mode.
    esxcli --server=<server_name> system maintenanceMode set --enable true
  4. Verify that the host is in maintenance mode.
    esxcli --server=<server_name> system maintenanceMode get