Method for verifying data completeness of virtual machine live migration
By generating and verifying data clusters inside the virtual machine and using the MD5 algorithm to verify data consistency, the low efficiency and precise location problems of data integrity verification during virtual machine hot migration are solved, achieving efficient data integrity verification.
Patent Information
- Application Number
- CN202211719532.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In existing virtual machine hot migration technologies, data integrity verification methods are inefficient and cannot accurately locate data anomalies, affecting host resource utilization and user data security.
A cluster generator is used to generate data clusters and fill them with checksums. The clusters are stored in a linked list and verified by a cluster checker inside the virtual machine. The MD5 algorithm is used to verify the consistency of the data clusters and accurately locate the anomaly.
It improves data verification efficiency, does not consume host resources, can accurately locate data anomalies, and ensures data integrity.
Smart Images

Figure CN115933989B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of virtual machine live migration, and in particular to a method for verifying data integrity of virtual machine live migration. BACKGROUND
[0002] With the development of cloud computing industry, more and more advanced cloud business features are implemented based on virtual machine live migration function, and the virtual machine live migration function has gradually become a core basic function of virtualization. DRS (Distributed Resource Scheduling), host sub-health disposal, host maintenance, host rolling hot upgrade, and virtualization component hot upgrade all rely on virtual machine live migration technology.
[0003] Live migration of virtual machine, also known as dynamic migration or real-time migration. Live migration is widely used in cloud computing, which can enable users to migrate virtual machines from one physical host to another physical host without awareness, and the application program will hardly be interrupted during the entire migration process, and the user will not feel any difference.
[0004] Data loss, data corruption, and data tampering may occur during virtual machine live migration, which will cause significant data loss to users. Therefore, data integrity verification is particularly important during the implementation of virtual machine live migration.
[0005] In the existing data integrity verification technology, one type is to capture migrated data and migrated data, and to check the captured data. This scheme is performed on the host side, and the data checking is a black box, which cannot accurately locate the specific position of the error data, and the data checking needs to occupy a large amount of additional host resources, affecting the running of other virtual machines on the host. Another type is to calculate the hash value of all files in the virtual machine, and to check before and after migration. This scheme is low in efficiency and coarse in checking granularity, and also cannot accurately locate the specific position of the error data.
[0006] Therefore, how to provide a more accurate and efficient virtual machine live migration data integrity verification method has become a technical problem to be solved. SUMMARY
[0007] Therefore, in order to overcome the shortcomings of the prior art, the present application aims to provide a method for verifying data integrity of virtual machine live migration.
[0008] The present application provides a method for verifying data integrity of virtual machine live migration, comprising:
[0009] Step S1: creating a data cluster generation environment for the source virtual machine by a cluster generator;
[0010] Step S2: generating data clusters by a cluster generator, and filling source check values to the generated data clusters;
[0011] Step S3: sequentially storing the filled data clusters to a linked list;
[0012] Step S4: obtaining data clusters from the linked list by a cluster checker, and verifying the obtained data clusters.
[0013] Further, the step S1 of the method for verifying data completeness of virtual machine live migration comprises:
[0014] formatting a data disk of the source virtual machine by the cluster generator;
[0015] mounting a memory space of the source virtual machine into tmpfs by the cluster generator, and formatting the tmpfs.
[0016] Further, the method for verifying data completeness of virtual machine live migration, the data cluster generated in the step S2 comprises a cluster head, a data body, a cluster pointer, a cluster tail and a check bit, wherein the cluster head is used for marking the beginning of the data cluster, the data body is used for filling random data, the cluster pointer is used for pointing to the starting address of the next data cluster, the cluster tail is used for marking the end of the data cluster, and the check bit is used for filling the source check value.
[0017] Further, the method for verifying data completeness of virtual machine live migration, in the step S2, the source check value is filled to the generated data cluster, comprising: generating a corresponding source check value for the generated data cluster by the cluster generator using MD5 algorithm, and filling the source check value to the check bit of the corresponding data cluster.
[0018] Further, the step S3 of the method for verifying data completeness of virtual machine live migration comprises: inserting the filled data cluster into the head of the linked list, and sequentially storing to the linked list.
[0019] Further, the method for verifying data completeness of virtual machine live migration, in the step S4, the data cluster is obtained from the linked list by the cluster checker, comprising: obtaining the data cluster from the tail of the linked list by the cluster checker in the process of virtual machine live migration.
[0020] Further, the method for verifying data completeness of virtual machine live migration, in the step S4, the obtained data cluster is verified, comprising:
[0021] generating a corresponding destination check value for the obtained data cluster by the cluster checker using MD5 algorithm, and verifying whether the destination check value of the data cluster is consistent with the corresponding source check value;
[0022] When the destination check value of the data cluster is consistent with the corresponding source check value, continue to obtain the next data cluster from the tail of the linked list to generate and verify the destination check value;
[0023] When the destination check value of the data cluster is inconsistent with the corresponding source check value, suspend the data cluster generator and the cluster checker, and output the abnormal information of the data cluster.
[0024] Further, the abnormal information in step S4 of the verification method for data completeness of virtual machine live migration includes data cluster information, position information and marking information.
[0025] Further, the verification method for data completeness of virtual machine live migration, when the abnormal source is the memory, the position information is the virtual address of the memory, and when the abnormal source is the disk, the position information is the offset address of the disk.
[0026] Further, the verification method for data completeness of virtual machine live migration, the position information is determined by comparing the data cluster with the last data cluster verified by the destination check value.
[0027] The verification method for data completeness of virtual machine live migration has the following beneficial effects:
[0028] 1. By performing data cluster fragmentation check on the migration data, the data cluster fragmentation size is consistent and space-aligned, and the check efficiency is improved.
[0029] 2. By performing the check in the virtual machine, no additional resources of the host are occupied, and the operation of other virtual machines on the host is not affected.
[0030] 3. By performing the consistency check between the data clusters, the position information of the abnormality can be accurately located. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0032] Figure 1 It is a schematic diagram of the technical principle of the present application.
[0033] Figure 2 It is a flow chart of a verification method for data completeness of virtual machine live migration according to the exemplary first embodiment of the present application.
[0034] Figure 3 It is an execution flow chart of a verification method for data completeness of virtual machine live migration according to the exemplary first embodiment of the present application.
[0035] Figure 4 A format diagram of a generated data cluster of a verification method of data completeness of virtual machine live migration according to an exemplary second embodiment of the present application. DETAILED DESCRIPTION
[0036] The embodiments of the present application will be described in detail below with reference to the drawings.
[0037] It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict; and all other embodiments obtained by those skilled in the art based on the embodiments in the present disclosure without creative labor are within the scope of protection of the present disclosure.
[0038] It should be noted that various aspects of the embodiments described below are within the scope of the appended claims. As will be apparent, the aspects described herein can be implemented in various ways, and that any particular structure is merely an example. Based on this disclosure, one of ordinary skill in the art will appreciate that one aspect described herein can be implemented independently of any other aspects and that two or more of these aspects can be combined in various ways. For example, an apparatus can be implemented or a method can be practiced using any number of the aspects described herein. In addition, such an apparatus can be implemented or such a method can be practiced using other structure and / or functionality in addition to or other than one or more of the aspects described herein.
[0039] The technical principle of the present application is as follows:
[0040] As shown in Figure 1 Before live migration, data clusters are generated by a cluster generator in a source virtual machine, and the data clusters are associated by a linked list. During the migration process, the data clusters are continuously generated and migrated to a destination virtual machine, and the destination virtual machine checks the data clusters by a cluster verifier to check the completeness before and after migration.
[0041] The following each embodiment involves the following explanations of terms:
[0042] tmpfs: a temporary file system, a memory-based file system, which is characterized by its storage space in memory. The mount point of tmpfs can be used as a normal disk, and in Linux, some program temporary files are placed in tmpfs to improve system performance by taking advantage of the faster speed of tmpfs than hard disk.
[0043] MD5 algorithm: MD5 Message-Digest Algorithm, is a widely used hash algorithm, through the irreversible transformation algorithm, produces a unique MD5 message digest. MD5 algorithm because of its universal, stable, fast characteristics, is widely used in electronic signature, information integrity check, data encryption protection and other fields.
[0044] Figure 2 For a flowchart of a virtual machine live migration data integrity verification method according to an exemplary first embodiment of the present application, Figure 3 For the execution flowchart of the method of the present embodiment, as shown in Figure 2 And Figure 3 The method of the present embodiment comprises:
[0045] Step S1: creating a data cluster generation environment for the source virtual machine through the cluster generator;
[0046] Step S2: generating a data cluster through the cluster generator, and filling the generated data cluster with a source check value;
[0047] Step S3: storing the filled data cluster in order to a linked list;
[0048] Step S4: obtaining the data cluster from the linked list through the cluster verifier, and verifying the obtained data cluster.
[0049] Step S1 of the method of the present embodiment comprises: formatting the data disk of the source virtual machine through the cluster generator; and mounting the memory space of the source virtual machine into tmpfs through the cluster generator, and formatting the tmpfs.
[0050] Step S3 of the method of the present embodiment comprises: inserting the filled data cluster into the head of the linked list, and storing it in order to the linked list.
[0051] The method of the present embodiment performs verification inside the virtual machine, does not occupy additional resources of the host, and does not affect the running of other virtual machines on the host.
[0052] The exemplary second embodiment of the present application provides a virtual machine live migration data integrity verification method, which is Figure 2 And Figure 3 The preferred embodiment of the method shown in Figure 4 As shown, the format of the data cluster generated in step S2 of the method of the present embodiment comprises a cluster head, a data body, a cluster pointer, a cluster tail and a check bit, wherein the cluster head is used to mark the beginning of the data cluster, the data body is used to fill random data, the cluster pointer is used to point to the starting address of the next data cluster, the cluster tail is used to mark the end of the data cluster, and the check bit is used to fill the source check value.
[0053] In step S2 of the method of the embodiment, the generated data cluster is filled with a source check value, including: generating a corresponding source check value for the generated data cluster by the cluster generator using the MD5 algorithm, and filling the source check value into the check bit of the corresponding data cluster.
[0054] The method of the embodiment can make the data cluster slice size consistent and space-aligned, and improve the check efficiency, by checking the data slice of the migrated data.
[0055] The exemplary third embodiment of the application provides a method for verifying the completeness of virtual machine live migration data. Figure 2 and Figure 3 The preferred embodiment of the method shown.
[0056] In step S4 of the method of the embodiment, the data cluster is obtained from the linked list by the cluster checker, including: obtaining the data cluster from the tail of the linked list by the cluster checker during the virtual machine live migration process.
[0057] In step S4 of the method of the embodiment, the obtained data cluster is verified, including:
[0058] The corresponding destination check value of the obtained data cluster is generated by the cluster checker using the MD5 algorithm, and the destination check value of the data cluster is verified to be consistent with the corresponding source check value;
[0059] When the destination check value of the data cluster is consistent with the corresponding source check value, the next data cluster is obtained from the tail of the linked list for the generation and verification of the destination check value;
[0060] When the destination check value of the data cluster is inconsistent with the corresponding source check value, the data cluster generator and the cluster checker are suspended, and the abnormal information of the data cluster is output, including the data cluster information, the position information and the marker information.
[0061] In the method of the embodiment, when the abnormal source is the memory, the position information is the virtual address of the memory, and when the abnormal source is the disk, the position information is the offset address of the disk. The position information is determined by comparing the data cluster with the last data cluster verified by the destination check value.
[0062] The method of the embodiment can accurately locate the position information of the abnormality by consistency check between data clusters.
[0063] The above is only a specific embodiment of the application, but the protection scope of the application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the application, which should be covered within the protection scope of the application. Therefore, the protection scope of the application should be subject to the protection scope of the claims.
Claims
1. A method for verifying data completeness of virtual machine live migration, characterized in that, The method comprises: Step S1: creating a data cluster generation environment for a source virtual machine by a cluster generator; Step S2: generating a data cluster by the cluster generator, and filling a source check value to the generated data cluster; Step S3: storing the filled data cluster in sequence to a linked list; Step S4: obtaining the data cluster from the linked list by a cluster checker, and verifying the obtained data cluster; The data cluster generated in step S2 comprises a cluster head, a data body, a cluster pointer, a cluster tail and a check bit, wherein the cluster head is used for marking the beginning of the data cluster, the data body is used for filling random data, the cluster pointer is used for pointing to the starting address of the next data cluster, the cluster tail is used for marking the end of the data cluster, and the check bit is used for filling the source check value; In step S4, the obtained data cluster is verified, comprising: generating a corresponding destination check value for the obtained data cluster by the cluster checker using an MD5 algorithm, and verifying whether the destination check value of the data cluster is consistent with the corresponding source check value; when the destination check value of the data cluster is consistent with the corresponding source check value, continuing to obtain the next data cluster from the tail of the linked list for the generation and verification of the destination check value; when the destination check value of the data cluster is inconsistent with the corresponding source check value, suspending the data cluster generator and the cluster checker, and outputting the abnormal information of the data cluster.
2. The method of claim 1, wherein, Step S1 comprises: formatting the data disk of the source virtual machine by the cluster generator; mounting the memory space of the source virtual machine into tmpfs by the cluster generator, and formatting the tmpfs.
3. The method of claim 1, wherein, In step S2, the generated data cluster is filled with a source check value, comprising: generating a corresponding source check value for the generated data cluster by the cluster generator using an MD5 algorithm, and filling the source check value to the check bit of the corresponding data cluster.
4. The method of claim 1, wherein, Step S3 comprises: inserting the filled data cluster into the head of the linked list, and storing it in sequence to the linked list.
5. The method of claim 1, wherein, In step S4, the data cluster is obtained from the linked list by the cluster checker, comprising: obtaining the data cluster from the tail of the linked list by the cluster checker during the virtual machine live migration process.
6. The method of claim 1, wherein, The abnormal information in step S4 comprises data cluster information, position information and marking information.
7. The method of claim 6, wherein, When the abnormal source is the memory, the position information is the virtual address of the memory, and when the abnormal source is the disk, the position information is the offset address of the disk.
8. The method of claim 7, wherein, The position information is determined by comparing the data cluster with the last data cluster verified by the destination check value.
Citation Information
Patent Citations
Method for using p2p technology to fast transmit virtual machine template
CN104902000A