Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 10. Live migration
10.1. About live migration Link kopierenLink in die Zwischenablage kopiert!
Live migration is the process of moving a running virtual machine (VM) to another node in the cluster without interrupting the virtual workload. By default, live migration traffic is encrypted using Transport Layer Security (TLS).
10.1.1. Live migration requirements Link kopierenLink in die Zwischenablage kopiert!
Live migration has the following requirements:
-
The cluster must have shared storage with (RWX) access mode.
ReadWriteMany The cluster must have sufficient RAM and network bandwidth.
NoteYou must ensure that there is enough memory request capacity in the cluster to support node drains that result in live migrations. You can determine the approximate required spare memory by using the following calculation:
Product of (Maximum number of nodes that can drain in parallel) and (Highest total VM memory request allocations across nodes)The default number of migrations that can run in parallel in the cluster is 5.
- If a VM uses a host model CPU, the nodes must support the CPU.
- Configuring a dedicated Multus network for live migration is highly recommended. A dedicated network minimizes the effects of network saturation on tenant workloads during migration.
10.1.2. Common live migration tasks Link kopierenLink in die Zwischenablage kopiert!
You can perform the following live migration tasks:
10.1.3. Additional resources Link kopierenLink in die Zwischenablage kopiert!
10.2. Configuring live migration Link kopierenLink in die Zwischenablage kopiert!
You can configure live migration settings to ensure that the migration processes do not overwhelm the cluster.
You can configure live migration policies to apply different migration configurations to groups of virtual machines (VMs).
10.2.1. Live migration settings Link kopierenLink in die Zwischenablage kopiert!
You can configure the following live migration settings:
10.2.1.1. Configuring live migration limits and timeouts Link kopierenLink in die Zwischenablage kopiert!
Configure live migration limits and timeouts for the cluster by updating the
HyperConverged
openshift-cnv
Procedure
Edit the
CR and add the necessary live migration parameters:HyperConverged$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnvExample configuration file
apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged namespace: openshift-cnv spec: liveMigrationConfig: bandwidthPerMigration: 64Mi1 completionTimeoutPerGiB: 8002 parallelMigrationsPerCluster: 53 parallelOutboundMigrationsPerNode: 24 progressTimeout: 1505 - 1
- Bandwidth limit of each migration, where the value is the quantity of bytes per second. For example, a value of
2048Mimeans 2048 MiB/s. Default:0, which is unlimited. - 2
- The migration is canceled if it has not completed in this time, in seconds per GiB of memory. For example, a VM with 6GiB memory times out if it has not completed migration in 4800 seconds. If the
Migration MethodisBlockMigration, the size of the migrating disks is included in the calculation. - 3
- Number of migrations running in parallel in the cluster. Default:
5. - 4
- Maximum number of outbound migrations per node. Default:
2. - 5
- The migration is canceled if memory copy fails to make progress in this time, in seconds. Default:
150.
You can restore the default value for any
spec.liveMigrationConfig
progressTimeout: <value>
progressTimeout: 150
10.2.2. Live migration policies Link kopierenLink in die Zwischenablage kopiert!
You can create live migration policies to apply different migration configurations to groups of VMs that are defined by VM or project labels.
You can create live migration policies by using the web console.
10.2.2.1. Creating a live migration policy by using the command line Link kopierenLink in die Zwischenablage kopiert!
You can create a live migration policy by using the command line. A live migration policy is applied to selected virtual machines (VMs) by using any combination of labels:
-
VM labels such as ,
size, orosgpu -
Project labels such as ,
priority, orbandwidthhpc-workload
For the policy to apply to a specific group of VMs, all labels on the group of VMs must match the labels of the policy.
If multiple live migration policies apply to a VM, the policy with the greatest number of matching labels takes precedence.
If multiple policies meet this criteria, the policies are sorted by alphabetical order of the matching label keys, and the first one in that order takes precedence.
Procedure
Create a
object as in the following example:MigrationPolicyapiVersion: migrations.kubevirt.io/v1alpha1 kind: MigrationPolicy metadata: name: <migration_policy> spec: selectors: namespaceSelector:1 hpc-workloads: "True" xyz-workloads-type: "" virtualMachineInstanceSelector:2 workload-type: "db" operating-system: ""Create the migration policy by running the following command:
$ oc create -f <migration_policy>.yaml
10.3. Initiating and canceling live migration Link kopierenLink in die Zwischenablage kopiert!
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
virtctl migrate <vm_name>
virtctl migrate-cancel <vm_name>
10.3.1. Initiating live migration Link kopierenLink in die Zwischenablage kopiert!
10.3.1.1. Initiating live migration by using the web console Link kopierenLink in die Zwischenablage kopiert!
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.
Prerequisites
- 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.
Procedure
-
Navigate to Virtualization
VirtualMachines in the web console. -
Select Migrate from the Options menu
beside a VM.
- Click Migrate.
10.3.1.2. Initiating live migration by using the command line Link kopierenLink in die Zwischenablage kopiert!
You can initiate the live migration of a running virtual machine (VM) by using the command line to create a
VirtualMachineInstanceMigration
Procedure
Create a
manifest for the VM that you want to migrate:VirtualMachineInstanceMigrationapiVersion: 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>.yamlThe
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.VirtualMachineInstanceMigration
Verification
Obtain the VM status by running the following command:
$ oc describe vmi <vm_name> -n <namespace>Example output
# ... 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
10.3.2. Canceling live migration Link kopierenLink in die Zwischenablage kopiert!
10.3.2.1. Canceling live migration by using the web console Link kopierenLink in die Zwischenablage kopiert!
You can cancel the live migration of a virtual machine (VM) by using the OpenShift Container Platform web console.
Procedure
-
Navigate to Virtualization
VirtualMachines in the web console. -
Select Cancel Migration on the Options menu
beside a VM.
10.3.2.2. Canceling live migration by using the command line Link kopierenLink in die Zwischenablage kopiert!
Cancel the live migration of a virtual machine by deleting the
VirtualMachineInstanceMigration
Procedure
Delete the
object that triggered the live migration,VirtualMachineInstanceMigrationin this example:migration-job$ oc delete vmim migration-job