VMware Cloud Community
benutzername
Contributor
Contributor
Jump to solution

Assign VM´s to specific Hosts

Hi,

I got a HA cluster that is distributed over 4 Datacenters. The hosts in each Datacenter can connect to the local SAN Storage and to the SAN Storage located in the other 3 Datacenters. To reduce traffic on the Datacenter interconnects each host runs only VM´s that are on the local SAN Storage.

When one host fail, the other host can run the vm´s. But then we have more traffic on the datacenter interconnects.

Is there a way that the VM´s are automatically pushed back to their origin? Maybe a script that checks it one time a day?

I add this funny drawing from me to make myself clear. :smileygrin:

0 Kudos
1 Solution

Accepted Solutions
Craig_Baltzer
Expert
Expert
Jump to solution

Finally got around to documenting these a bit and posting them

http://communities.vmware.com/docs/DOC-9212

View solution in original post

0 Kudos
10 Replies
RParker
Immortal
Immortal
Jump to solution

I think you are confused about how ESX works and what it's for.

ESX isn't just a VM host, it's a datacenter. So if you have 4 machines managing your VM's, the idea is that your ESX hosts should be exactly the same, so there is no need to put VM's on a particular host, you let VC manage your VM's and leave it alone.

Why do you need to keep certain VM's on a host or push them back to the original host? Is this some sort of asset management? When you configure an ESX cluster you should ignore the number of ESX hosts you have, and think of them as a whole. You can't lost any of them, so you are adding nodes to a network. It's like network switches, you have a need for a certain amount of ports, and you buy enough switches to accomodate your capacity. Same with ESX. You dont' worry about where your VM's are, as long as they are running. stop thinking of ESX as a group of machines, it's a managed entity of many Virtual Machines.

So you are managing at a very miniscule level, and ESX was designed to be more general. Each ESX host becomes an expansion port, you can't lose any one because they all work together.

0 Kudos
benutzername
Contributor
Contributor
Jump to solution

Hi,

I ´m not confused.I think I didn´t make myself clear enough. In this particular cluster there are 4 ESX Hosts. Each host stays in a physically separated datacenter, that is miles away from the other datacenter. And these datacenters are all connected with a High-Speed Fiber Optic Backbone. With datacenter I did not mean the term VMware Datacenter. It´s a real physical facility what I mean.

Please open my drawing above, when you read this:

In normal Situation the host1 resides in datacenter1 in city1. In datacenter1 there is the SAN1. Host1 is running the machines that are locatet in SAN1. The same situation at host2, host3 and host4.

When for example host2 fails, the other 3 host will start to run the vm from host1. But in this situation the host have to connect to the vm via the Backbone. And that causes more traffic on the Backbone. So after the hos1 comes back online he should start to manage the vm that are located in SAN1.

Is it now clear why the machine should go back to the origin?

I also add this drawing how host2 has to connect to the vm´s of host1 when host1 fails. The SAN Traffic is routed over the Backbone (red path).

0 Kudos
Craig_Baltzer
Expert
Expert
Jump to solution

There's nothing built-in to the product that will do a "move back to original host after an HA move". The approach I took was to create an additional attribute in VC called "Preferred Host" and set it to the ESX host where I'd prefer the VM to run (go under the "Annotations" section for each VM and just add it). I then have a PowerShell script that runs periodically that looks for VMs that are running where the current host doesn't match the preferred host, and when one is found the script just VMotions it back onto the preferred host.

malaysiavm
Expert
Expert
Jump to solution

I guess what you mentioned here is different. It should be something like clustering through WAN connection for multiple physical location. As far as I know, the HA in ESX is not running with this kind of concept.

Malaysia VMware Communities -

Craig vExpert 2009 & 2010 Netapp NCIE, NCDA 8.0.1 Malaysia VMware Communities - http://www.malaysiavm.com
0 Kudos
benutzername
Contributor
Contributor
Jump to solution

Hey Craig,

that sounds really good. I guess that is exactly what I need. Do you have a similiar construction like me or do you need it for an other purpose?

Would you be so kind to post that scritpt? That would be awesome.

0 Kudos
Craig_Baltzer
Expert
Expert
Jump to solution

Sure, I'll clean it up over the next few days and post it as a document here. The driver here was to help manage our VM placement as over time things tended to get "misplaced" with VMotioning being done for patching, equipment changes, administrative inattention, etc.

0 Kudos
benutzername
Contributor
Contributor
Jump to solution

Hi Craig,

I don´t wan´t to stress you. Hope to hear from you and your great script soon.

Thanks!

0 Kudos
Craig_Baltzer
Expert
Expert
Jump to solution

I should get a chance to post it over the weekend; just tied up with a few project issues at the moment and unlike working for Google my management isn't buying my "I need 20% of my time devoted to being creative" line Smiley Happy

0 Kudos
Craig_Baltzer
Expert
Expert
Jump to solution

Finally got around to documenting these a bit and posting them

http://communities.vmware.com/docs/DOC-9212

0 Kudos
benutzername
Contributor
Contributor
Jump to solution

Hey Craig,

thank you very much! That is a nice pre-x-mas-gift!

0 Kudos