concept Hosting
Live VM migration and dirty-page convergence
A pre-copy migration makes progress when it copies memory faster than the guest dirties it. Follow the pages left after each round to see why reaching a threshold is different from predicting downtime.
What it means
Pre-copy live migration can stall when a running virtual machine changes memory pages as fast as the migration can copy them. A page that changes after it was copied is dirty: the destination needs a newer copy. The important question is not just how many pages were sent, but how many still need copying at the end of each round.
In QEMU pre-copy migration, much of the guest's state can transfer while the guest runs. The guest then stops for the remaining work, which can include both dirty memory and device state that was not transferred in rounds. “Live” describes the overlap between copying and running; it does not guarantee a near-zero pause.
Try it
Simulation: Start with 1,000 pages to copy, a transfer rate of 1,000 pages/s and a dirtying rate of 200 pages/s. The goal is to reach 50 or fewer remaining pages within four pre-copy rounds. With scenario evidence provided, the default result is converged: 1,000 pages initially, 200 after the first round and 40 after the second.
Live VM migration and dirty-page convergence
Explain why pre-copy live migration can stall when guest dirtying outpaces transfer
Remaining dirty pages reach the stipulated stop-copy threshold.
Progress
- Resultconverged
- Rounds represented2
- Stop-copy threshold50 pages
The marker is the stop-copy threshold. Reaching it does not measure the pause or account for all remaining device state.
Evaluated inputs
- Required scenario evidence
- provided
- Stop-copy threshold
- 50 count
- Initially dirty pages
- 1000 count
- Dirtying rate
- 200 pages/s
- Transfer rate
- 1000 pages/s
- Maximum pre-copy rounds
- 4 count
Integer rounded recurrence, unique dirty pages bounded by initial set, constant rates; no real hypervisor, compression or measured downtime.
About this model
The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.
Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.
Change only Dirtying rate to 1,000 pages/s. The result becomes nonconvergent. The trace contains just the initial 1,000 pages: the model can tell from the equal rates that another round cannot reduce the count, so it does not calculate one.
Use Reset to restore the defaults, then change only Maximum pre-copy rounds to 1. This time the result is limit: the first round leaves 200 pages, still above 50. Unlike the equal-rate case, copying is gaining ground. The round budget ends before the model can count the second round.
What one round leaves behind
Copying the first 1,000 pages at 1,000 pages/s takes one second in the example. At 200 newly dirty pages/s, that leaves 200 pages needing another copy. The next round copies just those 200 pages. It takes 0.2 seconds, giving the guest time to dirty 40 pages. The second round leaves less work because it takes less time, even though neither rate changed.
In each round, the model multiplies the current page count by the dirtying rate divided by the transfer rate. It rounds the result up to a whole page and never counts more distinct dirty pages than the initial set. At the default rates, each round leaves one-fifth of its starting count. A lower dirtying rate than transfer rate is necessary for a reduction, but it does not guarantee reaching every threshold: rounding can leave a small count unchanged, and the number of rounds is limited.
The bar lengths show pages still needing a copy, not pages copied in that round. If the initial count is already equal to the threshold, the model reports convergence with no pre-copy round at all. The remaining work is still nonzero; the threshold says when to stop the recurrence, not when every byte of guest state has arrived.
The stop-copy threshold is a count, not a timer. Reaching it means the model stops asking for another pre-copy round; it does not mean the destination has all the state it needs. At the assumed transfer rate, 40 pages alone would take 0.04 seconds to copy. That arithmetic covers only those pages, not the whole cutover, and is not a measured guest pause.
In practice
For a real pre-copy attempt, compare transfer and dirtying estimates from the same phase in compatible units, then look at the remaining work across rounds. QEMU's QMP reference defines dirty-pages-rate in pages per second, page-size in bytes and mbps in megabits per second. This simulation takes both rates in pages per second. Do not enter the raw mbps number as a page rate. If the throughput represents page data, its page-equivalent rate is megabits/s × 1,000,000 ÷ 8 ÷ bytes per page. Converting units alone does not establish how many distinct pages were copied; the simulation assumes constant rates and does not model compression.
If the needed evidence is missing, the result is unknown, not “stalled.” Stop before intervening if the migration phase or recovery policy is unclear. Cancellation is phase-dependent: for example, QEMU does not allow cancellation after post-copy has begun when post-copy RAM is in use. The simulation neither inspects nor changes a running migration.
Use the remaining-page trend to distinguish two situations: a falling count still above the threshold means progress has not yet been enough; a count that does not fall calls for checking how much work is being created while copying proceeds. Neither observation, by itself, tells you how long the guest will be stopped.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
What is a dirty page?
In the pre-copy example, a dirty page is a memory page changed since its relevant copy, so the destination may need another version. QEMU reports dirty-page statistics; the exact accounting and tracking interval depend on the implementation.
Why may migration stall?
In this pre-copy recurrence, the guest creates more dirty-page transfer work while copying proceeds. When the stipulated dirtying rate reaches or exceeds the transfer rate, the modeled remaining work cannot shrink.
Can a model converge without performing a round?
Yes. When the initial remaining-page count is already at the stipulated stop-copy threshold, this recurrence ends immediately. That does not establish zero remaining work or zero downtime.
Can policy abort migration?
A controller may abandon a nonconverging pre-copy attempt. For example, QEMU documents migration cancellation but disallows it after the post-copy phase begins when post-copy RAM is in use. Check the real migration phase and recovery policy before intervening.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- QEMU migration
precopy. Live migration transfers most guest state while running; remaining state and noniterative devices may be sent during stop phase. Toy recurrence not claimed as actual QEMU implementation.
Checked .
- QEMU QMP reference
Migration RAM statistics; migrate_cancel. QEMU QMP development documentation reports dirty-rate observations and migration cancellation semantics. Cancellation is not allowed after the post-copy phase starts when post-copy RAM is in use. The toy recurrence assumes pre-copy with fixed rates; do not infer actual downtime or issue a cancellation based on it.
Checked .