A virtual disk file protection method

Through virtual disk image preprocessing, monitoring and verification steps, IO monitoring and sliding window technology is used to solve the problem of time-consuming judgment of virtual disk file integrity, and rapid detection and recovery are achieved, improving the protection efficiency of virtual disk file and Data reliability.

CN113900768BActive Publication Date: 2024-11-15SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111090651.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-17
Publication Date
2024-11-15
Estimated Expiration
2041-09-17

AI Technical Summary

Technical Problem

The prior art takes a long time to determine whether the virtual disk has been tampered with or damaged, and it is impossible to quickly judge the integrity of the virtual disk.

Method used

Through the steps of virtual disk mirroring preprocessing, monitoring, checking and data restoration, IO monitoring and data block chunking technology can record changes in the virtual disk in real time, combining sliding windows and Hash value matching to achieve rapid detection and recovery.

Benefits of technology

It significantly improves the protection efficiency and data reliability of virtual disk files, can quickly determine whether the virtual disk has been tampered with, and recovers data when tampering is detected, enhancing the protection capability of virtual disk files in cloud computing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113900768B_ABST
    Figure CN113900768B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of cloud computing virtualization technology, and specifically provides a method for protecting virtual disk files, which specifically includes the following steps: S1, preprocessing virtual machine disk images; S2, monitoring virtual disks; S3, verifying virtual disks; S4, restoring virtual disk data. Compared with the prior art, the present invention, on the one hand, strengthens the protection of virtual disk files in a cloud computing environment. On the other hand, the verification requirements of large-capacity virtual disks can be met through IO flow monitoring and data block tracking. The protection and recovery of virtual disk files can significantly improve the reliability of cloud data information and business continuity requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud computing virtualization, and specifically provides a virtual disk file protection method. Background Art

[0002] A virtual machine disk file is a storage unit that carries the persistence of virtual machine data. The carriers that can be used as virtual machine disk images mainly include two categories: file type and block device (RBD block, LUN, LVM). The image types of virtual machines mainly include: Qcow2, RAW, vdi, vhd, vmdk, etc.

[0003] The virtual machine image file saves all the information of the virtual machine hard disk. According to the different data storage methods, it can be divided into two modes: full image mode (Flat Mode) and sparse mode Sparse mode (Sparse Mode). Full image mode saves all byte data on the virtual disk, including data that is invalid to the user. The raw format is full image mode. Sparse mode only saves data that is valid for the user and the file system, and only occupies the necessary storage space. The image file in this mode may not use continuous physical disk space when storing data; the qcow2, vdi, vmdk, etc. mentioned above are all sparse modes.

[0004] An MD5 checksum verifies the correctness of the data by performing a hash operation on the received transmission data. The calculated hash value is compared with the hash value transmitted with the data. If the two values ​​are the same, it means that the transmitted data is complete and has not been tampered with, so it can be used with confidence.

[0005] However, the verification method takes a long time for large files and cannot quickly determine whether the virtual disk has been tampered with or damaged. Summary of the invention

[0006] The present invention aims at solving the above-mentioned deficiencies of the prior art and provides a highly practical virtual disk file protection method.

[0007] The technical solution adopted by the present invention to solve its technical problem is:

[0008] A virtual disk file protection method specifically comprises the following steps:

[0009] S1, preprocessing the virtual machine disk image;

[0010] S2, monitor the virtual disk;

[0011] S3, verification of virtual disk;

[0012] S4. Restoration of virtual disk data.

[0013] Further, in step S1, the process of completing the creation of the virtual machine disk from the image includes determining whether the format of the image is RAW, verifying the integrity of the image, differentiating the backend for creating the system disk according to the volume type, and the proxy program will record the changes in the virtual disk I / O, i.e., the Hash value of the data block, during the process of creating the image to the backend storage.

[0014] Further, in step S1, the virtual machine disk can be stored in different storage backends, including the local file system storage backend, the distributed storage Ceph backend, and the centralized storage SAN backend.

[0015] Preferably, the virtual disk image of the local file system storage backend is uniformly managed in the RAW format type.

[0016] Further, in step S2, the disks used by the virtual machine include the system disk and multiple data disks. After the virtual machine runs on the computing node, the IO monitoring will automatically detect the addition or reduction of the virtual disks of the virtual machine and record the sector changes of the disks in real time, and record the change situation with each data block as the incremental unit.

[0017] Further, the virtual disk file is divided into variable-length data blocks, and the length of the data block is between a specified minimum value and maximum value;

