Virtual machine data backup method and device, electronic equipment and storage medium

By employing full-volume backup with snapshot-based incremental backups and linked list management, the method alleviates storage pressure on servers, improving performance and stability.

CN120315635APending Publication Date: 2025-07-15BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510371228.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

In the prior art, full backup of virtual machine data causes server storage pressure, affecting server performance and stability.

Method used

The incremental backup method of full backup combined with bitmap information is adopted to reduce duplicate data storage by creating snapshots when the server storage space exceeds the threshold and using bitmap information to determine the change data for incremental backup.

Benefits of technology

It effectively alleviates the pressure on server storage, improves the performance and stability of servers, and saves storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120315635A_ABST
    Figure CN120315635A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual machine data backup method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the one-time full backup of virtual machine data stored in a logical volume for a target virtual machine; detecting whether the storage space of the server exceeds a preset storage space threshold value or not; when it is detected that the storage space of the server exceeds a preset storage space threshold value, a snapshot is created for the logical volume at the current backup moment, and the snapshot comprises bitmap information of virtual machine data; wherein the bitmap information is used for marking data change information of the virtual machine; and determining changed virtual machine data based on the bitmap information so as to perform incremental backup on the changed virtual machine data. According to the technical scheme, the incremental backup can be performed on the virtual machine data of the target virtual machine when the server storage has pressure, and the storage space of the server is saved, so that the technical problems that the server storage pressure is caused and the performance and stability of the server are influenced due to the fact that the virtual machine data is subjected to multiple times of full backup are effectively relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a method, device, electronic device, and storage medium for virtual machine data backup. Background Art

[0002] Server virtualization, desktop virtualization, and application virtualization are the three major virtualization technologies in current computer virtualization. They are also an important technology for future cloud computing. Currently, in various industries around the world, the promotion of virtualization technology has begun and it has gradually become popular in the IT (Information Technology) industry.

[0003] Currently, the virtualization market has gradually occupied a large part of the IT market space. Virtualization has become the mainstream technology in the IT world. Virtual machines have begun to replace physical machines to run systems and applications, providing desktop services and application services for end-users. During the use of virtual machines, in order to ensure against downtime caused by misoperations and to ensure the security of virtual machine data, the existing method often uses the open-source qemu-img tool to perform full backups of virtual machine data at regular intervals. Since each backup is a full backup, after multiple full backups, it causes storage pressure on the server, affecting the performance and stability of the server, and is not conducive to user use. Summary of the Invention

[0004] In view of this, in order to effectively alleviate the technical problems of server storage pressure caused by multiple full backups of virtual machine data, which affect the performance and stability of the server, the embodiments of the present application provide a method, device, electronic device, and storage medium for virtual machine data backup.

[0005] In a first aspect, the embodiments of the present application provide a method for virtual machine data backup, the method comprising:

[0006] Perform a full backup of the virtual machine data stored in the logical volume for a target virtual machine;

[0007] Detect whether the server storage space exceeds a preset storage space threshold;

[0008] In the case where it is detected that the server storage space exceeds the preset storage space threshold, at the current backup moment, create a snapshot of the logical volume, where the snapshot includes bitmap information of the virtual machine data; wherein, the bitmap information is used to mark information on changes in the virtual machine data;

[0009] Determine the changed virtual machine data based on the bitmap information to perform an incremental backup of the changed virtual machine data.

[0010] Optionally, in the method as described above, the method further comprises:

[0011] When it is detected that the storage of the server does not exceed the preset storage threshold, continue to execute the step of performing a full backup of the virtual machine data stored in the logical volume.

[0012] Optionally, as in the foregoing method, the determining the changed virtual machine data based on the bitmap information includes:

[0013] Obtain the historical bitmap information in the snapshot created at the previous backup time; wherein, the previous backup time is the time of full backup or incremental backup;

[0014] Compare the bitmap information with the historical bitmap information;

[0015] Determine the virtual machine data corresponding to the bitmap information that is inconsistent with the historical bitmap information as the changed virtual machine data.

[0016] Optionally, as in the foregoing method, the method further includes:

[0017] Create a staging snapshot volume for storing the new virtual machine data generated by the target virtual machine during the incremental backup;

[0018] When it is monitored that the incremental backup is completed, restore the new virtual machine data in the staging snapshot volume to the logical volume and release the staging snapshot volume.

[0019] Optionally, as in the foregoing method, the method further includes:

[0020] Copy the virtual machine data corresponding to the full backup and the incremental backup to different specified system files respectively;

[0021] Send each of the specified system files to the object storage for persistent storage.

[0022] Optionally, as in the foregoing method, the method further includes:

[0023] Obtain the backup identification information and the parent node information of the incremental backup, and create a chain node for the incremental backup; wherein, the pointer field of the chain node stores the parent node information, and the data field of the chain node stores the changed virtual machine data;

[0024] Add the chain node to the head of the linked list, use the parent node information to point to the next chain node in the linked list, store the backup identification information in the head node of the linked list, and associate the backup identification information with the identification information of the target virtual machine; wherein, the linked list is a singly linked list constructed with the full backup as the tail of the chain.

[0025] Optionally, as in the foregoing method, the method further includes:

