Virtual Machine Data Loading Conflict Resolution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Data conflicts occur during the virtual machine data loading process due to overlapping data writing operations, leading to potential data errors when target data from the mirror server overwrites virtual machine data in the lazy loading volume.
Innovation Solution
The method involves creating a snapshot associated with the virtual machine's volume, writing target data from the mirror server into the snapshot, and separately managing virtual machine data in the volume, thereby avoiding conflicts and reducing data loading errors. Additionally, data is loaded in the background and switched to a normal attribute once all data is loaded, optimizing resource usage and storage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If target data is written directly into the lazy loading volume from the mirror server, then data loading speed is improved, but data conflicts occur when virtual machine data needs to be written to the same location
Solution Approach 1:
The patent segments the storage structure into three distinct layers: the mirror server (source), the snapshot (intermediate buffer), and the lazy loading volume (destination). By introducing the snapshot as a separate intermediate layer, the system allows parallel writing operations without conflict - target data is written to the snapshot while virtual machine data is written to the volume, eliminating data conflicts while maintaining loading speed
Solution Approach 2:
The snapshot serves as an intermediary buffer between the mirror server and the lazy loading volume. It temporarily holds target data during the loading process, acting as a mediator that prevents direct conflict with virtual machine data writes. The volume management program can then copy data from the snapshot to the volume in a controlled manner, ensuring data accuracy
2Productivity
If all data in the image file is loaded into the lazy loading volume in the background, then virtual machine creation efficiency is improved, but storage resources are wasted due to pre-loading unnecessary data
Solution Approach 1:
The system performs preliminary actions by creating the snapshot structure and establishing the association relationship between the snapshot and image file before actual data loading occurs. This allows the virtual machine to be created and started quickly without waiting for complete data loading, while data loading continues in the background at a controlled pace
Solution Approach 2:
Instead of loading all data from the image file into the lazy loading volume, the system loads only the necessary portions on-demand. The snapshot contains only the data that needs to be transferred to the volume, avoiding the waste of storing and managing unnecessary data in the lazy loading volume
3Reliability
If the snapshot is maintained indefinitely to prevent data conflicts, then data accuracy is improved, but device complexity increases due to additional management overhead
Solution Approach 1:
The snapshot is designed as a temporary structure that is discarded after it has served its purpose. Once all necessary data has been copied from the snapshot to the lazy loading volume, the volume management program deletes the snapshot, recovering storage space and reducing system complexity. This temporary nature of the snapshot simplifies long-term system management
Data Source
Figure 1A
Figure 1B
Figure 2A~2B
AI summary
This application provides a data loading method and apparatus, and relates to the computer field. The method includes: after a virtual machine is started, obtaining a data loading request of the virtual machine, where the data loading request is used to request to load target data in an image file; determining whether the target data is stored in a volume and a snapshot that correspond to the virtual machine, where the snapshot is obtained based on a blank volume corresponding to the virtual machine when the virtual machine is created; when the target data is not stored in the volume or the snapshot, writing the target data from a mirror server into the snapshot, and reading the target data and transferring the target data to the virtual machine; and obtaining virtual machine data generated by the virtual machine, and writing the virtual machine data into the volume. A conflict between new data and old data in a data loading process can be resolved. Because the virtual machine data and the target data are separately written into different locations, the conflict between the new data and the old data does not occur, and a probability of a data loading error of the virtual machine can be reduced.