[0018] The variable-length data blocks are divided by a sliding window. When the hash value of the sliding window matches a reference value, a block is created so that the size of the data block can reach a desired distribution.

[0019] Further, for the variable-length data blocks, two integers G and x (x < G) are predefined. A fixed window of size h moves on the file. If the hash value of the data within the fixed window at position k is f, and f mod G = x, then this position is a boundary of the data block;

[0020] Repeat this process until the entire file is blocked, and store the metadata information of the data block and the incremental data information of the changes.

[0021] Further, in step S3, in combination with the virtualization hypervisor, the integrity of the virtual machine disk file is verified during the power-on and cold migration of the virtual machine lifecycle management,

[0022] Specifically, it includes:

[0023] Before the virtual machine is powered on, according to the key data in step S2, check whether the disk data has changed during the shutdown of the disk and whether there are unauthorized modification operations on the virtual disk file;

[0024] The key to this test is that there is no need to recalculate all the source virtual disk files. By using the calculated and stored data for calculation, it is possible to quickly determine whether the files have been illegally modified for large-capacity virtual disks. If there is no illegal modification, it will start normally. If the virtual disk has been illegally modified, it will be blocked from starting and the data information before the modification can be restored.

[0025] Furthermore, in step S4, after it is detected that the data has been tampered with, the data before the tampering can be restored with the help of the recorded data block change information and the archived data.

[0026] Compared with the prior art, the virtual disk file protection method of the present invention has the following outstanding beneficial effects:

[0027] On the one hand, the present invention strengthens the protection of virtual disk files in the cloud computing environment. On the other hand, the verification requirements of large-capacity virtual disks can be met through IO flow monitoring and data block tracking. The protection and recovery of virtual disk files can significantly improve the reliability of cloud data information and business continuity requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Attached Figure 1 It is a virtual disk file protection method architecture diagram;

[0030] Attached Figure 2 It is a diagram of a virtual disk image file type in a virtual disk file protection method. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] A best embodiment is given below:

[0033] like Figure 1-2 As shown, a virtual disk file protection method in this embodiment specifically includes the following steps:

[0034] S1. Preprocess the virtual machine disk image:

[0035] Virtual machine disks can be stored in different storage backends. The present invention supports local file system storage backends, distributed storage Ceph backends, and centralized storage SAN backends. Both local file systems and remote backend storage virtual disk images are uniformly managed in the RAW format type.

[0036] The mirror preprocessing module mainly completes the processing from the mirror template to the creation of the virtual machine disk system disk, specifically including: judging whether the format of the mirror is RAW, integrity verification of the mirror (the MD5 checksum value will be calculated for the mirror file, and the original mirror supports encrypted upload and then decryption), differentiating the backend for creating the system disk according to the volume type, and the proxy program will record the virtual disk IO changes and the Hash value of the data block during the process of creating the mirror to the backend storage.

[0037] S2. Monitor the virtual disk:

[0038] The disks used by the virtual machine include the system disk or one or more data disks. After the virtual machine runs on the computing node, the IO monitoring will automatically detect the addition or reduction of the virtual machine's virtual disks and record the sector changes of the disks in real time. Each time, the change situation is recorded with an increment unit of about 512M - 2G of data blocks. This can quickly identify the changed data in the incremental changed data and effectively record it.

[0039] The key data of this record is similar to indexing and encoding large virtual disk data blocks, which can quickly judge the data changes and whether there are any tampering operations.

[0040] This incremental algorithm divides the virtual disk file into variable - length data blocks. The length of the data block is between a specified minimum value min(a) and a maximum value max(b). The variable - length data blocks are divided by a sliding window. When the hash value of the sliding window matches a reference value, a block is created, so that the size of the data block can reach an expected distribution.

[0041] Based on content - variable - length chunking, two integers G and x (x < G) are predefined. A fixed - size window of size h moves on the file. If at position k, the hash value of the data within the fixed window is f, and f mod G = x, then this position is a boundary of the data block. Repeat this process until the entire file is chunked. And store the metadata information of the data block and the changed incremental data information.

[0042] S3. Verify the virtual disk:

[0043] Combined with the virtualization manager, verify the integrity of the virtual machine disk file during the power - on and cold migration in the virtual machine lifecycle management to ensure the security of the virtual disk file.

