VMware Cloud Community
mmaus
Enthusiast
Enthusiast
Jump to solution

Auto migrate after host restore

I have two host in a HA cluster currently with DRS turned off.  When one host failes all the VMs migrate over to the second host as expected.  I would like for the VMs to migrate back to the original host when it comes back online and service is restored.

How do I do this?

I know I can setup affinity rules to keep a VM from being migrated over to another host or to a specific host, but does this migrate the VM back if the host is restored?

From what I can see...I would have to have DRS enabled to do this which means I would need to have an Enterprise level license and not just a standard...is this correct as well?

Is there some other way to do this?

Reply
0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

There are a couple ways to go about doing this, but the simplest is going to be to use DRS VM-Host affinity rules in a "should" configuration. If a given host fails, those VMs will be restarted on the second host. When the first host returns to service, DRS will see this and move them back. Do not use a "must" configuration, otherwise the VMs will not be powered on in the case of a host failure.

View solution in original post

Reply
0 Kudos
4 Replies
daphnissov
Immortal
Immortal
Jump to solution

There are a couple ways to go about doing this, but the simplest is going to be to use DRS VM-Host affinity rules in a "should" configuration. If a given host fails, those VMs will be restarted on the second host. When the first host returns to service, DRS will see this and move them back. Do not use a "must" configuration, otherwise the VMs will not be powered on in the case of a host failure.

Reply
0 Kudos
mmaus
Enthusiast
Enthusiast
Jump to solution

Is there any other way of doing this...its a bit of a waste to have to buy a whole enterprise license just to have the benefit of not having to manually migrate the vm back to its original host?

Reply
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

Well, DRS does a lot more than that, but I get what you're saying. The only other two options that come to mind are scripted approaches: One with PowerCLI and the other (provided you have a vCenter Server Standard license) is vRealize Orchestrator. They will both require custom scripts/workflows be developed which could be a significant investment of time and effort depending on your level of familiarity with PowerShell and JavaScript, respectively.

Reply
0 Kudos
mmaus
Enthusiast
Enthusiast
Jump to solution

Thanks for the quick reply. 

Reply
0 Kudos