Virtual Machine Snapshot Capture with Buffered Memory Protection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing virtual machine snapshot methods, particularly for KVM, require suspension and long-lived migration, leading to significant downtime and service disruption due to the time-consuming process of capturing memory data.
Innovation Solution
A method and apparatus that suspends the virtual machine momentarily to capture device status, employs a buffer to intercept and store memory page content without contamination, and then resumes the virtual machine, ensuring minimal downtime by parallel processing of device and memory snapshots.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Manufacturing precision
If the virtual machine is suspended to capture memory data, then the snapshot consistency is improved, but the service downtime increases
Solution Approach 1:
The patent applies preliminary action by suspending the virtual machine only momentarily at the beginning to capture device status, then resuming it while continuing to capture memory data in the background. This allows the memory capture to proceed without further suspensions, thereby maintaining snapshot consistency while minimizing service downtime.
Solution Approach 2:
The patent segments the snapshot capture process into two independent phases: device status capture (requiring suspension) and memory data capture (can proceed while running). By separating these operations, the system achieves consistent snapshots without requiring prolonged suspension, thus resolving the contradiction between consistency and downtime.
2Measurement precision
If the virtual machine is suspended for memory migration, then the snapshot accuracy is improved, but the productivity decreases
Solution Approach 1:
The patent performs the suspension and device status capture as a preliminary action before resuming the virtual machine. After resumption, memory data is captured continuously in the background without further suspensions, thereby achieving accurate snapshots while maintaining high service availability and productivity.
Solution Approach 2:
The patent ensures continuity of useful action by resuming the virtual machine after brief suspension and continuing the memory capture process in the background. This allows the virtual machine to remain operational throughout most of the snapshot process, maintaining productivity while still achieving accurate snapshots through continuous memory data collection.
3Measurement precision
If the memory data is captured sequentially, then the memory accuracy is improved, but the time consumption increases
Solution Approach 1:
The patent segments memory data capture into multiple pages that can be processed independently. By dividing the memory into pages and capturing them in parallel after the initial suspension, the system maintains memory accuracy through systematic page-by-page collection while significantly reducing total capture time through concurrent processing.
Solution Approach 2:
The patent uses a brief preliminary suspension to establish the starting point for memory capture, then proceeds with parallel page capture. This preliminary action ensures accuracy by establishing a consistent reference point, while the subsequent parallel processing minimizes time consumption.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Embodiments of the present invention disclose a method and an apparatus for generating a virtual machine snapshot. The method in the embodiments of the present invention includes: suspending a virtual machine at a first moment according to a received snapshot command, and starting to perform a storage operation on a memory page in memory of the virtual machine and a contamination interception operation on the memory page in the memory; storing a device status, which is at the first moment, of the virtual machine to a snapshot file; and restoring the virtual machine from a suspended state to a running state after the device status is stored, where the performing a contamination interception operation on the memory page includes: intercepting, from the first moment to a moment at which content of the memory page is stored to the snapshot file of the virtual machine, a contamination action that affects the content of the memory page, and after the content of the memory page is stored to a buffer, releasing the interception on the contamination action; and the performing a storage operation on a memory page in memory of the virtual machine includes: storing the content, stored in the buffer, of the memory page to the snapshot file of the virtual machine.