mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * virt/live_migration/virt-migrate-vmi.adoc
|
|
|
|
:_content-type: PROCEDURE
|
|
[id="virt-initiating-vm-migration-cli_{context}"]
|
|
= Initiating live migration of a virtual machine instance in the CLI
|
|
|
|
Initiate a live migration of a running virtual machine instance by creating a `VirtualMachineInstanceMigration` object in the cluster and referencing the name of the virtual machine instance.
|
|
|
|
.Procedure
|
|
|
|
. Create a `VirtualMachineInstanceMigration` configuration file for the virtual machine instance to migrate. For example, `vmi-migrate.yaml`:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: kubevirt.io/v1
|
|
kind: VirtualMachineInstanceMigration
|
|
metadata:
|
|
name: migration-job
|
|
spec:
|
|
vmiName: vmi-fedora
|
|
----
|
|
|
|
. Create the object in the cluster by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc create -f vmi-migrate.yaml
|
|
----
|
|
|
|
The `VirtualMachineInstanceMigration` object triggers a live migration of the virtual machine instance.
|
|
This object exists in the cluster for as long as the virtual machine instance is running, unless manually deleted.
|