Perform this task to migrate a VM between hosts and storages.
VM migration changes the carriers of a VM, including computing resources and storage resources. For example, you can change the host where a VM runs, or change the storage pool that stores disks (image files) of a VM.
Based on the VM state, VM migration includes online migration and offline migration.
Online migration—Migrates a running VM. To ensure a successful online migration, make sure the target host has enough memory before you migrate a VM.
Offline migration—Migrates a shutdown VM.
Based on the application mode, VM migration includes dynamic migration and manual migration.
Dynamic migration—VMs are dynamically migrated in a cluster when they are running. Dynamic migration occurs when hosts fail, resources are allocated unevenly, or DPM policies are configured. Dynamic VM migration is implemented through HA, DRS, and DPM configuration of a cluster.
Manual migration—VMs are migrated manually by an administrator. Manual migration is performed during maintenance to optimize system performance. For example, you can manually migrate the VMs on a host before you upgrade the hardware of the host. After the hardware upgrade, you can migrate the VMs back to the host.
Change host—Migrates a VM between hosts. This method is available only for VMs that use a shared storage pool, and the shared storage pool must be mounted to the migration destination host.
When a host fails or is overloaded, you can migrate VMs on that host to other hosts to ensure VM service availability.
When multiple hosts are in light-load state, you can migrate VMs on these hosts to one of them and shut down the other hosts to save resources.
Change storage—Migrates the disks of a VM to another storage pool that is mounted to the host where the VM is running.
Change host and storage—Migrates a VM between hosts, and changes the storage pool to which its disks are attached. The destination host can be any host in the cloud resource, and the destination storage pool must be mounted to the destination host. Use this method when a VM uses a local disk or the disk of the VM is in a shared storage pool but the storage pool is not mounted to the destination host.
Table-1 Networks used in VM migration
VM state |
Migration method |
||
Change host |
Change storage |
Change host and storage |
|
Online |
Migration network and management network |
Storage network |
Migration network, management network, and storage network |
Offline |
Management network |
Storage network |
Migration network, management network, and storage network |
· Management network—Transmits control layer data between the management platform and hosts, including configuration information and control commands. · Storage network—Transmits packets from hosts to the storage. The storage network and management network can share the same IP range. · Migration network—Transmits service data during VM migration, including VM memory and disk image data. The migration network and management network can share the same IP range. |
If you migrate the host and storage for a VM or migrate only the host for a VM, the system uses the following rules to select the networks:
If the migration networks of the source and destination hosts are available, the system uses the migration networks. During migration, the management networks are used to transmit configuration information and control commands.
If the migration networks of the source and destination hosts are unavailable, the system uses the management networks.
You cannot migrate online VMs that use RBDs by changing storage or changing host and storage.
To avoid VM startup failure or slow VM startup after migration, make sure the target storage pool has sufficient space and the target host has enough CPU and memory resources.
For successful migration, make sure the available space of the target storage pool is larger than the storage volume size of a VM when you migrate the VM by using the Storage and Host and Storage migration type. If you change the disk format, you must also make sure the available space of the target storage pool is at least twice the space of the storage volume on the source VM.
When you migrate a VM by using the Host or Host and Storage migration type, the VM list of the destination host might contain two entries about the VM before the migration is finished. After the migration is finished, only one entry about the VM is displayed in the VM list of the destination host.
If a VM has snapshots, you can only change the storage of the VM between file system type storage pools or between RBD storage pools in the same distributed storage system.
VMs that act as Kubernetes cluster nodes cannot be migrated to another cluster. If you migrate VMs across clusters in bulk, VMs that act as Kubernetes cluster nodes will be filtered out.
Migrating VM storage while a VM is online will rate limit disk I/O and might degrade service performance or cause other service issues. If VM storage migration has not finished before the migration timer expires, the system will suspend the VM. Services running on the VM will become unavailable. As a best practice, perform this operation while the service running on the VM is idle.
You cannot migrate a VM between an x86 host and an ARM host.
To avoid migration failures, do not shut down a VM during online migration of that VM.
The system supports cancelling online VM migration tasks. To cancel such a task, right-click that task on the task console, and then select Cancel Migration. |
On the top navigation bar, click Resources.
From the left navigation pane, select Compute > Host Pool Name > Host Name > VM Name or Compute > Host Pool Name > Cluster Name > Host Name > VM Name.
Click Migrate.
Follow the configuration wizard to migrate the VM.
Select migration type:
Host: Migrate the VM to another host. This method applies to VMs that use shared storage pools. The target host and the destination host must use the same shared storage pool.
Storage: Migrate the disks of a VM to another storage pool that is mounted to the host to which the VM is attached.
Host and Storage: Migrate the VM to another host and migrate the disks of a VM to another storage pool that is mounted to the host to which the VM is attached. The target host can be any host in the same cloud resource.
Timeout: Specify the timeout period for the migration of a running VM. The system suspends the VM when the VM is not migrated within the migration timeout to speed up the migration. After migration, the system resumes the VM automatically. The default migration timeout is 5 minutes. If you set the migration timeout to 0, the system does not suspend the VM during migration.
The migration timer is triggered depending on the migration mode.
Change Host/Change Host and Storage—The timer is triggered when the VM starts to be migrated.
Change Storage—The timer is triggered when the system updates dirty data (data generated during migration) of the first disk on the VM after all target disks have been migrated to the target storage pool.
Target Host: Select a destination host for migration if you migrate the VM by changing the host or both the host and storage.
Network Type: vSwitch network type of the selected target host. This parameter is automatically populated after you select a target host for a VM migration by changing the host.
Post-Copy Memory: Enable post-copy memory to ensure that VM migration finishes within the migration timeout period. This feature is available if you manually migrate a running VM by host. To avoid VM service interruption during the migration, make sure the storage resources and networks of the source and target operate correctly.
Estimated Migration Duration: Estimated length of time that the system will use to migrate the running VM by changing the host. If a migration network is available between the source and destination hosts, the migration duration is estimated based on the migration network condition. If no migration network is available between the source and destination hosts, the migration duration is estimated based on the management network condition. As a best practice, enable post-copy memory for the migration if this duration is longer than 24 hours.
Initiative CPU Frequency Underclocking: Enable the system to reduce the CPU frequency on the VM and reduce the data to migrate to accelerate the migration if the migration has not finished after a long period. Enabling this feature might degrade VM performance. This feature takes effect only when you migrate a running VM by changing its host or changing both its host and storage. This feature is enabled by default.
Encryption: Set whether to encrypt the data to be transmitted during migration of a running or suspended by changing the host or changing the host and storage.
Configure destination storage:
Destination Storage Pool: Select a new storage pool for the VM disk. If the VM has multiple disks, you can select different storage pools for the disks.
Set Format: Specify the disk format. If the disk of a VM has base image files, the disk format cannot be changed. This parameter takes effect only if you select a destination storage pool of the local directory, shared file system, or NFS file system type.
Same Format—The disk format keeps unchanged.
Intelligent—The disk format is qcow2.