apiVersion: kubevirt.io/v1
kind: VirtualMachineInstanceMigration
metadata:
name: <migration_name>
spec:
vmiName: <vm_name>
You can initiate the live migration of a virtual machine (VM) to another node by using the OpenShift Container Platform web console or the command line.
You can cancel a live migration by using the web console or the command line. The VM remains on its original node.
You can also initiate and cancel live migration by using the |
You can live migrate a running virtual machine (VM) to a different node in the cluster by using the OpenShift Container Platform web console.
The Migrate action is visible to all users but only cluster administrators can initiate a live migration. |
The VM must be migratable.
If the VM is configured with a host model CPU, the cluster must have an available node that supports the CPU model.
Navigate to Virtualization → VirtualMachines in the web console.
Select Migrate from the Options menu beside a VM.
Click Migrate.
You can initiate the live migration of a running virtual machine (VM) by using the command line to create a VirtualMachineInstanceMigration
object for the VM.
Create a VirtualMachineInstanceMigration
manifest for the VM that you want to migrate:
apiVersion: kubevirt.io/v1
kind: VirtualMachineInstanceMigration
metadata:
name: <migration_name>
spec:
vmiName: <vm_name>
Create the object by running the following command:
$ oc create -f <migration_name>.yaml
The VirtualMachineInstanceMigration
object triggers a live migration of the VM. This object exists in the cluster for as long as the virtual machine instance is running, unless manually deleted.
Obtain the VM status by running the following command:
$ oc describe vmi <vm_name> -n <namespace>
# ...
Status:
Conditions:
Last Probe Time: <nil>
Last Transition Time: <nil>
Status: True
Type: LiveMigratable
Migration Method: LiveMigration
Migration State:
Completed: true
End Timestamp: 2018-12-24T06:19:42Z
Migration UID: d78c8962-0743-11e9-a540-fa163e0c69f1
Source Node: node2.example.com
Start Timestamp: 2018-12-24T06:19:35Z
Target Node: node1.example.com
Target Node Address: 10.9.0.18:43891
Target Node Domain Detected: true
You can cancel the live migration of a virtual machine (VM) by using the OpenShift Container Platform web console.
Navigate to Virtualization → VirtualMachines in the web console.
Select Cancel Migration on the Options menu beside a VM.
Cancel the live migration of a virtual machine by deleting the
VirtualMachineInstanceMigration
object associated with the migration.
Delete the VirtualMachineInstanceMigration
object that triggered the live
migration, migration-job
in this example:
$ oc delete vmim migration-job