I have the follow scenario that I'm not able to solve:
1) cluster 1 with 2 hosts
2) cluster 2 with 2 hosts
3) VCSA is on separate host
3) the hosts are in the same network 10.1.30.x
4) I've created a DSwitch too to merge all the hosts
The manual vMotion works like a charm I can move the VM from one host of cluster 2 to an host to cluster 1 or directly cluster to cluster.
What I want to do is to force both the cluster 2 hosts in maintenance mode and expect that the active VM will vMotion to the cluster 1.
Any suggestion will be appreciated.
That would be DRS across clusters, however DRS is a function to manage the compute resources of a single cluster and does not operate across multiple clusters.
Put either of the 2 hosts in the same DRS cluster into maintenance mode and the VMs should migrate (if your DRS is fully automated) to the other host in the same cluster, but this won't work across clusters.
Perhaps a PowerCLI script would be your best approach - identify all the VMs in your cluster, have them all migrate, then put the hosts into maintenance mode.
This would be the right place to post about such a script: VMware PowerCLI - I can move this thread there if you wish?
Moderator note: Moved to the PowerCLI area.
As there is no built-in function for DRS to migrate across clusters, the user wishes to achieve the equivalent with a script:
1. Identify all VMs in a cluster
2. Migrate all those VMs to hosts in a different cluster
3. Place the hosts in the first cluster into maintenance mode
The above would also need to be reversed following the maintenance window, returning all migrated VMs back into the first cluster.