[0026] Determine a first incremental backup in the linked list according to the deletion task information; wherein, the first incremental backup is the incremental backup that needs to be deleted;

[0027] Determine whether the chain node of the first incremental backup is located at the head of the linked list;

[0028] In the case where it is determined that the chain node of the first incremental backup is located at the head of the linked list, delete the chain node corresponding to the first incremental backup from the linked list, and associate the identification information of the target virtual machine with the backup identification information of the backup corresponding to the parent node information of the first incremental backup.

[0029] Optionally, as in the foregoing method, the method further includes:

[0030] Determine a second incremental backup in the linked list according to the recovery task information; wherein, the identification information of the target virtual machine is associated with the backup identification information of the second incremental backup;

[0031] Determine a recovery backup based on the parent node information of the second incremental backup, so as to perform data recovery based on the virtual machine data in the second incremental backup and the recovery backup.

[0032] Optionally, as in the foregoing method, the method further includes:

[0033] Determine a third incremental backup in the linked list according to the merge task information; wherein, the third incremental backup is the incremental backup that needs to be merged;

[0034] Merge the virtual machine data in the third incremental backup and generate a merged incremental backup;

[0035] Create a merge chain node for the merged incremental backup and add the merge chain node to the head of the linked list; wherein, the identification information of the target virtual machine is associated with the backup identification information of the merged backup.

[0036] Optionally, as in the foregoing method, the method further includes:

[0037] Determine a fourth incremental backup in the linked list according to the virtual machine creation task information;

[0038] Determine a virtual machine creation backup based on the parent node information of the fourth incremental backup, so as to create a new virtual machine based on the virtual machine data in the fourth incremental backup and the virtual machine creation backup; wherein, the identification information of the new virtual machine is associated with the backup identification information of the fourth incremental backup.

[0039] Second aspect, an embodiment of the present application provides a virtual machine data backup device, characterized in that the device includes:

[0040] A full backup module for performing a full backup of the virtual machine data stored in the logical volume for a target virtual machine;

[0041] A detection module for detecting whether the server storage space exceeds a preset storage space threshold;

[0042] A snapshot module for creating a snapshot of the logical volume at the current backup time when it is detected that the server storage space exceeds the preset storage space threshold, where the snapshot includes bitmap information of the virtual machine data; wherein, the bitmap information is used to mark information on changes in the virtual machine data;

[0043] An incremental backup module for determining the changed virtual machine data based on the bitmap information to perform an incremental backup of the changed virtual machine data.

[0044] Third aspect, an embodiment of the present application provides an electronic device, which includes: a processor and a memory, and the processor is configured to execute a program for virtual machine data backup stored in the memory to implement the above virtual machine data backup method.

[0045] Fourth aspect, an embodiment of the present application provides a storage medium, where the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above virtual machine data backup method.

[0046] The virtual machine data backup method, device, electronic device, and storage medium provided by the embodiments of the present application. The method includes: performing a full backup of the virtual machine data stored in the logical volume for a target virtual machine; detecting whether the server storage space exceeds a preset storage space threshold; when it is detected that the server storage space exceeds the preset storage space threshold, creating a snapshot of the logical volume at the current backup time, where the snapshot includes bitmap information of the virtual machine data; wherein, the bitmap information is used to mark information on changes in the virtual machine data; determining the changed virtual machine data based on the bitmap information to perform an incremental backup of the changed virtual machine data. The above technical solution can perform an incremental backup of the virtual machine data of the target virtual machine when the server storage is under pressure, saving the server storage space, thereby effectively alleviating the technical problems of the server storage pressure caused by performing multiple full backups of the virtual machine data and affecting the server performance and stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.

[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0049] Figure 1 It is a flowchart of an embodiment of a method for virtual machine data backup provided by an embodiment of the present application;

[0050] Figure 2 It is a flowchart of an embodiment of another method for virtual machine data backup provided by an embodiment of the present application;

[0051] Figure 3 It is a schematic structural diagram of a linked list provided by an embodiment of the present application;

[0052] Figure 4 It is a schematic structural diagram of another linked list provided by an embodiment of the present application;

[0053] Figure 5 It is a schematic structural diagram of another linked list provided by an embodiment of the present application;

[0054] Figure 6 It is a schematic structural diagram of another linked list provided by an embodiment of the present application;

[0055] Figure 7 It is a schematic structural diagram of another linked list provided by an embodiment of the present application;

[0056] Figure 8 It is a block diagram of an embodiment of a device for virtual machine data backup provided by an embodiment of the present application;

[0057] Figure 9 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0059] It should be noted that the terms "first", "second", etc. in the description, claims and the above-mentioned drawings of the present invention are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising", "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0060] The reference to "an embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure or characteristic described in combination with the embodiment is included in one or more embodiments of the present application. Thus, statements such as "in an embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0061] It should be understood that the magnitudes of the sequence numbers of the steps in the following embodiments do not mean the order of execution is prior or subsequent. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0062] The following introduces some concepts involved in the embodiments of the present invention.

[0063] Snapshot: It refers to a fully available copy of a specified data set, and this copy includes the image of the corresponding data at a certain point in time (the time point when the copy starts).

