What is VM Scheduling Policy?
A VM scheduling policy is a resource orchestration policy based on which VM instances are assigned hosts to achieve the high performance and high availability of businesses.
Concepts
- ZStack Cloud provides four types of scheduling
policies, and each policy can be executed based on two execution mechanisms.
You can schedule a VM instance by associating it with different scheduling
policies and execution mechanisms to meet the needs of different business
scenarios.
- Four types of VM scheduling policies: VM Exclusive from Each Other,
VM Affinitive to Each Other, VMs Exclusive from Hosts, and VMs
Affinitive to Hosts.
- VM Exclusive from Each Other: VM instances in the same VM scheduling group should not/must not run on the same host.
- VM Affinitive to Each Other: VM instances in the same VM scheduling group should/must run on the same host.
- VMs Exclusive from Hosts: Given any one of the VM instances in a VM scheduling group and any one of the hosts in a host scheduling group, the VM instance should not/must not run the host.
- VMs Affinitive to Hosts: Given any one of the VM instances in a VM scheduling group and any one of the hosts in a host scheduling group, the VM instance should/must run the host.
- A VM scheduling policy can be executed based on either of the two
execution mechanisms: Hard and Soft. Hard execution mechanism
requires VM instances to strictly comply with their associated
scheduling policies, while Soft execution mechanisms allows for some
flexibility in policy execution when the hosts do not have
sufficient resources.
- Hard: VM instances are forcibly assigned to hosts based on the associated VM scheduling policies. For example, if you associate the VM Exclusive from Each Other policy with a VM scheduling group and select the Hard mechanism for the policy, any two of the VM instances in the scheduling group are not allowed to run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the associated VM scheduling policies. For example, if you associate the VM Exclusive from Each Other policy with a VM scheduling group and select the Soft mechanism for the policy, any two of the VM instances in the scheduling group will primarily not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy.
- Four types of VM scheduling policies: VM Exclusive from Each Other,
VM Affinitive to Each Other, VMs Exclusive from Hosts, and VMs
Affinitive to Hosts.
- A VM scheduling group is the basic unit for VM instances to associate with
the VM scheduling policies.
- A VM instance can only be added to one VM scheduling group. After the addition, the VM instance will be scheduled based on the associated scheduling policies.
- A VM scheduling group can associate with one or more scheduling policies.
- A scheduling policy can associate with one VM scheduling group.
- Deleting a VM scheduling group also deletes its associated VM scheduling policies.
- Host scheduling group is the basic unit for hosts to associate with host
scheduling policies. You can use a host scheduling group when you select
VMs Affinitive to Hosts or VMs Exclusive from Hosts
policies.
- A host can only be added to one host scheduling group. After the addition, the host will be scheduled based on the associated scheduling policies.
- A host scheduling group can associate with one or more scheduling policies.
- A scheduling policy can associate with one VM scheduling group.
- Deleting a host scheduling group also deletes its associated VM scheduling policies.
Fundamentals
- If you associate a VM scheduling group with a VM Exclusive from Each Other or VM Affinitive to Each Other scheduling policy, you do not need to specify a host scheduling group, as the VM instance will be assigned to hosts based on the policy and execution mechanism.
- If you associate a VM scheduling group with a VMs Affinitive to Hosts or VMs Exclusive from Hosts scheduling policy, you need to specify the corresponding host scheduling groups and the VM instance will be assigned to hosts based on the policy and execution mechanism.
In the following section, you will learn how the four scheduling policies work through four scenario illustrations.
- Under the Hard execution mechanism, VM3 follows the policy of VM
Exclusive from Each Other:
- If Host3 has sufficient resources, VM3 can start and run normally on Host3.
- If Host3 does not have sufficient resources, then VM3 cannot start.
- Under the Soft execution mechanism, VM3 follows the policy of VM
Exclusive from Each Other and first chooses to start on Host3:
- If Host3 has sufficient resources, VM3 can start and run normally on Host3.
- If Host3 does not have sufficient resources, VM3 tries to start on other host that has available resources. In this scenario, VM3 starts and runs on Host2.

- Under the Hard execution mechanism, VM3 follows the policy of VM
Affinitive to Each Other:
- If Host1 has sufficient resources, VM3 can start and run normally on Host1.
- If Host1 does not have sufficient resources, VM3 cannot start.
- Under the Soft execution mechanism, VM3 follows the policy of VM
Affinitive to Each Other and first chooses to start on Host1:
- If Host1 has sufficient resources, VM3 can start and run normally on Host1.
- If Host3 does not have sufficient resources, VM3 tries to start on other host that has available resources. In this scenario, VM3 starts and runs on Host2.

