ð 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.
ð All Live migration in virtual machines MCQs
Q1. What is live migration in virtualization?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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?
ð 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.