live migration
Suppose a physical server needs maintenance, but it is running a virtual machine serving live traffic that must not go down. Live migration is the trick that moves a running virtual machine from one physical host to another with the guest barely noticing - no shutdown, no reboot, the operating system and its applications keep running across the move. It is one of virtualization's most striking payoffs: because a VM is ultimately just state (memory, CPU registers, device state), you can copy that state to another machine and resume it there.
The hard part is the memory, because it keeps changing while you copy it. The common technique is pre-copy migration. First, the hypervisor copies the guest's entire memory to the destination while the guest keeps running on the source. Of course, the guest dirties some pages during that copy, so the hypervisor tracks which pages changed and copies just those again, then the ones dirtied during THAT round, iterating as the set of dirty pages shrinks. When the remaining dirty set is small enough, it does a brief stop-and-copy: pause the guest for a few milliseconds, copy the last handful of dirty pages plus the CPU and device state, and resume the guest on the destination. Done well, the pause is short enough that network connections survive and users see at most a tiny hiccup. (An alternative, post-copy, starts the guest on the destination immediately and pulls pages over on demand, trading a different risk profile.)
Why it matters: live migration is what makes a fleet of servers feel like one elastic pool - you can drain a host for maintenance, rebalance load away from a hot machine, or consolidate VMs onto fewer servers at night, all without downtime. The honest caveats are important. It needs fast shared networking and usually compatible CPUs and shared or replicated storage; it can fail or stall if a guest dirties memory faster than the link can copy it (a write-heavy workload may never converge); and it is much harder or impossible when the guest holds passed-through physical hardware, since you cannot copy a real device's hidden state. Live migration is a powerful, carefully-engineered illusion, not a free guarantee.
To take a host down for maintenance, the operator triggers live migration: the VM's 8 GiB of memory is pre-copied to a second host over several rounds, then the guest is paused for about 50 milliseconds to ship the last dirty pages and CPU state, and it resumes on the new host - open TCP connections survive.
Pre-copy iterates over dirty pages, then a millisecond-scale pause ships the rest - the guest hardly notices.
Live migration is not guaranteed: a write-heavy guest can dirty pages faster than they copy and never converge, and passed-through physical devices (whose hidden hardware state cannot be copied) often make it impossible. It also needs compatible CPUs and shared or replicated storage.