The Wild

Proxmox Live Migration: How It Works

· 7 min read · Mammals

In this article
  1. Background: Why Live Migration Exists
  2. How Proxmox Live Migration Works Step by Step
  3. Choosing Between Shared and Local Storage
  4. Common Problems and Troubleshooting
  5. Comparing Live Migration with Other Methods
  6. Costs and Requirements
  7. Safety and Best Practices
  8. Frequently Asked Questions

Proxmox VE live migration moves a running virtual machine (VM) or container from one physical host to another with no downtime, by copying the guest's memory and disk state over the network while the VM keeps running, then switching over execution at the end. This works because Proxmox uses QEMU/KVM for VMs and LXC for containers, both of which support live migration through built-in mechanisms that synchronize state incrementally.

Background: Why Live Migration Exists

Live migration was developed to solve a simple operational problem: physical servers need maintenance, hardware fails, or workloads need rebalancing, but stopping a VM means lost uptime. Before live migration, admins had to shut down a VM, copy its disk, and start it elsewhere—minutes or hours of downtime. Live migration reduces that to a sub-second pause, so users don't notice anything. Proxmox inherited this capability from the underlying QEMU/KVM project, which has supported live migration for years. For containers, Proxmox uses a similar approach with LXC's checkpoint/restore feature, though it is less seamless than VM migration.

How Proxmox Live Migration Works Step by Step

The migration process can be broken into clear stages. For a VM with local storage (not shared), Proxmox does the following:

  1. Pre-migration check: Proxmox verifies the target node is online, has enough resources (RAM, CPU), and can access the VM's storage. If the storage is local, it plans to copy the disk.
  2. Memory copy: The VM's RAM is copied from the source to the target over the network using QEMU's migration protocol. The VM keeps running, so memory changes during the copy.
  3. Iterative synchronization: QEMU repeatedly copies the pages that changed since the last iteration. Each pass gets smaller as the rate of change slows down.
  4. Disk copy (for local storage): If the VM uses local storage, Proxmox copies the disk image to the target node before or during memory copy. This is done via a “storage migration” feature that copies the disk while the VM runs, then switches to the new disk at the end.
  5. Switchover: When the remaining dirty memory is small enough, the source VM is paused briefly (typically 50–200 ms), the final memory state is copied, and the target VM resumes. The source is then shut down.

For containers, the process is similar but uses LXC's CRIU (Checkpoint/Restore In Userspace) to freeze the container, dump its state, copy it, and restore it on the target. This can cause a longer pause (a few seconds) because containers don't have the same iterative memory copying as QEMU.

Choosing Between Shared and Local Storage

The storage type dramatically affects migration behavior. Shared storage (NFS, Ceph, iSCSI, GlusterFS) means both nodes see the same disk image, so only memory needs copying—this is the fastest and most reliable method. Local storage (on the host's own disks) requires copying the disk image, which adds time and network load. Proxmox supports both, but shared storage is recommended for production because it reduces migration time and avoids disk copy errors.

When using local storage, Proxmox offers a “migration with storage” option that copies the disk to the target node. This works but can be slow for large disks, and the VM must be stopped if the disk is not on a filesystem that supports live copy (like qcow2 with dirty bitmaps).

Common Problems and Troubleshooting

Live migration can fail for several reasons. The most common are:

  • Network issues: Migration uses a dedicated network path (default is the management network). High latency or packet loss can cause timeouts.
  • Resource constraints: The target node must have enough free RAM and CPU to accommodate the VM. If not, migration aborts.
  • Storage mismatches: If the target node can't access the same storage (e.g., different mount points), migration fails.
  • CPU compatibility: If the VM uses CPU features not available on the target, migration may fail. Proxmox mitigates this by recommending “host” CPU type or enabling “migrate” flag, but you must ensure both nodes have similar CPUs.
  • Firewall or network isolation: Proxmox uses specific ports (e.g., 8006 for web, but migration uses a separate TCP port that must be open between nodes).

To troubleshoot, check the migration log in the Proxmox web interface (under the VM's “Tasks” section). Common errors include “migration aborted” or “cannot open shared storage.”

Comparing Live Migration with Other Methods

Live migration is not the only way to move VMs. Alternatives include:

  • Offline migration: Shut down the VM, copy its disk, start it elsewhere. Simple but causes downtime.
  • Backup and restore: Create a backup, restore on another node. Works across clusters but is slow and not continuous.
  • Replication: Proxmox has a built-in replication feature that periodically copies disk changes to a secondary node. This allows near-live failover but not a seamless migration—the VM must be stopped and started on the replica.

Live migration is the only method with zero downtime, making it ideal for maintenance windows or load balancing.

Costs and Requirements

Live migration is a feature of Proxmox VE itself, so it costs nothing extra—you just need a valid subscription for updates, but the feature works without it. However, there are infrastructure costs:

  • Network bandwidth: Migrating a VM with 16 GB RAM and a 100 GB disk can transfer tens of GB over the network. A dedicated 10 GbE network is recommended for large VMs.
  • Shared storage: If you use Ceph or NFS, you need the hardware and maintenance for that storage cluster.
  • Resource headroom: The target node must have enough free RAM to hold the VM's memory, so you need to overprovision or keep spare capacity.

For a small cluster, the cost is minimal—just a second server and a network connection. For large environments, shared storage and high-speed networking can be significant investments.

Safety and Best Practices

Live migration is generally safe, but there are important precautions:

  • Test before relying: Always test migration in a staging environment, especially if using local storage or unusual configurations.
  • Ensure both nodes are on the same Proxmox version: Mixed versions can cause migration failures.
  • Monitor network load: Migration can saturate the network, affecting other services. Use a separate network for migration traffic if possible.
  • Check CPU compatibility: If you plan to migrate between different CPU models, set the VM's CPU type to “qemu64” or “host” with the “migrate” flag to ensure compatibility.
  • Have a rollback plan: If migration fails, the VM should remain on the source. Proxmox handles this automatically—the source VM is not stopped until the target is ready—but you should verify after a failure.

One common misconception is that live migration is risky and can cause data loss. In practice, QEMU's migration protocol ensures data integrity by copying memory and disk state consistently. The VM is only paused at the very end, and if anything goes wrong, the source VM continues running.

Frequently Asked Questions

Does live migration work for containers?

Yes, Proxmox supports live migration for LXC containers, but it uses a different mechanism (CRIU) that typically results in a longer pause (a few seconds) compared to VMs. The container's filesystem must be on shared storage, or you must use local storage with the migration option.

Can I migrate a VM to a node with less RAM than the VM uses?

No, the target node must have enough free RAM to accommodate the VM's allocated memory. If it doesn't, migration will fail with a resource error.

What happens if the network drops during migration?

If the network connection between nodes fails during migration, Proxmox aborts the migration and the VM continues running on the source node. The source VM is never stopped until the target confirms it has the full state, so there is no data loss.

Does live migration work without shared storage?

Yes, Proxmox can migrate VMs with local storage by copying the disk image to the target node. This is slower and requires enough disk space on the target, but it works. The VM will experience a brief pause at the end when the disk is switched.

Is there any downtime during live migration?

There is a very short pause (typically under a second) when the VM is switched from the source to the target. This is called the “downtime” and is usually imperceptible to users, but it is not zero.

Can I migrate a VM while it is under heavy load?

Yes, but heavy load can cause the memory to change faster than it can be copied, leading to a longer migration time or failure. Proxmox has a “downtime limit” setting that controls how long the final pause can be, and it will abort if the limit is exceeded.