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.
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.
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 |
Management network |
Migration network and management network |
Offline |
Management network |
Management network |
Migration network and management network |
For more information about the management network and migration network, see "Manage virtual switches for hosts."
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.
The migration timeout is timeout period for the migration of a running VM. If the VM migration is not finished within the migration timeout, the system suspends the VMs to accelerate the migration. After the migration, the system resumes the VMs automatically. When the migration timeout timer starts depends on the migration method you use.
If you change the host or change both the host and storage, the migration timeout timer starts when the VM migration begins.
If you change the storage, the migration timeout timer starts when dirty data is updated to the first disk after the disks are copied to the destination storage pool.
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.
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.
From the left navigation pane, select Resources > Host Pool Name > Host Name > VM Name or Resources > 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.
Compress: Set whether to compress the data to be transmitted during migration. This parameter is applicable only to running and suspended VMs.
Configure destination storage:
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.