Data recovery method and device, storage medium and electronic device

By monitoring faults, detecting object types and recovery times in the virtualization platform, and extracting data that matches the object type from the backup data, it solves the problem that the virtualization platform cannot take snapshots of shared disk virtual machines, and improves data recovery efficiency and system performance. Availability.

CN118377657BActive Publication Date: 2024-09-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410835936.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-24
Estimated Expiration
2044-06-26

AI Technical Summary

Technical Problem

The virtualization platform cannot take snapshots of virtual machines that use shared disks, resulting in the inability to recover in the event of a failure, which reduces the availability and security of the virtualization platform.

Method used

Deploy the virtual machine system, controller, shared storage space and backup storage space in the server. By monitoring faults, detecting object types and recovery times, extract data that matches the object type from the backup data and restore it to the reference object.

Benefits of technology

It avoids recovery failures caused by incorrect backup data and ensures that correct backup data is obtained, thereby improving data recovery efficiency and improving the availability and security of virtual machines and shared storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118377657B
    Figure CN118377657B
Patent Text Reader

Abstract

The embodiment of the present application provides a data recovery method and device, storage medium and electronic device, wherein the method includes: in the case of monitoring that a target object in a virtual machine system and a shared storage space has a fault, detecting the target object type corresponding to the target object, and detecting the target recovery time corresponding to the reference object to which the target object is allowed to be restored; extracting target backup data that conforms to the target object type corresponding to the target recovery time from the backup time, virtual machine system backup data and shared storage space backup data that have a corresponding relationship; and restoring the target object to the reference object using the target backup data. Through the present application, the problem of low data recovery efficiency is solved, thereby achieving the effect of improving data recovery efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and in particular, to a data recovery method and device, a storage medium, and an electronic device. Background Art

[0002] Currently, all virtualization platforms have a virtual machine snapshot function. By taking a snapshot of a virtual machine, the virtual machine can retain the current data and memory state, so that the virtual machine can be rolled back to the state when the snapshot was taken in the future. The virtualization platform allocates a hard disk as the local hard disk of each virtual machine. When taking a snapshot of such a virtual machine, the local hard disk data and memory data will be retained and processed to form a snapshot. However, the virtualization platform cannot take a snapshot of a virtual machine that uses a virtual disk as a shared disk, which makes it impossible for a virtual machine that uses a shared disk to use the snapshot function.

[0003] Since it is impossible to take snapshots of virtual machines using shared disks, when a virtual machine using the shared disk and / or the shared disk fails, the virtual machine and / or the shared disk cannot be modified, which reduces the availability of the virtualization platform and the security of the virtual machines using the shared disk. Summary of the invention

[0004] The embodiments of the present application provide a data recovery method and device, a storage medium, and an electronic device to at least solve the problem of low data recovery efficiency in the related art.

[0005] According to an embodiment of the present application, a data recovery method is provided, wherein a virtual machine system, a controller, a shared storage space and a backup storage space are deployed on a server, the virtual machines on the virtual machine system share the shared storage space, the backup storage space stores backup time, virtual machine system backup data and shared storage space backup data with corresponding relationships, the method is applied to the controller, and the method includes: monitoring faults occurring in the virtual machine system and the shared storage space; in the case of detecting faults occurring in target objects in the virtual machine system and the shared storage space, detecting a target object type corresponding to the target object, and detecting a target recovery time corresponding to a reference object to which the target object is allowed to be restored; extracting target backup data corresponding to the target recovery time and conforming to the target object type from the backup time, virtual machine system backup data and shared storage space backup data with corresponding relationships; and restoring the target object to the reference object using the target backup data.

[0006] In an exemplary embodiment, detecting the target object type corresponding to the target object includes: extracting object description information of the target object, wherein the object description information is used to indicate the target object; filtering type description information from the object description information, and determining the object type indicated by the type description information as the target object type.

[0007] In an exemplary embodiment, the extracting of the target backup data that corresponds to the target recovery time and conforms to the target object type from the backup times, virtual machine system backup data, and shared storage space backup data that have corresponding relationships includes: extracting candidate virtual machine system backup data and candidate shared storage space backup data that correspond to the target recovery time from the backup times, virtual machine system backup data, and shared storage space backup data that have corresponding relationships; extracting the target backup data that conforms to the target object type from the candidate virtual machine system backup data and the candidate shared storage space backup data.

[0008] In an exemplary embodiment, the extracting of target backup data that conforms to the target object type from the candidate virtual machine system backup data and the candidate shared storage space backup data includes: when the target object type includes a virtual machine type and the target object includes a target virtual machine on the virtual machine system, extracting the target backup data corresponding to the target virtual machine from the candidate virtual machine system backup data; or, when the target object type includes a storage space type and the target object includes the shared storage space, determining the candidate shared storage space backup data as the target backup data; or, when the target object type includes the virtual machine type and the storage space type and the target object includes the shared storage space and the target virtual machine on the virtual machine system, extracting first backup data corresponding to the target virtual machine from the candidate virtual machine system backup data and determining the candidate shared storage space backup data as second backup data, wherein the target backup data includes the first backup data and the second backup data.

[0009] In an exemplary embodiment, extracting the target backup data corresponding to the target virtual machine from the candidate virtual machine system backup data includes: detecting a virtual machine identifier corresponding to the target virtual machine; and extracting the target backup data corresponding to the virtual machine identifier from the candidate virtual machine system backup data.

[0010] In an exemplary embodiment, before monitoring the failures occurring in the virtual machine system and the shared storage space, the method further includes: when the virtual machine system includes N virtual machines, backing up the data of the N virtual machines at the i-th backup time to obtain N virtual machine system backup data, and backing up the data of the shared storage space at the i-th backup time to obtain the i-th shared storage space backup data, wherein N is a positive integer greater than or equal to 2, and i is a positive integer; and recording the i-th backup time, the N virtual machine system backup data, and the i-th shared storage space backup data that have a corresponding relationship.

[0011] In an exemplary embodiment, backing up the data of the N virtual machines at the i-th backup time to obtain N virtual machine system backup data includes: backing up the data of the i-th virtual machine among the N virtual machines at the i-th backup time to obtain the i-th virtual machine system backup data by executing the following steps, wherein i is a positive integer less than or equal to N: extracting the i-th candidate backup data of the i-th virtual machine at the i-th backup time, wherein the i-th candidate backup data includes the i-th virtual machine system backup data and the i-th virtual machine shared backup data, the i-th virtual machine shared backup data is the backup data of the data corresponding to the i-th virtual machine in the shared storage space, and the i-th virtual machine system backup data is the backup data of the data corresponding to the operating system of the i-th virtual machine at the i-th backup time; extracting the i-th virtual machine system backup data from the i-th candidate backup data, and recording the i-th backup time and the system backup data of the i-th virtual machine having a corresponding relationship in the backup storage space.

[0012] In an exemplary embodiment, extracting the i-th virtual machine system backup data from the i-th candidate backup data includes: extracting the i-th storage address of the i-th virtual machine shared backup data in the i-th candidate backup data; deleting the data stored at the i-th storage address in the i-th candidate backup data to obtain the i-th virtual machine system backup data.

[0013] In an exemplary embodiment, backing up the data of the shared storage space at the i-th backup time to obtain the i-th shared storage space backup data includes: when the virtual machine system includes N virtual machines, backing up the data of the shared storage space at the i-th backup time to obtain the i-th shared storage space backup data by executing the following steps, wherein N is a positive integer greater than or equal to 2, and i is a positive integer: generating a target backup request, and sending the target backup request to each of the N virtual machines, wherein the target backup request is used to request a backup of the data of the shared storage space at the i-th backup time, and each of the N virtual machines is configured to respond to the received target backup request , write the updated data of each virtual machine at the i-th backup time that has not been written to the shared storage space into the shared storage space; receive N backup results returned by each of the N virtual machines in response to the target backup request; and when the N backup results are used to indicate that the N virtual machines have completed writing the updated data corresponding to the i-th backup time that has not been written to the shared storage space into the shared storage space, back up the reference data of the shared storage space at the i-th backup time, wherein the reference data is the data stored in the shared storage space when the N virtual machines have completed writing the updated data corresponding to the i-th backup time that has not been written to the shared storage space into the shared storage space.

[0014] In an exemplary embodiment, backing up the reference data of the shared storage space at the i-th backup time includes: setting the reference data to only allow each virtual machine among the N virtual machines to perform read operations; generating a candidate storage space corresponding to the shared storage space, wherein the N virtual machines share the candidate storage space, the reference data is stored in the candidate storage space, and the i-th shared storage space backup data includes the candidate storage space.

[0015] In an exemplary embodiment, generating a candidate storage space corresponding to the shared storage space includes: generating an initial storage space, wherein the initial storage space allows the reference data of the target data size to be stored; backing up the reference data to the initial storage space to obtain a reference storage space; and setting the reference storage space to allow the N virtual machines to be shared to obtain the candidate storage space.

[0016] In an exemplary embodiment, after generating the candidate storage space corresponding to the shared storage space, the method further includes: writing the i-th update data requested by the i-th virtual machine among the N virtual machines into the candidate storage space by executing the following steps, where i is a positive integer less than or equal to N, and N is a positive integer greater than or equal to 2: receiving the i-th adjustment request initiated by the i-th virtual machine, wherein the i-th adjustment request is used to request that the i-th update data be written into the candidate storage space; responding to the i-th adjustment request, detecting the i-th update storage address of the i-th update data in the candidate storage space, and writing the i-th update data into the i-th update storage address.

[0017] In an exemplary embodiment, the method also includes: when the rth virtual machine among the N virtual machines receives the target backup request, writing the rth update data corresponding to the rth virtual machine into the shared storage space by executing the following steps, wherein r is a positive integer less than or equal to N: extracting the rth update data generated by the rth virtual machine at the rth time and not yet written to the shared storage space, and detecting the rth storage address of the rth update data in the shared storage space, wherein the rth time is the time when the rth virtual machine receives the target backup request; writing the rth update data into the rth storage address.

[0018] In an exemplary embodiment, the use of the target backup data to restore the target object to the reference object includes: extracting the target recovery method corresponding to the target object type from the object types and recovery methods with corresponding relationships; and using the target backup data to restore the target object to the reference object according to the target recovery method.