[0044] Specifically, before the virtual machine is powered on, the key data in step S2 is used to check whether the disk data has changed during the shutdown period and whether there has been any unauthorized modification of the virtual disk file. The key to this test is that it is not necessary to recalculate all the source virtual disk files. With the help of the calculated and stored data, it can quickly determine whether the file has been illegally modified for a large-capacity virtual disk. If there is no illegal modification, it will start normally. If the virtual disk has been illegally modified, it will be blocked from starting and the data information before the modification can be restored.

[0045] S4. Restoration of virtual disk data:

[0046] After detecting that the data has been tampered with, the data before the tampering can be restored with the help of recorded data block change information and archived data.

[0047] Specific implementation: Create a new virtual disk by archiving data information, and mount it to the virtual machine for use, and track data changes of the new disk through step 2.

[0048] like Figure 1 As shown, IO monitoring, data verification and determination agent (CMA Proxy), management control center (CTL Manager), and backup storage backend on the computing node.

[0049] The IO monitoring module can monitor the virtual disk data IO flow and determine the incremental changes;

[0050] The data verification and judgment agent module can quickly determine whether the disk has been modified in combination with the virtual machine life cycle control;

[0051] The management control center is the center of the entire verification operation, which can specify verification strategies and risk warnings, data recovery, etc.

[0052] The backup storage backend archives virtual disk files, mainly in the form of incremental data backup.

[0053] like Figure 2 As shown, the location of the virtual machine disk file and the file composition type of the virtual disk in a virtualized environment are described.

[0054] The virtual machine disk file corresponds to the virtual machine's disk device, and in the KVM virtualization environment, the qemu template disk device and driver are used.

[0055] A virtual disk image can be in the form of a file such as a RAW file, a Qcow2 file, or a VHD file. A virtual disk image file can also be a remote RBD block, a LUN mapped to a SAN device, a direct local disk, or an LVM.

[0056] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any appropriate changes or substitutions made to the virtual disk file protection method that conforms to the claims of the present invention and are made by any ordinary technician in the technical field shall fall within the patent protection scope of the present invention.

[0057] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A virtual disk file protection method, characterized in that: Specifically, it includes the following steps: S1. Perform preprocessing on the virtual machine disk image; Complete the processing from the image to the creation of the virtual machine disk, including determining whether the format of the image is RAW, verifying the integrity of the image, differentiating the backend for creating the system disk according to the volume type, and the proxy program will record the changes in virtual disk I / O, i.e., the Hash value of the data block, during the process of creating the image to the backend storage; The virtual disk image of the local file system storage backend is uniformly managed in the RAW format type; S2. Monitor the virtual disk; The disks used by the virtual machine include the system disk and multiple data disks. After the virtual machine runs on the computing node, the IO monitoring will automatically detect the addition or reduction of the virtual disks of the virtual machine and record the sector changes of the disks in real time, and record the change situation with each data block as the incremental unit; S3. Verify the virtual disk; Combine with the virtualization management program to verify the integrity of the virtual machine disk file during the power-on and cold migration in the virtual machine life cycle management, Specifically including: Before the virtual machine is powered on, according to the key data in step S2, check whether the disk data has changed during the shutdown period and whether there are unauthorized modification operations on the virtual disk file; The key to this verification does not necessarily require recalculating all the source virtual disk files. By using the pre-calculated stored data for calculation, it is also possible to quickly determine whether the file has been illegally modified for large-capacity virtual disks. If there is no illegal modification, it will start normally. If the virtual disk has been illegally modified, the start will be blocked and the data information before the modification can be restored; S4. Restore the virtual disk data; After detecting that the data has been tampered with, the data before the tampering can be restored by using the recorded data block change information and the archived data.

2. A virtual disk file protection method according to claim 1, characterized in that: In step S1, the virtual machine disk can be stored in different storage backends, including the local file system storage backend, the distributed storage Ceph backend, and the centralized storage SAN backend.

3. A virtual disk file protection method according to claim 2, characterized in that: The virtual disk file is divided into data blocks with variable lengths, and the length of the data block is between a specified minimum value and maximum value; The variable-length data blocks are divided by a sliding window. When the hash value of the sliding window matches a reference value, a block is created so that the size of the data block can reach an expected distribution.

4. A virtual disk file protection method according to claim 3, characterized in that: Two integers G and x are predefined for the variable-length data block, where x < G. A fixed window of size h moves on the file. If the hash value of the data within the fixed window at position k is f, and f mod G = x, then this position is a boundary of the data block; Repeat this process until the entire file is blocked, and store the metadata information of the data block and the incremental data information of the changes.