The qm migrate command is a command-line tool provided by the QEMU/KVM Virtual Machine Manager that allows users to migrate a virtual machine from one physical host to another. This command creates a new migration task, which can be monitored and controlled using other commands in the QEMU/KVM Virtual Machine Manager.
To use qm migrate, users need to specify the ID number of the virtual machine they want to migrate, as well as the destination host where the virtual machine will be migrated. The command will then initiate the migration process, which transfers the virtual machine’s data and settings from the source host to the destination host.
qm migrate Command Examples
1. Migrate a specific virtual machine:
# qm migrate {{vm_id}} {{target}}
2. Override the current I/O bandwidth limit with 10 KiB/s:
# qm migrate {{vm_id}} {{target}} --bwlimit 10
3. Allow migration of virtual machines using local devices (root only):
# qm migrate {{vm_id}} {{target}} --force true
4. Use online/live migration if a virtual machine is running:
# qm migrate {{vm_id}} {{target}} --online true
5. Enable live storage migration for local disks:
# qm migrate {{vm_id}} {{target}} --with-local-disks true
Summary
The migration process can take some time, depending on the size of the virtual machine and the speed of the network connection between the hosts. During the migration, the virtual machine will remain running on the source host, but will be in a paused state while the data is being transferred. Once the migration is complete, the virtual machine will resume running on the destination host, and the source host will release the resources that were allocated to the virtual machine.
In addition to qm migrate, the QEMU/KVM Virtual Machine Manager provides a variety of other commands and features for managing virtual machines, including creating, cloning, modifying, and backing up VMs. More information about qm migrate and other features of the QEMU/KVM Virtual Machine Manager can be found in the project’s documentation at https://pve.proxmox.com/pve-docs/qm.1.html.