[0019] In an exemplary embodiment, the use of the target backup data to restore the target object to the reference object according to the target recovery method includes: when the virtual machine system includes N virtual machines and the target object type includes a virtual machine type, by performing the following steps, the i-th virtual machine system backup data is used to restore the i-th virtual machine among the N virtual machines to the i-th backup virtual machine corresponding to the i-th backup time, wherein the target backup data includes the i-th virtual machine system backup data, the target object includes the i-th virtual machine, the i-th virtual machine system backup data is the virtual machine system backup data corresponding to the i-th virtual machine at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N: controlling the i-th virtual machine to stop sending a target adjustment request to the shared storage space, and restoring the i-th virtual machine at the i-th backup time that has been generated and has not yet been written to the shared storage The target adjustment request is used to request to perform a target operation on the data in the shared storage space, and the target operation includes a read operation and / or a write operation; after completing writing the data generated by the i-th virtual machine at the i-th backup time and not yet written to the shared storage space into the shared storage space, extracting the i-th process data and the i-th operating system data carried in the i-th virtual machine system backup data, wherein the i-th process data is used to indicate the i-th group of processes being executed by the i-th virtual machine at the i-th backup time, and the i-th operating system data is used to indicate the data of the operating system of the i-th virtual machine at the i-th backup time; according to the i-th process data, the process being executed on the i-th virtual machine is restored to the i-th group of processes, and the data of the operating system of the i-th virtual machine is restored to the i-th operating system data, so as to obtain the i-th backup virtual machine.

[0020] In an exemplary embodiment, the use of the target backup data to restore the target object to the reference object according to the target recovery method includes: when the virtual machine system includes N virtual machines, the target object type includes a storage space type, and the target object includes the shared storage space, by performing the following steps, the i-th shared storage space backup data is used to restore the shared storage space to the i-th backup shared storage space corresponding to the i-th backup time, wherein the target object includes the shared storage space, the target recovery time includes the i-th backup time, the target backup data includes the i-th shared storage space backup data, the i-th shared storage space backup data is the shared storage space backup data corresponding to the shared storage space at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N. Number: suspend responding to the adjustment request initiated by each virtual machine among the N virtual machines for requesting to perform a target operation on the data in the shared storage space, wherein the target operation includes a read operation and / or a write operation performed on the data in the shared storage space, and set each virtual machine among the N virtual machines to not allow the adjustment request to be initiated; delete the corresponding data of each virtual machine in the shared storage space stored in each virtual machine among the N virtual machines, and end the target process in each virtual machine among the N virtual machines for performing the target operation on the data in the shared storage space; establish a mapping relationship between each virtual machine among the N virtual machines and the i-th candidate storage space indicated by the i-th shared storage space backup data, and set the data in the i-th candidate storage space to allow each virtual machine among the N virtual machines to perform read operations and write operations.

[0021] In an exemplary embodiment, the establishing of a mapping relationship between each virtual machine among the N virtual machines and the i-th candidate storage space indicated by the i-th shared storage space backup data includes: establishing a mapping relationship between the i-th virtual machine among the N virtual machines and the i-th candidate storage space by executing the following steps: determining an i-th group of storage addresses in the i-th virtual machine for storing data of the i-th virtual machine, and determining a j-th group of storage addresses in the i-th candidate storage space for storing data of the i-th virtual machine; establishing a corresponding relationship between each storage address in the i-th group of storage addresses and each storage address in the j-th group of storage addresses, wherein the i-th virtual machine performs a target operation on the data stored at the t-th storage address in the j-th group of storage addresses corresponding to the s-th storage address by accessing the s-th storage address in the i-th group of storage addresses, and the target operation includes a read operation and / or a write operation.

[0022] In an exemplary embodiment, the use of the target backup data to restore the target object to the reference object according to the target recovery method includes: when the target object type includes a virtual machine type and a storage space type, and the target object includes the shared storage space and a target virtual machine on the virtual machine system, using the target backup data to restore the target object to the reference object according to the target recovery method by performing the following steps: extracting first backup data corresponding to the target virtual machine from the target backup data, and extracting second backup data corresponding to the shared storage space from the target backup data; using the first backup data to restore the target virtual machine to the backup virtual machine corresponding to the target recovery time, and using the second backup data to restore the shared storage space to the backup storage space corresponding to the target recovery time.

[0023] According to another embodiment of the present application, a data recovery device is provided, wherein a virtual machine system, a controller, a shared storage space and a backup storage space are deployed on a server, the virtual machines on the virtual machine system share the shared storage space, the backup storage space stores backup time, virtual machine system backup data and shared storage space backup data with corresponding relationships, the device is applied to the controller, and the device includes: a monitoring module, used to monitor faults occurring in the virtual machine system and the shared storage space; a detection module, used to detect a target object type corresponding to the target object and detect a target recovery time corresponding to a reference object to which the target object is allowed to be restored when a fault is detected in the target object in the virtual machine system and the shared storage space; a first extraction module, used to extract target backup data corresponding to the target recovery time and conforming to the target object type from the backup time, virtual machine system backup data and shared storage space backup data with corresponding relationships; and a recovery module, used to restore the target object to the reference object using the target backup data.

[0024] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0025] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0026] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0027] Through the present application, the data of the virtual machine and the data in the shared storage space are backed up in the server respectively. The virtual machines on the virtual machine system and the shared storage space shared by the virtual machines on the virtual machine system may both fail. In this case, backup data of the object type that matches the failed object can be extracted from the stored virtual machine system backup data and the shared storage space backup data, but is not limited to. In this way, the failure of restoring the virtual machine or shared storage space due to obtaining erroneous backup data is avoided, and the correct backup data is ensured to be obtained. Therefore, the problem of low data recovery efficiency can be solved, thereby achieving the effect of improving data recovery efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a hardware structure block diagram of a server device of a data recovery method according to an embodiment of the present application;

[0029] Figure 2 is a flow chart of a method for recovering data according to an embodiment of the present application;

[0030] Figure 3 is a schematic diagram of an optional method of backing up data of a virtual machine according to an embodiment of the present application;

[0031] Figure 4 is a schematic diagram of an optional backing up of a shared storage space according to an embodiment of the present application;

[0032] Figure 5 is a schematic diagram of an optional backup of a virtual machine and a shared storage space according to an embodiment of the present application;

[0033] Figure 6 is a schematic diagram of an optional recovery virtual machine according to an embodiment of the present application;

[0034] Figure 7 is a schematic diagram of an optional recovery of a shared storage space according to an embodiment of the present application;

[0035] Figure 8 is a schematic diagram of an optional recovery of a virtual machine and a shared storage space according to an embodiment of the present application;

[0036] Fig. 9 is a schematic diagram of an optional data recovery according to an embodiment of the present application;

[0037] Fig.10It is a structural block diagram of a data recovery device according to an embodiment of the present application. DETAILED DESCRIPTION

[0038] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0040] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a data recovery method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0041] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data recovery method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0042] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0043] First, the terms involved in the embodiments of the present application are explained as follows:

[0044] Virtualization: is a broad term. In computers, it usually refers to computing elements running on a virtual basis rather than a real basis. Virtualization technology can expand the capacity of hardware and simplify the reconfiguration process of software. CPU virtualization technology can simulate multiple CPUs in parallel with a single CPU, allowing a platform to run multiple operating systems at the same time, and applications can run in independent spaces without affecting each other, thereby significantly improving computer work efficiency.

[0045] Virtual Machine: refers to a complete computer system with complete hardware system functions that is simulated by software and runs in a completely isolated environment. Any work that can be done in a physical computer can be done in a virtual machine. When creating a virtual machine in a computer, part of the hard disk and memory capacity of the physical machine needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent CMOS, hard disk and operating system, and can be operated on the virtual machine just like a physical machine.

[0046] Virtualization platform: the platform system on which virtual machines run, such as the Linux KVM system. This platform manages and runs several virtual machines, is responsible for the normal operation of virtual machines, allocates the host's physical memory to virtual machines for use and manages the memory used by virtual machines, and converts the read and write of virtual machine memory into the read and write of physical memory when the virtual machine uses the memory. This platform is the basis for the operation and management of virtual machines, is the host of virtual machines, and is responsible for the conversion of virtual memory and physical memory addresses of virtual machines, etc.

[0047] Virtual machine snapshot: A disk "snapshot" is a copy of a virtual machine disk file (VMDK (VMWare Virtual MachineDisk Format)) at a certain point in time. In case of a system crash or system anomaly, you can restore to the snapshot to maintain the disk file system and system storage. Snapshots play a big role when upgrading applications and servers and patching them. VMware snapshot is a special feature in VMware. The snapshot in VMware is a "copy" of the VMDK at a certain point in time. This "copy" is not a copy of the VMDK, but keeps the state of the disk file and system memory at that point in time, so that the virtual machine can be restored to that point in time after a virtual machine failure. If you create multiple snapshots for the virtual machine, you can have multiple recoverable time points.

[0048] Shared disk: A virtual disk can be created on the virtualized storage space. After setting it to shared mode, it can be allocated to multiple virtual machines for use. The virtual machine using the shared disk can see the shared disk under the virtual machine system. The shared disk can be read and written concurrently with the help of cluster software, allowing multiple virtual machines to read and write the shared disk at the same time.

[0049] In this embodiment, a data recovery method is provided. A virtual machine system, a controller, a shared storage space and a backup storage space are deployed on a server. The virtual machines on the virtual machine system share the shared storage space. The backup storage space stores backup time, virtual machine system backup data and shared storage space backup data with corresponding relationships. The method is applied to the controller. Figure 2 is a flow chart of a method for recovering data according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0050] Step S202, detecting faults occurring in the virtual machine system and the shared storage space;

[0051] Step S204, in the case where a failure occurs in the target object in the virtual machine system and the shared storage space, detecting a target object type corresponding to the target object, and detecting a target recovery time corresponding to a reference object to which the target object is allowed to be recovered;

[0052] Step S206, extracting target backup data that corresponds to the target recovery time and conforms to the target object type from the backup time, virtual machine system backup data, and shared storage space backup data that have a corresponding relationship;

[0053] Step S208: Use the target backup data to restore the target object to the reference object.

[0054] Through the above steps, the data of the virtual machine and the data in the shared storage space are backed up in the server respectively. The virtual machines on the virtual machine system and the shared storage space shared by the virtual machines on the virtual machine system may both fail. In this case, it is possible but not limited to extracting backup data of the object type that matches the failed object from the stored virtual machine system backup data and the shared storage space backup data. In this way, the failure of restoring the virtual machine or shared storage space due to obtaining erroneous backup data is avoided, and the correct backup data is ensured. Therefore, the problem of low data recovery efficiency can be solved, thereby achieving the effect of improving data recovery efficiency.

