Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions modules/virt-migrate-vm-to-labeled-node.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Module included in the following assemblies:
//
// virt/live_migration/virt-configuring-live-migration.adoc

:_mod-docs-content-type: PROCEDURE
[id="virt-migrate-vm-to-labeled-node_{context}"]
= Migrating a VM to a specific node

You can migrate a running virtual machine (VM) to a specific subset of nodes by using the `addedNodeSelector` field on the `VirtualMachineInstanceMigration` object. This field lets you apply additional node selection rules for a *one-time* migration attempt, without affecting the VM configuration or future migrations.

.Prerequisites

* You have access to the cluster as a user with the `cluster-admin` role.
* The VM you want to migrate is running.
* You have identified the labels of the target nodes. Multiple labels can be specified and are combined with logical `AND`.
* The `oc` CLI tool is installed.

.Procedure

. Create a migration manifest YAML file. For example:
+
[source,yaml]
----
apiVersion: kubevirt.io/v1
kind: VirtualMachineInstanceMigration
metadata:
name: migration-job
spec:
vmiName: vmi-fedora
addedNodeSelector:
accelerator: gpu-enabled23
kubernetes.io/hostname: "ip-172-28-114-199.example"
----
+

where:

`vmiName`:: Specifies the name of the running VM (for example, `vmi-fedora`).
`addedNodeSelector`:: Specifies additional constraints for selecting the target node.

. Apply the manifest to the cluster by running the following command:
+
[source,terminal]
----
$ oc apply -f <file_name>.yaml
----
+
If no nodes satisfy the constraints, the migration is declared a failure after a timeout. The VM remains unaffected.
4 changes: 4 additions & 0 deletions virt/live_migration/virt-configuring-live-migration.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
:_mod-docs-content-type: ASSEMBLY
[id="virt-configuring-live-migration"]
= Configuring live migration

include::_attributes/common-attributes.adoc[]

:context: virt-configuring-live-migration

toc::[]
Expand Down Expand Up @@ -31,6 +33,8 @@ You can create live migration policies by using the {product-title} web console.

include::modules/virt-configuring-a-live-migration-policy.adoc[leveloffset=+2]

include::modules/virt-migrate-vm-to-labeled-node.adoc[leveloffset=+1]

[role="_additional-resources"]
[id="additional-resources_virt-configuring-live-migration"]
== Additional resources
Expand Down