💻 Proxmox VE Course IV-B-2. Executing VM/CT Live Migration: Working Principles (Memory Copy)

 

🔄 The Magic of Non-Stop Servers: An In-depth Analysis of Live Migration

In the previous session, we learned about the essential prerequisites for Live Migration: clusters and shared storage. In this #lecture, we will delve into the magic that happens inside the system when you actually click the migration button. The reason a Virtual Machine (VM) can cross physical server boundaries without stopping is due to the sophisticated 'Memory Copy' technology. Let's understand the core #method of moving data without affecting running services, step by step.


1. Core Technology of Live Migration: Iterative Memory Copy



The reason Live Migration feels 'seamless' is that it synchronizes memory data in real-time.

A. Pre-copy Phase

  • When migration starts, the system begins transferring the entire memory #data of the VM from the source node to the target node. During this time, the VM continues to provide services and modify its memory contents. Memory pages changed during the transfer are called 'Dirty Pages,' and tracking them is the key to this technology.

B. Iterative Synchronization

  • Once the first full copy is complete, only the 'Dirty Pages' that changed in the meantime are re-transmitted. By repeating this process multiple times, the memory difference between the source and target nodes is reduced to an extreme minimum. How quickly this process is performed determines the overall #performance.

C. Final Cut-over

  • When the amount of memory left to transfer reaches a very low threshold, the VM on the source node is briefly paused. The remaining tiny amount of memory and CPU register states are instantly transferred, and the VM is resumed on the target node. This moment usually occurs in milliseconds (ms), demonstrating #stability where users do not notice any service interruption.


2. Differences Between VM and Container (CT) Migration

Proxmox supports both QEMU/KVM-based VMs and LXC-based containers, and each handles migration differently.

A. Memory Dump of QEMU/KVM VMs

  • Since VMs have independent kernels, they use the migration protocol provided by QEMU. Streaming the entire memory in binary form and precisely replicating the hardware state is the core of #virtualization technology.

B. LXC Container Checkpointing (CRIU)

  • Since containers share the host's kernel, they utilize CRIU (Checkpoint/Restore In Userspace) technology. It works by freezing the state of running processes, turning them into files, and restoring them on the target node. This allows for a lighter and faster #optimized move compared to typical VM migrations.

C. Maintaining Network Sessions

  • Immediately after the move is completed, the cluster broadcasts ARP packets to the network switch to announce the VM's new location. This ensures incredible #network continuity, allowing TCP/IP sessions with external users to remain connected.


3. Factors Affecting Migration Speed



These are the elements to consider to maximize migration performance in a real-world environment.

A. Network Bandwidth and Latency

  • Memory copying occurs over the network. Having a dedicated #infrastructure of 10Gbps or higher, rather than 1Gbps, shortens migration time and increases the success rate. Setting up a dedicated migration network is the best approach.

B. VM Memory Size and Write Intensity

  • VMs with large memory capacities (e.g., 128GB+) or those with frequent memory writes (like DB servers) generate Dirty Pages quickly, which can prolong copy time. In such cases, sufficient migration #bandwidth must be allocated.

C. CPU Compatibility (CPU Flags)

  • If the CPU models differ between nodes, the VM may crash after migration due to differences in Instruction Sets. To prevent this, #software preparation is required to set the VM's CPU type to a common model like 'kvm64' instead of 'Host.'


4. Practical! Performing Live Migration in Proxmox

The process of executing and monitoring migration through commands and the GUI.

A. Easy Execution via GUI

  • Right-click the VM in the Proxmox web console and select 'Migrate.' Designate the target node, ensure the 'Online' checkbox is active, and execute. You can check the memory copy status in real-time through the progress logs.

B. Advanced Control Using CLI Commands

  • You can execute from the command line using the qm migrate <VMID> <TargetNode> --online command. This is useful for writing scripts to move large numbers of VMs at once, allowing for precise control of #resource allocation.

C. Failure Response Strategy

  • If a network failure occurs during migration, Proxmox protects the service by restarting the VM on the source node. If 'Migration failed' appears in the log, you must immediately #respond by checking storage locks or network connectivity.


Live Migration is not just data movement; it is a culmination of cluster technologies. By understanding the principles of memory copying, you can design your infrastructure to be more intelligent and robust. We hope today's lecture helps you build a non-stop system. Next time, we will cover the reality of HA (High Availability), which automatically restores services when a failure occurs.


Lecture, Method, Data, Performance, Stability, Virtualization, Optimization, Network, Infrastructure, Bandwidth, Software, Resource, Respond


Optimal performance, best cost efficiency! Experience Proxmox VE-based hosting that perfectly fits your project. Go to Luzen Hosting

댓글

이 블로그의 인기 게시물

💻 Proxmox VE Course II-A-5. CPU and Memory Settings: Understanding Ballooning and NUMA Configuration

💻 Proxmox VE Course III-A-3. Bonding (NIC Teaming) Configuration: Redundancy and Bandwidth Expansion (Active/Backup, LACP)

Sui (SUI) Mainnet Launch News: Preemptive Buying, Now is the Opportunity!