[0055] In the technical solution provided in the above step S202, multiple virtual machines may be deployed on the virtual machine system but are not limited to it, and each virtual machine deployed on the virtual machine system may be but are not limited to being allowed to use the shared storage space. For example, each virtual machine deployed on the virtual machine system is allowed to perform read operations and write operations on the data in the shared storage space, or each virtual machine deployed on the virtual machine system is allowed to store data in the shared storage space, etc.

[0056] Optionally, in this embodiment, it is possible but not limited to monitoring failures of each virtual machine and shared storage space in the virtual machine system, for example, monitoring whether each virtual machine in the virtual machine system cannot run, whether the virtual machine cannot write data to the shared storage space, or whether the shared storage space cannot store data written by the virtual machine, etc.

[0057] In an exemplary embodiment, before monitoring the failures occurring in the virtual machine system and the shared storage space, the method further includes: when the virtual machine system includes N virtual machines, backing up the data of the N virtual machines at the i-th backup time to obtain N virtual machine system backup data, and backing up the data of the shared storage space at the i-th backup time to obtain the i-th shared storage space backup data, wherein N is a positive integer greater than or equal to 2, and i is a positive integer; and recording the i-th backup time, the N virtual machine system backup data, and the i-th shared storage space backup data that have a corresponding relationship.

[0058] Optionally, in this embodiment, the data of the virtual machines and the shared storage space on the virtual machine system may also be backed up in the following manner, but is not limited to: backing up the virtual machines on the virtual machine system in the jth 1 Back up the data at the jth backup time and get the 1 The virtual machine system backs up the data and records the jth virtual machine system with corresponding relationship. 1 The backup time and the jth 1The virtual machine system backs up data for the shared storage space in the jth 2 Back up the data at the jth backup time and get the 2 The shared storage space backs up the data and records the jth 2 The backup time and the jth 2 The shared storage space backs up data for the virtual machines and shared storage space on the virtual machine system in the jth order. 3 Back up the data at the jth backup time and get the 3 The backup data of the virtual machine system and the jth 3 The shared storage space backs up the data and records the jth 3 backup time, jth 3 The backup data of the virtual machine system and the jth 3 Shared storage space backup data, where j 1 、j 2 , and 3 are all positive integers, j 1 and j 3 Can be but not limited to different, j 1 and j 2 Can be but not limited to different, j 2 and j 3 Can be but not limited to different.

[0059] In an exemplary embodiment, the data of the i-th virtual machine among the N virtual machines at the i-th backup time can be backed up, but not limited to, by executing the following steps to obtain the i-th virtual machine system backup data, wherein i is a positive integer less than or equal to N: extracting the i-th candidate backup data of the i-th virtual machine at the i-th backup time, wherein the i-th candidate backup data includes the i-th virtual machine system backup data and the i-th virtual machine shared backup data, the i-th virtual machine shared backup data is the backup data of the data corresponding to the i-th virtual machine in the shared storage space, and the i-th virtual machine system backup data is the backup data of the data corresponding to the operating system of the i-th virtual machine at the i-th backup time; extracting the i-th virtual machine system backup data from the i-th candidate backup data, and recording the i-th backup time and the system backup data of the i-th virtual machine having a corresponding relationship in the backup storage space.

[0060] Optionally, in this embodiment, the shared backup data of the i-th virtual machine may include but is not limited to backup data of data stored by the i-th virtual machine in the shared storage space, or backup data of data on which the i-th virtual machine performs a target operation in the shared storage space, wherein the target operation may include but is not limited to read operations and / or write operations.

[0061] In an exemplary embodiment, the i-th virtual machine system backup data can be extracted from the i-th candidate backup data in the following manner, but is not limited to: extracting the i-th storage address of the i-th virtual machine shared backup data in the i-th candidate backup data; deleting the data stored at the i-th storage address in the i-th candidate backup data to obtain the i-th virtual machine system backup data.

[0062] Optionally, in this embodiment, the i-th virtual machine system backup data may be extracted in the following manner but is not limited to: extracting data at storage addresses other than the i-th storage address from the i-th candidate backup data to obtain the i-th virtual machine system backup data.

[0063] Figure 3 is a schematic diagram of an optional method of backing up data of a virtual machine according to an embodiment of the present application, such as Figure 3 As shown in the figure, the shared disk (equivalent to shared storage space) is generally used in a cluster environment formed by multiple virtual machines. When taking a snapshot of a virtual machine, it is determined whether the shared disk is used. If the shared disk is not used, the snapshot is generated by the ordinary virtual machine snapshot logic. If a shared disk is used, it will prompt whether to take a snapshot of the virtual machine system or the shared disk. If you choose to take a snapshot of the virtual machine system only, the virtual machine system-related data (equivalent to the backup data of the i-th virtual machine system) will be stripped from the virtual machine's memory and snapshots will be taken together with the relevant processes and the local hard disk of the virtual machine.

[0064] For example, if you only take a snapshot of the virtual machine system but not the shared disk, the shared disk data will not be included in the snapshot, and this snapshot operation only affects this virtual machine and will not affect other virtual machines using the shared disk. The virtualization platform obtains the location of the shared disk data in the virtual machine memory (equivalent to the i-th storage address) and the process information involving the shared disk from the virtual machine, and strips the shared disk memory data (equivalent to the i-th virtual machine shared backup data) when generating a snapshot to save the virtual machine system memory data, and only saves the virtual machine system memory data (equivalent to the i-th virtual machine system backup data) by snapshot, and then takes a snapshot. In this way, the problem that virtual machines using virtual shared disks cannot take snapshots is solved, and it is ensured that the virtual machine system snapshot does not contain the relevant data of the shared disk, so that the virtual machine system using the shared disk can be restored by snapshots later.

[0065] In an exemplary embodiment, the data of the shared storage space at the i-th backup time can be backed up to obtain the i-th shared storage space backup data by performing the following steps, but not limited to, wherein N is a positive integer greater than or equal to 2, and i is a positive integer: generating a target backup request, and sending the target backup request to each of the N virtual machines, wherein the target backup request is used to request a backup of the data of the shared storage space at the i-th backup time, and each of the N virtual machines is configured to respond to the received target backup request and back up the data of each virtual machine at the i-th backup time that has not yet been written to the shared storage space. The target backup request comprises: receiving N backup results returned by each of the N virtual machines in response to the target backup request; and backing up the reference data of the shared storage space at the i-th backup time when the N backup results are used to indicate that the N virtual machines have completed writing the update data corresponding to the i-th backup time but not yet written to the shared storage space into the shared storage space, wherein the reference data is the data stored in the shared storage space when the N virtual machines have completed writing the update data corresponding to the i-th backup time but not yet written to the shared storage space into the shared storage space.

[0066] Optionally, in this embodiment, when at least one backup result among the N backup results is used to indicate that at least one of the N virtual machines has not completed writing the updated data corresponding to the i-th backup time and not yet written to the shared storage space into the shared storage space, backing up the reference data of the shared storage space at the i-th backup time is suspended.

[0067] In an exemplary embodiment, the reference data of the shared storage space at the i-th backup time can be backed up in the following manner but is not limited to: the reference data is set to allow only each virtual machine among the N virtual machines to perform read operations; a candidate storage space corresponding to the shared storage space is generated, wherein the N virtual machines share the candidate storage space, the reference data is stored in the candidate storage space, and the i-th shared storage space backup data includes the candidate storage space.

[0068] Optionally, in the present embodiment, each virtual machine among the N virtual machines is only allowed to perform read operations on the reference data. It is understandable that each virtual machine among the N virtual machines cannot modify, delete, and so on the reference data. In this way, it is ensured that when the reference data in the shared storage space is backed up, the reference data in the shared storage space will no longer be updated, thereby improving the stability of the data obtained by backing up the reference data.

[0069] Optionally, in this embodiment, each virtual machine among the N virtual machines is allowed to store corresponding data in the candidate storage space, or each virtual machine among the N virtual machines is allowed to perform read operations and / or write operations on the data in the candidate storage space.

[0070] In an exemplary embodiment, the candidate storage space corresponding to the shared storage space can be generated in the following manner but is not limited to: generating an initial storage space, wherein the initial storage space allows the reference data of the target data size to be stored; backing up the reference data to the initial storage space to obtain a reference storage space; setting the reference storage space to allow the N virtual machines to be shared to obtain the candidate storage space.

[0071] Optionally, in this embodiment, the space size of the initial storage space and the space size of the shared storage space may be, but are not limited to being, the same; the size of the storage space may be, but is not limited to being used to indicate the amount of data allowed to be stored in the storage space; it may be, but is not limited to, performing a backup operation on the reference data to obtain backup reference data, and storing the backup reference data in the initial storage space to obtain a reference storage space.

[0072] In an exemplary embodiment, after the candidate storage space corresponding to the shared storage space is generated, the method further includes: writing the i-th update data requested by the i-th virtual machine among the N virtual machines into the candidate storage space by executing the following steps, where i is a positive integer less than or equal to N, and N is a positive integer greater than or equal to 2: receiving an i-th adjustment request initiated by the i-th virtual machine, wherein the i-th adjustment request is used to request that the i-th update data be written into the candidate storage space; responding to the i-th adjustment request, detecting the i-th update storage address of the i-th update data in the candidate storage space, and writing the i-th update data into the i-th update storage address.

[0073] Optionally, in this embodiment, the i-th adjustment request can also be but is not limited to requesting to read the i-th update data from the candidate storage space. In this case, it is possible but not limited to responding to the i-th adjustment request and reading the i-th update data from the corresponding i-th update storage address in the candidate storage space.

[0074] In this way, after the shared storage space is rolled back to a state at a certain backup time by backing up the data in the shared storage space, it is possible but not limited to responding to the received request to read data, write data, or adjust data by the backup shared storage space that is rolled back, thereby enabling all virtual machines on the virtual machine system to restart I / O requests to the restored shared storage space.

[0075] In an exemplary embodiment, the above method also includes: when the rth virtual machine among the N virtual machines receives the target backup request, writing the rth update data corresponding to the rth virtual machine into the shared storage space by executing the following steps, wherein r is a positive integer less than or equal to N: extracting the rth update data generated by the rth virtual machine at the rth time and not yet written to the shared storage space, and detecting the rth storage address of the rth update data in the shared storage space, wherein the rth time is the time when the rth virtual machine receives the target backup request; writing the rth update data into the rth storage address.

