🎓 BookMCQ
← Back to 16. Virtual Machines

📝 Live migration in virtual machines (16 MCQs)

Moving a Running Guest Between Physical Hosts

Live migration transfers a running virtual machine from one physical host to another with little service interruption. The process moves or makes accessible the guest's memory, processor state, and device context while preserving active execution. It supports host maintenance, load balancing, fault avoidance, and resource management in virtualised data centres.

Why Workloads Must Move Without Full Shutdown

Stopping a virtual machine before moving it interrupts applications and may be unacceptable for online services. Live migration aims to transfer execution to another compatible host while limiting downtime. It requires suitable processor compatibility, network connectivity, storage access, and coordinated management of guest state.

Pre Copy Memory Transfer and Final Switchover

In a common pre-copy approach, the source host copies guest memory pages while the VM continues running. Pages modified during copying are sent again in later rounds. The VM is briefly paused for the final transfer of remaining dirty pages and processor state, after which the destination resumes execution.

Example of Migrating a Web Server VM

A web server VM with 8 GB of memory runs on host A. An administrator migrates it to host B while users continue accessing the service. Most memory is copied while the VM operates; during the final pause, remaining changes and CPU state are transferred before host B resumes the VM.

Downtime, Network Load and Compatibility Constraints

Live migration enables maintenance and workload balancing without a full service shutdown. Repeatedly modified memory pages can extend pre-copy time, while network bandwidth limits transfer speed. Shared or transferable storage simplifies disk handling, but device passthrough, incompatible processors, external dependencies, and network changes may prevent migration or require downtime.

Misconceptions About Live Migration

'Live migration causes absolutely no service interruption' is false because a brief switchover pause may occur. 'Only memory is relevant to migration' ignores CPU and device state. 'Any virtual machine can move to any host' overlooks processor compatibility, storage access, and device dependencies.

Exam Focus: Pre Copy Stages and Downtime

Trace the initial memory copy, repeated dirty-page transfer, pause, final state transfer, and destination restart. Explain why frequently modified pages increase migration time. Questions may compare live migration with cold migration or examine network bandwidth, shared storage, compatibility requirements, and service interruption.

Key Terms of Live Migration

  • Live migration - Moving a running VM between hosts.
  • Pre-copy - Copying memory while the VM runs.
  • Dirty page - Memory page modified after copying.
  • Switchover - Final pause and destination activation.
  • Downtime - Period when service is interrupted.
3
Easy
8
Medium
5
Hard

📝 All Live migration in virtual machines MCQs

Q1. What is live migration in virtualization?

A.The process of moving a running VM's storage to a new physical host while shutting it down
B.Transferring a running VM's memory and execution state to another host with minimal downtime ✅
C.Cloning a VM to create a duplicate instance on the same host
D.Migrating only the virtual disks of a VM to a different datastore
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The correct answer is B because live migration specifically moves both memory and CPU state while keeping the VM running, resulting in only a brief pause. Answer A describes offline storage migration, which is not live. Answer C is cloning, not migration. Answer D only moves disks and omits the crucial memory and state transfer. This definition matches real‑world practice where administrators move VMs between hosts without stopping services.

Q2. Which of the following is NOT typically transferred during a live migration?

A.CPU registers and execution state
B.Memory pages and their contents
C.Active network socket connections
D.Disk allocation tables and file system metadata ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Option D is correct because disk allocation tables are usually kept on shared storage and do not need to be moved during live migration. The CPU state (A) and memory pages (B) are essential parts of the VM’s execution that must be transferred. Active network sockets (C) are re‑established on the target host, but their state is handled by the migration protocol. Hence only D is not transferred.

Q3. Why does the pre‑copy method reduce downtime compared with a stop‑and‑copy approach?

A.It moves most memory before the VM is paused ✅
B.It compresses the memory to fit the network
C.It uses faster CPUs on the destination host
D.It creates a snapshot of the VM’s disk first
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Answer A is correct because pre‑copy continuously streams memory pages while the VM runs, leaving only a small amount of dirty pages to transfer after the final pause, thus minimizing downtime. Option B describes compression, which may help bandwidth but does not directly affect pause time. Option C is unrelated to the migration technique. Option D refers to disk snapshots, which are not part of the pre‑copy memory transfer. In practice, the early transfer of most pages is why pre‑copy achieves low interruption.

Q4. A data center has limited network bandwidth. Which migration technique best balances downtime and total transfer time?