[0064] Full backup: Also known as complete backup, it refers to a complete backup of all data at a certain point in time.

[0065] Incremental backup: It refers to only backing up the data that has changed since the last backup (full backup or incremental backup).

[0066] For the convenience of understanding the embodiments of the present application, the following will further explain with specific embodiments in conjunction with the drawings. The embodiments do not constitute a limitation to the embodiments of the present application.

[0067] The embodiments of the present application provide a method for backing up virtual machine data. SeeFigure 1 , Figure 1 This is a flowchart of an embodiment of a method for backing up virtual machine data provided by an embodiment of the present application. Figure 1 The process shown may include the following steps:

[0068] Step 101, for the target virtual machine, perform a full backup of the virtual machine data stored in the logical volume;

[0069] The target virtual machine can be understood as a virtual machine that can run normally and requires virtual machine data backup. Virtual machine data refers to various data running in the virtual machine environment. Usually, virtual machine data is stored in the data disk corresponding to the virtual machine. In actual applications, in order to more conveniently manage and allocate hard disk space uniformly and achieve dynamic adjustment of disk capacity, the logical volume manager can be used to store the virtual machine data in the created logical volume. Therefore, in this embodiment, when it is necessary to back up the virtual machine data of the target virtual machine, it is necessary to perform a full backup of the virtual machine data stored in the logical volume.

[0070] Step 102, detect whether the server storage space exceeds a preset storage space threshold;

[0071] Usually, the backed-up virtual machine data needs to be stored in the server storage space. After the full backup stores the virtual machine data in the server storage space, it is necessary to detect whether the current server storage space exceeds the preset storage space threshold. The preset storage space threshold is the limit of the server storage space usage that does not affect the performance and stability of the server operation set in advance.

[0072] It can be understood that when the server storage space exceeds the preset storage space threshold, it indicates that there will be server storage pressure when the server storage space faces the storage of the full-backup virtual machine data, which will affect the performance and stability of the server. Then, in this embodiment, subsequent incremental backups need to be performed to relieve the server storage pressure; when the server storage space does not exceed the preset storage space threshold, it indicates that the server has no storage pressure and will not affect the performance and stability of the server. Then, the step of performing a full backup of the virtual machine data stored in the logical volume can be continued, so as to facilitate subsequent rapid recovery of virtual machine data.

[0073] Step 103, in the case of detecting that the server storage space exceeds the preset storage space threshold, at the current backup moment, create a snapshot of the logical volume, and the snapshot includes the bitmap information of the virtual machine data;

[0074] As can be seen from the above description, when it is detected that the storage space of the server exceeds the preset storage space threshold, incremental backup needs to be performed. The current backup time can refer to the time when the first incremental backup is performed after the above full backup and it is detected that the storage space of the server exceeds the preset storage space threshold, or it can refer to the time when an incremental backup is performed after at least one incremental backup. There is no limitation here. When performing an incremental backup, a snapshot needs to be created for the logical volume. The snapshot not only includes the virtual machine data stored in the logical volume at the current backup time, but also includes the bitmap information corresponding to the virtual machine data. The bitmap information is used to mark the information of the virtual machine data change. The bitmap information can be a data version number or other information characterizing the change of the virtual machine data. There is no limitation here.

[0075] In this embodiment, the above logical manager can be the Cloud-admin volume management tool. The Cloud-admin volume management tool is encapsulated based on the open-source lvm transformation. When creating a logical volume, the above bitmap information will be included in the logical volume.

[0076] Step 104: Determine the changed virtual machine data based on the bitmap information to perform an incremental backup on the changed virtual machine data.

[0077] Through the bitmap information, the virtual machine data changed between the current backup time and the previous backup time can be determined, so as to perform an incremental backup on the changed virtual machine data, save the storage space of the server, and effectively relieve the storage pressure on the server.

[0078] The process of determining the changed virtual machine data based on the bitmap information is as follows: obtain the historical bitmap information in the snapshot created at the previous backup time; where the previous backup time is the time of full backup or incremental backup; compare the bitmap information with the historical bitmap information; determine the virtual machine data corresponding to the bitmap information that is inconsistent with the historical bitmap information as the changed virtual machine data.

[0079] That is, the virtual machine data with inconsistent bitmap information in the snapshot at the current backup time and the historical bitmap information in the snapshot at the previous backup time is determined as the changed virtual machine data. This change can be understood as new addition, modification, or update.

[0080] Through the method in this embodiment, when there is storage pressure on the server, incremental backup can be performed on the virtual machine data of the target virtual machine, saving the storage space of the server, effectively relieving the technical problem that multiple full backups of the virtual machine data occupy too much storage space of the server and bring storage pressure to the server, thereby improving the performance and stability of the server.

[0081] In one embodiment, during incremental backup, to ensure the consistency and integrity of the backup, a staging snapshot volume needs to be created at the current backup moment for storing the new virtual machine data generated by the target virtual machine during incremental backup. In this way, during the incremental backup process, if virtual machine data write operations continue, this new virtual machine data also needs to be included in the backup scope to ensure the integrity of the backup.

