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>.
vicfg-hostops suspends virtual machines by default, or powers off the virtual machine if you run
vicfg-hostops --action poweroff.
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>.
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.