[0076] Optionally, in this embodiment, the rth storage address may include but is not limited to one or more storage addresses. For example, when the amount of data in the rth updated data is large, the rth storage address may include but is not limited to multiple storage addresses. The data generated by each virtual machine on the virtual machine system and not written to the shared storage space is immediately written to the shared storage space, thereby preventing the loss of this part of the data and ensuring the integrity of the data stored in the shared storage space.

[0077] Figure 4 is a schematic diagram of an optional backing up of a shared storage space according to an embodiment of the present application, such as Figure 4 As shown in the figure, if only the shared disk is backed up (for example, snapshot), the snapshot processing will not be performed on all virtual machine systems using the shared disk. After initiating a shared disk snapshot, the virtualization platform generates a snapshot disk (equivalent to the candidate storage space) of the same size according to the size of the shared disk. The snapshot disk is also a shared attribute like the shared disk (equivalent to the shared storage space) and can be shared by multiple virtual machines. The virtualization platform sends the snapshot disk information to all virtual machines on the virtual machine system for use by these virtual machines.

[0078] If you choose to back up the shared disk (for example, snapshot), then send a snapshot instruction (equivalent to a target backup request) to all powered-on virtual machines that use the shared disk, strip the data of the shared disk in the memory of all virtual machines that use the shared disk and save it together with the related processes, generate a new shared snapshot file (equivalent to candidate storage space), send the shared snapshot file information to all virtual machines that use the shared disk, and new modifications and writes will be made on the shared snapshot file. For the new and changed shared disk data that has been generated in the memory of each virtual machine when the shared disk snapshot operation is initiated and has not been written to the shared disk (equivalent to updated data), these data will be forced to be written to the shared disk immediately, and the shared disk will be set to read-only mode after each virtual machine completes the writing; for the new and changed shared disk data that is generated after the shared disk snapshot operation is initiated, this type of data can be retained in the memory and will not be written to the shared disk in the future, but will be written to the shared snapshot disk (equivalent to candidate storage space) to ensure the integrity of the data in the shared disk between each virtual machine when the snapshot is initiated.

[0079] Figure 5 is a schematic diagram of an optional backup of a virtual machine and a shared storage space according to an embodiment of the present application, such as Figure 5 As shown, snapshots are taken for both the current virtual machine system and the shared disk, but not for all virtual machine systems that use the shared disk. The virtualization platform obtains the location of the shared disk data in the virtual machine memory and the process information involving the shared disk from the virtual machine. When generating a snapshot to save the virtual machine system memory data, the shared disk memory data is stripped and only the virtual machine system memory data is snapshotted and saved. Then the snapshot is taken. This ensures that the virtual machine system snapshot does not contain the shared disk memory data, so that the virtual machine system with the shared disk can be restored by the later snapshot. Then the shared disk snapshot is started. After the shared disk snapshot is initiated, the virtualization platform generates a snapshot disk of the same size according to the shared disk size. The snapshot disk is also a shared attribute like the shared disk and can be shared and used by multiple virtual machines. The virtualization platform sends the snapshot disk information to all virtual machines for use by these virtual machines. For the shared disk additions and changes that have been generated in the memory of each virtual machine when the shared disk snapshot operation is initiated, but have not been written to the shared disk, these data will be forced to be written to the shared disk immediately. After each virtual machine completes the writing, the shared disk will be set to read-only mode; for the shared disk additions and changes that are newly generated after the shared disk snapshot operation is initiated, such data can be retained in the memory and will not be written to the shared disk in the future, but will be written to the shared snapshot disk to ensure the integrity of the shared disk data between the virtual machines when the snapshot is initiated. By taking two snapshots of the virtual machine system and the shared disk, the purpose of taking snapshots of both the virtual machine system and the shared disk is achieved.

[0080] It should be noted that the order of backing up the virtual machine system and the shared disk is not limited in the embodiment of the present application. For example, the virtual machine system can be backed up first and then the shared disk, or the shared disk can be backed up first and then the virtual machine system.

[0081] In the technical solution provided in the above step S204, each virtual machine and shared storage space on the virtual machine system may fail. In such a case, the target object may include but is not limited to at least one virtual machine on the virtual machine system and / or the shared storage space.

[0082] Optionally, in this embodiment, the target object may be, but is not limited to, a backup object at multiple candidate times that can be restored. In such a case, the target recovery time may be, but is not limited to, a time including multiple candidate times. As an optional example, the target recovery time may be, but is not limited to, being screened out from multiple candidate times based on user needs.

[0083] In an exemplary embodiment, the target object type corresponding to the target object can be detected in the following manner but is not limited to: extracting object description information of the target object, wherein the object description information is used to indicate the target object; filtering type description information from the object description information, and determining the object type indicated by the type description information as the target object type.

[0084] Optionally, in this embodiment, the object description information may include but is not limited to fault description information of the target object and type description information of the target object, etc. The fault description information may be but is not limited to being used to describe the fault occurring in the target object. In such a case, the type description information may be but is not limited to being filtered from the object description information, and the object type indicated by the type description information may be but is not limited to being determined as the target object type.

[0085] In the technical solution provided in the above step S206, the target backup data may include but is not limited to the virtual machine system backup data and the shared storage space backup data corresponding to the target recovery time, and the target object type may include but is not limited to the virtual machine type and / or storage space type.

[0086] In an exemplary embodiment, the target backup data that corresponds to the target recovery time and conforms to the target object type can be extracted from the backup times, virtual machine system backup data, and shared storage space backup data that have corresponding relationships in the following manner, but is not limited to: extracting candidate virtual machine system backup data and candidate shared storage space backup data that correspond to the target recovery time from the backup times, virtual machine system backup data, and shared storage space backup data that have corresponding relationships; extracting target backup data that conforms to the target object type from the candidate virtual machine system backup data and candidate shared storage space backup data.

[0087] Optionally, in this embodiment, the target backup data may include but is not limited to at least one of candidate virtual machine system backup data and candidate shared storage space backup data, the candidate virtual machine system backup data may be but is not limited to data that conforms to the virtual machine type, and the candidate shared storage space backup data may be but is not limited to data that conforms to the storage space type.

[0088] In an exemplary embodiment, the target backup data that conforms to the target object type can be extracted from the candidate virtual machine system backup data and the candidate shared storage space backup data in the following manner, but is not limited to: when the target object type includes a virtual machine type and the target object includes a target virtual machine on the virtual machine system, the target backup data corresponding to the target virtual machine is extracted from the candidate virtual machine system backup data; or, when the target object type includes a storage space type and the target object includes the shared storage space, the candidate shared storage space backup data is determined as the target backup data; or, when the target object type includes the virtual machine type and the storage space type and the target object includes the shared storage space and the target virtual machine on the virtual machine system, the first backup data corresponding to the target virtual machine is extracted from the candidate virtual machine system backup data, and the candidate shared storage space backup data is determined as the second backup data, wherein the target backup data includes the first backup data and the second backup data.

[0089] Optionally, in this embodiment, the virtual machine system may include, but is not limited to, multiple virtual machines, the target virtual machine may include, but is not limited to, at least one of the multiple virtual machines, and the candidate virtual machine system backup data may include, but is not limited to, virtual machine system backup data of the multiple virtual machines at the target recovery time. In the event that at least one of the virtual machines on the virtual machine system has a problem, the virtual machine system backup data corresponding to the target virtual machine may be extracted from the candidate virtual machine system backup data, but is not limited to.

[0090] In an exemplary embodiment, the target backup data corresponding to the target virtual machine can be extracted from the candidate virtual machine system backup data in the following manner but is not limited to: detecting the virtual machine identifier corresponding to the target virtual machine; extracting the target backup data corresponding to the virtual machine identifier from the candidate virtual machine system backup data.

[0091] Optionally, in this embodiment, the candidate virtual machine system backup data may include but is not limited to virtual machine system backup data corresponding to multiple virtual machines on the virtual machine system. In such a case, the backup data corresponding to the virtual machine identifier may be extracted from the candidate virtual machine system backup data but is not limited to.

[0092] In the technical solution provided in the above step S208, the target object can be restored to the reference object corresponding to the target recovery time using the target backup data, but is not limited to it. It can be understood that the reference object can be used but is not limited to indicate the state corresponding to the target object at the target recovery time. For example, in the case where the target object includes a virtual machine on a virtual machine system, the reference object can be used but is not limited to represent the process being executed by the virtual machine at the target recovery time and the operating system data of the virtual machine. In the case where the target object includes a shared storage space, the reference object can be used but is not limited to include the data of the shared storage space at the target recovery time.

[0093] Through the embodiments of the present application, in a virtual machine cluster environment using a shared disk (equivalent to a shared storage space), by implementing a snapshot function of the shared disk in the virtualized environment, the availability of the virtualized environment is enhanced, and the security of the virtual machines using the shared disk can be improved. In addition, since a snapshot of the shared disk can be taken, this can be used as a way to back up the shared disk data, providing a new option for data protection for the shared disk. The functions of the virtualization system are further improved and enhanced, and the availability of the virtualized environment is improved.

[0094] In an exemplary embodiment, the target object can be restored to the reference object using the target backup data in the following manner, but is not limited to: extracting a target recovery method corresponding to the target object type from object types and recovery methods having a corresponding relationship; and restoring the target object to the reference object using the target backup data according to the target recovery method.

[0095] Optionally, in this embodiment, each object type may have, but is not limited to, a corresponding recovery method, and different object types may have, but are not limited to, different corresponding recovery methods. For example, the corresponding recovery method when the target backup data includes virtual machine system backup data may be, but are not limited to, different from the corresponding recovery method when the target backup data includes shared storage space backup data.