[0082] However, when it is detected that the incremental backup is completed, the new virtual machine data in the staging snapshot volume is restored to the logical volume, and the staging snapshot volume is released. The purpose of restoring the new virtual machine data to the logical volume is to ensure the integrity of the backup during the next backup, and the purpose of releasing the staging snapshot volume is to save the storage space of the server. It can be understood that a staging snapshot volume needs to be created during each incremental backup, and when the current incremental backup is completed, the new virtual machine data in the staging snapshot volume is restored to the logical volume, and the staging snapshot volume is released.

[0083] In one embodiment, since the backed-up virtual machine data exists locally on the server, when the server crashes, there is a problem that the virtual machine data is unavailable and cannot be restored. To effectively solve this technical problem, in this embodiment, the virtual machine data corresponding to the full backup and the incremental backup needs to be copied to different specified system files respectively; and each specified system file is sent to the object storage for persistent storage.

[0084] The above object storage can be KS3 (Kingsoft Cloud Standard Storage Service), high-availability object storage, intelligent tiered object storage, deep archive object storage, etc. The above object storages all provide different degrees of persistence and availability to meet the requirements of different application scenarios. When selecting, it should be comprehensively considered according to factors such as specific data storage requirements, access frequency, cost budget, and fault tolerance requirements, and no limitation is made here.

[0085] To facilitate the management of virtual machine data in diverse virtual machine data application scenarios, in this embodiment, it can be implemented using a linked list. On the basis of Figure 1 refer to Figure 2 Figure 2 which is the flowchart of another embodiment of the method for backing up virtual machine data provided by the embodiment of the present application. Figure 2 The shown process may include the following steps:

[0086] Step 201, perform a full backup of the virtual machine data stored in the logical volume for the target virtual machine;

[0087] Step 202, detect whether the server storage space exceeds the preset storage space threshold;​

[0088] Step 203, when it is detected that the storage space of the server exceeds the preset storage space threshold, at the current backup time, create a snapshot of the logical volume, where the snapshot includes bitmap information of virtual machine data; wherein, the bitmap information is used to mark the information of virtual machine data changes;

[0089] Step 204, determine the changed virtual machine data based on the bitmap information, so as to perform an incremental backup on the changed virtual machine data;

[0090] The processes of the above steps 201 to 204 are the same as the above steps 101 to 104, and will not be elaborated here.

[0091] Step 205, obtain the backup identification information and the parent node information of the incremental backup, and create a chain node of the incremental backup;

[0092] Among them, the pointer field of the chain node stores the parent node information, and the data field of the chain node stores the changed virtual machine data; the parent node information can be understood as the backup identification information corresponding to the full backup or incremental backup at the previous backup time when the incremental backup is performed at the current backup time. The above backup identification information is an automatically generated identification information representing that the full backup or incremental backup is the only backup, and the backup identification information can be represented by numbers, characters, letters or any combination thereof, which is not limited here.

[0093] Step 206, add the chain node to the head of the linked list, use the parent node information to point to the next chain node in the linked list, store the backup identification information in the head node of the linked list, and associate the backup identification information with the identification information of the target virtual machine; wherein, the linked list is a single linked list constructed with the full backup as the tail of the chain.

[0094] In one implementation, each time the chain node corresponding to the latest incremental backup is added to the head of the linked list. Since the parent node information (parent) is equivalent to the linked list pointer (next), the parent node information can be used to connect each chain node to form a linked list. For the sake of understanding, as Figure 3 shown, Backup 1 is a full backup, Backup 2 is an incremental backup based on Backup 1, and Backup 3 is an incremental backup based on Backup 2. Therefore, the chain nodes corresponding to Backup 1, Backup 2, and Backup 3 are connected by the parent node information (parent) to form a single linked list. For the sake of facilitating the recording of the reference relationship between the target virtual machine and the incremental backup after the last operation, the identification information (instance_uuid) of the target virtual machine can be associated with the backup identification information (backup_uuid) of Backup 3 stored in the head node (head) of the linked list with a dotted arrow, and in Figure 3Associate and display on the right side of the shown linked list. Associating the identification information of the target virtual machine with the backup identification information of the head node is beneficial for subsequent backup queries corresponding to the target virtual machine.

[0095] In practical applications, since there may be multiple full backups, that is, both Backup 1 and Backup 2 are full backups, and there is no incremental backup for Backup 1. In this embodiment, a linked list for Backup 1 may not be constructed, and only a linked list with at least one incremental backup is constructed, that is, a linked list of Backup 2 and Backup 3 is constructed.

[0096] Through the method provided in this embodiment, when using a singly linked list to manage multiple backups, each backup can be regarded as a node. The data field in the node is used to store the virtual machine data of the backup, and the pointer field is used to point to the next backup node. In this way, by traversing the singly linked list, all virtual machine data can be easily accessed and managed.

[0097] For the convenience of understanding, the management of virtual machine data is realized through the management of the linked list in different policy scenarios below.

[0098] For the scenario of virtual machine data deletion, in one implementation, determine the first incremental backup in the linked list according to the deletion task information; where the first incremental backup is the incremental backup that needs to be deleted; determine whether the linked node of the first incremental backup is located at the head of the linked list; in the case where it is determined that the linked node of the first incremental backup is located at the head of the linked list, delete the linked node corresponding to the first incremental backup from the linked list, and associate the identification information of the target virtual machine with the backup identification information of the backup corresponding to the parent node information of the first incremental backup.

