Virtual Machine Memory Snapshot Generation via Valid Data Extraction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current memory snapshot technologies for virtual machines are inefficient, as they generate and recover snapshots by copying all memory pages, leading to long processing times and wasteful storage of both time and resources due to the inclusion of invalid data.
Innovation Solution
The method identifies and differentiates between valid and invalid memory page types within a virtual machine, only recording and recovering valid data, thereby reducing the size of the snapshot file and shortening the generation and recovery times.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If full copying of all memory pages is performed to generate a memory snapshot, then the snapshot contains complete memory data, but the generation time and recovery time are excessively long
Solution Approach 1:
The patent extracts only the necessary and valid memory pages from the virtual machine's memory space, excluding invalid pages (such as zero pages, shared pages, and pages already present in storage). This selective extraction approach maintains the completeness of essential memory data while dramatically reducing the amount of data that needs to be copied and stored, thereby shortening both snapshot generation time and recovery time.
Solution Approach 2:
The patent segments the memory snapshot into two distinct parts: storage snapshot data (containing persistent storage data) and memory snapshot data (containing only valid memory pages). This segmentation allows the system to handle only the necessary memory portions separately from storage data, avoiding the overhead of copying entire memory spaces and reducing the time required for snapshot operations.
2Reliability
If full copying of all memory pages is performed, then the snapshot is complete, but the snapshot file size becomes excessively large and wastes storage resources
Solution Approach 1:
The patent extracts and identifies invalid memory pages (zero pages, shared pages, and pages already existing in storage) and excludes them from the memory snapshot. This extraction of unnecessary data significantly reduces the snapshot file size while preserving all essential memory information needed for virtual machine recovery, thereby eliminating storage resource waste.
Solution Approach 2:
The patent discards invalid memory pages during snapshot creation and recovers only valid pages during restoration. By identifying and discarding pages that are either empty (zero pages), shared with other virtual machines, or already persisted in storage, the system minimizes storage usage while ensuring complete recovery of necessary memory state.
3Reliability
If all memory pages are copied including invalid data, then the snapshot is comprehensive, but the processing efficiency is low and resources are wasted
Solution Approach 1:
The patent extracts and filters out invalid memory pages (zero pages, shared pages, and pages already in storage) before creating the snapshot. This pre-filtering process ensures that only valid, necessary memory pages are processed and stored, significantly improving snapshot creation efficiency and reducing the computational resources required for processing.
Solution Approach 2:
The patent performs preliminary identification and classification of memory pages into valid and invalid categories before the actual snapshot creation process. By pre-processing the memory space to identify which pages need to be captured, the system avoids unnecessary processing during snapshot generation, thereby improving overall processing efficiency.
Data Source
Figure 1~2
Figure 3
Figure 4~6
AI summary
Embodiments of the present invention disclose a method, an apparatus, and a system for generating and recovering a memory snapshot of a virtual machine, where the method for generating a memory snapshot includes: obtaining a current Sth memory page of the virtual machine; identifying a page type of the current Sth memory page, where the page type includes a invalid data page and a valid data page; and recording the page type of the current Sth memory page in a memory snapshot file when the current Sth memory page is an invalid data page; and recording the page type and page data of the current Sth memory page in the memory snapshot file when the current Sth memory page is a valid data page, so that only valid data is stored according to the embodiments of the present invention, thereby reducing backup of invalid data, greatly shortening the generation time of the memory snapshot, reducing the size of the memory snapshot file, and saving storage resources.