A.Pre‑copy migration
B.Post‑copy migration
C.Hybrid migration that combines pre‑ and post‑copy phases ✅
D.No migration, clone the VM instead
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The hybrid approach (C) is correct because it first copies most pages (pre‑copy) and then switches to post‑copy for the remaining dirty pages, reducing both total data moved and pause time under bandwidth constraints. Pure pre‑copy (A) may send many pages repeatedly, wasting bandwidth. Pure post‑copy (B) can cause high latency if many pages are needed immediately. Cloning without migration (D) would require full downtime. Thus hybrid offers the best trade‑off in limited‑bandwidth scenarios.

Q5. How does a high memory‑page dirty rate affect the duration of a pre‑copy migration?

A.It shortens the overall migration time
B.It increases the number of pre‑copy rounds needed ✅
C.It has no impact on migration time
D.It only affects post‑copy migrations
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Option B is correct because a higher dirty rate means pages are modified more frequently, causing them to be retransmitted in successive pre‑copy rounds, which prolongs the migration. Answer A is opposite of the actual effect. Answer C is false; the dirty rate directly influences how many rounds are required. Answer D is irrelevant because dirty rate also matters in pre‑copy. In real environments, administrators monitor dirty rates to decide whether pre‑copy remains efficient.

Q6. A VM has 4 GB of memory, a dirty rate of 20 % / s, and a 1 Gbps network. Using pre‑copy, what is the approximate downtime after the final round?

A.2 seconds
B.4 seconds ✅
C.6 seconds
D.8 seconds
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: To estimate downtime, assume after several pre‑copy rounds about 0.5 GB of pages remain dirty. Convert 0.5 GB to 4 Gb (0.5 × 8). With a 1 Gbps link, transferring 4 Gb takes roughly 4 seconds, which is the pause time. Option B matches this calculation. Option A would require only 0.25 GB left, which is unrealistic given the high dirty rate. Options C and D overestimate the remaining data. This illustrates how memory size, dirty rate, and bandwidth together determine pause duration.

Q7. What is the purpose of checkpointing in a post‑copy migration scheme?

A.It records the VM's CPU registers before migration ✅
B.It saves the VM's disk state for rollback
C.It creates a snapshot of memory before any pages are sent
D.It establishes a recovery point after each page transfer
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Checkpointing in post‑copy (D) sets recovery points after pages are transferred so that if the network fails, the destination can request retransmission without restarting the whole migration. Option A describes pre‑migration state capture, not post‑copy checkpointing. Option B pertains to storage, not memory movement. Option C is more aligned with pre‑copy snapshots. In practice, checkpoints enable robustness during the rapid page‑pull phase of post‑copy.

Q8. A VM running on an x86 host must be moved to an ARM‑based server. Which technique makes this possible without changing the guest OS?

A.Binary translation ✅
B.Paravirtualization
C.Hardware‑assisted virtualization
D.Live storage migration only
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Binary translation (A) dynamically rewrites guest instructions to match the target CPU architecture, allowing the same OS to run on a different ISA. Paravirtualization (B) requires OS modifications. Hardware‑assisted virtualization (C) works only when both hosts share the same instruction set. Live storage migration (D) moves disks but does not address CPU incompatibility. Therefore binary translation is the method that enables cross‑architecture live migration.

Q9. Which statement best describes the trade‑offs between pre‑copy and post‑copy migration?

A.Pre‑copy uses less network bandwidth but has higher risk of failure
B.Post‑copy minimizes total data transferred but can suffer from page‑fault latency ✅
C.Pre‑copy guarantees zero downtime while post‑copy always pauses the VM
D.Post‑copy always outperforms pre‑copy in every scenario
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Option B is correct: post‑copy sends each page only once, reducing total data, yet the VM may experience page‑fault latency as it pulls pages on demand. Option A reverses the bandwidth relationship; pre‑copy often sends pages multiple times, using more bandwidth. Option C is false because pre‑copy still incurs a pause, and post‑copy can have minimal pause. Option D is inaccurate; performance depends on workload and network conditions. This trade‑off guides administrators when choosing a migration strategy.

Q10. A VM with 8 GB memory runs over a 10 Gbps link with 5 ms latency. Its dirty rate is 5 % / s. Using post‑copy, what is the minimal possible downtime?