[0099] When it is necessary to delete the virtual machine data in a certain incremental backup, it is necessary to determine whether the linked node of this incremental backup is located at the head of the linked list. If the linked node of this incremental backup is located at the head of the linked list, such as Figure 3 Backup 3, it indicates that there is no subsequent incremental backup based on the virtual machine data of this incremental backup. Then, deleting the linked node of this incremental backup, that is, deleting the virtual machine data of this incremental backup, will not affect the data integrity of the subsequent incremental backups. If the linked node of the deleted incremental backup is not located at the head of the linked list, such as Figure 3 Backup 2, then deleting the linked node of this incremental backup, that is, deleting the virtual machine data of this incremental backup, can affect the data integrity of the subsequent incremental backups. Therefore, in this embodiment, only the linked node located at the head of the linked list can be deleted to achieve the deletion of virtual machine data.

[0100] For the virtual machine data recovery scenario, in another implementation, the second incremental backup in the linked list is determined according to the recovery task information; wherein, the identification information of the target virtual machine is associated with the backup identification information of the second incremental backup; the recovery backup is determined based on the parent node information of the second incremental backup, so as to perform data recovery based on the virtual machine data in the second incremental backup and the recovery backup.

[0101] The second incremental backup can be understood as the incremental backup used for virtual machine data recovery. The recovery backup can be determined according to the parent node information of the second incremental backup. This recovery backup is all the backups used for virtual machine data recovery, and this backup includes a full backup and / or at least one incremental backup. For example, as Figure 3 shown, if backup 2 is used for virtual machine data recovery, then the recovery backup can be determined as backup 1 according to the parent node information of backup 2. Specifically, virtual machine data recovery can be realized by using backup 1 and backup 2. In order to reflect the association relationship between the target virtual machine and the incremental backup of the last operation in real time, the identification information of the target virtual machine needs to be associated with the backup identification information of backup 2, that is, as Figure 4 shown, wherein, backup 3 in the dotted box indicates that it is disconnected from backup 2 in the linked list.

[0102] If backup 3 is used for virtual machine data recovery, then the recovery backup can be determined as backup 2 and backup 1 according to the parent node information of backup 3. Specifically, virtual machine data recovery can be realized by using backup 1, backup 2 and backup 3. Since the backup identification information of backup 3 is currently associated with the identification information of the target virtual machine, no association is required.

[0103] In actual application, if after using backup 2 for virtual machine data recovery, an incremental backup is performed again based on backup 2, then the link node of the incremental backup backup 4 is connected to the link node of backup 2, and the formed linked list is as Figure 5 shown. Since backup 4 is at the head of the linked list and is the incremental backup after the last operation, therefore, the backup identification information of backup 4 needs to be associated with the identification information of the target virtual machine. Among them, backup 3 in the dotted box indicates that it is disconnected from backup 2 in the linked list.

[0104] For the virtual machine data merging scenario, in another implementation, the third incremental backup in the linked list is determined according to the merging task information; wherein, the third incremental backup is the incremental backup to be merged; the virtual machine data in the third incremental backup is merged, and a merged incremental backup is generated; a merged link node of the merged incremental backup is created, and the merged link node is added to the head of the linked list; wherein, the identification information of the target virtual machine is associated with the backup identification information of the merged backup.

[0105] As Figure 5As shown, if the third incremental backup for virtual machine data merging is Backup 2 and Backup 4, then after merging the virtual machine data in Backup 2 and Backup 4, a merged incremental backup is generated, and a merged chain node for this merged incremental backup is created and added to the head of the linked list. For ease of understanding, as Figure 6 shown, Backup 5 is the merged incremental backup after merging Backup 2 and Backup 4. As the new incremental backup of Backup 1, the merged chain node of Backup 5 is added before the chain node of Backup 1 as the head of the chain. To reflect the association between the target virtual machine and the incremental backup of the last operation, the identification information of the target virtual machine needs to be associated with the backup identification information of Backup 5. Among them, Backup 2, Backup 3, and Backup 4 in the dashed box indicate being disconnected from Backup 1 in the linked list.

[0106] For the virtual machine creation scenario, in another implementation, the fourth incremental backup in the linked list is determined according to the virtual machine creation task information; the virtual machine creation backup is determined based on the parent node information of the fourth incremental backup, so as to create a new virtual machine based on the virtual machine data in the fourth incremental backup and the virtual machine creation backup; among them, the identification information of the new virtual machine is associated with the backup identification information of the fourth incremental backup.

[0107] The fourth incremental backup can be understood as the incremental backup used for new virtual machine creation. According to the parent node information of the fourth incremental backup, the virtual machine creation backup can be determined. This virtual machine creation backup is all the backups used for new virtual machine creation, and this backup includes a full backup and / or at least one incremental backup. For example, if Figure 6 Backup 5 in is used for new virtual machine creation, then according to the parent node information of Backup 5, the virtual machine creation backup can be determined as Backup 1. Specifically, Backup 1 and Backup 5 can be used to create a new virtual machine. To reflect the association between the new virtual machine and the incremental backup of the last operation in real time, the identification information (instance_uuid1) of the new virtual machine needs to be associated with the backup identification information of Backup 5, that is, as Figure 7 shown.

