Cloud Computing 18 min read

How UCloud Optimizes KVM Live Migration for Faster, Safer Cloud Operations

This article details UCloud's comprehensive optimizations for KVM live migration—including host selection, zero‑data handling, network switch improvements, auto‑converge tuning, compression, fast‑migration paths, cross‑machine type migration, and local hot‑upgrade—demonstrating how each stage reduces downtime, data transfer, and resource consumption while maintaining VM availability.

UCloud Tech
UCloud Tech
UCloud Tech
How UCloud Optimizes KVM Live Migration for Faster, Safer Cloud Operations

Introduction

In the previous article, the principles of KVM cross‑host live migration were analyzed. To address the complexity of cloud environments and diverse user needs, UCloud optimizes several aspects of the migration process.

Preparation Stage

During preparation, the host must match the business type and have sufficient free memory, disk, and appropriate CPU specifications. Bandwidth limitations are considered, and parallel migrations between the same two hosts are generally prohibited unless the network capacity is ample.

Migration Stage

Live migration transfers all VM disks and memory without downtime, requiring efficient handling of incremental data. Reducing transferred data shortens migration time and improves dynamic resource adjustment.

1. Zero‑Data Optimization

UCloud stores VM disks as sparse files; only used blocks occupy space. Native QEMU discards sparsity during migration, causing full‑size transfers. UCloud patches QEMU to skip sending all‑zero blocks, preserving sparsity and dramatically reducing transferred data and storage usage.

2. UDisk Network Disk Optimization

Since UDisk is network‑attached, its migration is unnecessary. UCloud filters out UDisk during migration and supports multi‑point mounting, allowing transparent migration without moving UDisk data.

3. Migration End Optimization

High memory‑write workloads generate continuous dirty pages, extending incremental transfer beyond the allowed downtime. UCloud improves QEMU's auto‑converge by increasing throttling speed and adjusting trigger thresholds, reducing vCPU execution time and limiting dirty page generation.

4. Compression Optimization

UCloud leverages QEMU's XBZRLE compression, which caches previously sent memory pages and transmits only XOR‑encoded differences, significantly lowering memory transfer volume and speeding up migration.

Switch Stage

Source‑side paused optimization: Migration control moves from QEMU to Libvirt, and UCloud’s management platform handles source host recovery, preventing VM downtime.

OVS switch optimization: By tuning Open vSwitch flow rule propagation, network interruption during the final switch is reduced to a few hundred milliseconds, making the migration virtually transparent to users.

Typical Application Scenarios

Fast Migration

For VMs with large data disks or high I/O workloads, UCloud skips disk transfer by sharing storage between source and destination, migrating memory and CPU first, then pulling the disk data, achieving rapid VM startup on the target host.

Cross‑Machine‑Type Migration

UCloud enables migration between different host types (e.g., standard, SSD, Ark) by converting disk formats (qcow2 → raw) via Libvirt configuration, allowing seamless upgrades without VM downtime.

Local Hot Upgrade

A local hot‑migration method upgrades QEMU without moving VM disks, transferring only memory. A new VM with the updated QEMU runs paused, receives memory from the old VM, and then switches over, completing the upgrade in seconds.

Conclusion

UCloud has implemented full‑stack optimizations for live migration—including host selection, disk and memory handling, network switching, fast migration, cross‑type migration, and local hot upgrades—ensuring uninterrupted, high‑performance VM operation and supporting efficient, elastic cloud services.

Zero‑data migration before and after
Zero‑data migration before and after
Zero‑data migration optimization diagram
Zero‑data migration optimization diagram
Memory auto‑converge optimization
Memory auto‑converge optimization
XBZRLE compression optimization
XBZRLE compression optimization
Fast migration shared storage diagram
Fast migration shared storage diagram
Cross‑machine‑type storage format conversion
Cross‑machine‑type storage format conversion
Local hot migration memory transfer
Local hot migration memory transfer
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performanceKVMLive Migrationcloud optimizationUCloud
UCloud Tech
Written by

UCloud Tech

UCloud is a leading neutral cloud provider in China, developing its own IaaS, PaaS, AI service platform, and big data exchange platform, and delivering comprehensive industry solutions for public, private, hybrid, and dedicated clouds.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.