VMware Cloud Community
cjeff123
Contributor
Contributor
Jump to solution

Automating Datastore Migration For VMs Based Off Host

Hey all Im trying to figure out if its possible to migrate VM datastore based off of the host the VM resides on. Im essentially attempting a poor mans vSAN. The idea would go as follows:

Host A and B both have identical TruNAS iSCSI data stores as well the same compute resources. When host A is running the compute resources for a VM the data store resides on host B and host A runs the shadow for FT. This way if host A fails the VM can migrate compute resources to host B, if host B fails the shadow datastore will take over on host A.

In testing I have noticed that when the compute VM migration happens from Host A to Host B and Host A comes back the VM will continue to use Host B for compute and datastore resources. I would like to automate this so that the datastore is always opposite of the host running as the compute. This way the VMs will always have somewhere to fail to as long as one of the hosts is up,

Is this is possible? Or is there is a better way to accomplish this without paying for vSAN?

Reply
0 Kudos
1 Solution

Accepted Solutions
kastlr
Expert
Expert
Jump to solution

Hi,

I'm not quite sure if I did fully understood your design.

Whenever a VM will be powered on the ESXi Server has to have access to the datastore the VM resides on.
Otherwise that server wouldn't be able to start the Vm simply because he couldn't access the VM vmdks (and other content stored on the datastore).
So if your VM is running on host A the datastore must be accessible aka mounted on that physical ESXi Server.

VM configured to use (or be protected with) FT does have their own set of vmdks which could reside on a different datastore.

It's possible to use VM affinity rules with vSphere, check out the following article.

Using Virtual Machine Affinity Rules without vSphere DRS
 


Hope this helps a bit.
Greetings from Germany. (CEST)

View solution in original post

3 Replies
cjeff123
Contributor
Contributor
Jump to solution

Anybody???

Reply
0 Kudos
kastlr
Expert
Expert
Jump to solution

Hi,

I'm not quite sure if I did fully understood your design.

Whenever a VM will be powered on the ESXi Server has to have access to the datastore the VM resides on.
Otherwise that server wouldn't be able to start the Vm simply because he couldn't access the VM vmdks (and other content stored on the datastore).
So if your VM is running on host A the datastore must be accessible aka mounted on that physical ESXi Server.

VM configured to use (or be protected with) FT does have their own set of vmdks which could reside on a different datastore.

It's possible to use VM affinity rules with vSphere, check out the following article.

Using Virtual Machine Affinity Rules without vSphere DRS
 


Hope this helps a bit.
Greetings from Germany. (CEST)
cjeff123
Contributor
Contributor
Jump to solution

Thank you very much for the response. I know the topology is a little confusing. The design aims to mimic running redundant SAN servers virtually. Because each host has an iSCSI target to the datastore that lives virtually on the other host, every host has access to every datastore. I think I may be accomplish what I am after with Affinity Rules. Ill let you know if it works out!

Reply
0 Kudos