[0108] If Figure 3 Backup 3 in is used for new virtual machine creation, then according to the parent node information of Backup 3, the virtual machine creation backup can be determined as Backup 2 and Backup 1. Specifically, Backup 1, Backup 2, and Backup 3 can be used to create a new virtual machine. Similarly, the identification information of the new virtual machine is associated with the backup identification information of Backup 3, and no diagram is shown here.

[0109] In actual application, when a new virtual machine is powered on and needs virtual machine data backup during operation, the association between the identification information of the new virtual machine and the backup identification information of the fourth incremental backup should be disconnected, and a linked list should be rebuilt to manage the backup of the new virtual machine through the linked list. Specifically, reference can be made to the process and usage of building the linked list for the target virtual machine described above, which will not be elaborated here.

[0110] Generally, to facilitate technicians to view the association between the target virtual machine and the incremental backup of the last operation, a virtual machine backup association table can be built. The virtual machine backup association table is used to store in real time the identification information of the target virtual machine and the backup identification information of the incremental backup of the last operation.

[0111] In actual application, a backup table can also be built. In this backup table, information such as the backup identification information, parent node information, backup name, and number of child nodes of each generated incremental backup and full backup is recorded for easy viewing.

[0112] See Figure 8 , which is a block diagram of an embodiment of a virtual machine data backup device provided by an embodiment of the present application. As Figure 8 shown, the device includes:

[0113] A full backup module 801, configured to perform a full backup of the virtual machine data stored in the logical volume for the target virtual machine;

[0114] A detection module 802, configured to detect whether the server storage space exceeds a preset storage space threshold;

[0115] A snapshot module 803, configured to create a snapshot of the logical volume at the current backup moment when it is detected that the server storage space exceeds the preset storage space threshold. The snapshot includes bitmap information of the virtual machine data; wherein, the bitmap information is used to mark the information of the changed virtual machine data;

[0116] An incremental backup module 804, configured to determine the changed virtual machine data based on the bitmap information to perform an incremental backup of the changed virtual machine data.

[0117] Specifically, for the specific process of each module in the device of the embodiment of the present invention to implement its function, reference can be made to the relevant description in the method embodiment, which will not be elaborated here.

[0118] As an optional implementation manner, the above device further includes:

[0119] An execution module, configured to continue to perform the step of performing a full backup of the virtual machine data stored in the logical volume when it is detected that the server storage space does not exceed the preset storage space threshold.

[0120] Specifically, for the specific processes of each module in the device according to the embodiments of the present invention to implement their functions, reference can be made to the relevant descriptions in the method embodiments, which will not be elaborated here.

[0121] As an alternative implementation manner, the above-mentioned incremental backup module 804 is further configured to:

[0122] Obtain historical bitmap information in the snapshot created at the previous backup time; wherein, the previous backup time is the time of full backup or incremental backup;

[0123] Compare the bitmap information with the historical bitmap information;

[0124] Determine the virtual machine data corresponding to the bitmap information inconsistent with the historical bitmap information as the changed virtual machine data.

[0125] Specifically, for the specific processes of each module in the device according to the embodiments of the present invention to implement their functions, reference can be made to the relevant descriptions in the method embodiments, which will not be elaborated here.

[0126] As an alternative implementation manner, the above-mentioned device further includes:

[0127] A creation module, configured to create a temporary snapshot volume for storing new virtual machine data generated by the target virtual machine during incremental backup;

[0128] A release module, configured to, when detecting that the incremental backup is completed, restore the new virtual machine data in the temporary snapshot volume to the logical volume and release the temporary snapshot volume.

[0129] Specifically, for the specific processes of each module in the device according to the embodiments of the present invention to implement their functions, reference can be made to the relevant descriptions in the method embodiments, which will not be elaborated here.

[0130] As an alternative implementation manner, the above-mentioned device further includes:

[0131] A copy module, configured to copy the virtual machine data corresponding to the full backup and the incremental backup to different specified system files respectively;

[0132] A storage module, configured to send each specified system file to the object storage for persistent storage.

[0133] Specifically, for the specific processes of each module in the device according to the embodiments of the present invention to implement their functions, reference can be made to the relevant descriptions in the method embodiments, which will not be elaborated here.

[0134] As an alternative implementation manner, the above-mentioned device further includes:

[0135] An acquisition and creation module, configured to acquire backup identification information and parent node information of an incremental backup, and create a chain node of the incremental backup; wherein, the pointer field of the chain node stores the parent node information, and the data field of the chain node stores the changed virtual machine data;

[0136] An addition module, configured to add the chain node to the head of the linked list, use the parent node information to point to the next chain node in the linked list, store the backup identification information in the head node of the linked list, and associate the backup identification information with the identification information of the target virtual machine; wherein, the linked list is a singly linked list constructed with a full backup as the tail of the chain.

[0137] Specifically, for the specific processes of each module in the device according to the embodiments of the present invention to implement their functions, reference may be made to the relevant descriptions in the method embodiments, which will not be elaborated herein.