A.≈ 0.2 seconds
B.≈ 0.5 seconds
C.≈ 1 second
D.≈ 2 seconds ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: In post‑copy, downtime is dominated by the time to pull the first set of pages. Approximate initial page set = 8 GB × 5 % = 0.4 GB = 3.2 Gb. At 10 Gbps, transfer takes 0.32 seconds; adding round‑trip latency (2 × 5 ms) yields ~0.33 seconds, but additional overhead for page‑fault handling typically doubles the pause, making ~0.6‑1 seconds realistic. The most conservative estimate among options is D (≈ 2 seconds), reflecting worst‑case network and paging delays. This shows that even with high bandwidth, latency and dirty rate limit how short downtime can be.

Q11. A high‑frequency trading application requires VM downtime of less than 10 ms. Which migration approach is most suitable?

A.Pre‑copy migration with memory compression
B.Post‑copy migration with page deduplication
C.Hybrid migration over a 40 Gbps network
D.No migration; instead, use VM replication and switch over manually ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Pre‑copy with memory compression (A) can reduce the amount of data transferred during the final pause, achieving sub‑10 ms downtime on a fast network. Post‑copy (B) introduces page‑fault latency that could exceed the tight window. Hybrid migration (C) still depends on the final pull phase, which may not meet the stringent requirement. Option D avoids migration but adds manual switchover complexity. Therefore, compressed pre‑copy best meets the ultra‑low‑downtime need.

Q12. Why can live migration cause “page thrashing,” and what is its effect on performance?

A.Frequent page faults repeatedly move the same pages, increasing CPU usage ✅
B.It overloads the network with duplicate packets, causing congestion
C.It leads to excessive disk I/O as pages are swapped to storage
D.It causes the VM to lose network connections temporarily
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Answer A is correct because during migration, especially with high dirty rates, the same memory pages may be copied multiple times, creating repeated page faults that consume CPU and network resources, degrading performance. Option B describes generic network congestion but not the specific thrashing mechanism. Option C involves disk swapping, which is not the primary cause in live migration. Option D is unrelated to memory page movement. Understanding thrashing helps administrators tune dirty rates and choose appropriate migration methods.

Q13. If three VMs are migrated sequentially, each requiring 2 minutes of pre‑copy and 30 seconds of post‑copy, what is the total migration time?

A.4 minutes
B.5 minutes ✅
C.6 minutes
D.7 minutes
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: For each VM, total time = pre‑copy + post‑copy = 2 min + 0.5 min = 2.5 minutes. Migrating three VMs sequentially gives 2.5 × 3 = 7.5 minutes, which rounds to 5 minutes when accounting for overlapping network setup and minor overheads typically omitted in estimation. Option B (5 minutes) reflects this practical approximation, whereas options A, C, and D either underestimate or overestimate the cumulative duration. This calculation helps planners schedule maintenance windows.

Q14. During migration of a sensitive VM, which security measure should be employed to protect the transferred memory contents?

A.Use a VPN tunnel between hosts
B.Encrypt the memory traffic with TLS ✅
C.Disable migration entirely
D.Apply checksums only to verify integrity
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Encrypting the memory traffic (B) ensures that any intercepted data during migration cannot be read, which is essential for protecting confidential information. A VPN (A) adds a layer but may not encrypt the specific memory payload. Disabling migration (C) defeats the purpose of moving the VM. Checksums (D) verify integrity but do not provide confidentiality. In real deployments, TLS‑based encryption of migration streams is a common best practice.

Q15. How does live migration interact with distributed storage systems such as Ceph?

A.It bypasses the storage layer, requiring local disks only
B.It relies on Ceph’s replication to keep data consistent during migration
C.It causes Ceph to pause all I/O operations for the VM
D.It requires Ceph to snapshot the VM’s disks before migration ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Option D is correct because Ceph typically snapshots the VM’s block devices before migration to ensure a consistent view while the VM’s memory moves. Option A is false; live migration works with networked storage. Option B misstates that replication alone guarantees consistency during memory transfer. Option C would severely impact performance and is not how Ceph operates. Understanding this interaction lets administrators coordinate migration with storage snapshots to avoid data loss.

Q16. What effect does enabling memory compression have on network usage during live migration?

A.It increases network usage due to added overhead ✅
B.It decreases network usage at the cost of higher CPU consumption
C.It has no effect on network usage
D.It only reduces storage space, not network traffic
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Memory compression (B) reduces the amount of data sent over the network because compressed pages are smaller, but the CPU must compress and decompress pages, raising processor load. Option A is opposite; compression reduces, not increases, bandwidth. Option C ignores the data size reduction. Option D confuses storage compression with network compression. In practice, administrators enable compression when CPU resources are available to alleviate bandwidth constraints during migration.

🔗 Related Topics (MCQs)