[0096] In an exemplary embodiment, the target object can be restored to the reference object in the target recovery method using the target backup data in the following manner, but is not limited to: when the virtual machine system includes N virtual machines and the target object type includes a virtual machine type, the i-th virtual machine system backup data is used to restore the i-th virtual machine among the N virtual machines to the i-th backup virtual machine corresponding to the i-th backup time by performing the following steps, wherein the target backup data includes the i-th virtual machine system backup data, the target object includes the i-th virtual machine, the i-th virtual machine system backup data is the virtual machine system backup data corresponding to the i-th virtual machine at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N: controlling the i-th virtual machine to stop sending a target adjustment request to the shared storage space, and restoring the i-th virtual machine at the i-th backup time that has been generated and has not yet been written to the shared storage space. The data in the shared storage space is written into the shared storage space, wherein the target adjustment request is used to request to perform a target operation on the data in the shared storage space, and the target operation includes a read operation and / or a write operation; when the data generated by the i-th virtual machine at the i-th backup time and not yet written into the shared storage space is written into the shared storage space, the i-th process data and the i-th operating system data carried in the i-th virtual machine system backup data are extracted, wherein the i-th process data is used to indicate the i-th group of processes being executed by the i-th virtual machine at the i-th backup time, and the i-th operating system data is used to indicate the data of the operating system of the i-th virtual machine at the i-th backup time; according to the i-th process data, the process being executed on the i-th virtual machine is restored to the i-th group of processes, and the data of the operating system of the i-th virtual machine is restored to the i-th operating system data, so as to obtain the i-th backup virtual machine.

[0097] Optionally, in this embodiment, when only the i-th virtual machine among N virtual machines fails, the data in the shared storage space can be but is not limited to being kept in the latest state. It can be understood that restoring the failed virtual machine will not affect the data in the shared storage space.

[0098] Optionally, in this embodiment, the i-th group of processes may be but is not limited to being used to execute the business of the i-th virtual machine, or being used to execute the processes requested by the i-th virtual machine to perform read operations and / or write operations on data in a shared storage space, etc.

[0099] Figure 6is a schematic diagram of an optional recovery virtual machine according to an embodiment of the present application, such as Figure 6 As shown, in the case where only a snapshot is taken of the virtual machine system but no snapshot is taken of the shared disk used by it, when restoring the snapshot, the virtual machine first stops receiving and initiating new I / O operation requests to the shared disk (equivalent to target adjustment requests) to ensure that the shared disk data will not undergo new changes after the snapshot restore operation is initiated, triggering the immediate writing of new and changed data in the memory of this virtual machine but not yet written to the shared disk (equivalent to data that has been generated at the backup time and has not yet been written to the shared storage space) to the shared disk. The purpose of this operation is to complete the writing of the changed and new data on the shared disk by the virtual machine before the snapshot is restored to ensure the consistency and integrity of the shared disk data on each virtual machine using the shared disk.

[0100] When the data is written, the virtual machine system can be restored using the snapshot. After the virtual machine system is restored, the virtual machine system will return to a certain point in the past, while the shared disk still maintains the latest data status. The restored virtual machine can re-initiate I / O (Input / Output) operations (equivalent to target operations) on the shared disk data.

[0101] In an exemplary embodiment, the target object can be restored to the reference object in accordance with the target recovery method using the target backup data in the following manner, but is not limited to: when the virtual machine system includes N virtual machines, the target object type includes a storage space type, and the target object includes the shared storage space, the shared storage space is restored to the i-th backup shared storage space corresponding to the i-th backup time using the i-th shared storage space backup data by executing the following steps, wherein the target object includes the shared storage space, the target recovery time includes the i-th backup time, the target backup data includes the i-th shared storage space backup data, the i-th shared storage space backup data is the shared storage space backup data corresponding to the shared storage space at the i-th backup time, N is a positive integer greater than or equal to 2, and i is less than or equal to A positive integer of N: suspending responding to adjustment requests initiated by each of the N virtual machines for requesting to perform a target operation on the data in the shared storage space, wherein the target operation includes a read operation and / or a write operation on the data in the shared storage space, and setting each of the N virtual machines to not allow the adjustment request to be initiated; deleting the corresponding data of each virtual machine in the shared storage space stored in each of the N virtual machines, and ending the target process in each of the N virtual machines for performing the target operation on the data in the shared storage space; establishing a mapping relationship between each of the N virtual machines and the i-th candidate storage space indicated by the i-th shared storage space backup data, and setting the data in the i-th candidate storage space to allow each of the N virtual machines to perform read operations and write operations.

[0102] Optionally, in this embodiment, the data corresponding to each virtual machine in the shared storage space stored in each virtual machine among the N virtual machines can be deleted in the following manner but is not limited to: extracting the storage address to be accessed corresponding to the data to be deleted in each virtual machine among the N virtual machines, wherein the data to be deleted is the data corresponding to the virtual machine in the shared storage space stored in the virtual machine, and deleting the data stored at the corresponding address to be accessed in each virtual machine among the N virtual machines.

[0103] Figure 7 is a schematic diagram of an optional recovery shared storage space according to an embodiment of the present application, such as Figure 7As shown in the figure, after taking a snapshot of the shared disk (equivalent to the shared storage space), the original shared disk master disk (equivalent to the shared storage space) is already in a read-only state, and subsequent database changes and writes are performed on the snapshot disk (equivalent to the candidate storage space). After using the snapshot to restore the shared disk, all virtual machines using the shared disk will first stop initiating new read and write I / O requests to the shared disk (equivalent to adjustment requests), and then the virtualization platform will stop all existing I / O requests for the shared snapshot disk of the shared disk (equivalent to the target operation), and then obtain the location of the shared disk data in the virtual machine memory and the process information involving the shared disk from the virtual machine. The virtualization platform cleans up the data related to the shared disk in the virtual machine memory and ends the process involving the shared disk I / O (equivalent to the target process) and all I / O requests to the shared disk (equivalent to the adjustment request). The purpose is to ensure that after the shared disk is restored to its previous state, there are no factors in the virtual machine that affect the shared disk data. The original shared disk master disk is already in read-only state, and database changes and writes are performed on the snapshot disk (equivalent to the candidate storage space). The shared disk is set to read-write mode, so you only need to redirect I / O to the original snapshot disk and set the original snapshot disk to read-write state to complete the restoration of the shared disk. After the shared disk restoration is completed, the virtualization platform releases all virtual machines' I / O requests to the shared disk, and all virtual machines can restart I / O requests to the shared disk.

[0104] In an exemplary embodiment, a mapping relationship between each virtual machine among the N virtual machines and the i-th candidate storage space indicated by the i-th shared storage space backup data can be established in the following manner, but is not limited to: establishing a mapping relationship between the i-th virtual machine among the N virtual machines and the i-th candidate storage space by executing the following steps: determining an i-th group of storage addresses in the i-th virtual machine for storing data of the i-th virtual machine, and determining a j-th group of storage addresses in the i-th candidate storage space for storing data of the i-th virtual machine; establishing a corresponding relationship between each storage address in the i-th group of storage addresses and each storage address in the j-th group of storage addresses, wherein the i-th virtual machine performs a target operation on the data stored at the t-th storage address in the j-th group of storage addresses corresponding to the s-th storage address by accessing the s-th storage address in the i-th group of storage addresses, and the target operation includes a read operation and / or a write operation.

[0105] Optionally, in this embodiment, each storage address in the i-th group of storage addresses may have, but is not limited to, a one-to-one correspondence with each storage address in the j-th group of storage addresses. It can be understood that an address in the i-th group of storage addresses corresponds to an address in the j-th group of storage addresses.

[0106] In an exemplary embodiment, the target object can be restored to the reference object in accordance with the target recovery method using the target backup data in the following manner, but is not limited to: when the target object type includes a virtual machine type and a storage space type, and the target object includes the shared storage space and a target virtual machine on the virtual machine system, the target object can be restored to the reference object in accordance with the target recovery method using the target backup data by performing the following steps: extracting first backup data corresponding to the target virtual machine from the target backup data, and extracting second backup data corresponding to the shared storage space from the target backup data; using the first backup data to restore the target virtual machine to the backup virtual machine corresponding to the target recovery time, and using the second backup data to restore the shared storage space to the backup storage space corresponding to the target recovery time.

[0107] Optionally, in this embodiment, it is also possible but not limited to first using the first backup data to restore the target virtual machine to the backup virtual machine corresponding to the target recovery time, and then using the second backup data to restore the shared storage space to the backup storage space corresponding to the target recovery time; or, first using the second backup data to restore the shared storage space to the backup storage space corresponding to the target recovery time, and then using the first backup data to restore the target virtual machine to the backup virtual machine corresponding to the target recovery time. This application does not impose any restrictions on this.

[0108] In this way, when both the virtual machines and the shared storage space on the virtual machine system fail, it is possible, but not limited to, to restore the virtual machines first and then restore the shared storage space, or to restore the shared storage space first and then restore the virtual machines, or to restore the shared storage space and the virtual machines at the same time. The virtual machines and shared storage space can be restored in a variety of ways, thereby improving the flexibility of restoring the virtual machines and shared storage space.

[0109] Figure 8 is a schematic diagram of an optional recovery virtual machine and shared storage space according to an embodiment of the present application, such as Figure 8 As shown, first restore the system of the virtual machine that needs to be restored. When restoring the snapshot, first stop all virtual machine systems that use the shared disk from receiving and initiating new I / O operation requests for the shared disk, and existing shared disk I / O requests also stop operating on the shared disk. Clear all data related to the shared disk in the memory of all virtual machines that use the shared disk, end related processes involving the shared disk, and then start restoring the virtual machine system that needs to be restored.

[0110] After the virtual machine system is restored, the virtual machine system will return to a certain point in the past. After the shared disk is snapshotted, the original shared disk master disk is already in a read-only state. Subsequent database changes and writes are performed on the snapshot disk, so you only need to redirect the I / O to the original snapshot disk and set the original snapshot disk to a read-write state. After the shared disk is restored, the virtualization platform releases all virtual machines' I / O requests to the shared disk, and all virtual machines can restart I / O requests to the shared disk.

[0111] In order to better understand the data recovery process in the embodiment of the present application, the data recovery process in the embodiment of the present application is explained and illustrated in combination with optional embodiments below, which can be applicable to but not limited to the embodiment of the present application.

[0112] Fig. 9 is a schematic diagram of an optional data recovery according to an embodiment of the present application, such as Fig. 9 As shown, the virtualization platform records the information of all virtual machines using the shared disk. When a virtual disk is set as a shared disk, all virtual machines using the shared disk will be recorded by the virtualization platform. The purpose is to record which virtual machines use the virtual disk.

