-
Notifications
You must be signed in to change notification settings - Fork 28
MTV-2772: Scheduling target VMs #781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RichardHoch
wants to merge
2
commits into
kubev2v:main
Choose a base branch
from
RichardHoch:MTV-2772_target_vm_scheduling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
documentation/modules/about-configuring-target-vm-scheduling.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * documentation/doc-Migration_Toolkit_for_Virtualization/master.adoc | ||
|
|
||
| :_content-type: CONCEPT | ||
| [id="about-configuring-target-vm-scheduling_{context}"] | ||
| = About scheduling target VMs | ||
|
|
||
| [role="_abstract"] | ||
| Starting with {project-first} 2.10, you can use the _target VM scheduling_ feature to direct {project-short} to migrate virtual machines (VMs) to specific nodes of {virt} as well as to schedule when the VMs are powered on. Using the feature, you can design and enforce rules that you set using either the UI or command-line interface. | ||
|
|
||
| Previously, when you migrated VMs to {virt}, {virt} automatically determined the node the VMs would be migrated to. Although this served many customers' needs, there are certain situations in which it is very useful to be able to specify the target node of a VM or the conditions under which the VM is powered on, regardless of the type of migration involved. | ||
|
Check failure on line 12 in documentation/modules/about-configuring-target-vm-scheduling.adoc
|
||
|
|
||
| == Use cases | ||
|
|
||
| Target VM scheduling is designed to help you with the following use cases, among others: | ||
|
|
||
| * *Prioritizing critical workloads*: In many migrations, there are VMs that must be among the first migrated and powered up. Node selector rules let you ensure that specific VMs are migrated first to support other VMs that are migrated afterwards. | ||
|
|
||
| * *Business continuity and disaster recovery*: You can use scheduling rules to migrate and power up critical VMs to several sites, in different time zones or otherwise geographically separated by significant distances. This allows you to deploy these VMs as strategic assets for business continuity, such as disaster recovery. | ||
|
|
||
| * *Working with fluctuating demands*: In situations where demand for a service might vary significantly, rules for scheduling when to spin up VMs based on demand allows you to use your resources more efficiently. | ||
|
Check failure on line 22 in documentation/modules/about-configuring-target-vm-scheduling.adoc
|
||
91 changes: 91 additions & 0 deletions
91
documentation/modules/configuring-target-vm-scheduling-cli.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * documentation/doc-Migration_Toolkit_for_Virtualization/master.adoc | ||
|
|
||
| :_content-type: PROCEDURE | ||
| [id="configuring-target-vm-scheduling-cli_{context}"] | ||
| = Scheduling target VMs from the command-line interface | ||
|
|
||
| [role="_abstract"] | ||
| You can use the command-line interface (CLI) to tell {project-first} to migrate virtual machines (VMs) to specific nodes or workloads (pods) of {virt} as well as to schedule when the VMs are powered on. | ||
|
|
||
| The {project-soft} CLI supports the following scheduling-related labels, all of which are added to the `Plan` CR: | ||
|
|
||
| `targetAffinity`: Implements placement policies such as co-locating related workloads or, for disaster recovery, ensuring that specific VMs are migrated to different nodes. This type of label uses hard (requirements) and soft (preferences) conditions combined with logical operators, such as `and`, `or,` and `not`, to provide greater flexibility than the `targetLabelSelector` label discussed following. | ||
RichardHoch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| `targetLabels`: Applies organizational or operational labels to migrated VMs for identification and management. | ||
| `targetNodeSelector`: Ensures VMs are scheduled on nodes that are an exact match for key-value pairs you create. This type of label is often used for nodes with special capabilities, such as GPU nodes or storage nodes. | ||
|
|
||
| [IMPORTANT] | ||
| ==== | ||
| System-managed labels, such as migration, plan, VM ID, or application labels, override any user-defined labels. | ||
| ==== | ||
|
|
||
| .Prerequisites | ||
|
|
||
| Migrations that use target VM scheduling require the following prerequisites, in addition to the prerequisites for your source provider: | ||
|
|
||
| * {project-first} 2.10 or later. | ||
| * Version of {virt} that is compatible with your version of {project-short}. For {project-short} 2.10, the compatible versions of {virt} are 4.18, 4.19, and 4.20 only. | ||
| * `cluster-admin` or equivalent security privileges that allow managing `VirtualMachineInstance` objects and associated Kubernetes scheduling primitives. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Create custom resources (CR)s for the migration according to the procedure for the provider. | ||
| . In the `Plan` CR, add the following labels before `spec:targetNamespace`. All are optional. | ||
| + | ||
| [source,yaml,subs="attributes+"] | ||
| ... | ||
| targetAffinity: <affinity rule, which may be quite complex, is entered in lines following this label. See example that follows> | ||
| targetLabels: | ||
| label: <label> | ||
| targetNodeSelector: | ||
| <key>:<value> | ||
| targetNamespace:<target_namespace> | ||
| ... | ||
|
|
||
| .Example | ||
|
|
||
| The following scheduling rule migrates the VMs in the plan to different nodes for disaster recovery: | ||
| + | ||
| [source,yaml,subs="attributes+"] | ||
RichardHoch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ---- | ||
| targetLabels: | ||
| label: test1 | ||
| targetAffinity: | ||
| podAntiAffinity: | ||
| requiredDuringSchedulingIgnoredDuringExecution: | ||
| - labelSelector: | ||
| matchExpressions: | ||
| - key: label | ||
| operator: In | ||
| values: | ||
| - test1 | ||
| topologyKey: kubernetes.io/hostname | ||
| ---- | ||
|
|
||
| As a result of the preceding rule, the VMs are migrated accordingly to the resulting `spec`. | ||
| + | ||
| [source,yaml,subs="attributes+"] | ||
| ---- | ||
| spec: | ||
| runStrategy: Always | ||
| template: | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app: mtv-rhel8-sanity-ceph-rbd | ||
| label: test1 | ||
| spec: | ||
| affinity: | ||
| podAntiAffinity: | ||
| requiredDuringSchedulingIgnoredDuringExecution: | ||
| - labelSelector: | ||
| matchExpressions: | ||
| - key: label | ||
| operator: In | ||
| values: | ||
| - test1 | ||
| topologyKey: kubernetes.io/hostname | ||
| ---- | ||
|
|
||
|
|
||
28 changes: 28 additions & 0 deletions
28
documentation/modules/configuring-target-vm-scheduling-ui.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * documentation/doc-Migration_Toolkit_for_Virtualization/master.adoc | ||
|
|
||
| :_content-type: PROCEDURE | ||
| [id="configuring-target-vm-scheduling-ui_{context}"] | ||
| = Scheduling target VMs from the user interface | ||
|
|
||
| [role="_abstract"] | ||
| You can use the {project-first} user interface, which is located in the {ocp} web console, to tell {project-first} to migrate virtual machines (VMs) to specific nodes or workloads (pods) of {virt} as well as to schedule when the VMs are powered on. | ||
|
|
||
| The *Virtualization* section of the {ocp} web console supports the following options for scheduling target VMs: | ||
|
|
||
| * *VM target node selector*: Ensures VMs are scheduled on nodes that are an exact match for key-value pairs you create. This type of label is often used for nodes with special capabilities, such as GPU nodes or storage nodes. | ||
| * *VM target labels*: Applies organizational or operational labels to migrated VMs for identification and management. | ||
| * *VM target affinity rules*: Implements placement policies such as co-locating related workloads or, for disaster recovery, ensuring that specific VMs are migrated to different nodes. This type of rule uses hard (requirements) and soft (preferences) conditions combined with logical operators, such as `Exists` or `DoesNotExist` instead of using the rigid key-value pairs used by a VM target node selector. As a result, target affinity rules are more flexible than target affinity rules. | ||
| + | ||
| The {project-short} supports the following affinity rules: | ||
| + | ||
| ** Node affinity rules | ||
| ** Workload (pod) affinity and anti-affinity rules | ||
|
|
||
| You configure target VM scheduling options on the *Plan details* page of the relevant migration plan. The options apply to all VMs that are included in that migration. | ||
|
|
||
| Instructions for the VM target scheduling options are included in the procedures for creating migration plans. The same options are supported for all vendors ({virt}, {rhv-full}, {osp}, Open Virtual Appliance (OVA), and {virt}). | ||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.