VM Live & Storage Migration
Cockpit allows you to move running virtual machines (VMs) and their virtual hard drives between physical servers and storage pools without turning them off.
1. Compute Live Migration (Moving the VM)
This moves a running VM's active processors and memory (RAM) state from a source physical server to a destination physical server.
- 💡 Analogy: The Relay Race Imagine a relay race. Instead of stopping the race to hand over the baton (the VM's active state), the second runner (the destination server) starts running alongside the first runner (the source server). They match speeds, transfer the baton, and the second runner continues running. The VM never shuts down, and users experience zero downtime.
Depending on your storage setup, Cockpit performs one of two migration types:
A. Shared Storage Migration (Instant Move)
- How it works: The VM's virtual hard drive is saved on a shared network drive (like NFS or OCFS2) that both physical servers can access.
- 💡 Analogy: Both runners are on the same running track. We only need to hand over the baton (CPU/RAM state). Since we don't have to copy the hard drive, this migration takes only a few seconds.
B. Shared-Nothing Migration (Block Migration)
- How it works: The VM's virtual hard drive is stored on the physical server's local SSD.
- 💡 Analogy: The runner has to carry a heavy backpack (the VM's virtual disk) and transfer all its contents item-by-item to the second runner while they are both running. Cockpit copies the entire virtual disk file over the network block-by-block. This takes longer depending on the disk size and network speed.
2. Storage Migration (Moving the Disk)
This moves a VM's virtual disk file (its hard drive) between different storage pools (datastores) on the same physical server while the VM is running.
- 💡 Analogy: Changing Filing Cabinets Think of this like moving an open document from a slow filing cabinet (HDD datastore) to a fast filing cabinet (SSD datastore) without closing the document.
- Auto-Pivot: As soon as Cockpit completes copying the disk files, it automatically redirects the VM to write new data to the new disk file (pivoting) and safely deletes the old source files.
Advanced Options
When starting a live migration, administrators can configure these settings:
- Live: Minimizes the tiny pause when the VM switches from the source server to the destination server.
- Persistent: Ensures the VM's configuration is saved permanently on the target host so it remains there after reboots.
- Undefine Source: Deletes the VM's settings from the old source server once the move is complete to keep things clean.
- Auto Converge: If the VM is active and writing to memory faster than the network can copy it, this setting temporarily slows down the VM's processor slightly to let the copy finish.
- Max Bandwidth: Limits the amount of network speed (in MB/s) the migration can use, preventing it from slowing down other network traffic.
Pre-Flight Validations (Safety Checks)
Before Cockpit moves a VM, it runs automatic safety checks to prevent failures:
- Storage Check: Verifies that the destination server can access the VM's storage files.
- Network Check: Ensures that the destination server is plugged into the same virtual network switch (bridge) so the VM does not lose its network connection.
- CPU Check: Confirms that the processor on the destination server supports the same technical instructions as the processor on the source server.