VMware Cloud Community
zpzhou
Contributor
Contributor
Jump to solution

How to make a virtual machine the last one to be migrated by DRS

I have several vms at one host, one vm provides service for others. so i want this VM to stay on the host until it has no other VMs

also i need DRS & DPM work correctly.

who can help me?

thanks

0 Kudos
1 Solution

Accepted Solutions
vijayrana968
Virtuoso
Virtuoso
Jump to solution

That is something not possible with DRS so far. How will you able to Power On this VM when host come back online. Either you can schedule a task for this particular VM to shut down at given time by right click on VM or you have option to Power Off VMs when host is entering in maintenance mode, this option is available in Update manager admin view, what that is something relevant to update manager remediation.

View solution in original post

0 Kudos
5 Replies
bhards4
Hot Shot
Hot Shot
Jump to solution

Hi,

In your case where you don't want to migrate specific VM's to other ESXi and want them to stay on one ESXi host. Here you require to add required VMs into DRS rules ( Affinity and anti-afinity rules) where DRS need to be enabled at Cluster level.

Please follow below link to apply them on requested VM's

https://pubs.vmware.com/vcd-810/index.jsp?topic=%2Fcom.vmware.vcloud.users.doc_810%2FGUID-103BE81A-0...

https://kb.vmware.com/s/article/2003128

-Sachin

0 Kudos
vijayrana968
Virtuoso
Virtuoso
Jump to solution

You need to configure VM affinity rules for this VM or group of VMs which you want to stay on particular ESXI host and don't want to migrate back and forth. You need to set up rules in DRS settings. Here is step by step guide how to da that. How to Configure VMware Affinity Rules for DRS and Storage DRS

Once you set this. DRS will work on all other VMs/workload excluding VMs you have configured affinity for.

0 Kudos
zpzhou
Contributor
Contributor
Jump to solution

Thanks for your reply.

What i want :

1. The specified VM must keep running on the host and cannot be migrated when there are other VMs.

2. The specified VM must be the last one to be migrated when DRS needs to shut down this host to conserve energy.

If i set the rule(make the specified VM must run on it's host),DRS will not try to shutdown the host to conserve energy. so I think the DRS rules can not help me solve my problem.

0 Kudos
vijayrana968
Virtuoso
Virtuoso
Jump to solution

That is something not possible with DRS so far. How will you able to Power On this VM when host come back online. Either you can schedule a task for this particular VM to shut down at given time by right click on VM or you have option to Power Off VMs when host is entering in maintenance mode, this option is available in Update manager admin view, what that is something relevant to update manager remediation.

0 Kudos
jfene72
Enthusiast
Enthusiast
Jump to solution

You might try setting an override for the VM if DPM is fully automated. But you'd still have to migrate it manually.

If vMotion is set up correctly what difference does it make if the VM is migrated first, last or somewhere in between. It will maintain network connectivity regardless or am I missing something?

0 Kudos