[0138] As an alternative implementation manner, the above device further includes:

[0139] A first determination module, configured to determine a first incremental backup in the linked list according to the deletion task information; wherein, the first incremental backup is the incremental backup to be deleted;

[0140] A determination module, configured to determine whether the chain node of the first incremental backup is located at the head of the linked list;

[0141] A deletion module, configured to, when it is determined that the chain node of the first incremental backup is located at the head of the linked list, delete the chain node corresponding to the first incremental backup from the linked list, and associate the identification information of the target virtual machine with the backup identification information of the backup corresponding to the parent node information of the first incremental backup.

[0142] Specifically, for the specific processes of each module in the device according to the embodiments of the present invention to implement their functions, reference may be made to the relevant descriptions in the method embodiments, which will not be elaborated herein.

[0143] As an alternative implementation manner, the above device further includes:

[0144] A second determination module, configured to determine a second incremental backup in the linked list according to the restoration task information; wherein, the identification information of the target virtual machine is associated with the backup identification information of the second incremental backup;

[0145] A data restoration module, configured to determine a restoration backup based on the parent node information of the second incremental backup, so as to perform data restoration based on the virtual machine data in the second incremental backup and the restoration backup.

[0146] Specifically, for the specific processes of each module in the device according to the embodiments of the present invention to implement their functions, reference may be made to the relevant descriptions in the method embodiments, which will not be elaborated herein.

[0147] As an alternative implementation manner, the above device further includes:

[0148] A third determination module, configured to determine a third incremental backup in the linked list according to the merge task information; wherein, the third incremental backup is the incremental backup that needs to be merged.

[0149] A merge module, configured to merge the virtual machine data in the third incremental backup and generate a merged incremental backup.

[0150] A creation and addition module, configured to create a merge chain node of the merged incremental backup and add the merge chain node to the head of the linked list; wherein, the identification information of the target virtual machine is associated with the backup identification information of the merged backup.

[0151] Specifically, for the specific processes of each module in the device according to the embodiments of the present invention to implement their functions, reference may be made to the relevant descriptions in the method embodiments, which will not be elaborated here.

[0152] As an optional implementation manner, the above device further includes:

[0153] A fourth module, configured to determine a fourth incremental backup in the linked list according to the virtual machine creation task information.

[0154] A virtual machine creation module, configured to determine a virtual machine creation backup based on the parent node information of the fourth incremental backup, so as to create a new virtual machine based on the virtual machine data in the fourth incremental backup and the virtual machine creation backup; wherein, the identification information of the new virtual machine is associated with the backup identification information of the fourth incremental backup.

[0155] Figure 9 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Figure 9 The illustrated electronic device 1200 includes: at least one processor 1201, a memory 1202, at least one network interface 1204, and other user interfaces 1203. Each component in the electronic device 1200 is coupled together through a bus system 1205. It can be understood that the bus system 1205 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1205 further includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 9 all kinds of buses are labeled as the bus system 1205.

[0156] Among them, the user interface 1203 may include a display, a keyboard, or a pointing device (such as a mouse, a trackball, a touchpad, or a touch screen, etc.).

[0157] It can be understood that the memory 1202 in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM), and direct rambus RAM (DRRAM). The memory 1202 described herein is intended to include but not be limited to these and any other suitable types of memories.

[0158] In some embodiments, the memory 1202 stores the following elements, executable units, or data structures, or subsets thereof, or extended sets thereof: an operating system 12021 and an application program 12022.

[0159] Among them, the operating system 12021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., and is used to implement various basic services and process hardware-based tasks. The application program 12022 includes various application programs, such as a media player and a browser, etc., and is used to implement various application services. The program for implementing the method of the embodiments of the present application can be included in the application program 12022.

[0160] In the embodiments of the present application, by calling the program or instruction stored in the memory 1202, specifically, the program or instruction stored in the application program 12022, the processor 1201 is used to execute the method steps provided in each method embodiment.

[0161] The method disclosed in the embodiments of the present application above can be applied to the processor 1201 or implemented by the processor 1201. The processor 1201 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method can be completed by the integrated logic circuit of the hardware in the processor 1201 or the instructions in the form of software. The above-mentioned processor 1201 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of the hardware and software units in the decoding processor. The software unit may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 1202, and the processor 1201 reads the information in the memory 1202 and combines its hardware to complete the steps of the above method.

[0162] It can be understood that these embodiments described herein can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0163] For a software implementation, the technologies described herein can be implemented by units that execute the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented within the processor or external to the processor.

[0164] The electronic device provided in this embodiment may be the electronic device shown in Figure 9 and can execute all steps of the method for virtual machine data backup as shown in Figure 1-2 , thereby achieving the technical effect of the method for virtual machine data backup shown in Figure 1-2 . For specific details, please refer to Figure 1-2 for relevant descriptions. For the sake of brevity, it will not be elaborated here.

[0165] This embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium stores one or more programs. Among them, the storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk or solid-state drive; the memory may also include a combination of the above types of memory.

[0166] When one or more programs in the storage medium can be executed by one or more processors to implement the above method for virtual machine data backup.