- Under the Hard execution mechanism, VM3 and hosts in the host scheduling
group A follow the policy of VMs Exclusive from Hosts:
- If Host1 has sufficient resources, VM3 can start and run normally on Host1.
- If Host1 does not have sufficient resources, VM3 cannot start.
- Under the Soft execution mechanism, VM3 and hosts in the host scheduling
group A follow the policy of VMs Exclusive from Hosts and VM3 first
chooses to start on Host1:
- If Host1 has sufficient resources, VM3 can start and run normally on Host1.
- If Host1 does not have sufficient resources, VM3 tries to start on other host that has available resources. In this scenario, VM3 starts and runs on Host2.

- Under the Hard execution mechanism, VM6 and hosts in the host scheduling
group A follow the policy of VMs Affinitive to Hosts:
- If Host2 or Host3 have sufficient resources, VM6 can start and run normally on Host2 or Host3.
- If Host2 and Host3 do not have sufficient resources, VM6 cannot start.
- Under the Soft execution mechanism, VM6 and hosts in the host scheduling
group A follow the policy of VMs Affinitive to Hosts and VM6 first
chooses to start on Host2 or Host3:
- If Host2 or Host3 have sufficient resources, VM6 can start and run normally on Host2 or Host3.
- If both Host2 and Host3 do not have sufficient resources, VM6 tries to start on other host that has available resources. In this scenario, VM6 starts and runs on Host1.

Advantages
- Comprehensive & Flexible:
- ZStack Cloud provides four types of scheduling policies matched with two execution mechanisms to define mutual exclusion/affinity relationships between VM instances and between VM instances and hosts. Various scheduling policies can be flexibly combined to meet the needs of all mainstream business scenarios.
- ZStack Cloud supports the association of one or more scheduling policies with multiple VM instances in the VM scheduling group, as well as the removal of these policies from the VM instances in the VM scheduling group, which is simple and efficient.
- ZStack Cloud intuitively displays the VM scheduling status and provides quick conflict resolution operations to facilitate users to grasp business scheduling dynamics in real time and make timely adjustments.
- Powerful & Reliable:
- ZStack Cloud supports exclusion/affinity between the same/different businesses, achieving business isolation/efficient communication and ensuring high business performance and reliability.
- You can flexibly configure the failure domains in VM businesses through host scheduling groups. ZStack Cloud supports single host deployment, batch hosts deployment within a single cluster, and cross-cluster hosts deployment to avoid single point of failure. This ensures business stability and improves physical resource utilization.
Use Cases
In the following part, we introduce some use cases for the VM Exclusive from Each Other (Hard/Soft) and VMs Affinitive to Hosts (Hard/Soft) scheduling policies.
- VM Exclusive from Each Other (Hard):In this case, we have two VM instances that run an active-backup database. The two VM instances are required to be deployed on different hosts to ensure business high availability.
- Example: A user deploys two VMs for hosting a main and a backup MySQL database respectively, with a requirement that the two VM instances to be deployed on different hosts to minimize the risk of business downtime. Due to automatic deployment, the user does not know which hosts have available resources. At this point, the user can choose a VM Exclusive from Each Other (Hard) policy to ensure that the two VMs run on two different hosts, ensuring the business high availability.
- VM Exclusive from Each Other (Soft):In this case, we want the nodes with different roles in Hadoop to be spread across different hosts, so as to improve the overall system performance.
- Example: When deploying a Hadoop system, the user cannot predict the total number of nodes for different roles such as namenode, datanode, jobtracker, tasktracker. However, it's clear that deploying these nodes on different hosts would enhance efficiency. The VM Exclusive from Each Other (Soft) policy can help distribute the Hadoop cluster across as many different hosts as possible, thereby alleviating I/O pressure and improving the overall system performance.
- VMs Affinitive to Hosts (Hard):In this case, we want to deploy the business VM instances on hosts with a specified CPU frequency, thereby ensuring the business stability.
- Example: A user deploys four VM instances running important businesses and requires these VM intances run on the hosts that have a high CPU frequency. Given that there are limited hosts that can meet this CPU frequency requirement, the user can choose a VMs Affinitive to Hosts (Hard) policy to force these VM instances run on the specified hosts to ensure business stability.
- VMs Affinitive to Hosts (Soft):In this case, we want VM instances that run different businesses are deployed to hosts in the same rack as much as possible, so as to facilitate efficient communication between businesses.
- Example: A user deploys four VM instances that run different businesses that require frequent intercommunication. In this case, minimizing the physical distance between the VM instances can significantly reduce communication latency. At this point, the user can choose a VMs Affinitive to Hosts (Soft) policy to deploy the VM instances on the specified hosts, thereby promoting efficient business intercommunication.
Functions
Create a VM Scheduling Policy
On the main menu of ZStack Cloud, choose . On the VM Scheduling Policy page, click Create VM Scheduling Policy. Then, the Create VM Scheduling Policy page is displayed.
- Create VM Exclusive from Each Other Scheduling Policy
- Create VM Affinitive to Each Other Scheduling Policy
- Create VMs Exclusive from Hosts Scheduling Policy
- Create VMs Affinitive to Hosts Scheduling Policy
Create VM Exclusive from Each Other Scheduling Policy
- Name: Enter a name for the VM scheduling policy.
- Description: Optional. Enter a description for the VM scheduling policy.
- Type: Select VM Exclusive from Each Other.
- Execution Mechanism: The following two mechanisms are
provided:
- Hard: VM instances are forcibly assigned to hosts based on the VM Exclusive from Each Other policy. VM instances in the same VM scheduling group must not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the VM Exclusive from Each Other policy. If possible, VM instances in the same VM scheduling group should not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy while has sufficient resources.
- Associate VM Scheduling Group: You can associate a VM
scheduling policy with a new or existing VM scheduling group. After the
association, the policy takes effect on all VM instances in the VM
scheduling group:
- Existing: Associate the VM scheduling policy
with an existing VM scheduling group.
- VM Scheduling Group: Select an existing VM scheduling group.
- Create: Create a new VM scheduling group.
- VM Scheduling Group Name: Enter a name for the VM scheduling group.
- VM Instance: Select one or more VM instances to add to the scheduling group.
- Existing: Associate the VM scheduling policy
with an existing VM scheduling group.

