We are running ESX 4.0 on HP DL380G6 servers. I created a cluster with three hosts and enabled HA and DRS. I can use the VSphere GUI to tell a host to enter Maintenance Mode, and since it is in a DRS enabled cluster, it will migrate it's VMs to the other hosts in the cluster and all is well. When I try to do the same thing in PowerCLI (i.e. : Set-VMHost -VM <VMHostName> -State "Maintenance"), I get the message: "There are one or more powered on virtual machines on host: <VMHostName>. The host will go into maintenance mode once all virtual machines are powered off." We are trying to create some Security Updates scripts and would like the capability to do this without having to specify the migration of each VM manually by name.
Any ideas?