A VM scheduling policy defines how hosts are assigned to VMs to support service performance and availability. You can add VMs to a VM scheduling group and associate the group with a scheduling policy to control VM placement.
How It Works
ZSphere supports the following scheduling relationships:
VM-exclusive-from-each-other and VM-affinitive-to-each-other policies do not require a host scheduling group. VMs are assigned to hosts according to the policy and its execution mechanism.
VMs-exclusive-from-hosts and VMs-affinitive-to-hosts policies require a corresponding host scheduling group. VMs are assigned to hosts according to the policy and its execution mechanism.
The following scenarios illustrate how the four scheduling policy types work.
Scenario 1: Assume that a data center contains Host1, Host2, and Host3. VM scheduling group A is associated with the VM Exclusive from Each Other policy. VM1 and VM2 belong to the group and run on Host1 and Host2, respectively. When VM3 joins the group, its behavior depends on the execution mechanism:
With the Hard mechanism, VM3 must run on a different host from the other VMs in the group:
If Host3 has sufficient resources, VM3 starts and runs on Host3.
If Host3 has insufficient resources, VM3 cannot start.
With the Soft mechanism, the scheduler prioritizes placing VM3 on a different host from the other VMs in the group:
If Host3 has sufficient resources, VM3 starts and runs on Host3.
If Host3 has insufficient resources, VM3 can start on another host with sufficient resources. In this scenario, VM3 starts and runs on Host2.
See Figure 1 for an illustration.Figure 1. VM Exclusive from Each Other (Hard/Soft)
Scenario 2: Assume that a data center contains Host1 and Host2. VM scheduling group A is associated with the VM Affinitive to Each Other policy. VM1 and VM2 belong to the group and run on Host1. When VM3 joins the group, its behavior depends on the execution mechanism:
With the Hard mechanism, VM3 must run on the same host as the other VMs in the group:
If Host1 has sufficient resources, VM3 starts and runs on Host1.
If Host1 has insufficient resources, VM3 cannot start.
With the Soft mechanism, the scheduler prioritizes placing VM3 on the same host as the other VMs in the group:
If Host1 has sufficient resources, VM3 starts and runs on Host1.
If Host1 has insufficient resources, VM3 can start on another host with sufficient resources. In this scenario, VM3 starts and runs on Host2.
See Figure 2 for an illustration.Figure 2. VM Affinitive to Each Other (Hard/Soft)
Scenario 3: Assume that a data center contains Host1, Host2, and Host3. VM scheduling group A is associated with the VMs Exclusive from Hosts policy. VM1 and VM2 belong to the group and run on Host1. Host scheduling group A is also associated with the VMs Exclusive from Hosts policy, and Host2 and Host3 belong to that group. When VM3 joins VM scheduling group A, its behavior depends on the execution mechanism:
With the Hard mechanism, VM3 must not run on a host in host scheduling group A:
If Host1 has sufficient resources, VM3 starts and runs on Host1.
If Host1 has insufficient resources, VM3 cannot start.
With the Soft mechanism, the scheduler prioritizes placing VM3 on a host outside host scheduling group A:
If Host1 has sufficient resources, VM3 starts and runs on Host1.
If Host1 has insufficient resources, VM3 can start on another host with sufficient resources. In this scenario, VM3 starts and runs on Host2.
See Figure 3 for an illustration.Figure 3. VMs Exclusive from Hosts (Hard/Soft)
Scenario 4: Assume that a data center contains Host1, Host2, and Host3. VM scheduling group A is associated with the VMs Affinitive to Hosts policy. VM1 through VM5 belong to the group and run on Host2 and Host3. Host scheduling group A is also associated with the VMs Affinitive to Hosts policy, and Host2 and Host3 belong to that group. When VM6 joins VM scheduling group A, its behavior depends on the execution mechanism:
With the Hard mechanism, VM6 must run on a host in host scheduling group A:
If Host2 or Host3 has sufficient resources, VM6 starts and runs on that host.
If both Host2 and Host3 have insufficient resources, VM6 cannot start.
With the Soft mechanism, the scheduler prioritizes placing VM6 on Host2 or Host3:
If Host2 or Host3 has sufficient resources, VM6 starts and runs on that host.
If both Host2 and Host3 have insufficient resources, VM6 can start on another host with sufficient resources. In this scenario, VM6 starts and runs on Host1.
See Figure 4 for an illustration.Figure 4. VMs Affinitive to Hosts (Hard/Soft)