Create VM Affinitive to Each Other Scheduling Policy
- Name: Enter a name for the VM scheduling policy.
- Description: Optional. Enter a description for the VM scheduling policy.
- Type: Select VM Affinitive to Each Other.
- Execution Mechanism: The following two mechanisms are
provided:
- Hard: VM instances are forcibly assigned to hosts based on the VM Affinitive to Each Other policy. VM instances in the same VM scheduling group must run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the VM Affinitive to Each Other policy. If possible, VM instances in the same VM scheduling group should run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy while has sufficient resources.
- Associate VM Scheduling Group: You can associate a VM
scheduling policy with a new or existing VM scheduling group. After the
association, the policy takes effect on all VM instances in the scheduling
group:
- Existing: Associate the VM scheduling policy
with an existing VM scheduling group.
- VM Scheduling Group: Select an existing VM scheduling group.
- Create: Create a new VM scheduling group.
- VM Scheduling Group Name: Enter a name for the VM scheduling group.
- VM Instance: Select one or more VM instances to add to the scheduling group.
- Existing: Associate the VM scheduling policy
with an existing VM scheduling group.

Create VMs Exclusive from Hosts Scheduling Policy
- Name: Enter a name for the VM scheduling policy.
- Description: Optional. Enter a description for the VM scheduling policy.
- Type: Select VMs Exclusive from Hosts.
- Execution Mechanism: The following two mechanisms are
provided:
- Hard: VM instances are forcibly assigned to hosts based on the VMs Exclusive from Hosts policy. Given any one of the VM instances in a VM scheduling group and any one of the hosts in a host scheduling group, the VM instance must not run the host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the VMs Exclusive from Hosts policy. Given any one of the VM instances in a VM scheduling group and any one of the hosts in a host scheduling group, the VM instance should not run the host if possible. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy while has sufficient resources.
- Associate VM Scheduling Group: You can associate a VM
scheduling policy with a new or existing VM scheduling group. After the
association, the policy takes effect on all VM instances in the scheduling
group:
- Existing: Associate the VM scheduling policy
with an existing VM scheduling group.
- VM Scheduling Group: Select an existing VM scheduling group.
- Create: Create a new VM scheduling group.
- VM Scheduling Group Name: Enter a name for the VM scheduling group.
- VM Instance: Select one or more VM instances to add to the scheduling group.
- Existing: Associate the VM scheduling policy
with an existing VM scheduling group.
- Associate Host Scheduling Group: You can associate a
VM scheduling policy with a new or existing host scheduling group. After the
association, the policy takes effect on all hosts in the scheduling
group:
- Existing: Associate the VM scheduling policy
with an existing host scheduling group.
- Host Scheduling Group: Select an existing host scheduling group.
- Create: Create a new host scheduling
group.
- Host Scheduling Group Name: Enter a name for the host scheduling group.
- Host: Select one or more hosts to add to the scheduling group.
- Existing: Associate the VM scheduling policy
with an existing host scheduling group.

