content_image/1006934.jpg
## Affinity policies 

An affinity policy  specifies affinity rules for a set of VMs that defines how the VMs must be placed within a host group during a relocation. The following affinity policies are supported if all VMs in an affinity group have the same priority. 

## Collocation 

A collocation policy  indicates that the set of VMs must always be placed on the same host after relocation, as shown in Figure 3-5. 

<img src='content_image/1006934.jpg'>

To set this policy, run the following commands: 

ksysmgr add collocation name vm=vmname1[,...]> ksysmgr modify collocation name policy=add|delete vm=vm1[,...] 

Example 3-55 shows the collocation policy policy_1 for the VMs rt12001 , r12002 , and 12003 . 

# ksysmgr add collocation policy_1 vm=rt12001,rt12002,rt12003 Collocation group policy_1 was created 

To list the collocation policies that are available, run the command ksysmgr query collocation , as shown in Example 3-56. 

# ksysmgr query collocation Name: policy_1 Type: Collocation VMs: rt12003 rt12002 rt12001 

Example 3-57 shows how to delete a collocation policy. 

# ksysmgr delete collocation policy_1 Collocation group policy_1 was removed 

