Enabling and disabling maintenance mode
If you want to shut down, patch, upgrade, or reconfigure a host, you do not want any virtual machines running on the host. If you put a host in maintenance mode, you are sure that no virtual machines will be moved to or started on the host. If the host is running on a fully automated DRS-enabled cluster, the DRS will move the running virtual machines from the host to other hosts in the cluster using vMotion.
The following screenshot of the vSphere Web Client shows the different DRS automation levels that a cluster can have:
To put a host in maintenance mode, you have to use the Set-VMHost
cmdlet.
This cmdlet has the following syntax:
Set-VMHost [-VMHost] <VMHost[]> [[-State] <VMHostState>] [-VMSwapfilePolicy <VMSwapfilePolicy>] [-VMSwapfileDatastore <Datastore>] [-Profile <VMHostProfile>] [-Evacuate] [-TimeZone <VMHostTimeZone>] [-LicenseKey <String>] [-VsanDataMigrationMode <VsanDataMigrationMode>] [...