Create VMs Affinitive to Hosts Scheduling Policy
- Name: Enter a name for the VM scheduling policy.
- Description: Optional. Enter a description for the VM scheduling policy.
- Type: Select VMs Affinitive to Hosts.
- Execution Mechanism: The following two mechanisms are
provided:
- Hard: VM instances are forcibly assigned to hosts based on the VMs Affinitive to Hosts policy. A VM instance in a VM scheduling group must run on a host in a host scheduling group. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the VMs Affinitive to Hosts policy. A VM instance in a VM scheduling group should run on a host in a host scheduling group if possible. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy while has sufficient resources.
- Associate VM Scheduling Group: You can associate a VM
scheduling policy with a new or existing VM scheduling group. After the
association, the policy takes effect on all VM instances in the scheduling
group:
- Existing: Associate the VM scheduling policy
with an existing VM scheduling group.
- VM Scheduling Group: Select an existing VM scheduling group.
- Create: Create a new VM scheduling group.
- VM Scheduling Group Name: Enter a name for the VM scheduling group.
- VM Instance: Select one or more VM instances to add to the scheduling group.
- Existing: Associate the VM scheduling policy
with an existing VM scheduling group.
- Associate Host Scheduling Group: You can associate a
VM scheduling policy with a new or existing host scheduling group. After the
association, the policy takes effect on all hosts in the scheduling
group:
- Existing: Associate the VM scheduling policy
with an existing host scheduling group.
- Host Scheduling Group: Select an existing host scheduling group.
- Create: Create a new host scheduling
group.
- Host Scheduling Group Name: Enter a name for the host scheduling group.
- Host: Select one or more hosts to add to the scheduling group.
- Existing: Associate the VM scheduling policy
with an existing host scheduling group.

Manage a VM Scheduling Policy
On the main menu of ZStack Cloud, choose . Then, the VM Scheduling Policy is displayed.
| Action | Description |
|---|---|
| Create VM Scheduling Policy | Create a VM scheduling policy. |
| Edit VM Scheduling Policy | Edit the name and description of a VM scheduling policy. |
| Enable VM Scheduling Policy | Enable a disabled VM scheduling policy. |
| Disable VM Scheduling Policy | Disable an enabled VM scheduling policy. Note: If
you disable a VM scheduling policy, the associated VM instances
will not be scheduled based on the policy. |
| Change Execution Mechanism | Changes the execution mechanism of a VM scheduling policy. Two mechanisms are provided: Hard and Soft. |
| Delete VM Scheduling Policy | Delete a VM scheduling policy. Note: If you delete
a VM scheduling policy, the associated VM instances will not be
scheduled based on the policy. |
Associated Resource of VM Scheduling Policy
On the main menu of ZStack Cloud, choose . Then, the VM Scheduling Policy page is displayed.
Create a VM Scheduling Group
On the main menu of ZStack Cloud, choose . On the VM Scheduling Group page, click Create VM Scheduling Group. Then, the Create VM Scheduling Group page is displayed.
- Name: Enter a name for the VM scheduling group.
- Description: Optional. Enter a description for the VM scheduling group.
- VM Instance: Select one or more VM instances to add to the scheduling group.

