VMware Cloud Community
demetriol
Contributor
Contributor

Customize DRS initial placement

Hi all,

is there a way to customize the DRS initial placement in order to avoid the power on of a virtual machine in a set of specified hosts?

Thank you

Reply
0 Kudos
4 Replies
daphnissov
Immortal
Immortal

A VM-Host anti-affinity rule is the only way.

Reply
0 Kudos
demetriol
Contributor
Contributor

Hi,

thank you for your reply. I have the need to apply this rule every time a new vm is created/deployed. I think I need to use an alarm to get the trigger of the creation of new vm, in order to run a script that apply the rule.

Any suggestion?

Reply
0 Kudos
daphnissov
Immortal
Immortal

What exactly is your use case here? Just wondering if there's a better method for you.

Reply
0 Kudos
demetriol
Contributor
Contributor

Hi,

I need to deploy automatically the VM inside an host group, for licensing (microsoft) purposes.

My approach is to create a VM group and a Host Group inside the vcenter. Then I schedule a affinity rules, "must run", between VM group and host group. The challenge is to automatically add new VMs to the vm group, in order to let the DRS to power on the virtual machines on a host of the host group.

I'm trying to create an alarm to trigger the event when a new virtual machine is created, but I have to customize the code "run a command" as action of the trigger.

Thank you

Reply
0 Kudos