[0113] When the virtualization platform needs to generate a snapshot of a virtual machine that uses a shared disk, it will retrieve each virtual machine that uses the shared disk, obtain the location of the shared disk data in the virtual machine's memory and the process information related to the shared disk from each virtual machine, and the virtual machine obtains the location of the shared disk data in the virtual machine's memory and the process information related to the shared disk as required and feeds it back to the virtualization platform. The virtualization platform can use the obtained information to process the shared disk data in the memory according to customer needs to meet the snapshot requirements of different objects such as virtual machines and shared disks. Similarly, when using snapshot restoration for virtual machines that use shared disks, with the help of the virtualization platform's information about virtual machines that use shared disks, different logics can be selected for recovery according to the restoration object.

[0114] When you use the snapshot button to generate a snapshot for a virtual machine, the virtualization platform makes different logical judgments based on whether the virtual machine has a shared disk. If the virtual machine does not use a shared disk, the virtual machine generates a snapshot according to the existing snapshot logic. If the virtual machine has a shared disk, three options are given: snapshot only of the virtual machine system, snapshot only of the shared disk, and snapshot of both the virtual machine system and the shared disk. The user can choose according to actual needs. Each option has corresponding processing logic.

[0115] If a shared disk is used, the system prompts whether to take a snapshot of the virtual machine system or the shared disk. If you choose to take a snapshot of the virtual machine system only, the virtual machine system-related data will be stripped from the virtual machine's memory and snapshots will be taken together with the related processes and the virtual machine's local hard disk. If you choose to take a snapshot of the shared disk, a shared disk snapshot instruction will be issued to all powered-on virtual machines that use the shared disk, and the data of the shared disk in the memory of all virtual machines that use the shared disk will be stripped out and saved together with the related processes, and the shared disk will become read-only, and a new shared snapshot file will be generated. The shared snapshot file information will be sent to all virtual machines that use the shared disk, and new modifications and writes will be made to the shared snapshot file. When restoring a virtual machine using a virtual machine snapshot, if the snapshot is only a snapshot of the virtual machine system (the snapshot does not include the shared disk snapshot and the shared disk memory data and related process information), there will be no related processes and memory data for the shared disk at the moment after the virtual machine system is restored using the snapshot, which is equivalent to the restored virtual machine needing to restart the related I / O operations on the shared disk.

[0116] If you restore a shared disk on a virtual machine that uses a shared disk, a shared disk restore command will be issued to all virtual machines that use the shared disk. The data and processes related to the shared disk in the memory of all virtual machines will be cleared, but the data and processes related to the virtual machine system will be retained. Then, the memory and process data of each virtual machine in the shared disk snapshot will be restored to each virtual machine, and the shared disk data will be restored. Through the above logical mechanism, snapshot generation and restoration of virtual machines with shared disks can be achieved.

[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0118] In this embodiment, a data recovery device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0119] Fig.10 is a structural block diagram of a data recovery device according to an embodiment of the present application, such as Fig.10 As shown, a virtual machine system, a controller, a shared storage space and a backup storage space are deployed on the server. The virtual machines on the virtual machine system share the shared storage space. The backup storage space stores the backup time, virtual machine system backup data and shared storage space backup data with corresponding relationships. The device is applied to the controller, such as Fig.10 As shown, the device comprises:

[0120] A monitoring module 1002, used to monitor faults occurring in the virtual machine system and the shared storage space;

[0121] The detection module 1004 is used to detect the target object type corresponding to the target object and detect the target recovery time corresponding to the reference object to which the target object is allowed to be recovered when a failure occurs in the target object in the virtual machine system and the shared storage space;

[0122] A first extraction module 1006 is used to extract the target backup data corresponding to the target recovery time and conforming to the target object type from the backup time, virtual machine system backup data and shared storage space backup data having a corresponding relationship;

[0123] The recovery module 1008 is configured to restore the target object to the reference object using the target backup data.

[0124] By means of the above-mentioned device, the data of the virtual machine and the data in the shared storage space are backed up in the server respectively. The virtual machines on the virtual machine system and the shared storage space shared by the virtual machines on the virtual machine system may both fail. In such a case, it is possible but not limited to extracting backup data of the object type that matches the failed object from the stored virtual machine system backup data and the shared storage space backup data. In this way, the failure of restoring the virtual machine or shared storage space due to obtaining erroneous backup data is avoided, and the correct backup data is ensured to be obtained. Therefore, the problem of low data recovery efficiency can be solved, thereby achieving the effect of improving data recovery efficiency.

[0125] In an exemplary embodiment, the detection module includes:

[0126] A first extraction unit, configured to extract object description information of the target object, wherein the object description information is used to indicate the target object;

[0127] The screening unit is used to screen the type description information from the object description information, and determine the object type indicated by the type description information as the target object type.

[0128] In an exemplary embodiment, the first extraction module includes:

[0129] A second extraction unit is used to extract candidate virtual machine system backup data and candidate shared storage space backup data corresponding to the target recovery time from the backup time, virtual machine system backup data and shared storage space backup data having a corresponding relationship;

[0130] The third extraction unit is configured to extract target backup data that matches the target object type from the candidate virtual machine system backup data and the candidate shared storage space backup data.

[0131] In an exemplary embodiment, the third extraction unit is used to:

[0132] In a case where the target object type includes a virtual machine type, and the target object includes a target virtual machine on the virtual machine system, extracting the target backup data corresponding to the target virtual machine from the candidate virtual machine system backup data; or

[0133] In a case where the target object type includes a storage space type and the target object includes the shared storage space, determining the candidate shared storage space backup data as the target backup data; or,

[0134] In a case where the target object type includes the virtual machine type and the storage space type, and the target object includes the shared storage space and the target virtual machine on the virtual machine system, the first backup data corresponding to the target virtual machine is extracted from the candidate virtual machine system backup data, and the candidate shared storage space backup data is determined as the second backup data, wherein the target backup data includes the first backup data and the second backup data.

[0135] In an exemplary embodiment, the third extraction unit is further used to:

[0136] Detecting a virtual machine identifier corresponding to the target virtual machine;

[0137] The target backup data corresponding to the virtual machine identifier is extracted from the candidate virtual machine system backup data.

[0138] In an exemplary embodiment, the apparatus further includes: a backup module, which is used to, before the monitoring of the failure occurring in the virtual machine system and the shared storage space, back up the data of the N virtual machines at the i-th backup time when the virtual machine system includes N virtual machines to obtain N virtual machine system backup data, and back up the data of the shared storage space at the i-th backup time to obtain the i-th shared storage space backup data, wherein N is a positive integer greater than or equal to 2, and i is a positive integer;

[0139] The recording module is used to record the i-th backup time, the N virtual machine system backup data and the i-th shared storage space backup data that have a corresponding relationship.

[0140] In an exemplary embodiment, the backup module includes: backing up data of the i-th virtual machine among the N virtual machines at the i-th backup time by executing the following steps to obtain i-th virtual machine system backup data, wherein i is a positive integer less than or equal to N:

[0141] a fourth extraction unit, configured to extract the i-th candidate backup data of the i-th virtual machine at the i-th backup time, wherein the i-th candidate backup data includes the i-th virtual machine system backup data and the i-th virtual machine shared backup data, the i-th virtual machine shared backup data is the backup data of the data corresponding to the i-th virtual machine in the shared storage space, and the i-th virtual machine system backup data is the backup data of the data corresponding to the operating system of the i-th virtual machine at the i-th backup time;

[0142] The processing unit is used to extract the i-th virtual machine system backup data from the i-th candidate backup data, and record the i-th backup time and the system backup data of the i-th virtual machine having a corresponding relationship in the backup storage space.

[0143] In an exemplary embodiment, the processing unit is configured to:

[0144] Extracting the i-th storage address of the i-th virtual machine shared backup data in the i-th candidate backup data;

[0145] The data stored at the i-th storage address in the i-th candidate backup data is deleted to obtain the i-th virtual machine system backup data.

[0146] In an exemplary embodiment, the backup module includes: when the virtual machine system includes N virtual machines, backing up the data of the shared storage space at the i-th backup time by executing the following steps to obtain the i-th shared storage space backup data, wherein N is a positive integer greater than or equal to 2, and i is a positive integer:

[0147] A generating unit, configured to generate a target backup request, and send the target backup request to each of the N virtual machines, wherein the target backup request is used to request to back up the data of the shared storage space at the i-th backup time, and each of the N virtual machines is configured to respond to the received target backup request by writing the updated data of each virtual machine at the i-th backup time that has not been written into the shared storage space into the shared storage space;

[0148] A receiving unit, configured to receive N backup results returned by each of the N virtual machines in response to the target backup request;

[0149] A backup unit, used for backing up reference data of the shared storage space at the i-th backup time when the N backup results are used to indicate that the N virtual machines have all completed writing the updated data corresponding to the i-th backup time but not yet written to the shared storage space into the shared storage space, wherein the reference data is data stored in the shared storage space when the N virtual machines have all completed writing the updated data corresponding to the i-th backup time but not yet written to the shared storage space into the shared storage space.

[0150] In an exemplary embodiment, the backup unit is used to:

[0151] The reference data is set to allow only each virtual machine among the N virtual machines to perform a read operation;

[0152] A candidate storage space corresponding to the shared storage space is generated, wherein the N virtual machines share the candidate storage space, the reference data is stored in the candidate storage space, and the i-th shared storage space backup data includes the candidate storage space.

[0153] In an exemplary embodiment, the backup unit is further used for:

[0154] generating an initial storage space, wherein the initial storage space allows storing the reference data of a target data size;

[0155] Backing up the reference data to the initial storage space to obtain a reference storage space;

[0156] The reference storage space is set to allow the N virtual machines to share, so as to obtain the candidate storage space.

[0157] In an exemplary embodiment, the apparatus further includes: writing the i-th update data requested to be written by the i-th virtual machine among the N virtual machines into the candidate storage space by executing the following steps, where i is a positive integer less than or equal to N, and N is a positive integer greater than or equal to 2:

[0158] a receiving module, configured to receive an i-th adjustment request initiated by the i-th virtual machine after the candidate storage space corresponding to the shared storage space is generated, wherein the i-th adjustment request is used to request that the i-th update data be written into the candidate storage space;

[0159] The first writing module is used to respond to the i-th adjustment request, detect the i-th update storage address of the i-th update data in the candidate storage space, and write the i-th update data into the i-th update storage address.

[0160] In an exemplary embodiment, the apparatus further includes: when the r-th virtual machine among the N virtual machines receives the target backup request, writing the r-th update data corresponding to the r-th virtual machine into the shared storage space by executing the following steps, wherein r is a positive integer less than or equal to N:

[0161] a second extraction module, configured to extract the rth update data generated by the rth virtual machine at the rth time and not yet written into the shared storage space, and detect the rth storage address of the rth update data in the shared storage space, wherein the rth time is the time when the rth virtual machine receives the target backup request;

[0162] The second writing module is used to write the rth update data into the rth storage address.

[0163] In an exemplary embodiment, the recovery module includes:

[0164] A fifth extraction unit, configured to extract a target recovery method corresponding to the target object type from the object types and recovery methods having a corresponding relationship;

[0165] A recovery unit is used to use the target backup data to restore the target object to the reference object according to the target recovery method.

[0166] In an exemplary embodiment, the recovery unit is used to:

[0167] In the case where the virtual machine system includes N virtual machines and the target object type includes a virtual machine type, the following steps are performed to restore an i-th virtual machine among the N virtual machines to an i-th backup virtual machine corresponding to an i-th backup time using the i-th virtual machine system backup data, wherein the target backup data includes the i-th virtual machine system backup data, the target object includes the i-th virtual machine, the i-th virtual machine system backup data is the virtual machine system backup data corresponding to the i-th virtual machine at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N:

[0168] Controlling the i-th virtual machine to stop sending a target adjustment request to the shared storage space, and writing data generated by the i-th virtual machine at the i-th backup time and not yet written into the shared storage space into the shared storage space, wherein the target adjustment request is used to request to perform a target operation on the data in the shared storage space, and the target operation includes a read operation and / or a write operation;

[0169] Upon completion of writing the data generated by the i-th virtual machine at the i-th backup time and not yet written into the shared storage space into the shared storage space, extracting the i-th process data and the i-th operating system data carried in the system backup data of the i-th virtual machine, wherein the i-th process data is used to indicate the i-th group of processes being executed by the i-th virtual machine at the i-th backup time, and the i-th operating system data is used to indicate the data of the operating system of the i-th virtual machine at the i-th backup time;

[0170] According to the i-th process data, the process being executed on the i-th virtual machine is restored to the i-th group of processes, and the data of the operating system of the i-th virtual machine is restored to the i-th operating system data to obtain the i-th backup virtual machine.

[0171] In an exemplary embodiment, the recovery unit is used to: when the virtual machine system includes N virtual machines, the target object type includes a storage space type, and the target object includes the shared storage space, use the i-th shared storage space backup data to restore the shared storage space to the i-th backup shared storage space corresponding to the i-th backup time by performing the following steps, wherein the target object includes the shared storage space, the target recovery time includes the i-th backup time, the target backup data includes the i-th shared storage space backup data, the i-th shared storage space backup data is the shared storage space backup data corresponding to the shared storage space at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N:

[0172] suspending responding to adjustment requests initiated by each of the N virtual machines for requesting to perform a target operation on the data in the shared storage space, wherein the target operation includes a read operation and / or a write operation performed on the data in the shared storage space, and setting each of the N virtual machines to not allow initiation of adjustment requests;

[0173] Deleting data corresponding to each virtual machine in the shared storage space stored in each virtual machine among the N virtual machines, and ending a target process in each virtual machine among the N virtual machines for performing the target operation on the data in the shared storage space;

[0174] A mapping relationship is established between each virtual machine in the N virtual machines and the i-th candidate storage space indicated by the i-th shared storage space backup data, and the data in the i-th candidate storage space is set to allow each virtual machine in the N virtual machines to perform read operations and write operations.

[0175] In an exemplary embodiment, the recovery unit is further used to establish a mapping relationship between the i-th virtual machine among the N virtual machines and the i-th candidate storage space by executing the following steps:

[0176] Determine an i-th group of storage addresses in the i-th virtual machine for storing data of the i-th virtual machine, and determine a j-th group of storage addresses in the i-th candidate storage space for storing data of the i-th virtual machine;

[0177] A correspondence between each storage address in the i-th group of storage addresses and each storage address in the j-th group of storage addresses is established, wherein the i-th virtual machine performs a target operation on the data stored at the t-th storage address in the j-th group of storage addresses corresponding to the s-th storage address by accessing the s-th storage address in the i-th group of storage addresses, and the target operation includes a read operation and / or a write operation.

[0178] In an exemplary embodiment, the recovery unit is further configured to: when the target object type includes a virtual machine type and a storage space type, and the target object includes the shared storage space and a target virtual machine on the virtual machine system, restore the target object to the reference object using the target backup data in the target recovery mode by performing the following steps:

[0179] Extracting first backup data corresponding to the target virtual machine from the target backup data, and extracting second backup data corresponding to the shared storage space from the target backup data;

[0180] The target virtual machine is restored to the backup virtual machine corresponding to the target restoration time using the first backup data, and the shared storage space is restored to the backup storage space corresponding to the target restoration time using the second backup data.

[0181] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0182] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0183] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0184] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0185] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0186] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0187] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0188] An embodiment of the present application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.

[0189] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0190] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0191] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data recovery method, characterized in that: A virtual machine system, a controller, a shared storage space and a backup storage space are deployed on a server. The virtual machines on the virtual machine system share the shared storage space. The backup storage space stores backup time, virtual machine system backup data and shared storage space backup data with corresponding relationships. The method is applied to the controller, and the method includes: Monitoring failures occurring in the virtual machine system and the shared storage space; In the case of monitoring that a failure occurs in the target object in the virtual machine system and the shared storage space, detecting a target object type corresponding to the target object, and detecting a target recovery time corresponding to a reference object to which the target object is allowed to be recovered; Extracting target backup data that corresponds to the target recovery time and conforms to the target object type from the backup time, virtual machine system backup data, and shared storage space backup data that have a corresponding relationship; restoring the target object to the reference object using the target backup data; The step of restoring the target object to the reference object using the target backup data includes: Extracting a target recovery method corresponding to the target object type from object types and recovery methods having a corresponding relationship; Using the target backup data and in accordance with the target recovery method, restore the target object to the reference object; The step of restoring the target object to the reference object using the target backup data according to the target recovery method includes: In the case where the virtual machine system includes N virtual machines and the target object type includes a virtual machine type, the following steps are performed to restore an i-th virtual machine among the N virtual machines to an i-th backup virtual machine corresponding to an i-th backup time using the i-th virtual machine system backup data, wherein the target backup data includes the i-th virtual machine system backup data, the target object includes the i-th virtual machine, the i-th virtual machine system backup data is the virtual machine system backup data corresponding to the i-th virtual machine at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N: Controlling the i-th virtual machine to stop sending a target adjustment request to the shared storage space, and writing data generated by the i-th virtual machine at the i-th backup time and not yet written into the shared storage space into the shared storage space, wherein the target adjustment request is used to request to perform a target operation on the data in the shared storage space, and the target operation includes a read operation and / or a write operation; Upon completion of writing the data generated by the i-th virtual machine at the i-th backup time and not yet written into the shared storage space into the shared storage space, extracting the i-th process data and the i-th operating system data carried in the system backup data of the i-th virtual machine, wherein the i-th process data is used to indicate the i-th group of processes being executed by the i-th virtual machine at the i-th backup time, and the i-th operating system data is used to indicate the data of the operating system of the i-th virtual machine at the i-th backup time; According to the i-th process data, the process being executed on the i-th virtual machine is restored to the i-th group of processes, and the data of the operating system of the i-th virtual machine is restored to the i-th operating system data, so as to obtain the i-th backup virtual machine; Alternatively, the use of the target backup data to restore the target object to the reference object according to the target recovery method includes: when the virtual machine system includes N virtual machines, the target object type includes a storage space type, and the target object includes the shared storage space, by performing the following steps, the i-th shared storage space backup data is used to restore the shared storage space to the i-th backup shared storage space corresponding to the i-th backup time, wherein the target object includes the shared storage space, the target recovery time includes the i-th backup time, the target backup data includes the i-th shared storage space backup data, the i-th shared storage space backup data is the shared storage space backup data corresponding to the shared storage space at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N: suspending responding to adjustment requests initiated by each of the N virtual machines for requesting to perform a target operation on the data in the shared storage space, wherein the target operation includes a read operation and / or a write operation performed on the data in the shared storage space, and setting each of the N virtual machines to not allow initiation of adjustment requests; Deleting data corresponding to each virtual machine in the shared storage space stored in each virtual machine among the N virtual machines, and ending a target process in each virtual machine among the N virtual machines for performing the target operation on the data in the shared storage space; A mapping relationship is established between each virtual machine in the N virtual machines and the i-th candidate storage space indicated by the i-th shared storage space backup data, and the data in the i-th candidate storage space is set to allow each virtual machine in the N virtual machines to perform read operations and write operations.

2. The method according to claim 1, characterized in that: The detecting the target object type corresponding to the target object includes: Extracting object description information of the target object, wherein the object description information is used to indicate the target object; Type description information is filtered from the object description information, and the object type indicated by the type description information is determined as the target object type.

3. The method according to claim 1, characterized in that The step of extracting target backup data that corresponds to the target recovery time and conforms to the target object type from the backup time, virtual machine system backup data, and shared storage space backup data that have a corresponding relationship includes: Extracting candidate virtual machine system backup data and candidate shared storage space backup data corresponding to the target recovery time from the backup times, virtual machine system backup data and shared storage space backup data having corresponding relationships; Target backup data that matches the target object type is extracted from the candidate virtual machine system backup data and the candidate shared storage space backup data.

4. The method according to claim 3, characterized in that The extracting target backup data that meets the target object type from the candidate virtual machine system backup data and the candidate shared storage space backup data includes: In a case where the target object type includes a virtual machine type, and the target object includes a target virtual machine on the virtual machine system, extracting the target backup data corresponding to the target virtual machine from the candidate virtual machine system backup data; or In a case where the target object type includes a storage space type and the target object includes the shared storage space, determining the candidate shared storage space backup data as the target backup data; or, In a case where the target object type includes the virtual machine type and the storage space type, and the target object includes the shared storage space and the target virtual machine on the virtual machine system, the first backup data corresponding to the target virtual machine is extracted from the candidate virtual machine system backup data, and the candidate shared storage space backup data is determined as the second backup data, wherein the target backup data includes the first backup data and the second backup data.

5. The method according to claim 4, characterized in that The extracting the target backup data corresponding to the target virtual machine from the candidate virtual machine system backup data includes: Detecting a virtual machine identifier corresponding to the target virtual machine; The target backup data corresponding to the virtual machine identifier is extracted from the candidate virtual machine system backup data.

