Create VM to host rule

DRS VM to host rules are used in DRS clusters to specify whether VMs can or can’t be run on a host. These rules are used in conjunction with DRS groups for ease of administration. A DRS group can either consist of one or more VMs or one or more ESXi hosts.

You can create DRS groups using vSphere Web Client:

1. Select the DRS cluster in the inventory, go to Manage > Settings > DRS Groups, and click the Add button:

add drs group

2. The Create DRS Group window opens. First we will create a VM DRS group. Enter the name for the group, select VM DRS Group as the group type, and click the Add button:

vm drs group

3. Select one or more VMs and click OK:

add vm drs group

4. Click OK to create the group.

5. Next, we need to create a Host DRS group. In the DRS Groups panel, click Add:

drs add another group

6. Type the name for the group, select Host DRS Group as the group type, and click the Add button:

host drs group

7. Select one or more ESXi hosts and click OK:

host drs group hosts

8. Click OK to create the group.

After you’ve created DRS groups, you can create a VM to host rule using vSphere Web Client:

1. Select your cluster from the inventory, go to Manage > Settings > DRS Rules, and click the Add button:

add drs rules

2. The Create DRS Rule window opens. Type the name for the rule and choose the rule type. In this example, we will create a rule that will keep a VM on a specific host, so select the Virtual Machines to Hosts type. We will also select the DRS VM Group and the DRS Host Group we’ve created in the previous step and select the Must run on hosts in group option:

create VM to host rule

The rule we’ve created will force the VM from the group VM DRS Example Group (Linux-VM) to run on the host from the Host DRS Example Group (192.168.5.116). We can test this by selecting our cluster and going to Monitor > vSphere DRS. Because our VM is currently running on a different host, DRS will recommend to migrate Linux-VM to 192.168.5.116:

drs vm to hosts recommendation

Geek University 2022