[0167] The processor is used to execute the program for virtual machine data backup stored in the memory to implement the steps of the method for virtual machine data backup.

[0168] Those skilled in the art should further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0169] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0170] The specific embodiments described above further elaborate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above is only the specific embodiment of this application and is not used to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection scope of this application.

Claims

1. A method for backing up virtual machine data, characterized in that The method includes: Performing a full backup of the virtual machine data stored in the logical volume for the target virtual machine; Detecting whether the server storage space exceeds a preset storage space threshold; When it is detected that the server storage space exceeds the preset storage space threshold, at the current backup moment, creating a snapshot of the logical volume, where the snapshot includes bitmap information of the virtual machine data; wherein, the bitmap information is used to mark the information of the changed virtual machine data; Determining the changed virtual machine data based on the bitmap information to perform an incremental backup of the changed virtual machine data.

2. The method according to claim 1, characterized in that, The method further includes: When it is detected that the server storage space does not exceed the preset storage space threshold, continuing to perform the step of performing a full backup of the virtual machine data stored in the logical volume.

3. The method according to claim 1, characterized in that, The determining the changed virtual machine data based on the bitmap information includes: Obtaining historical bitmap information in the snapshot created at the previous backup moment; wherein, the previous backup moment is the moment of full backup or incremental backup; Comparing the bitmap information with the historical bitmap information; Determining the virtual machine data corresponding to the bitmap information that is inconsistent with the historical bitmap information as the changed virtual machine data.

4. The method according to claim 1, characterized in that The method further includes: Creating a temporary snapshot volume for storing the new virtual machine data generated by the target virtual machine during the incremental backup; When it is monitored that the incremental backup is completed, restoring the new virtual machine data in the temporary snapshot volume to the logical volume and releasing the temporary snapshot volume.

5. The method according to claim 1, wherein The method further includes: Copying the virtual machine data corresponding to the full backup and the incremental backup to different specified system files respectively; Sending each of the specified system files to the object storage for persistent storage.

6. The method according to claim 1, wherein The method further includes: Obtaining the backup identification information and the parent node information of the incremental backup, and creating a chain node of the incremental backup; wherein, the pointer field of the chain node stores the parent node information, and the data field of the chain node stores the changed virtual machine data; Adding the chain node to the head of the linked list, using the parent node information to point to the next chain node in the linked list, storing the backup identification information in the head node of the linked list, and associating the backup identification information with the identification information of the target virtual machine; wherein, the linked list is a singly linked list constructed with the full backup as the tail of the chain.

7. The method according to claim 6, wherein The method further includes: Determining the first incremental backup in the linked list according to the deletion task information; wherein, the first incremental backup is the incremental backup that needs to be deleted; Determining whether the chain node of the first incremental backup is located at the head of the linked list; When it is determined that the chain node of the first incremental backup is located at the head of the linked list, deleting the chain node corresponding to the first incremental backup from the linked list, and associating the identification information of the target virtual machine with the backup identification information of the backup corresponding to the parent node information of the first incremental backup.

8. The method according to claim 6, wherein The method further includes: Determine the second incremental backup in the linked list according to the restoration task information; wherein, the identification information of the target virtual machine is associated with the backup identification information of the second incremental backup; Determine the restoration backup based on the parent node information of the second incremental backup, so as to perform data restoration based on the virtual machine data in the second incremental backup and the restoration backup.

9. The method according to claim 6, wherein The method further includes: Determine the third incremental backup in the linked list according to the merge task information; wherein, the third incremental backup is the incremental backup that needs to be merged; Merge the virtual machine data in the third incremental backup and generate a merged incremental backup; Create a merge chain node of the merged incremental backup and add the merge chain node to the head of the linked list; wherein, the identification information of the target virtual machine is associated with the backup identification information of the merged backup.

10. The method according to claim 6, wherein The method further includes: Determine the fourth incremental backup in the linked list according to the virtual machine creation task information; Determine the virtual machine creation backup based on the parent node information of the fourth incremental backup, so as to create a new virtual machine based on the virtual machine data in the fourth incremental backup and the virtual machine creation backup; wherein, the identification information of the new virtual machine is associated with the backup identification information of the fourth incremental backup.

11. An apparatus for backing up virtual machine data, characterized in that, The device includes: A full backup module, configured to perform a full backup of the virtual machine data stored in the logical volume for a target virtual machine; A detection module, configured to detect whether the server storage space exceeds a preset storage space threshold; A snapshot module, configured to create a snapshot of the logical volume at the current backup moment when it is detected that the server storage space exceeds the preset storage space threshold, where the snapshot includes bitmap information of the virtual machine data; wherein, the bitmap information is used to mark the information of the changed virtual machine data; An incremental backup module, configured to determine the changed virtual machine data based on the bitmap information, so as to perform an incremental backup of the changed virtual machine data.

12. An electronic device, characterized in that, Includes: A processor and a memory, the processor is configured to execute a program for virtual machine data backup stored in the memory, so as to implement the method for virtual machine data backup according to any one of claims 1 to 10.

13. A storage medium, characterized in that, The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for virtual machine data backup according to any one of claims 1 to 10.

Citation Information

Cited By

  • Incremental data extraction method and device and electronic equipment

    CN121188053A