6. The method according to claim 1, characterized in that Before monitoring the failures occurring in the virtual machine system and the shared storage space, the method further includes: In the case where the virtual machine system includes N virtual machines, backing up the data of the N virtual machines at the i-th backup time to obtain N virtual machine system backup data, and backing up the data of the shared storage space at the i-th backup time to obtain the i-th shared storage space backup data, wherein N is a positive integer greater than or equal to 2, and i is a positive integer; The i-th backup time, the N virtual machine system backup data, and the i-th shared storage space backup data having a corresponding relationship are recorded.

7. The method according to claim 6, characterized in that The step of backing up the data of the N virtual machines at the i-th backup time to obtain the N virtual machine system backup data comprises: backing up the data of the i-th virtual machine among the N virtual machines at the i-th backup time to obtain the i-th virtual machine system backup data by executing the following steps, wherein i is a positive integer less than or equal to N: Extracting the i-th candidate backup data of the i-th virtual machine at the i-th backup time, wherein the i-th candidate backup data includes the i-th virtual machine system backup data and the i-th virtual machine shared backup data, the i-th virtual machine shared backup data is the backup data of the data corresponding to the i-th virtual machine in the shared storage space, and the i-th virtual machine system backup data is the backup data of the data corresponding to the operating system of the i-th virtual machine at the i-th backup time; The i-th virtual machine system backup data is extracted from the i-th candidate backup data, and the i-th backup time and the system backup data of the i-th virtual machine having a corresponding relationship are recorded in the backup storage space.

8. The method according to claim 7, characterized in that The extracting the i-th virtual machine system backup data from the i-th candidate backup data includes: Extracting the i-th storage address of the i-th virtual machine shared backup data in the i-th candidate backup data; The data stored at the i-th storage address in the i-th candidate backup data is deleted to obtain the i-th virtual machine system backup data.

9. The method according to claim 6, characterized in that The step of backing up the data of the shared storage space at the i-th backup time to obtain the i-th shared storage space backup data comprises: when the virtual machine system includes N virtual machines, backing up the data of the shared storage space at the i-th backup time to obtain the i-th shared storage space backup data by performing the following steps, wherein N is a positive integer greater than or equal to 2, and i is a positive integer: Generate a target backup request, and send the target backup request to each virtual machine among the N virtual machines, wherein the target backup request is used to request to back up the data of the shared storage space at the i-th backup time, and each virtual machine among the N virtual machines is configured to respond to the received target backup request and write the updated data of each virtual machine at the i-th backup time that has not been written into the shared storage space into the shared storage space; Receiving N backup results returned by each of the N virtual machines in response to the target backup request; When the N backup results are used to indicate that the N virtual machines have all completed writing the updated data corresponding to the i-th backup time that has not yet been written to the shared storage space into the shared storage space, the reference data of the shared storage space at the i-th backup time is backed up, wherein the reference data is the data stored in the shared storage space when the N virtual machines have all completed writing the updated data corresponding to the i-th backup time that has not yet been written to the shared storage space into the shared storage space.

10. The method according to claim 9, characterized in that The backing up the reference data of the shared storage space at the i-th backup time includes: The reference data is set to allow only each virtual machine among the N virtual machines to perform a read operation; A candidate storage space corresponding to the shared storage space is generated, wherein the N virtual machines share the candidate storage space, the reference data is stored in the candidate storage space, and the i-th shared storage space backup data includes the candidate storage space.

11. The method according to claim 10, characterized in that The generating the candidate storage space corresponding to the shared storage space includes: generating an initial storage space, wherein the initial storage space allows storing the reference data of a target data size; Backing up the reference data to the initial storage space to obtain a reference storage space; The reference storage space is set to allow the N virtual machines to share, so as to obtain the candidate storage space.

12. The method according to claim 10, characterized in that After generating the candidate storage space corresponding to the shared storage space, the method further includes: writing the i-th update data requested to be written by the i-th virtual machine among the N virtual machines into the candidate storage space by executing the following steps, where i is a positive integer less than or equal to N, and N is a positive integer greater than or equal to 2: receiving an i-th adjustment request initiated by the i-th virtual machine, wherein the i-th adjustment request is used to request that the i-th update data be written into the candidate storage space; In response to the i-th adjustment request, an i-th update storage address of the i-th update data in the candidate storage space is detected, and the i-th update data is written into the i-th update storage address.

13. The method according to claim 9, characterized in that The method further includes: when the rth virtual machine among the N virtual machines receives the target backup request, writing the rth update data corresponding to the rth virtual machine into the shared storage space by executing the following steps, wherein r is a positive integer less than or equal to N: Extracting the rth update data generated by the rth virtual machine at the rth time and not yet written into the shared storage space, and detecting the rth storage address of the rth update data in the shared storage space, wherein the rth time is the time when the rth virtual machine receives the target backup request; The rth update data is written into the rth storage address.

14. The method according to claim 1, characterized in that The establishing of a mapping relationship between each virtual machine in the N virtual machines and the i-th candidate storage space indicated by the i-th shared storage space backup data comprises: establishing a mapping relationship between the i-th virtual machine in the N virtual machines and the i-th candidate storage space by executing the following steps: Determine an i-th group of storage addresses in the i-th virtual machine for storing data of the i-th virtual machine, and determine a j-th group of storage addresses in the i-th candidate storage space for storing data of the i-th virtual machine; A correspondence between each storage address in the i-th group of storage addresses and each storage address in the j-th group of storage addresses is established, wherein the i-th virtual machine performs a target operation on the data stored at the t-th storage address in the j-th group of storage addresses corresponding to the s-th storage address by accessing the s-th storage address in the i-th group of storage addresses, and the target operation includes a read operation and / or a write operation.

15. The method according to claim 1, characterized in that The using the target backup data to restore the target object to the reference object in the target recovery mode includes: when the target object type includes a virtual machine type and a storage space type, and the target object includes the shared storage space and a target virtual machine on the virtual machine system, restoring the target object to the reference object in the target recovery mode by using the target backup data by performing the following steps: Extracting first backup data corresponding to the target virtual machine from the target backup data, and extracting second backup data corresponding to the shared storage space from the target backup data; The target virtual machine is restored to the backup virtual machine corresponding to the target restoration time using the first backup data, and the shared storage space is restored to the backup storage space corresponding to the target restoration time using the second backup data.

16. A data recovery device, characterized in that: A virtual machine system, a controller, a shared storage space and a backup storage space are deployed on a server. The virtual machines on the virtual machine system share the shared storage space. The backup storage space stores backup time, virtual machine system backup data and shared storage space backup data with corresponding relationships. The device is applied to the controller and includes: A monitoring module, used for monitoring faults occurring in the virtual machine system and the shared storage space; A detection module, configured to detect a target object type corresponding to the target object and a target recovery time corresponding to a reference object to which the target object is allowed to be recovered when a failure of the target object in the virtual machine system and the shared storage space is detected; A first extraction module is used to extract the target backup data corresponding to the target recovery time and conforming to the target object type from the backup time, virtual machine system backup data and shared storage space backup data having a corresponding relationship; a recovery module, configured to restore the target object to the reference object using the target backup data; Wherein, the recovery module includes: A fifth extraction unit, configured to extract a target recovery method corresponding to the target object type from the object types and recovery methods having a corresponding relationship; A recovery unit, configured to use the target backup data to restore the target object to the reference object in the target recovery mode; Wherein, the recovery unit is used for: In the case where the virtual machine system includes N virtual machines and the target object type includes a virtual machine type, the following steps are performed to restore an i-th virtual machine among the N virtual machines to an i-th backup virtual machine corresponding to an i-th backup time using the i-th virtual machine system backup data, wherein the target backup data includes the i-th virtual machine system backup data, the target object includes the i-th virtual machine, the i-th virtual machine system backup data is the virtual machine system backup data corresponding to the i-th virtual machine at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N: Controlling the i-th virtual machine to stop sending a target adjustment request to the shared storage space, and writing data generated by the i-th virtual machine at the i-th backup time and not yet written into the shared storage space into the shared storage space, wherein the target adjustment request is used to request to perform a target operation on the data in the shared storage space, and the target operation includes a read operation and / or a write operation; Upon completion of writing the data generated by the i-th virtual machine at the i-th backup time and not yet written into the shared storage space into the shared storage space, extracting the i-th process data and the i-th operating system data carried in the system backup data of the i-th virtual machine, wherein the i-th process data is used to indicate the i-th group of processes being executed by the i-th virtual machine at the i-th backup time, and the i-th operating system data is used to indicate the data of the operating system of the i-th virtual machine at the i-th backup time; According to the i-th process data, the process being executed on the i-th virtual machine is restored to the i-th group of processes, and the data of the operating system of the i-th virtual machine is restored to the i-th operating system data, so as to obtain the i-th backup virtual machine; Alternatively, the recovery unit is used to: when the virtual machine system includes N virtual machines, the target object type includes a storage space type, and the target object includes the shared storage space, use the i-th shared storage space backup data to restore the shared storage space to the i-th backup shared storage space corresponding to the i-th backup time by performing the following steps, wherein the target object includes the shared storage space, the target recovery time includes the i-th backup time, the target backup data includes the i-th shared storage space backup data, the i-th shared storage space backup data is the shared storage space backup data corresponding to the shared storage space at the i-th backup time, N is a positive integer greater than or equal to 2, and i is a positive integer less than or equal to N: suspending responding to adjustment requests initiated by each of the N virtual machines for requesting to perform a target operation on the data in the shared storage space, wherein the target operation includes a read operation and / or a write operation performed on the data in the shared storage space, and setting each of the N virtual machines to not allow initiation of adjustment requests; Deleting data corresponding to each virtual machine in the shared storage space stored in each virtual machine among the N virtual machines, and ending a target process in each virtual machine among the N virtual machines for performing the target operation on the data in the shared storage space; A mapping relationship is established between each virtual machine in the N virtual machines and the i-th candidate storage space indicated by the i-th shared storage space backup data, and the data in the i-th candidate storage space is set to allow each virtual machine in the N virtual machines to perform read operations and write operations.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 15 when executed by a processor.

18. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 15 are implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 15 are implemented.

Citation Information

Patent Citations

  • Data restoration method and apparatus

    CN107544868A

  • Data center active-active implementation method

    CN112003716A

  • Data backup recovery method, system and equipment based on object storage and medium

    CN116610498A

  • Data backup method and device, equipment and storage medium

    CN116610500A