VMware Cloud Community

Does putting host in maintenance mode from vim-sdk directly and not through vcenter automatically migrate VM to other host in cluster?


    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?



Labels (1)
Tags (1)
0 Kudos
2 Replies

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

~Sai Garimella

0 Kudos
VMware Employee
VMware Employee

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.

Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

0 Kudos