Manage a VM Scheduling Group
On the main menu of ZStack Cloud, choose . Then, the VM Scheduling Group page is displayed.
| Action | Description |
|---|---|
| Create VM Scheduling Group | Create a VM scheduling group. |
| Edit VM Scheduling Group | Edit the name and description of a VM scheduling group. |
| Add VM Instance | Add one or more VM instances to a VM scheduling
group. Note: After the addition, the scheduling policies associated
with the group take effect on the VM instances
immediately. |
| Remove VM Instance | Remove one or more VM instances from a VM
scheduling group. Note: After the removal, the VM instances will no
longer be scheduled based on scheduling policies associated with
the group. |
| Delete VM Scheduling Group | Delete a VM scheduling group. Note: If you delete
a VM scheduling group, VM scheduling policies associated with
the group will also be deleted. |
Create a Host Scheduling Group
On the main menu of ZStack Cloud, choose . On the Host Scheduling Group page, click Create Host Scheduling Group. Then, the Create Host Scheduling Group page is displayed.
- Name: Enter a name for the host scheduling group.
- Description: Optional. Enter a description for the host scheduling group.
- Host: Select one or more hosts to add to the scheduling group.

Manage a Host Scheduling Group
On the main menu of ZStack Cloud, choose . Then, the Host Scheduling Group page is displayed.
| Action | Description |
|---|---|
| Create Host Scheduling Group | Create a host scheduling group. |
| Edit Host Scheduling Group | Edit the name and description of a host scheduling group. |
| Add Host | Add one or more hosts to a host scheduling group.
Note: After the addition, the scheduling policies associated
with the group take effect on the hosts
immediately. |
| Remove Host | Remove one or more hosts from a host scheduling
group. Note: After the removal, the hosts will no longer be
scheduled based on scheduling policies associated with the
group. |
| Delete Host Scheduling Group | Delete a host scheduling group. Note: If you
delete a host scheduling group, VM scheduling policies
associated with the group will also be deleted. |
VM Scheduling Policy Practice
VM Exclusive from Each Other (Soft)
About this task
In this practice, you will learn how to use a VM Exclusive from Each Other (Soft) scheduling policy.
Assume that in a zone, a user intends to deploy three business VM instances and prefers these VM instances run separately on three different hosts as much as possible.
- Create three business VM instances.
- Create a VM Exclusive from Each Other (Soft) scheduling policy.
- Check whether the three business VM instances are deployed on different hosts when conditions allow.
Procedure
-
Create three business VM instances.
On the main menu of ZStack Cloud, choose . Then, the VM Instance page is displayed, and you can then batch create three VM instances by fast creation. For more information, see Create a VM Instance (Fast Creation).
-
Create a VM Exclusive from Each Other (Soft) scheduling policy.
On the main menu of ZStack Cloud, choose . Then, the VM Scheduling Policy page is displayed. Click Create VM Scheduling Policy and the Create VM Scheduling Policy page is displayed.
On the displayed page, set the following parameters:- Name: Enter a name for the VM scheduling policy.
- Description: Optional. Enter a description for the VM scheduling policy.
- Type: Select VM Exclusive from Each Other.
- Execution Mechanism: Supports the mechanisms
of Hard and Soft. Here we choose Soft.
- Hard: VM instances are forcibly assigned to hosts based on the VM Exclusive from Each Other policy. VM instances in the same VM scheduling group must not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the VM Exclusive from Each Other policy. If possible, VM instances in the same VM scheduling group should not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy while has sufficient resources.
- Associate VM Scheduling Group: You can
associate a VM scheduling policy with a new or existing VM
scheduling group. After the association, the policy takes effect on
all VM instances in the scheduling group. Here we create a new
scheduling group and associate it with the three VM instances
created on step1.
- Existing: Associate the VM scheduling
policy with an existing VM scheduling group.
- VM Scheduling Group: Select an existing VM scheduling group.
- Create: Create a new VM scheduling
group.
- VM Scheduling Group Name: Enter a name for the VM scheduling group.
- VM Instance: Select one or more VM instances to add to the scheduling group. Here we add the preceding three VM instances to the scheduling group.
- Existing: Associate the VM scheduling
policy with an existing VM scheduling group.
Figure 11. Create VM Exclusive from Each Other (Soft) 
-
Check whether the three business VM instances are deployed on different hosts
when conditions allow.
On the Overview tab of the VM scheduling group, you can see that the three business VM instances are deployed on three different hosts. This means the VM Exclusive from Each Other (Soft) scheduling policy takes effect.
Figure 12. Verify Effectiveness of VM Exclusive from Each Other (Soft) 
VM Exclusive from Each Other (Hard)
About this task
In this practice, you will learn how to use a VM Exclusive from Each Other (Hard) scheduling policy.
Assume that in a zone, a user intends to deploy three business VM instances and prefers these VM instances are forcibly assigned to three different hosts.
- Create three business VM instances.
- Create a VM Exclusive from Each Other (Hard) scheduling policy.
- Check whether the three business VM instances are forcibly deployed on three different hosts.
Procedure
-
Create three business VM instances.
On the main menu of ZStack Cloud, choose . Then, the VM Instance page is displayed, and you can batch create three VM instances by fast creation. For more information, see Create a VM Instance (Fast Creation).
-
Create a VM Exclusive from Each Other (Hard) scheduling policy.
On the main menu of ZStack Cloud, choose . Then, the VM Scheduling Policy page is displayed. Click Create VM Scheduling Policy, and then the Create VM Scheduling Policy page is displayed.
On the displayed page, set the following parameters:- Name: Enter a name for the VM scheduling policy.
- Description: Optional. Enter a description for the VM scheduling policy.
- Type: Select VM Exclusive from Each Other.
- Execution Mechanism: Supports the mechanisms
of Hard and Soft. Here we choose Hard.
- Hard: VM instances are forcibly assigned to hosts based on the VM Exclusive from Each Other policy. VM instances in the same VM scheduling group must not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the VM Exclusive from Each Other policy. If possible, VM instances in the same VM scheduling group should not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy while has sufficient resources.
- Associate VM Scheduling Group: You can
associate a VM scheduling policy with a new or existing VM
scheduling group. After the association, the policy takes effect on
all VM instances in the scheduling group. Here we create a new
scheduling group and associate it with VM instances.
- Existing: Associate the VM scheduling
policy with an existing VM scheduling group.
- VM Scheduling Group: Select an existing VM scheduling group.
- Create: Create a new VM scheduling
group.
- VM Scheduling Group Name: Enter a name for the VM scheduling group.
- VM Instance: Select one or more VM instances to add to the scheduling group. Here we add the preceding three VM instances to the scheduling group.
- Existing: Associate the VM scheduling
policy with an existing VM scheduling group.
Figure 13. Create VM Exclusive from Each Other (Hard) 
-
Check whether the three business VM instances are forcibly deployed on three
different hosts.
On the Overview tab of the VM scheduling group, you can see that the three VM instances are forcibly deployed on three different hosts. This means the VM Exclusive from Each Other (Hard) scheduling policy takes effect.
Figure 14. Verify Effectiveness of VM Exclusive from Each Other (Hard) 
VMs Affinitive to Hosts (Soft)
About this task
In this practice, you will learn how to use a VMs Affinitive to Hosts (Soft) scheduling policy.
Assume that in a zone, a user intends to deploy three business VM instances and prefers these VM instances are deployed on the specified Host1 and Host2 as much as possible.
- Create three business VM instances.
- Create a VMs Affinitive to Hosts (Soft) scheduling policy.
- Check whether the three business VM instances are deployed on the specified two hosts.
Procedure
-
Create three business VM instances.
On the main menu of ZStack Cloud, choose . Then, the VM Instance page is displayed, and you can batch create three VM instances by fast creation. For more information, see Create a VM Instance (Fast Creation).
-
Create a VMs Affinitive to Hosts (Soft) scheduling policy.
On the main menu of ZStack Cloud, choose . Then, the VM Scheduling Policy page is displayed. Click Create VM Scheduling Policy, and then the Create VM Scheduling Policy page is displayed.
On the displayed page, set the following parameters:- Name: Enter a name for the VM scheduling policy.
- Description: Optional. Enter a description for the VM scheduling policy.
- Type: Select VMs Affinitive to Hosts.
- Execution Mechanism: Supports the mechanisms
of Hard and Soft. Here we choose Soft.
- Hard: VM instances are forcibly assigned to hosts based on the VM Exclusive from Each Other policy. VM instances in the same VM scheduling group must not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the VM Exclusive from Each Other policy. If possible, VM instances in the same VM scheduling group should not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy while has sufficient resources.
- Associate VM Scheduling Group: You can
associate a VM scheduling policy with a new or existing VM
scheduling group. After the association, the policy takes effect on
all VM instances in the scheduling group. Here we create a new
scheduling group and associate it with VM instances.
- Existing: Associate VMs with a
existing VM scheduling group.
- VM Scheduling Group: Choose a existing VM scheduling group.
- Create: Create a new VM scheduling
group.
- VM Scheduling Group Name: Set the name of the VM scheduling group.
- VM Instance: Add one or more VM instances to this scheduling group. Here we add the preceding three VM instances.
- Existing: Associate VMs with a
existing VM scheduling group.
- Associate Host Scheduling Group: You can
associate a VM scheduling policy with a new or existing host
scheduling groups. Here we choose to create a new host scheduling
group. After the association, the policy takes effect on all hosts
in the scheduling group.
- Existing: Associate a VM scheduling
policy with a existing host scheduling group.
- Host Scheduling Group: Choose an existing host scheduling group.
- Create: Create a new host scheduling
group.
- Name: Enter a name for the host scheduling group.
- Host: Add one or more hosts to this scheduling group. Here we add Host1 and Host2.
- Existing: Associate a VM scheduling
policy with a existing host scheduling group.
Figure 15. Create VMs Affinitive to Hosts (Soft) 
-
Check whether the three business VM instances are deployed on the specified two
hosts.
On the Overview tab of the VM scheduling group, you can see that the three VM instances are deployed on Host1 and Host2. This means the VMs Affinitive to Hosts (Soft) scheduling policy takes effect.
Figure 16. Verify Effectiveness of VMs Affinitive to Hosts (Soft) 
VMs Affinitive to Hosts (Hard)
About this task
In this practice, you will learn how to use a VMs Affinitive to Hosts (Hard) scheduling policy.
Assume that in a zone, a user intends to deploy three business VM instances and prefers these VM instances are forcibly assigned to Host1 and Host2.
- Create three business VM instances.
- Create a VMs Affinitive to Hosts (Hard) scheduling policy.
- Check whether the three business VM instances are deployed on the specified two hosts.
Procedure
-
Create three business VM instances.
On the main menu of ZStack Cloud, choose . Then, the VM Instance page is displayed, and you can batch create three VM instances by fast creation. For more information, see Create a VM Instance (Fast Creation).
-
Create a VMs Affinitive to Hosts (Hard) scheduling policy.
On the main menu of ZStack Cloud, choose . Then, the VM Scheduling Policy page is displayed. Click Create VM Scheduling Policy, and then the Create VM Scheduling Policy page is displayed.
On the displayed page, set the following parameters:- Name: Enter a name for the VM scheduling policy.
- Description: Optional. Enter a description for the VM scheduling policy.
- Type: Select VMs Affinitive to Hosts.
- Execution Mechanism: Supports the mechanisms
of Hard and Soft. Here we choose Hard.
- Hard: VM instances are forcibly assigned to hosts based on the VM Exclusive from Each Other policy. VM instances in the same VM scheduling group must not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will end up failure upon startup.
- Soft: VM instances are primarily assigned to hosts based on the VM Exclusive from Each Other policy. If possible, VM instances in the same VM scheduling group should not run on the same host. If no host is available to be scheduled based on the policy for a VM instance, the VM instance will attempt to run on a host that does not satisfy the policy while has sufficient resources.
- Associate VM Scheduling Group: You can
associate a VM scheduling policy with a new or existing VM
scheduling group. Here we create a new one and associate it with
VMs. After the association, the policy takes effect on all VM
instances in the scheduling group.
- Existing: Associate VMs with a
existing VM scheduling group.
- VM Scheduling Group: Choose an existing VM scheduling group.
- Create: Create a new VM scheduling
group.
- VM Scheduling Group Name: Enter a name for the VM scheduling group.
- VM Instance: Select one or more VM instances to add to the scheduling group. Here we add the preceding three VM instances to the scheduling group.
- Existing: Associate VMs with a
existing VM scheduling group.
- Associate Host Scheduling Group: You can
associate a VM scheduling policy with a new or existing host
scheduling groups. Here we choose to create a new host scheduling
group. After the association, the policy takes effect on all hosts
in the scheduling group.
- Existing: Associate a VM scheduling
policy with an existing host scheduling group.
- Host Scheduling Group: Choose an existing host scheduling group.
- Create: Create a new host scheduling
group.
- Name: Enter a name for the host scheduling group.
- Host: Add one or more hosts to this scheduling group. Here we add Host1 and Host2.
- Existing: Associate a VM scheduling
policy with an existing host scheduling group.
Figure 17. Create VMs Affinitive to Hosts (Hard) 
-
Check whether the three business VM instances are deployed on the specified two
hosts.
On the Overview tab of the VM scheduling group, you can see that the three VM instances are deployed on Host1 and Host2. This means the VMs Affinitive to Hosts (Soft) scheduling policy takes effect.

Note: