Virtual machine data recovery method, data backup method, data recovery device, data backup device and computer equipment
By creating the same configuration in the second virtual machine and uploading the snapshot chain image file, the problem of data loss of virtual machine is solved, and data recovery and loss is achieved.
Patent Information
- Application Number
- CN202411480599.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2044-10-23
AI Technical Summary
During operation, virtual machines are prone to data loss due to various reasons, and the prior art is difficult to effectively avoid data loss.
Create a second virtual machine with the same configuration as the virtual machine to be restored, and by obtaining the snapshot chain in its backup metadata, upload the mirror files corresponding to the snapshot chain to the second virtual machine in turn to form a second snapshot chain to complete data recovery.
Recovering the data of the first virtual machine in the second virtual machine is realized, avoiding data loss and ensuring the correctness and integrity of data recovery.
Smart Images

Figure CN119356945B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data recovery method, a data backup method, a data recovery device, a data backup device, a computer device, a computer-readable storage medium, and a computer program product for a virtual machine. Background Art
[0002] A virtual machine is a computer system with complete hardware functionality that runs in an isolated environment using virtualization technology. A virtual machine enables multiple operating systems to run simultaneously on a single physical machine, independently and without interfering with each other, thereby improving hardware resource utilization.
[0003] However, virtual machines may fail during operation due to various reasons, resulting in data loss in the virtual machines. Summary of the Invention
[0004] Based on this, it is necessary to provide a data recovery method, data backup method, data recovery device, data backup device, computer equipment, computer-readable storage medium and computer program product for a virtual machine that can avoid data loss in the virtual machine in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for recovering data of a virtual machine, comprising:
[0006] In response to a data recovery request for a first virtual machine, creating a second virtual machine with the same configuration as the first virtual machine; the first virtual machine is configured with multiple first disks, and the second virtual machine is configured with second disks corresponding to the first disks;
[0007] Obtaining a first snapshot chain in the backup metadata of the first virtual machine; the first snapshot chain is composed of multiple first snapshots; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot;
[0008] Based on the first snapshot chain, each image file corresponding to the first snapshot chain is uploaded to the second virtual machine in sequence, and each second snapshot corresponding to each first snapshot and a second snapshot chain composed of the second snapshots are obtained to complete the data recovery of the first virtual machine.
[0009] In one embodiment, each image file has a corresponding pre-order image file attribute, which is used to record the file identifier of the previous image file on the disk to which the image file belongs; each second disk has corresponding image file index information, which is used to record the file identifier of the uploaded image file on the second disk, and the image file index information is initialized to empty;
[0010] The method of uploading, based on the first snapshot chain, the image files corresponding to the first snapshot chain to the second virtual machine in sequence to obtain second snapshots corresponding to the first snapshots and a second snapshot chain consisting of the second snapshots includes:
[0011] traversing each first snapshot in the first snapshot chain in sequence, and for each traversed first snapshot, creating a second blank snapshot corresponding to the first snapshot in the second virtual machine, and determining, among the second disks, a second target disk corresponding to the first associated disk of the first snapshot; the first snapshots are sorted in the first snapshot chain in chronological order according to their creation times;
[0012] Based on the modification of the preceding image file attributes of the image file under the first snapshot and the modification of the image file index information of the second target disk, the image file under the first snapshot is uploaded to the second virtual machine as the image file of the second target disk under the second blank snapshot, thereby obtaining a second snapshot corresponding to the first snapshot;
[0013] A second snapshot chain of the second virtual machine is obtained according to the second snapshots that correspond one-to-one to the first snapshots of the second virtual machine.
[0014] In one embodiment, the step of uploading the image file under the first snapshot as the image file of the second target disk under the second blank snapshot to the second virtual machine based on the modification of the preceding image file attributes of the image file under the first snapshot and the modification of the image file index information of the second target disk to obtain the second snapshot corresponding to the first snapshot includes:
[0015] Traversing each first associated disk of the first snapshot, and for each traversed first associated disk, obtaining image file index information of a second target disk corresponding to the first associated disk;
[0016] When the image file index information is empty, uploading the image file of the first associated disk under the first snapshot as the image file of the second target disk under the second blank snapshot to the second virtual machine, and modifying the image file index information to the file identifier of the image file;
[0017] If the image file index information is not empty, modifying the preamble image file attribute of the image file of the first associated disk under the first snapshot to the image file index information to obtain a modified image file, uploading the modified image file to the second virtual machine as the image file of the second target disk under the second blank snapshot, and modifying the image file index information to the file identifier of the modified image file;
[0018] A second snapshot of the second virtual machine corresponding to the first snapshot is obtained based on the image file of the second target disk of each first associated disk under the second blank snapshot.
[0019] In one embodiment, the preceding image file attributes of the image file are recorded in the image file;
[0020] The modification of the attributes of the preceding image file of the image file under the first snapshot is achieved by the following process:
[0021] Reading a preset field of the image file; wherein the preset field records an offset value of a preceding image file attribute of the image file in the image file;
[0022] Verifying the preset fields;
[0023] If the preset field is verified to be successful, reading the offset value in the preset field;
[0024] Based on the offset value, the preceding image file attribute of the image file is read, and the preceding image file attribute of the image file is modified.
[0025] In one embodiment, the backup metadata of the first virtual machine also includes configuration information of the first virtual machine and backup locations of each image file corresponding to the first snapshot chain;
[0026] The creating of the second virtual machine having the same configuration as the first virtual machine includes:
[0027] Creating, based on the configuration information in the backup metadata of the first virtual machine, the second virtual machine having the same configuration as the first virtual machine;
[0028] Before uploading, based on the first snapshot chain, the image files corresponding to the first snapshot chain to the second virtual machine in sequence to obtain second snapshots corresponding to the first snapshots and a second snapshot chain consisting of the second snapshots, the method further includes:
[0029] Based on the backup locations of the image files corresponding to the first snapshot chain in the backup metadata of the first virtual machine, the image files corresponding to the first snapshot chain are obtained.
[0030] In a second aspect, the present application also provides a method for backing up data of a virtual machine, comprising:
[0031] In response to a data backup request for a first virtual machine, obtaining each currently existing first snapshot of the first virtual machine; the first virtual machine is configured with multiple first disks; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot;
[0032] determining, based on the first snapshots, a first snapshot chain of the first virtual machine under the current data backup; wherein the first snapshot chain is composed of the first snapshots, and the first snapshots are arranged in the first snapshot chain in chronological order according to their creation times;
[0033] traversing each first snapshot in the first snapshot chain in sequence, backing up the image file under each traversed first snapshot, and recording the backup location of the image file;
[0034] When traversal of all first snapshots in the first snapshot chain is completed, the first snapshot chain, the backup location of each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine are determined as the backup metadata of the first virtual machine under the current data backup, and the backup metadata is saved; the backup metadata is used to implement a data recovery method for a virtual machine.
[0035] In one embodiment, determining, based on the first snapshots, a first snapshot chain of the first virtual machine under the current data backup includes:
[0036] In a case where the backup request is an incremental backup request, determining, based on the backup metadata of the first virtual machine under the historical data backup, a first snapshot chain of the first virtual machine under the historical data backup, and determining each first snapshot in the first snapshot chain of the first virtual machine under the historical data backup as each first historical snapshot of the first virtual machine;
[0037] Determining, among the first snapshots currently existing in the first virtual machine, first snapshots other than the first historical snapshots as first current snapshots;
[0038] A first snapshot chain of the first virtual machine under the current data backup is obtained according to the respective first current snapshots and the first snapshot chain of the first virtual machine under the historical data backup.
[0039] In one embodiment, the method further comprises:
[0040] In response to a snapshot request for at least one first disk in the first virtual machine, determining the first disk targeted by the snapshot request as a first associated disk of a first snapshot to be created;
[0041] A snapshot operation is performed on the first associated disk, and an image file of the first associated disk at the current moment is generated as the image file of the first associated disk under the first snapshot to be created, thereby obtaining the first snapshot of the first associated disk at the current moment; the current moment is the moment when the first snapshot is created.
[0042] In a third aspect, the present application further provides a data recovery device for a virtual machine, comprising:
[0043] a virtual machine creation module, configured to create, in response to a data recovery request for a first virtual machine, a second virtual machine with the same configuration as the first virtual machine; the first virtual machine being configured with a plurality of first disks, and the second virtual machine being configured with respective second disks corresponding one-to-one to the respective first disks;
[0044] A snapshot chain acquisition module is configured to acquire a first snapshot chain from the backup metadata of the first virtual machine; the first snapshot chain is composed of a plurality of first snapshots; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot;
[0045] A data recovery processing module is used to upload each image file corresponding to the first snapshot chain to the second virtual machine in sequence based on the first snapshot chain, obtain each second snapshot corresponding to each first snapshot and a second snapshot chain composed of the second snapshots, so as to complete the data recovery of the first virtual machine.
[0046] In a fourth aspect, the present application further provides a virtual machine backup device, comprising:
[0047] A first snapshot acquisition module is configured to, in response to a data backup request for a first virtual machine, acquire each currently existing first snapshot of the first virtual machine; the first virtual machine is configured with multiple first disks; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot;
[0048] a snapshot chain determination module, configured to sequentially traverse each first snapshot in the first snapshot chain, back up the image file under each traversed first snapshot, and record the backup location of the image file;
[0049] an image file backup module, configured to sequentially traverse each first snapshot in the first snapshot chain, back up the image file under each traversed first snapshot, and record the backup location of the image file;
[0050] A backup data saving module is used to determine the first snapshot chain, the backup location of each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine as the backup metadata of the first virtual machine under the current data backup after the traversal of each first snapshot in the first snapshot chain is completed, and save the backup metadata; the backup metadata is used to implement a data recovery method for a virtual machine.
[0051] In a fifth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0052] In response to a data recovery request for a first virtual machine, creating a second virtual machine with the same configuration as the first virtual machine; the first virtual machine is configured with multiple first disks, and the second virtual machine is configured with second disks corresponding to the first disks;
[0053] Obtaining a first snapshot chain in the backup metadata of the first virtual machine; the first snapshot chain is composed of multiple first snapshots; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot;
[0054] Based on the first snapshot chain, each image file corresponding to the first snapshot chain is uploaded to the second virtual machine in sequence, and each second snapshot corresponding to each first snapshot and a second snapshot chain composed of the second snapshots are obtained to complete the data recovery of the first virtual machine.
[0055] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0056] In response to a data recovery request for a first virtual machine, creating a second virtual machine with the same configuration as the first virtual machine; the first virtual machine is configured with multiple first disks, and the second virtual machine is configured with second disks corresponding to the first disks;
[0057] Obtaining a first snapshot chain in the backup metadata of the first virtual machine; the first snapshot chain is composed of multiple first snapshots; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot;
[0058] Based on the first snapshot chain, each image file corresponding to the first snapshot chain is uploaded to the second virtual machine in sequence, and each second snapshot corresponding to each first snapshot and a second snapshot chain composed of the second snapshots are obtained to complete the data recovery of the first virtual machine.
[0059] In a seventh aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:
[0060] In response to a data recovery request for a first virtual machine, creating a second virtual machine with the same configuration as the first virtual machine; the first virtual machine is configured with multiple first disks, and the second virtual machine is configured with second disks corresponding to the first disks;
[0061] Obtaining a first snapshot chain in the backup metadata of the first virtual machine; the first snapshot chain is composed of multiple first snapshots; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot;
[0062] Based on the first snapshot chain, each image file corresponding to the first snapshot chain is uploaded to the second virtual machine in sequence, and each second snapshot corresponding to each first snapshot and a second snapshot chain composed of the second snapshots are obtained to complete the data recovery of the first virtual machine.
[0063] The above-mentioned virtual machine data recovery method, data backup method, data recovery device, backup device, computer equipment, computer-readable storage medium, and computer program product include the following steps: first, in response to a data recovery request for a first virtual machine, creating a second virtual machine with the same configuration as the first virtual machine; the first virtual machine is configured with multiple first disks, and the second virtual machine is configured with each second disk corresponding to each first disk; then, obtaining a first snapshot chain from the backup metadata of the first virtual machine; the first snapshot chain is composed of multiple first snapshots; each first snapshot corresponds to at least one first associated disk and the image file of each first associated disk at the time of creation of the first snapshot; finally, based on the first snapshot chain, uploading the image files corresponding to the first snapshot chain to the second virtual machine in sequence, obtaining each second snapshot corresponding to each first snapshot and a second snapshot chain composed of the second snapshots, thereby completing data recovery of the first virtual machine. In this way, based on the first snapshot chain in the backup metadata of the first virtual machine, the image files of each first disk in the first virtual machine under each first snapshot can be uploaded in sequence to the second virtual machine, obtaining each second snapshot of the second virtual machine, and further forming a second snapshot chain of the second virtual machine, thereby achieving data recovery of the first virtual machine in the second virtual machine with the same configuration as the first virtual machine. Based on the above process, data recovery of the virtual machine can be achieved to avoid data loss of the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0065] Figure 1 1 is a flow chart of a method for recovering data of a virtual machine according to an embodiment;
[0066] Figure 2 1 is a flowchart illustrating steps of obtaining a second snapshot chain of a second virtual machine based on a first snapshot chain in one embodiment;
[0067] Figure 3 A flowchart illustrating steps for obtaining a second snapshot by uploading the image file under the first snapshot to the second virtual machine based on the preceding image file attributes of the image file under the first snapshot and the image file index information of the second target disk in one embodiment;
[0068] Figure 4 A flowchart of steps for modifying the attributes of a preceding image file of an image file under a first snapshot in one embodiment is shown;
[0069] Figure 5 A flowchart of a method for backing up data of a virtual machine according to an embodiment of the present invention is shown;
[0070] Figure 6 1 is a flowchart illustrating steps of determining a first snapshot chain of a first virtual machine under current data backup according to each first snapshot in one embodiment;
[0071] Figure 7 A flowchart of a method for backing up and restoring data of a virtual machine in one embodiment;
[0072] Figure 8 A schematic diagram of a backup process in one embodiment;
[0073] Figure 9 is a flowchart of a recovery process in one embodiment;
[0074] Figure 10 is a flowchart of a modification process in one embodiment;
[0075] Figure 11 A structural block diagram of a data recovery device for a virtual machine in one embodiment;
[0076] Figure 12 A structural block diagram of a data backup device for a virtual machine in one embodiment;
[0077] Figure 13 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0078] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0079] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0080] In one embodiment, Figure 1As shown, a method for recovering data from a virtual machine is provided. This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, or to a system including a server and a terminal, and implemented through interaction between the server and the terminal. The server can be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablet computers, etc. In this embodiment, the method includes the following steps:
[0081] Step S102: In response to a data recovery request for the first virtual machine, a second virtual machine with the same configuration as the first virtual machine is created.
[0082] The first virtual machine is a virtual machine for which data recovery is to be performed. In a specific application, the virtual machine can be a virtual machine based on any virtual machine system. Preferably, the virtual machine is an ovirt virtual machine based on the ovirt system (Open Virtualization Manager, an open source virtualization software).
[0083] In this application, data recovery for the first virtual machine is a different machine recovery.
[0084] The first virtual machine is configured with multiple first disks, and the second virtual machine is configured with second disks corresponding to the first disks. Furthermore, each second disk has the same configuration as the corresponding first disk.
[0085] The data recovery of the first virtual machine is performed in the second virtual machine.
[0086] Specifically, in response to a user's data recovery request for a certain virtual machine, the server determines the virtual machine targeted by the data recovery request as the first virtual machine to be recovered, and creates a second virtual machine with the same configuration as the first virtual machine based on the backup metadata of the first virtual machine.
[0087] For example, the server first creates a second virtual machine with the same specifications as the first virtual machine and is blank; then, the server creates disks in the second virtual machine with the same configuration as the first disks in the first virtual machine, obtains second disks that correspond one-to-one to the first disks, and then obtains a second virtual machine with the same configuration as the first virtual machine.
[0088] Step S104: Obtain a first snapshot chain in the backup metadata of the first virtual machine.
[0089] The snapshot chain of a virtual machine is used to represent the dependency relationship between multiple snapshots of the virtual machine. In a specific application, each snapshot is composed of a snapshot chain based on the order of their creation time.
[0090] The backup metadata of the first virtual machine refers to the virtual machine data obtained when backing up the first virtual machine; the backup metadata of the first virtual machine includes at least the first snapshot chain of the first virtual machine. In specific applications, the backup metadata of the first virtual machine can be stored within the first virtual machine or outside the first virtual machine.
[0091] The first snapshot chain consists of multiple first snapshots of the first virtual machine.
[0092] Each first snapshot has at least one first associated disk among the multiple first disks; each first snapshot is obtained by taking a snapshot of each first associated disk of the first snapshot; and each first snapshot contains an image file of each first associated disk of the first snapshot at the time of creation of the first snapshot.
[0093] That is, in this application, each snapshot corresponds to at least one disk and an image file of the corresponding disk under the snapshot.
[0094] In practice, if the virtual machine is an ovirt virtual machine, the image file is a qcow2 file (a file format), and the snapshot is an inactive snapshot, that is, the snapshot_type attribute of the snapshot is not active. In ovirt virtual machines, in addition to inactive snapshots, there are also active snapshots, that is, the snapshot_type attribute of the snapshot is active. Active snapshots are created when the disk is created and serve as an activity log. The data in the active snapshot is mutable and reflects data modifications on the corresponding disk.
[0095] Taking an ovirt virtual machine as an example, each snapshot has a VM_Id attribute and a disks attribute. The VM_Id attribute records the VM ID of the virtual machine to which the snapshot belongs. The disks attribute is a two-dimensional array, with the first dimension recording the disk IDs of the disks corresponding to the snapshot and the second dimension recording the file IDs of the disks' image files under the snapshot. For example, for a virtual machine VM1 configured with disks D1, D2, and D3, a server takes a snapshot of disks D1 and D2 at a certain moment, resulting in snapshot 1. The image file for disk D1 at that moment is qcow2_D1, and the image file for disk D2 at that moment is qcow2_D2. Therefore, the VM_Id attribute of snapshot 1 is VM1. The first dimension of the disks attribute of snapshot 1 contains D1 and D2, the second dimension below element D1 contains qcow2_D1, and the second dimension below element D2 contains qcow2_D2.
[0096] Specifically, the server obtains the backup metadata of the first virtual machine, and obtains a first snapshot chain in the backup metadata, where the first snapshot chain describes a dependency relationship between first snapshots of the first virtual machine under the data backup corresponding to the backup metadata.
[0097] Step S106: Based on the first snapshot chain, upload each image file corresponding to the first snapshot chain to the second virtual machine in sequence, obtain each second snapshot corresponding to each first snapshot and a second snapshot chain composed of each second snapshot, so as to complete the data recovery of the first virtual machine.
[0098] The image files corresponding to the first snapshot chain refer to the image files of each first-associated disk of each first snapshot in the first snapshot chain at the creation time of the corresponding first snapshot.
[0099] Specifically, based on the dependency relationship between each first snapshot represented by the first snapshot chain, the server uploads the image file under each first snapshot as the image file of the second disk corresponding to the first associated disk of the first snapshot at the creation time of the first snapshot to the second virtual machine, thereby obtaining each image file of each second disk and further obtaining each second snapshot and second snapshot chain; wherein, each second disk corresponds to each image file at the same creation time, forming a second snapshot corresponding to the first snapshot at the creation time; each second snapshot forms a second snapshot chain in the order of the creation time of the corresponding first snapshot. Based on the above process, the server obtains each second snapshot corresponding to each first snapshot one by one by uploading each image file to the second virtual machine, and further obtains the second snapshot chain corresponding to the first snapshot chain. Since the first snapshot chain represents the dependency relationship between each first snapshot of the second virtual machine, the second virtual machine with the second snapshot chain completes the data recovery of the first virtual machine.
[0100] It is easy to understand that since each second snapshot corresponds to each first snapshot one-to-one, similar to the first snapshot, each second snapshot has at least one second associated disk in the multiple second disks, and each first snapshot has an image file of each second associated disk of the first snapshot at the creation time of the first snapshot corresponding to the second snapshot.
[0101] In the above-mentioned virtual machine data recovery method, first, in response to a data recovery request for a first virtual machine, a server creates a second virtual machine with the same configuration as the first virtual machine; the first virtual machine is configured with multiple first disks, and the second virtual machine is configured with second disks corresponding to each of the first disks; then, the server obtains a first snapshot chain from the backup metadata of the first virtual machine; the first snapshot chain is composed of multiple first snapshots; each first snapshot corresponds to at least one first associated disk and the image file of each first associated disk at the time of creation of the first snapshot; finally, based on the first snapshot chain, the server sequentially uploads the image files corresponding to the first snapshot chain to the second virtual machine, obtaining second snapshots corresponding to each of the first snapshots and a second snapshot chain composed of the second snapshots, thereby completing data recovery of the first virtual machine. In this way, based on the first snapshot chain in the backup metadata of the first virtual machine, the server can sequentially upload the image files of each first disk in the first virtual machine under each first snapshot to the second virtual machine, obtaining each second snapshot of the second virtual machine, and further forming a second snapshot chain of the second virtual machine, thereby achieving data recovery of the first virtual machine in the second virtual machine with the same configuration as the first virtual machine. Based on the above process, data recovery of the virtual machine can be achieved, avoiding data loss of the virtual machine.
[0102] In an exemplary embodiment, each image file has a corresponding preceding image file attribute, which is used to record the file identifier of the previous image file on the disk to which the image file belongs.
[0103] The "previous image file" refers to the previous image file on the disk in chronological order.
[0104] In actual applications, if the virtual machine is an ovirt virtual machine, the pre-order image file attribute is the backing file attribute of the qcow2 file, which is recorded in the backing file field of the qcow2 file.
[0105] It is easy to understand that if the image file is the first in the time sequence (that is, the earliest image file on the disk), then the previous image file attribute of the image file is empty.
[0106] Each second disk has corresponding image file index information, and the image file index information is used to record the file identifier of an uploaded image file on the second disk. The image file index information is initialized to empty.
[0107] The image file index information of each second disk is initialized when the second disk is created.
[0108] like Figure 2 As shown, the above step S106, based on the first snapshot chain, sequentially uploading each image file corresponding to the first snapshot chain to the second virtual machine, thereby obtaining each second snapshot corresponding to each first snapshot and a second snapshot chain composed of the second snapshots, specifically includes the following steps:
[0109] Step S202, traverse each first snapshot in the first snapshot chain in sequence, create a second blank snapshot corresponding to the first snapshot in the second virtual machine for each traversed first snapshot, and, in each second disk, determine a second target disk corresponding to the first associated disk of the first snapshot.
[0110] Step S204, based on the modification of the preceding image file attributes of the image file under the first snapshot and the modification of the image file index information of the second target disk, the image file under the first snapshot is uploaded to the second virtual machine as the image file under the second blank snapshot of the second target disk, thereby obtaining a second snapshot corresponding to the first snapshot.
[0111] Step S206: Obtain a second snapshot chain of the second virtual machine based on the second snapshots that correspond one-to-one to the first snapshots of the second virtual machine.
[0112] The first snapshots are arranged in the first snapshot chain in chronological order according to their creation times.
[0113] The second target disk is a second disk corresponding to the first associated disk of the first snapshot among the second disks.
[0114] Specifically, when configuring each second disk for the second virtual machine, the server initializes the corresponding image file index information for each second disk to be empty.
[0115] The server traverses each first snapshot according to the sorting order of each first snapshot in the first snapshot chain, starting from the first first snapshot (that is, the first snapshot with the earliest creation time).
[0116] For the first snapshot traversed, the server first creates a second blank snapshot corresponding to the first snapshot in the second virtual machine. For each first-associated disk of the first snapshot, the server determines the second disk corresponding to the first-associated disk in each second disk, thereby obtaining each second target disk. The server then uploads each image file under the first snapshot to the second virtual machine as the image file under the second blank snapshot corresponding to the first snapshot, thereby obtaining a second snapshot corresponding to the first snapshot. Furthermore, because the image file's pre-order image file attribute records the file identifier of the previous image file on the disk to which the image file belongs, and the image file index information of the second disk records the file identifier of the previous uploaded image file on the second disk, during the image file upload process, the server also needs to modify the pre-order image file attribute of the image file and the image file index information of the second target disk accordingly, to ensure that the temporal relationship between the image files of each second disk is consistent with the temporal relationship between the image files of the first disk corresponding to the second disk, and that the temporal relationship between the second snapshots of the second virtual machine is consistent with the temporal relationship between the first snapshots of the first virtual machine.
[0117] After traversing the first snapshots of the first snapshot chain, the server obtains the second snapshots of the second virtual machine corresponding to the first snapshots, and further obtains a second snapshot chain of the second virtual machine consisting of the second snapshots.
[0118] In this embodiment, the server can ensure that, for each second disk, the timing relationship of each image file is consistent with the timing relationship of each image file of the first disk corresponding to the second disk by modifying the preceding image file attributes of the image file and the image file index information of the second target disk, and that, for the second virtual machine, the timing relationship of each second snapshot is consistent with the timing relationship of each first snapshot of the first virtual machine, thereby obtaining each second snapshot corresponding to each first snapshot and a second snapshot chain corresponding to the first snapshot chain, thereby completing the data recovery of the first virtual machine and ensuring the correctness of the data recovery of the first virtual machine.
[0119] In an exemplary embodiment, Figure 3 As shown, the above step S204, based on the modification of the preceding image file attributes of the image file under the first snapshot and the modification of the image file index information of the second target disk, uploads the image file under the first snapshot as the image file under the second blank snapshot of the second target disk to the second virtual machine, thereby obtaining a second snapshot corresponding to the first snapshot, specifically includes the following steps:
[0120] Step S302 : traverse each first associated disk of the first snapshot, and for each traversed first associated disk, obtain image file index information of a second target disk corresponding to the first associated disk.
[0121] Step S304: when the image file index information is empty, the image file of the first associated disk under the first snapshot is uploaded to the second virtual machine as the image file of the second target disk under the second blank snapshot, and the image file index information is modified to the file identifier of the image file.
[0122] Or,
[0123] Step S306, when the image file index information is not empty, the pre-order image file attribute of the image file of the first associated disk under the first snapshot is modified to the image file index information to obtain the modified image file, and the modified image file is uploaded to the second virtual machine as the image file of the second target disk under the second blank snapshot, and the image file index information is modified to the file identifier of the modified image file.
[0124] Step S308 : obtaining a second snapshot of the second virtual machine corresponding to the first snapshot based on the image file of the second target disk of each first associated disk under the second blank snapshot.
[0125] Specifically, the server traverses each first associated disk of the first snapshot.
[0126] For each first associated disk traversed, the server first obtains the image file index information of the second target disk corresponding to the first associated disk, and determines whether the image file index information of the second target disk is empty.
[0127] If the image file index information of the second target disk is empty, it means that no image file has been uploaded to the second target disk. That is, for the second target disk, the image file to be uploaded is the first image file of the second target disk in the time sequence. Therefore, the server directly uploads the image file under the first snapshot of the first associated disk being traversed as the image file under the second blank snapshot corresponding to the first snapshot being traversed of the second target disk to the second virtual machine, and modifies the image file index information of the second target disk to the file identifier of the image file.
[0128] If the image file index information of the second target disk is not empty, it means that the second target disk has already uploaded an image file, that is, for the second target disk, the image file to be uploaded has a previous image file in terms of time sequence, and the file identifier of the previous image file is recorded in the image file index information of the second target disk. Therefore, the server first modifies the pre-order image file attribute of the image file of the first associated disk being traversed under the first snapshot being traversed to the image file index information of the second target disk, so as to establish a time sequence relationship between the image file to be uploaded and the previous image file of the second target disk, obtain the modified image file, and then upload the modified image file as the image file of the second target disk under the second blank snapshot corresponding to the first snapshot being traversed to the second virtual machine, and modify the image file index information of the second target disk to the file identifier of the uploaded image file, so as to ensure that the time sequence relationship between the image files constructed when uploading the image files subsequently is correct.
[0129] After traversing each first associated disk of the first snapshot being traversed, the server obtains a second snapshot of the second virtual machine corresponding to the first snapshot based on the image file of the second target disk of each first associated disk under the second blank snapshot.
[0130] In this embodiment, the server can ensure that, for each second disk, the timing relationship of each image file is consistent with the timing relationship of each image file of the first disk corresponding to the second disk by modifying the preceding image file attributes of the image file and the image file index information of the second target disk, and that, for the second virtual machine, the timing relationship of each second snapshot is consistent with the timing relationship of each first snapshot of the first virtual machine, thereby obtaining each second snapshot corresponding to each first snapshot, thereby ensuring the correctness of data recovery of the first virtual machine.
[0131] In an exemplary embodiment, the preceding image file attributes of the image file are recorded in the image file.
[0132] In actual applications, if the virtual machine is an ovirt virtual machine, the pre-order image file attribute is the backing file attribute of the qcow2 file, which is recorded in the backing file field of the qcow2 file.
[0133] like Figure 4 As shown, in the above step S204, the modification of the attributes of the preceding image file of the image file under the first snapshot is achieved through the following steps:
[0134] Step S402: Read the preset field of the image file.
[0135] Step S404: verify the preset fields.
[0136] Step S406: When the preset field verification passes, read the offset value in the preset field.
[0137] Step S408: Based on the offset value, read the preceding image file attribute of the image file, and modify the preceding image file attribute of the image file.
[0138] The preset field records the offset value of the preceding image file attribute of the image file in the image file.
[0139] Specifically, the server reads the preset field of the image file and performs a validity check on the preset field. If the validity check of the preset field passes, the server further reads the offset value in the preset field. The offset value is used to point to the field where the preceding image file attribute of the image file is located in the image file. Therefore, the server reads the preceding image file attribute of the image file based on the offset value and modifies the preceding image file attribute of the image file.
[0140] In actual applications, if the virtual machine is an ovirt virtual machine, the preset field is the first twenty bytes of the qcow2 file.
[0141] Taking the qcow2 file as an example, the first four bytes of the first twenty bytes are the format identification field (magic), which is of type uint32 and is used to identify the file as a qcow2 format file.
[0142] The next four bytes are the version identification field (version), of type uint32, which is used to identify the qcow2 version of the file.
[0143] The next eight bytes are the offset value field (backing file offset), which is of type uint64 and is used to identify the offset value of the backing file attribute of the previous image file in the qcow2 file.
[0144] The last four bytes are the length field (backing file size), of type uint32, which is used to identify the length of the backing file attribute.
[0145] Specifically, the server opens the qcow2 file in read-write mode, reads the first twenty bytes, and parses each field (format identification field, version identification field, offset value field, and length field) in big-endian order.
[0146] The server then verifies the validity of the format identifier, version identifier, and length fields. The format identifier verifies that the file format identified by the format identifier is the qcow2 format. The version identifier verifies that the version number identified by the version identifier is a currently supported version of the qcow2 format. The length field verifies that the length identified by the length field is equal to the length of the file identifier of the qcow2 file.
[0147] Next, when the format identification field, version identification field, and length field all pass the legitimacy check, the server reads the field corresponding to the length identified by the length field starting from the offset value corresponding to the offset value field of the qcow2 file. The value of this field is the backing file attribute, and the server overwrites the backing file attribute to implement the modification.
[0148] If any one of the format identification field, version identification field, and length field fails the validity check, the server reports an error and ends the process.
[0149] In this embodiment, the server fully utilizes the characteristics of the image file's data structure. By reading and validating preset fields, it can obtain the offset value of the preceding image file's attributes from the preset fields, thereby enabling the reading and modification of the preceding image file's attributes. Taking the qcow2 file as an example, currently, third-party tools are typically used to modify the backing file attributes of a qcow2 file. However, based on this embodiment, the server can fully utilize the composition of the first twenty bytes of the qcow2 file and the fact that the length of the backing file attributes is the same as the length of the image file's file identifier without the need for third-party tools. This allows the server to quickly and directly locate and modify the backing file attributes without affecting other contents of the qcow2 file.
[0150] In an exemplary embodiment, the backup metadata of the first virtual machine also includes configuration information of the first virtual machine and the backup location of each image file corresponding to the first snapshot chain.
[0151] In the above step S102 , creating a second virtual machine with the same configuration as the first virtual machine specifically includes the following steps: creating the second virtual machine with the same configuration as the first virtual machine based on the configuration information in the backup metadata of the first virtual machine.
[0152] In the above step S106, based on the first snapshot chain, each image file corresponding to the first snapshot chain is sequentially uploaded to the second virtual machine, and before each second snapshot corresponding to each first snapshot and a second snapshot chain composed of each second snapshot is obtained, the following specific content is further included: based on the backup location of each image file corresponding to the first snapshot chain in the backup metadata of the first virtual machine, each image file corresponding to the first snapshot chain is obtained.
[0153] Specifically, the server creates a second virtual machine with the same configuration as the first virtual machine based on the configuration information in the backup metadata; and obtains each image file corresponding to the first snapshot chain based on the backup location in the backup metadata.
[0154] In this embodiment, the server can create a second virtual machine that meets the conditions by backing up the metadata, and can obtain various image files used to implement data recovery for the first virtual machine.
[0155] Based on the same inventive concept, Figure 5 As shown, in an exemplary embodiment, the present application also provides a data backup method for a virtual machine. This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a server and a terminal, and is implemented through the interaction between the server and the terminal; wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services; the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, etc. In this embodiment, the method includes the following steps:
[0156] Step S502 : In response to a data backup request for a first virtual machine, obtaining each currently existing first snapshot of the first virtual machine.
[0157] The first virtual machine is configured with multiple first disks; each first snapshot has at least one first associated disk among the multiple first disks; each first snapshot is obtained by taking a snapshot of each first associated disk of the first snapshot; and each first snapshot has an image file of each first associated disk of the first snapshot at the time of creation of the first snapshot.
[0158] Specifically, in response to a user's data backup request for a certain virtual machine, the server determines the virtual machine targeted by the data backup request as a first virtual machine to be backed up, and obtains each first snapshot currently existing in the first virtual machine.
[0159] Step S504: determining a first snapshot chain of the first virtual machine under the current data backup according to each first snapshot.
[0160] The first snapshot chain is composed of various first snapshots, and the various first snapshots are arranged in the first snapshot chain in chronological order according to their respective creation times.
[0161] Specifically, the server composes a first snapshot chain of the first virtual machine under the current data backup according to the chronological order of creation times of the first snapshots.
[0162] Step S506 , traversing each first snapshot in the first snapshot chain in sequence, backing up the image file under each traversed first snapshot, and recording the backup location of the image file.
[0163] Specifically, the server traverses each first snapshot according to the sorting order of each first snapshot in the first snapshot chain, starting from the first first snapshot (that is, the first snapshot with the earliest creation time).
[0164] For the traversed first snapshot, the server determines each first associated disk corresponding to the first snapshot, and traverses each first associated disk.
[0165] For the first associated disk that is traversed, the server obtains the image file of the first associated disk under the first snapshot being traversed, backs up the image file, and records the backup location of the image file.
[0166] After the server has finished traversing all first associated disks of the first snapshot being traversed, it starts traversing the next first snapshot until all first snapshots are traversed, thereby completing the traversal of all first snapshots.
[0167] In step S508, when the traversal of each first snapshot in the first snapshot chain is completed, the first snapshot chain, the backup location of each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine are determined as the backup metadata of the first virtual machine under the current data backup, and the backup metadata is saved.
[0168] The backup metadata is used to implement the data recovery method of the virtual machine in any one of the above embodiments of the present application.
[0169] Specifically, after traversing each first snapshot in the first snapshot chain, the server completes the backup of the image files currently existing in the first virtual machine, determines the first snapshot chain, the backup locations of each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine as the backup metadata of the first virtual machine under the current backup, and then saves the backup metadata; subsequently, through the backup metadata, the server can realize data recovery for the first virtual machine.
[0170] It should be noted that the specific limitations of the virtual machine data backup method provided in this embodiment can be found in the above limitations of the virtual machine data recovery method, which will not be repeated here.
[0171] In the above-mentioned virtual machine data backup method, first, in response to a data backup request for a first virtual machine, the server obtains each currently existing first snapshot of the first virtual machine; the first virtual machine is configured with multiple first disks; each first snapshot corresponds to at least one first associated disk and the image file of each first associated disk at the time the first snapshot was created; then, based on each first snapshot, the server determines a first snapshot chain for the first virtual machine under the current data backup; the first snapshot chain is composed of each first snapshot, and each first snapshot is sorted in the first snapshot chain according to the time of their creation; then, the server sequentially traverses each first snapshot in the first snapshot chain, and for each traversed first snapshot, backs up the image file under the first snapshot and records the backup location of the image file; finally, after traversing all the first snapshots in the first snapshot chain, the server determines the first snapshot chain, the backup location of each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine as backup metadata for the first virtual machine under the current data backup, and saves the backup metadata; the backup metadata is used to implement a virtual machine data recovery method according to claim 1. In this way, based on the first snapshots of the first virtual machine, the server can obtain the first snapshot chain of the first virtual machine. By backing up the image files of each first disk under each first snapshot in sequence according to the order of each first snapshot in the first snapshot chain, the server can back up the image files existing in the first virtual machine and obtain the backup metadata of the first virtual machine under the current data backup. Based on the backup metadata, the server can subsequently realize data recovery for the first virtual machine to avoid data loss of the virtual machine.
[0172] In an exemplary embodiment, Figure 6 As shown, the above step 504, determining the first snapshot chain of the first virtual machine under the current data backup according to each first snapshot, specifically includes the following steps:
[0173] Step S602, when the backup request is an incremental backup request, based on the backup metadata of the first virtual machine under the historical data backup, determine the first snapshot chain of the first virtual machine under the historical data backup, and determine each first snapshot in the first snapshot chain of the first virtual machine under the historical data backup as each first historical snapshot of the first virtual machine.
[0174] Step S604: Determine each first snapshot currently existing in the first virtual machine, excluding each first historical snapshot, as each first current snapshot.
[0175] Step S606 : Obtain a first snapshot chain of the first virtual machine under the current data backup based on each first current snapshot and the first snapshot chain of the first virtual machine under the historical data backup.
[0176] The incremental backup request refers to a backup request for incremental backup; backup includes incremental backup and full backup.
[0177] The historical data backup refers to the data backup that was last performed before the current data backup.
[0178] Specifically, after receiving the backup request, the server will detect the type of backup request and determine whether the backup request is an incremental backup request or a full backup request; if the backup request is an incremental backup request, then the server first obtains the backup metadata of the first virtual machine under the last data backup, and further obtains the first snapshot chain in the backup metadata under the last data backup, and then determines each first snapshot in the first snapshot chain under the last data backup as each first historical snapshot of the first virtual machine; then, the server removes each first historical snapshot from each first snapshot currently existing in the first virtual machine, obtains each first snapshot other than each first historical snapshot as each first current snapshot, and adds each first current snapshot to the first snapshot chain of the first virtual machine under the historical data backup, to obtain the first snapshot chain of the first virtual machine under the current data backup.
[0179] In this embodiment, the server can obtain the first current snapshots targeted by the current incremental backup by removing the first historical snapshots from the currently existing first snapshots, and based on the first current snapshots and the first snapshot chain of the first virtual machine under the historical data backup, it can obtain the first snapshot chain of the first virtual machine under the current data backup, thereby realizing this incremental backup.
[0180] In an exemplary embodiment, the data backup method for a virtual machine in any of the above embodiments further includes the following contents, which are used to obtain a first snapshot and an image file: in response to a snapshot request for at least one first disk in a first virtual machine, determining the first disk targeted by the snapshot request as a first associated disk of the first snapshot to be created; performing a snapshot operation on the first associated disk, and generating an image file of the first associated disk at the current moment, to obtain a first snapshot of the first associated disk at the current moment.
[0181] The current time is the time when the first snapshot is created.
[0182] Specifically, in response to a user's snapshot request for at least one first disk, the server determines each first disk targeted by the snapshot request as a first associated disk of the first snapshot to be created; then, the server performs a snapshot taking operation on each first associated disk, and simultaneously generates an image file of each first associated snapshot at the current moment as the image file of each first associated snapshot under the first snapshot to be created, thereby obtaining the first snapshot of each first associated disk at the current moment, and determining the current moment as the creation moment of the first snapshot.
[0183] For example, assuming that for the first virtual machine VM1 configured with the first disk D1, the second disk D2 and the third disk D3, the server receives a snapshot request from the user for the first disk D1 and the second disk D2 at time T1. The server will perform a snapshot operation on the first disk D1 and the second disk D2, and generate an image file of the first disk D1 and the second disk D2 at time T1, which will serve as the image file of the first disk D1 and the second disk D2 under the first snapshot snapshot1 to be created, thereby obtaining the first snapshot of the first disk D1 and the second disk D2 at time T1.
[0184] In this embodiment, the server can obtain the first snapshot at the current moment by performing the first snapshot shooting operation and generating the image file for the snapshot request.
[0185] In an exemplary embodiment, Figure 7 As shown, a data backup and data recovery method for a virtual machine is provided. The method is applied to a server as an example for description, and includes the following steps:
[0186] Step S702 : in response to a data backup request for a first virtual machine, obtaining each currently existing first snapshot of the first virtual machine, and determining a first snapshot chain of the first virtual machine under the current data backup according to each first snapshot.
[0187] Step S704 , traversing each first snapshot in the first snapshot chain in sequence, backing up the image file under each traversed first snapshot, and recording the backup location of the image file.
[0188] In step S706, when the traversal of each first snapshot in the first snapshot chain is completed, the first snapshot chain, the backup location of each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine are determined as the backup metadata of the first virtual machine under the current data backup, and the backup metadata is saved.
[0189] Step S708 : In response to the data recovery request for the first virtual machine, a second virtual machine with the same configuration as the first virtual machine is created, and a first snapshot chain in the backup metadata of the first virtual machine is obtained.
[0190] Step S710, traverse each first snapshot in the first snapshot chain in sequence, and for each traversed first snapshot, create a second blank snapshot corresponding to the first snapshot being traversed in the second virtual machine, and, in each second disk, determine a second target disk corresponding to the first associated disk of the first snapshot being traversed.
[0191] Step S712: traverse each first associated disk of the first snapshot being traversed, and for each traversed first associated disk, obtain image file index information of a second target disk corresponding to the first associated disk being traversed.
[0192] Step S714, when the image file index information is empty, the image file of the first associated disk being traversed under the first snapshot is uploaded to the second virtual machine as the image file of the second target disk under the second blank snapshot, and the image file index information is modified to the file identifier of the image file.
[0193] Step S716, when the image file index information is not empty, the pre-order image file attribute of the image file of the first associated disk being traversed under the first snapshot is modified to the image file index information to obtain the modified image file, and the modified image file is used as the image file of the second target disk under the second blank snapshot, uploaded to the second virtual machine, and the image file index information is modified to the file identifier of the modified image file.
[0194] Step S718: When all first associated snapshots of the first snapshot being traversed are traversed, a second snapshot of the second virtual machine corresponding to the first snapshot being traversed is obtained based on the image file of the second target disk of each first associated disk under the second blank snapshot.
[0195] Step S720: When all first snapshots in the first snapshot chain being traversed are completely traversed, a second snapshot chain of the second virtual machine is obtained according to the second snapshots that correspond one-to-one to the first snapshots.
[0196] In this embodiment, first, based on each first snapshot of the first virtual machine, the server can obtain the first snapshot chain of the first virtual machine. By backing up the image files of each first disk under each first snapshot in sequence according to the order of each first snapshot in the first snapshot chain, the server can realize the backup of the image files existing in the first virtual machine and obtain the backup metadata of the first virtual machine under the current data backup. Based on the backup metadata, the server can subsequently realize data recovery for the first virtual machine to avoid data loss of the virtual machine. Then, based on the first snapshot chain in the backup metadata of the first virtual machine, the server can upload the image files of each first disk in the first virtual machine under each first snapshot as each image file of each second disk to the second virtual machine in sequence, obtain each second snapshot of the second virtual machine, and further form the second snapshot chain of the second virtual machine, thereby realizing data recovery of the first virtual machine in the second virtual machine with the same configuration as the first virtual machine. Based on the above process, data recovery of the virtual machine can be realized to avoid data loss of the virtual machine.
[0197] To more clearly illustrate the virtual machine data recovery method and virtual machine data backup provided by the embodiments of the present application, the virtual machine data recovery method and virtual machine data backup provided by the present application are specifically described below using a specific embodiment, but it should be understood that the embodiments of the present application are not limited thereto. In one exemplary embodiment, the present application also provides a method for virtual machine backup and recovery based on snapshots, which specifically includes the following:
[0198] In this embodiment, a virtual machine is configured with multiple disks. Snapshots can be taken for one or more of these disks at a time. Therefore, each snapshot has a corresponding associated disk. Each snapshot corresponds to the image file of the associated disk at the time the snapshot was created. Each image file has a corresponding backing file attribute, which records the file identifier of the previous image file on the disk to which it belongs. The virtual machine is an ovirt virtual machine, and the image file is a qocw2 file.
[0199] like Figure 8 The following is the backup process in this embodiment:
[0200] 1. Obtain all currently inactive first snapshots snap of the first virtual machine VM1 and sort them in the order in which they were created. If it is an incremental backup, filter out the first historical snapshot list prev_snaps used in the previous backup to obtain the first snapshot list snaps.
[0201] 2. If the first snapshot list snaps is empty, save the backup metadata and exit; otherwise, pop the first snapshot snap from the first snapshot list snaps.
[0202] 3. Get the first associated disk list disks of the first snapshot snap.
[0203] 4. If the first associated disk list disks is empty, then the processing of the current first snapshot snap is terminated and the process returns to step 2; otherwise, the first first associated disk disk is ejected from the first associated disk list disks.
[0204] 5. Create an image download channel corresponding to the first snapshot snap for the first associated disk disk, download the image file image under the first snapshot snap of the first associated disk disk based on the image download channel, and return to step 4 after the download is completed.
[0205] like Figure 9 The following is the recovery process in this embodiment:
[0206] 1. Read the backup metadata of the first virtual machine VM1.
[0207] 2. Create a second virtual machine VM2 with the same configuration as the first virtual machine VM1 based on the backup metadata; wherein the image file index information last_image_id of each second disk of the second virtual machine is initialized to empty, which is used to record the file identifier of an uploaded image file on the second disk.
[0208] 3. Read the first snapshot list src_snaps of the first virtual machine VM1 according to the backup metadata.
[0209] 4. If the first snapshot list src_snaps is empty, the restoration is terminated; otherwise, the first first snapshot src_snap is popped out from the first snapshot list src_snaps.
[0210] 5. Create a second snapshot snap for the second virtual machine VM2 using the first snapshot src_snap as a template.
[0211] 6. Get the first associated disk list disks of the first snapshot src_snap.
[0212] 7. If the first associated disk list disks is empty, then the processing of the current first snapshot src_snap is terminated and the process returns to step 4; otherwise, the first first associated disk disk is ejected from the first associated disk list disks.
[0213] 8. Create an image upload channel for the second disk disk corresponding to the first associated disk disk, and obtain the image file index information last_image_id of the first associated disk disk.
[0214] 9. If the image file index information last_image_id is empty, upload the image file image under the first snapshot src_snap of the first associated disk disk based on the image upload channel; otherwise, modify the image file's preceding image file attribute backing file to the image file index information last_image_id before uploading.
[0215] 10. After the upload is completed, the image file index information last_image_id is updated to the image file identifier of the image file that has just been uploaded.
[0216] 11. Return to step 7.
[0217] like Figure 10 The following is the modification process of the image file's preamble image file attribute backing file:
[0218] 1. Open the qcow2 file in read-write mode. The qcow2 file is the image file.
[0219] 2. Read the first 20 bytes of the qcow2 file.
[0220] 3. Parse the first 4 bytes in big-endian order. The type of these 4 bytes is uint32 and the value is magic.
[0221] 4. Parse the next 4 bytes in big-endian order. The type of these 4 bytes is uint32 and the value is version.
[0222] 5. Parse the next 8 bytes in big-endian order. The type of these 8 bytes is uint64, and the value is backingfile offset, which is the offset value of the backing file attribute of the previous image file in the qcow2 file.
[0223] 6. Parse the last 4 bytes in big-endian order. The type of these 4 bytes is uint32, and the value is backingfilesize, that is, the length of the backing file attribute of the previous image file, which should be the length of the file identifier of the image file.
[0224] 7. Check the validity of magic and version. If they are not valid, report an error and end. Otherwise, go to step 8.
[0225] 8. Check whether the backing file size is equal to the length of the file identifier of the image file. If not, report an error and end. Otherwise, go to step 9.
[0226] 9. Move the file offset to the backing file offset to overwrite the backing file.
[0227] 10. End.
[0228] It should be noted that there are currently two main methods for backing up and restoring Ovirt virtual machines: the first is to create a proxy virtual machine in the Ovirt system, then mount the virtual machine disk to be backed up and restored to the proxy virtual machine, and perform virtual machine backup and recovery by reading and writing device block files. The second method is to use the backup API provided by Ovirt for backup and recovery.
[0229] However, although mount-based backup and restore is not limited to Ovirt versions, it can only back up and restore virtual machines in the same data center as the proxy virtual machine. Furthermore, because it directly reads and writes block device files (in raw format), it struggles to support incremental backups. Secondly, while backup and restore using the Backup API doesn't require creating a proxy virtual machine in the Ovirt system and supports incremental backups, it only supports Ovirt versions 4.4 and above. Furthermore, in related technologies, modifying the backing file attributes of a qcow2 file typically requires using a third-party qemu tool. This embodiment, however, firstly, leverages the fact that the backing file attribute of an Ovirt system's qcow2 image file is the file identifier of the previous image file, enabling the reconstruction of the snapshot chain of the second virtual machine. Secondly, by leveraging the fact that the first twenty bytes of the qcow2 format are used as the structure, and that the length of the backing file attribute is the same as the length of the image file's file identifier, the backing file location can be located by simply parsing the first 20 bytes of the qcow2 file. This allows for quick and direct modification of the backing file attributes without affecting other contents of the qcow2 file. Based on the above process, this embodiment can support all versions after ovirt 4.0, and does not require the creation of a proxy virtual machine in the ovirt system. In addition, it also supports incremental backup and recovery, and can modify the backing file attributes of the qcow2 file without the help of a third-party qemu tool.
[0230] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0231] Based on the same inventive concept, embodiments of the present application also provide a virtual machine data recovery device for implementing the aforementioned virtual machine data recovery method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of the embodiments of the data recovery device for one or more virtual machines provided below can be found in the aforementioned limitations of the virtual machine data recovery method and will not be further elaborated here.
[0232] In an exemplary embodiment, Figure 11 As shown, a data recovery device for a virtual machine is provided, comprising: a virtual machine creation module 1102, a snapshot chain acquisition module 1104, and a data recovery processing module 1106, wherein:
[0233] The virtual machine creation module 1102 is used to create a second virtual machine with the same configuration as the first virtual machine in response to a data recovery request for the first virtual machine; the first virtual machine is configured with multiple first disks, and the second virtual machine is configured with each second disk corresponding to each first disk.
[0234] The snapshot chain acquisition module 1104 is used to obtain the first snapshot chain in the backup metadata of the first virtual machine; the first snapshot chain consists of multiple first snapshots; each first snapshot corresponds to at least one first associated disk and the image file of each first associated disk at the time of creation of the first snapshot.
[0235] The data recovery processing module 1106 is used to upload each image file corresponding to the first snapshot chain to the second virtual machine in sequence based on the first snapshot chain, obtain each second snapshot corresponding to each first snapshot and a second snapshot chain composed of each second snapshot, so as to complete the data recovery of the first virtual machine.
[0236] In an exemplary embodiment, each image file has a corresponding preceding image file attribute, which is used to record the file identifier of the previous image file on the disk to which the image file belongs; each second disk has corresponding image file index information, which is used to record the file identifier of an uploaded image file on the second disk, and the image file index information is initialized to empty.
[0237] The data recovery processing module 1106 is further configured to sequentially traverse each first snapshot in the first snapshot chain, create a second blank snapshot corresponding to the first snapshot in the second virtual machine for each traversed first snapshot, and determine, in each second disk, a second target disk corresponding to the first associated disk of the first snapshot; sort the first snapshots in the first snapshot chain in chronological order according to their respective creation times; based on the modification of the preceding image file attributes of the image file under the first snapshot and the modification of the image file index information of the second target disk, upload the image file under the first snapshot to the second virtual machine as the image file of the second target disk under the second blank snapshot, and obtain a second snapshot corresponding to the first snapshot; and obtain a second snapshot chain of the second virtual machine based on the one-to-one correspondence between the second virtual machine and each first snapshot.
[0238] In an exemplary embodiment, the data recovery processing module 1106 is further configured to traverse each first associated disk of the first snapshot, and for each traversed first associated disk, obtain image file index information of the second target disk corresponding to the first associated disk; if the image file index information is empty, upload the image file of the first associated disk under the first snapshot to the second virtual machine as the image file of the second target disk under the second blank snapshot, and modify the image file index information to the file identifier of the image file; if the image file index information is not empty, modify the pre-order image file attribute of the image file of the first associated disk under the first snapshot to the image file index information to obtain the modified image file, upload the modified image file to the second virtual machine as the image file of the second target disk under the second blank snapshot, and modify the image file index information to the file identifier of the modified image file; based on the image files of the second target disk of each first associated disk under the second blank snapshot, obtain the second snapshot of the second virtual machine corresponding to the first snapshot.
[0239] In an exemplary embodiment, the preceding image file attributes of the image file are recorded in the image file.
[0240] The data recovery processing module 1106 is also used to read the preset field of the image file; the preset field records the offset value of the preceding image file attribute of the image file in the image file; verify the preset field; if the preset field verification passes, read the offset value in the preset field; based on the offset value, read the preceding image file attribute of the image file, and modify the preceding image file attribute of the image file.
[0241] In an exemplary embodiment, the backup metadata of the first virtual machine also includes configuration information of the first virtual machine and the backup location of each image file corresponding to the first snapshot chain.
[0242] The virtual machine creation module 1102 is further configured to create a second virtual machine with the same configuration as the first virtual machine based on the configuration information in the backup metadata of the first virtual machine.
[0243] The data recovery processing module 1106 is further configured to obtain each image file corresponding to the first snapshot chain based on the backup locations of each image file corresponding to the first snapshot chain in the backup metadata of the first virtual machine.
[0244] Based on the same inventive concept, embodiments of the present application also provide a virtual machine data backup device for implementing the aforementioned virtual machine data backup method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of the embodiments of the data backup device for one or more virtual machines provided below can be found in the aforementioned limitations of the virtual machine data backup method and will not be further elaborated here.
[0245] In an exemplary embodiment, Figure 12 As shown, a data backup device for a virtual machine is provided, comprising: a first snapshot acquisition module 1202, a snapshot chain determination module 1204, an image file backup module 1206, and a backup data storage module 1208, wherein:
[0246] The first snapshot acquisition module 1202 is used to respond to a data backup request for the first virtual machine and obtain the first snapshots currently existing in the first virtual machine; the first virtual machine is configured with multiple first disks; each first snapshot corresponds to at least one first associated disk and the image file of each first associated disk at the time of creation of the first snapshot.
[0247] The snapshot chain determination module 1204 is used to determine the first snapshot chain of the first virtual machine under the current data backup based on each first snapshot; the first snapshot chain is composed of each first snapshot, and each first snapshot is sorted in the first snapshot chain according to their respective creation time.
[0248] The image file backup module 1206 is configured to sequentially traverse each first snapshot in the first snapshot chain, back up the image file under each traversed first snapshot, and record the backup location of the image file.
[0249] The backup data saving module 1208 is used to determine the backup location of the first snapshot chain, each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine as the backup metadata of the first virtual machine under the current data backup after the traversal of each first snapshot in the first snapshot chain is completed, and save the backup metadata; the backup metadata is used to implement the data recovery method of the virtual machine in any of the above embodiments.
[0250] In an exemplary embodiment, the snapshot chain determination module 1204 is also used to determine the first snapshot chain of the first virtual machine under the historical data backup based on the backup metadata of the first virtual machine under the historical data backup when the backup request is an incremental backup request, and determine each first snapshot in the first snapshot chain of the first virtual machine under the historical data backup as each first historical snapshot of the first virtual machine; determine each first snapshot currently existing in the first virtual machine, except for each first historical snapshot, as each first current snapshot; and obtain the first snapshot chain of the first virtual machine under the current data backup based on each first current snapshot and the first snapshot chain of the first virtual machine under the historical data backup.
[0251] In an exemplary embodiment, the data backup device of the virtual machine also includes a disk snapshot shooting module, which is used to respond to a snapshot request for at least one first disk in the first virtual machine, determine the first disk targeted by the snapshot request as the first associated disk of the first snapshot to be created; perform a snapshot shooting operation on the first associated disk, and generate an image file of the first associated disk at the current moment, to obtain the first snapshot of the first associated disk at the current moment; the current moment is the creation moment of the first snapshot.
[0252] Each module in the aforementioned virtual machine data recovery device and virtual machine data backup device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a computer device memory in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0253] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 13As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store backup metadata of the virtual machine. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data recovery method and a data backup method of a virtual machine are implemented.
[0254] Those skilled in the art will understand that Figure 13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0255] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0256] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0257] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0258] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0259] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0260] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A data recovery method for a virtual machine, characterized in that: The method comprises: In response to a data recovery request for a first virtual machine, creating a second virtual machine with the same configuration as the first virtual machine; the first virtual machine is configured with multiple first disks, and the second virtual machine is configured with second disks corresponding to the first disks; Obtaining a first snapshot chain in the backup metadata of the first virtual machine; the first snapshot chain comprises a plurality of first snapshots, the first snapshot chain being used to represent a chronological order of creation time of the plurality of first snapshots; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot; traversing each first snapshot in the first snapshot chain in sequence, traversing each first associated disk of each first snapshot being traversed, and obtaining, for each first associated disk being traversed, image file index information of a second target disk corresponding to each second disk of the first associated disk being traversed; the image file index information of the second target disk is used to record a file identifier of an uploaded image file on the second target disk, and the image file index information of the second target disk is initialized to empty; When the image file index information is empty, uploading the image file of the first associated disk being traversed under the first snapshot being traversed into the second virtual machine as the image file of the second target disk in the second virtual machine under the second blank snapshot corresponding to the first snapshot being traversed, and modifying the image file index information to the file identifier of the image file of the first associated disk being traversed under the first snapshot being traversed; If the image file index information is not empty, modifying the pre-order image file attribute of the image file of the first associated disk being traversed under the first snapshot being traversed to the image file index information to obtain a modified image file, uploading the modified image file to the second virtual machine as the image file of the second target disk under the second blank snapshot, and modifying the image file index information to the file identifier of the modified image file; the pre-order image file attribute of each image file is used to record the file identifier of the previous image file of the disk to which the image file belongs; Based on the image file of the second target disk of each first associated disk of each first snapshot under the second blank snapshot corresponding to each first snapshot, each second snapshot corresponding one-to-one to each first snapshot and a second snapshot chain composed of each second snapshot are obtained to complete the data recovery of the first virtual machine.
2. The method according to claim 1, characterized in that Before traversing each first associated disk of the first snapshot being traversed, the method further includes: A second blank snapshot corresponding to the first snapshot being traversed is created in the second virtual machine, and a second target disk corresponding to the first associated disk of the first snapshot being traversed is determined among the second disks.
3. The method according to claim 1, characterized in that The image file of the second target disk of each first associated disk of each first snapshot under the second blank snapshot corresponding to each first snapshot is obtained, and each second snapshot corresponding to each first snapshot and a second snapshot chain composed of each second snapshot are obtained, including: For each first snapshot, obtaining a second snapshot of the second virtual machine corresponding to the first snapshot based on the image file of the second target disk of each first associated disk of the first snapshot under the second blank snapshot corresponding to the first snapshot; A second snapshot chain of the second virtual machine is obtained according to each second snapshot.
4. The method according to claim 1, wherein The preceding image file attributes of the image file are recorded in the image file; The modification of the attributes of the preceding image file of the image file is achieved through the following process: Reading a preset field of the image file; wherein the preset field records an offset value of a preceding image file attribute of the image file in the image file; Verifying the preset fields; If the preset field is verified to be successful, reading the offset value in the preset field; Based on the offset value, the preceding image file attribute of the image file is read, and the preceding image file attribute of the image file is modified.
5. The method according to any one of claims 1 to 4, characterized in that The backup metadata of the first virtual machine also includes configuration information of the first virtual machine and backup locations of each image file corresponding to the first snapshot chain; The creating of the second virtual machine having the same configuration as the first virtual machine includes: Creating, based on the configuration information in the backup metadata of the first virtual machine, the second virtual machine having the same configuration as the first virtual machine; Before uploading, based on the first snapshot chain, the image files corresponding to the first snapshot chain to the second virtual machine in sequence to obtain second snapshots corresponding to the first snapshots and a second snapshot chain consisting of the second snapshots, the method further includes: Based on the backup locations of the image files corresponding to the first snapshot chain in the backup metadata of the first virtual machine, the image files corresponding to the first snapshot chain are obtained.
6. A data backup method for a virtual machine, characterized in that: The method comprises: In response to a data backup request for a first virtual machine, obtaining each currently existing first snapshot of the first virtual machine; the first virtual machine is configured with multiple first disks; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot; determining, based on the first snapshots, a first snapshot chain of the first virtual machine under the current data backup; wherein the first snapshot chain is composed of the first snapshots, and the first snapshots are arranged in the first snapshot chain in chronological order according to their creation times; traversing each first snapshot in the first snapshot chain in sequence, backing up the image file under each traversed first snapshot, and recording the backup location of the image file; When the traversal of each first snapshot in the first snapshot chain is completed, the first snapshot chain, the backup location of each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine are determined as the backup metadata of the first virtual machine under the current data backup, and the backup metadata is saved; the backup metadata is used to implement the data recovery method of the virtual machine described in any one of claims 1 to 5.
7. The method according to claim 6, characterized in that The determining, based on the first snapshots, a first snapshot chain of the first virtual machine under the current data backup includes: In a case where the backup request is an incremental backup request, determining, based on the backup metadata of the first virtual machine under the historical data backup, a first snapshot chain of the first virtual machine under the historical data backup, and determining each first snapshot in the first snapshot chain of the first virtual machine under the historical data backup as each first historical snapshot of the first virtual machine; Determining, among the first snapshots currently existing in the first virtual machine, first snapshots other than the first historical snapshots as first current snapshots; A first snapshot chain of the first virtual machine under the current data backup is obtained according to the respective first current snapshots and the first snapshot chain of the first virtual machine under the historical data backup.
8. The method according to claim 6, characterized in that The method further comprises: In response to a snapshot request for at least one first disk in the first virtual machine, determining the first disk targeted by the snapshot request as a first associated disk of a first snapshot to be created; A snapshot operation is performed on the first associated disk, and an image file of the first associated disk at a current moment is generated to obtain a first snapshot of the first associated disk at the current moment; the current moment is a creation moment of the first snapshot.
9. A data recovery device for a virtual machine, characterized in that: The device comprises: a virtual machine creation module, configured to create, in response to a data recovery request for a first virtual machine, a second virtual machine with the same configuration as the first virtual machine; the first virtual machine being configured with a plurality of first disks, and the second virtual machine being configured with respective second disks corresponding one-to-one to the respective first disks; A snapshot chain acquisition module is configured to acquire a first snapshot chain from the backup metadata of the first virtual machine; the first snapshot chain is composed of a plurality of first snapshots, and the first snapshot chain is configured to represent a chronological order of creation time of the plurality of first snapshots; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot; The data recovery processing module is used to traverse each first snapshot in the first snapshot chain in turn, traverse each first associated disk of the first snapshot being traversed, and obtain the image file index information of the second target disk corresponding to the first associated disk being traversed in each second disk for each first associated disk being traversed; the image file index information of the second target disk is used to record the file identifier of an uploaded image file on the second target disk, and the image file index information of the second target disk is initialized to empty; when the image file index information is empty, the image file of the first associated disk being traversed under the first snapshot being traversed is uploaded to the second virtual machine as the image file of the second target disk in the second virtual machine under the second blank snapshot corresponding to the first snapshot being traversed, and the image file index information is modified to the image file of the first associated disk being traversed in the The file identifier of the image file under the first snapshot being traversed; when the image file index information is not empty, the pre-order image file attribute of the image file of the first associated disk being traversed under the first snapshot being traversed is modified to the image file index information to obtain the modified image file, and the modified image file is uploaded to the second virtual machine as the image file of the second target disk under the second blank snapshot, and the image file index information is modified to the file identifier of the modified image file; the pre-order image file attribute of each image file is used to record the file identifier of the previous image file of the disk to which the image file belongs; based on the image file of the second target disk of each first associated disk of each first snapshot under the second blank snapshot corresponding to each first snapshot, each second snapshot corresponding to each first snapshot and a second snapshot chain composed of each second snapshot are obtained to complete the data recovery of the first virtual machine.
10. A data backup device for a virtual machine, characterized in that: The device comprises: A first snapshot acquisition module is configured to, in response to a data backup request for a first virtual machine, acquire each currently existing first snapshot of the first virtual machine; the first virtual machine is configured with multiple first disks; each first snapshot corresponds to at least one first associated disk and an image file of each first associated disk at the time of creation of the first snapshot; a snapshot chain determination module, configured to sequentially traverse each first snapshot in the first snapshot chain, back up the image file under each traversed first snapshot, and record the backup location of the image file; an image file backup module, configured to sequentially traverse each first snapshot in the first snapshot chain, back up the image file under each traversed first snapshot, and record the backup location of the image file; A backup data saving module is used to determine the first snapshot chain, the backup location of each image file corresponding to the first snapshot chain, and the configuration information of the first virtual machine as the backup metadata of the first virtual machine under the current data backup after the traversal of each first snapshot in the first snapshot chain is completed, and save the backup metadata; the backup metadata is used to implement the data recovery method of the virtual machine described in any one of claims 1 to 5.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the virtual machine data recovery method according to any one of claims 1 to 5 or the virtual machine data backup method according to any one of claims 6 to 8 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the virtual machine data recovery method according to any one of claims 1 to 5 or the virtual machine data backup method according to any one of claims 6 to 8 are implemented.
13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the virtual machine data recovery method according to any one of claims 1 to 5 or the virtual machine data backup method according to any one of claims 6 to 8 are implemented.
Citation Information
Patent Citations
Backup method, disaster recovery method, device and equipment of virtual machine
CN115098299A
Data recovery method and device, equipment, storage medium and computer program product
CN117370079A