Skip to content

Virtual Machine and Storage Migration

Cockpit facilitates the migration of running virtual machines (VMs) and their virtual disks between physical Vapor hosts and storage pools without causing workload interruption or guest downtime.


1. Compute Live Migration

Compute live migration transfers the active runtime execution state (vCPUs and RAM) of a running VM from a source physical host to a destination physical host.

Depending on the storage architecture, Cockpit executes compute migration in one of two ways:

A. Shared Storage Migration

  • Architecture: The VM's virtual disks reside on a network storage pool (e.g., NFS, OCFS2, or SAN) accessible to both the source and destination hosts.
  • Workflow: Only the CPU state and memory pages are copied over the network to the target host. Because the virtual disks do not need to be duplicated or transferred, the switchover is completed within seconds.

B. Shared-Nothing Migration (Block Migration)

  • Architecture: The VM's virtual disks are stored on local disks (e.g., local SSDs) of the source host.
  • Workflow: Cockpit initiates a block-level copy of the virtual disk files over the network while the VM is running. Simultaneously, memory pages and CPU execution states are synchronized. Once the block and memory copies are fully synchronized, Cockpit executes the final switchover. Migration time depends on the disk volume size and network bandwidth.

2. Storage-Only Migration

Storage migration transfers a VM's virtual disk files between different datastores (storage pools) on the same physical host while the VM remains active.

  • Storage Copy Mode: Copies the underlying disk image (typically in qcow2 or raw format) block-by-block to the target storage pool.
  • Auto-Pivot: Once the disk duplication is complete, Cockpit executes an automatic runtime pivot. The hypervisor redirecting new disk write operations to the new target disk file, flushes remaining writes, and safely deletes the source disk file to recover space.

3. Advanced Migration Configuration

Administrators can configure the following advanced parameters when initiating a migration:

  • Live: Toggles live migration mode. Disabling this executes an offline/cold migration (suspending the VM before moving it).
  • Persistent: Ensures the VM's XML definition is permanently written to the target host's libvirt configuration, making the migration survive target host reboots.
  • Undefine Source: Deletes the VM's XML definition from the source host's libvirt configuration upon successful migration to maintain clean environments.
  • Auto Converge: Mitigates scenarios where the guest OS writes to memory (dirtying memory pages) faster than the network can copy it to the target host. When active, this setting dynamically throttles the guest VM's CPU execution rate to allow the memory sync to converge and complete the migration.
  • Max Bandwidth: Caps the maximum network throughput (in MB/s) allocated for the migration traffic, preventing network congestion on shared physical links.

4. Pre-Flight Validation Checks

To prevent migration failures and avoid VM network isolation or storage corruption, Cockpit runs automated pre-flight checks before executing any migration:

  • Storage Access Check: Verifies that the destination host has access to the target datastore and can locate or create the necessary disk resources.
  • Network Bridge Check: Confirms that the destination host is connected to the same virtual network switches (bridges or distributed networks) as the source host so the VM retains its network connectivity post-migration.
  • CPU Compatibility Check: Validates that the destination host's physical CPU supports the instruction set required by the VM's CPU model definition.
  • Host TLS Trust Check: Assures that the source and destination Vapor hosts have established a mutual TLS trust relationship to secure the migration stream.