Migrate VMs in Proxmox VE on Debian 12
In this article
Migrating virtual machines (VMs) in Proxmox VE on Debian 12 allows you to move a VM between hosts or storage locations with minimal downtime. This guide covers both live migration (zero downtime) and offline migration (brief shutdown) using Proxmox's built-in tools. Before starting, ensure you have a working Proxmox VE cluster (for live migration) or at least two hosts with shared or separate storage, and that all nodes are on the same Proxmox VE version.
What You'll Need
- A Proxmox VE cluster with at least two nodes (for live migration) or a single node with multiple storage targets (for storage migration).
- Root or sudo access to the Proxmox web interface or command line.
- Network connectivity between nodes (for cluster migration) or between host and target storage (for storage migration).
- Sufficient disk space on the target storage.
- If migrating across different CPU types, consider enabling CPU compatibility mode (in VM options) to avoid issues.
Step-by-Step
- Check cluster status – Log into the Proxmox web interface (https://your-proxmox-ip:8006). Go to “Datacenter” → “Cluster” and verify all nodes show as online and have the same version. If you're not using a cluster, skip to step 4.
- Prepare the VM for live migration – Ensure the VM is running and has no local-only resources like passthrough devices or local ISOs. If the VM uses local storage, you'll need to migrate storage separately or use shared storage.
- Live migrate to another node – In the web interface, select the VM from the left tree. Click “Migrate” in the toolbar. Choose the target node from the dropdown. Select “Live” for zero-downtime migration (requires shared storage or replicated storage). Click “Migrate” and monitor progress under “Tasks”.
- Offline migrate (shutdown) to another node – If live migration isn't possible (e.g., no shared storage), shut down the VM first (right-click VM → “Shutdown”). Then go to “Migrate”, select target node, and choose “Offline”. This copies the disk data over the network.
- Migrate storage within the same host – To move a VM's disk to another storage (e.g., from local to NFS), select the VM, click “Disk Action” → “Move Disk”. Choose the target storage and optionally the format (raw, qcow2, etc.). Confirm and wait for the task to finish.
- Migrate using command line (optional) – For scripting or more control, use the `qm migrate` command. Example: `qm migrate
--online` for live migration, or `--offline` for offline. For storage migration: `qm move-disk `. - Verify migration success – After migration, check the VM's status on the new node or storage. In the web interface, the VM should appear under the target node. Test connectivity to the VM to ensure it's working.
Common Mistakes
- Attempting live migration without shared storage – This will fail or fall back to offline migration. Ensure storage is shared (e.g., NFS, Ceph) or use replication.
- Ignoring CPU compatibility – If the source and target CPUs differ, the VM may crash after migration. Enable “host” CPU type or set “Compatibility” to a common baseline.
- Migrating a VM with local devices – Passthrough devices (USB, PCI) are tied to the host and will break migration. Remove them before migrating.
- Not checking disk space on target – Migration will fail if the target storage lacks space. Always check available space beforehand.
- Forgetting to update Proxmox VE on all nodes – Version mismatches can cause migration errors. Keep all nodes updated.
Tips
- Use a dedicated migration network (e.g., a separate VLAN) to avoid saturating your main network during large disk copies.
- For frequent migrations, set up Ceph or another shared storage system to enable seamless live migration.
- Test migrations in a non-production environment first to understand the process and potential pitfalls.
- Monitor migration progress in the “Tasks” panel; you can see speed and ETA.
- If migrating many VMs, consider using the “Migrate all” option on a node (under Node → “Migrate all”) to move all VMs at once.
Troubleshooting
- Migration fails with “connection timeout” – Check network connectivity between nodes. Ensure firewalls allow traffic on ports 8006 and 60000-60050 (used for migration). Try increasing the migration timeout in Datacenter → Options.
- Live migration stalls or is very slow – This often happens with high I/O on the VM. Reduce VM load or switch to offline migration. Also check for network bottlenecks.
- VM doesn't start after migration – Check the VM's configuration on the new node. The disk may not be attached correctly. Verify the disk is present on the target storage and re-attach if needed.
- “Cannot migrate” error due to local storage – The VM has disks on local storage that aren't shared. Either migrate the disk first (using move disk) to shared storage, or perform offline migration with the “--with-local-disks” option (not recommended for production).
- CPU mismatch errors – The VM's CPU type may not be supported on the target. Edit the VM options and set CPU type to “kvm64” or “host” (if compatible) and retry.
Frequently Asked Questions
Can I migrate a VM while it's running?
Yes, Proxmox supports live migration, which moves a running VM with minimal downtime, provided you have shared storage or replication in place.
What is the difference between live and offline migration?
Live migration transfers the VM's memory and disk state without shutting it down, while offline migration requires the VM to be stopped, then copies its disk to the target.
Do I need a cluster to migrate VMs?
For live migration between nodes, yes, you need a cluster. For storage migration within the same host, no cluster is needed.
How long does migration take?
It depends on the VM's disk size, network speed, and I/O load. A small VM on a fast network can migrate in seconds; large VMs may take minutes or longer.
Can I migrate a VM with snapshots?
Yes, but snapshots are migrated along with the VM. Ensure the target storage supports the snapshot format (e.g., qcow2).
What happens to the VM's network configuration after migration?
The VM's network configuration remains the same; it will use the same bridge on the target node, so ensure that bridge exists there.