Configure VM-VM or VM-host affinity rules to define the relationships among VMs and the relationships between VMs and hosts.
VM-VM affinity rules include the following types:
CVM supports configuration of the association action in VM-VM affinity rules. The action can be one of the following:
VM-host affinity rules include the following types:
A VM-VM affinity rule for gathering VMs is applicable to service systems that have frequent data exchange and require VMs to run on the same host.
A VM-VM affinity rule for distributing VMs is applicable to environments that consume a large number of host resources, such as CPUs and memory. Distributing VMs to different hosts ensures load balancing in clusters.
Affinity rules might cause the failover host and DRS algorithms to be more complicated. Use affinity rules with caution.
Follow these restrictions and guidelines when you configure
If the cluster is enabled with HA and HA access control and is configured with failover hosts:
Assume that the difference between the numbers of hosts and failover hosts in the cluster is
The maximum number of VMs that can be restricted by the affinity rule is
The maximum number of VMs that can be restricted by the affinity rule is 2 if
If the cluster is not enabled with HA or is enabled with HA but not configured with failover hosts:
The maximum number of VMs that can be restricted by the affinity rule equals the number of hosts in the cluster if the number of hosts in the cluster is larger than 2.
The maximum number of VMs that can be restricted by the affinity rule is 2 if the number of hosts in the cluster is smaller than or equal to 2.
VMs restricted by VM-VM affinity rules must use shared storages.
You can add a VM to multiple non-conflicting VM-VM affinity rules, but cannot add a VM to both VM-VM and VM-host affinity rules. For example, you can configure a VM-VM affinity rule to require VM A and VM B to reside on the same host, and configure another VM-VM affinity rule to require VM A and VM C to reside on different hosts, but you can no longer add VM A to any VM-host affinity rules.
You cannot edit or delete VM-host affinity rules of the
If a stretched cluster has been configured, you cannot add VM-host affinity rules of the
On the top navigation bar, click
From the left navigation pane, select
Click
On the page that opens, click
Configure the parameters as described in "
Click
On the top navigation bar, click
From the left navigation pane, select
Click
Click
Configure the parameters as described in "
Click
On the top navigation bar, click
From the left navigation pane, select
Click
Click
In the dialog box that opens, click
If the stretched cluster feature has been enabled, make sure the name for the newly added affinity rule is not
Configure the following parameters if the rule type is
Configure the following parameters if the rule type is