I have setup a cluster and enabled HA/DRS. Now instead of putting a host in maintenance mode from Vcentre,
I have put host in maintenance mode from vim-sdk by directly connecting to host. I do not want to use Vcentre for
putting host in maintenance mode. In this scenario, does the User VM on the migrate on other host in cluster?
yes - both are same - the VMs should get migrated over - if there are other issues like VLANs,disks missing its another story - the tasks will get queued
Yes, VI client & Web client uses vSphere APIs internally. We can say these are ultimate applications of APIs. Whatever you can do from clients can be done from API.
In your case, if DRS is enabled in fully automated way, VMs will be migrated automatically. Otherwise you will have to migrate manually to proceed with maintenance mode.
1. If you have configured DRS anti-affinity rule configured & there are only 2 hosts in the cluster, VMs will not be migrated automatically even if DRS is in fully automated. If there are more than 2 hosts in the cluster VMs will be migrated automatically.
If there are NO this rule configured, VMs will be migrated automatically.(DRS is in fully auto mode)
2. If you have VM-Host MUST rule configured & putting host into maintenance mode leading to violation of MUST rule, DRS will not put host itself in Maintenance mode & even user also can not migrate such VMs: Only way is : you have to disable MUST rule for a while. Also note that:: MUST rules are honored by HA even DRS is disabled on cluster, it is mean that if there is host failure & restarting VMs on host is leading to violation of MUST rule, HA will not restart these VMs but will show error.