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 in place of <conn_options>.
To enter maintenance mode
Run vicfg-hostops <conn_options> --operation enter to enter maintenance mode.
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 datacenter in maintenance mode by using the --cluster or --datacenter option. Do not use those options unless suspending all virtual machines in that cluster or datacenter is no problem.
You can later run vicfg-hostops <conn_options> --operation exit to exit maintenance mode.