VM Scheduling Policy
VM scheduling policies define affinity or anti-affinity relationships between VMs, or between VMs and hosts. Administrators can use scheduling policies to control where VMs run and meet requirements such as service isolation, fault domain planning, performance optimization, and deployment on specific hosts.
Core Components
- Scheduling policy
- Defines the policy type and execution mechanism for VM scheduling.
- VM Scheduling Group
- The basic unit for associating VMs with scheduling policies.
- A VM can join only one VM scheduling group. After a VM joins a group, the VM is assigned to a host according to the scheduling policy associated with the group.
- A VM scheduling group can be associated with one or more scheduling policies.
- A scheduling policy can be associated with one VM scheduling group.
- Deleting a VM scheduling group also deletes the associated VM scheduling policies.
- Host Scheduling Group
- The basic unit for associating hosts with scheduling policies. Host scheduling groups are used only by VMs-exclusive-from-hosts and VMs-affinitive-to-hosts policies.
- A host can join only one host scheduling group. After a host joins a group, the host is scheduled according to the scheduling policy associated with the group.
- A host scheduling group can be associated with one or more scheduling policies.
- A scheduling policy can be associated with one host scheduling group.
- Deleting a host scheduling group also deletes the associated VM scheduling policies.
Policy Types and Execution Mechanisms
| Type | Description |
|---|---|
| VM Exclusive from Each Other | VMs in the same VM scheduling group should not or must not run on the same host. |
| VM Affinitive to Each Other | VMs in the same VM scheduling group should or must run on the same host. |
| VMs Exclusive from Hosts | VMs in a VM scheduling group should not or must not run on hosts in a host scheduling group. |
| VMs Affinitive to Hosts | VMs in a VM scheduling group should or must run on hosts in a host scheduling group. |
Each scheduling policy type supports the Hard and Soft execution mechanisms.
- The Hard mechanism requires VMs to be assigned to hosts strictly according to the policy. If no host satisfies the policy, VM startup fails.
- The Soft mechanism prioritizes host assignment according to the policy. If no host satisfies the policy, the VM can attempt to run on another host with sufficient resources.
How It Works
After a VM joins a VM scheduling group, the scheduling policy associated with the group affects host assignment for the VM.
- 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 both a VM scheduling group and a host scheduling group. VMs are assigned to hosts according to the policy and its execution mechanism.
Typical Scenarios
Different scheduling policies apply to different service isolation, resource aggregation, and host constraint scenarios.
- VM-exclusive-from-each-other policies are suitable for active/standby databases, distributed application nodes, and other scenarios where a single host failure must not affect multiple service instances.
- VM-affinitive-to-each-other policies are suitable for scenarios where multiple VMs are expected to run on the same host as much as possible to reduce communication latency.
- VMs-exclusive-from-hosts policies are suitable for scenarios where VMs need to avoid specified hosts, host groups, or fault domains.
- VMs-affinitive-to-hosts policies are suitable for scenarios where VMs need to be constrained to specified hardware specifications, rack locations, or host groups.
Create Mutually Exclusive/Affinitive VM Scheduling Policies
Before you begin
Procedure
Create VMs Exclusive from/Affinitive to Hosts Scheduling Policies
Before you begin
Procedure
Manage VM Scheduling Policies and Related Resources
About this task
After creating VM scheduling policies, VM scheduling groups, or host scheduling groups, you can adjust the enablement status, basic information, and group resources as needed.
