Entering and Exiting Maintenance Mode
You can instruct your host to enter or exit maintenance mode with ESXCLI or with vicfg-hostops.
Entering and Exiting Maintenance Mode with ESXCLI
You place a host in maintenance mode to service it, for example, to install more memory. A host enters or leaves maintenance mode only as the result of a user request.
esxcli system maintenanceMode set allows you to enable or disable maintenance mode.
When you run the vicfg-hostops vCLI command, you can specify one of the options listed in Connection Options for vCLI Host Management Commands in place of <conn_options>.
To enter and exit maintenance mode
1
Run esxcli <conn_options> system maintenanceMode set --enable true to enter maintenance mode.
After all virtual machines on the host have been suspended or migrated, the host enters maintenance mode. You cannot deploy or power on a virtual machine on hosts in maintenance mode.
2
Run esxcli <conn_options> system maintenanceMode set --enable false to have a host existing maintenance mode.
If you attempt to exit maintenance mode when the host is no longer in maintenance mode, an error informs you that maintenance mode is already disabled.
Entering and Exiting Maintenance Mode with vicfg-hostops
You place a host in maintenance mode to service it, for example, to install more memory. A host enters or leaves maintenance mode only as the result of a user request.
vicfg-hostops suspends virtual machines by default, or powers off the virtual machine if you run vicfg-hostops --action poweroff.
Note vicfg-hostops does not work with VMware DRS. Virtual machines are always suspended.
The host is in a state of Entering Maintenance Mode until all running virtual machines are suspended or migrated. When a host is entering maintenance mode, you cannot power on virtual machines on it or migrate virtual machines to it.
When you run the vicfg-hostops vCLI command, you can specify one of the options listed in Connection Options for vCLI Host Management Commands in place of <conn_options>.
To enter maintenance mode
1
Run vicfg-hostops <conn_options> --operation enter to enter maintenance mode.
2
Run vicfg-hostops <conn_options> --operation info to check whether the host is in maintenance mode or in the Entering Maintenance Mode state.
After all virtual machines on the host have been suspended or migrated, the host enters maintenance mode. You cannot deploy or power on a virtual machine on hosts in maintenance mode.
You can put all hosts in a cluster or data center in maintenance mode by using the --cluster or --datacenter option. Do not use those options unless suspending all virtual machines in that cluster or data center is no problem.
You can later run vicfg-hostops <conn_options> --operation exit to exit maintenance mode.