VMware Cloud Community
rndname
Contributor
Contributor

Default cluster affinity rule

We have ESXi hosts in the same vCenter cluster, but physically they're in different datacenters. Is it possible to have a default VM-Host Affinity rule to point all VMs without rules to specific ESXi hosts? I know I can make a rule and set all existing VMs to these hosts, but can I do this on a default basis so that I don't need to change this everytime another VM is created?

Basically, one datacenter has a better situation with power outages than the other one. So I want to have all VMs in one datacenter, yet have ability to failover to the other in case of emergency.

vCenter 6.0 U3d

ESXi 6.0U3

0 Kudos
8 Replies
admin
Immortal
Immortal

Could you Please confirm your Vcenter and esxi host version ?

Regards,

Randhir

0 Kudos
rndname
Contributor
Contributor

Oops, sorry. I've edited the post.

vCenter 6.0 U3d

ESXi 6.0U3

0 Kudos
depping
Leadership
Leadership

No, you can't do that. But you could use tags and automate the creation of rules using PowerCLI. There are many examples of how to do that to be found through google, one of which is below. Not exactly what you need, but it gives an idea of what is possible

Manage your VMware Metro Storage Cluster with tags

0 Kudos
rndname
Contributor
Contributor

Okay, thanks! I thought the script might be the answer, but didn't want to complicate it too much by using scripts.

0 Kudos
depping
Leadership
Leadership

I understand, I have put in a feature request to make this easier. But that of course will take time.

0 Kudos
PabloJAguilar20
Enthusiast
Enthusiast

have you a datastore sharing with both site?

If you have that, yes you can set  the afiinity rules between host, and you can create goups of VMs must to go for the recovery host

Regars

Pablo J Aguilar Consultor de Infraestructuras Virtuales. Buenos Aires - Argentina
0 Kudos
rndname
Contributor
Contributor

I know I can manually create groups of VMs, but I want cluster to have a default rule for everyone to go to specific hosts without adding every new VM to that rule.

0 Kudos
PabloJAguilar20
Enthusiast
Enthusiast

You could create a script for check what VM is or not in the group, in case of not the same script can add it at the group.

And this script can scheduled for run 1 time for week or for month, like as you wish!!

regard!!

Pablo J Aguilar Consultor de Infraestructuras Virtuales. Buenos Aires - Argentina
0 Kudos