Emergency method, device and equipment for virtual machine recovery interruption and storage medium
By acquiring the current and backup disk sets of virtual machines, creating snapshots, and rolling back to the snapshot state in the event of an agent machine failure, the problem of virtual machine recovery interruption is solved, improving the reliability and fault tolerance of virtual machine recovery, and ensuring data integrity and business continuity.
Patent Information
- Application Number
- CN202511041517.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-10-28
AI Technical Summary
Existing virtual machine recovery solutions are prone to interruption when faced with unpredictable factors such as network outages, server power failures, or natural disasters. This can result in virtual machines being in an incomplete or unusable state, data corruption, and business interruption.
By obtaining the current disk set and backup disk set of the virtual machine to be restored, a snapshot is created, and in the event of an agent machine failure, the snapshot state is rolled back to restore the configuration data state, ensuring the reversibility of the recovery process.
It improves the reliability and fault tolerance of virtual machine recovery, and ensures the integrity of virtual machine data and business continuity.
Smart Images

Figure CN120849020A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data recovery technology, and more specifically, to an emergency method, apparatus, device, and storage medium for virtual machine recovery interruption. Background Technology
[0002] With the development of virtualization technology, FusionCompute platform, as a mainstream virtualization platform, is widely used in enterprise data centers. The critical business it supports has extremely high requirements for virtual machine disaster recovery capabilities.
[0003] If the existing solution encounters unforeseen factors such as network interruption, server power failure, or natural disasters during the recovery process, the recovery may be interrupted, potentially leaving the virtual machine in an incomplete or unusable state, damaging the original data, and causing business interruption.
[0004] Based on this, how can we design a fault-tolerant virtual machine recovery method to improve the reliability and fault tolerance of virtual machine recovery, and ensure the integrity of virtual machine data and business continuity? Summary of the Invention
[0005] In view of the above problems, this application provides an emergency method, apparatus, device and storage medium for virtual machine recovery interruption, so as to improve the reliability and fault tolerance of virtual machine recovery and ensure the integrity of virtual machine data and business continuity.
[0006] To achieve the above objectives, the following specific solutions are proposed:
[0007] An emergency method for virtual machine recovery from interruption, applied to an agent machine, includes:
[0008] In response to the recovery command of the virtual machine to be recovered, the set of currently mounted disks of the virtual machine to be recovered, the configuration data of the virtual machine to be recovered, and the set of backup disks of the virtual machine to be recovered are obtained.
[0009] Create a snapshot of the current set of disks;
[0010] Based on the current disk set and the backup disk set, the virtual machine to be restored is backed up and restored. If the backup and restoration is interrupted due to an abnormality of the agent machine, the virtual machine to be restored that has not completed the backup and restoration will be rolled back to the state corresponding to the snapshot and restored to the state of the configuration data when the agent machine recovers.
[0011] Optionally, based on the current disk set and the backup disk set, the virtual machine to be recovered is backed up and restored, including:
[0012] Based on the current disk set and the backup disk set, calculate the first disk difference set to be deleted and the second disk difference set to be created during the disk recovery process;
[0013] The virtual machine to be recovered is backed up and restored based on the first disk difference set and the second disk difference set.
[0014] Optionally, the virtual machine to be recovered is backed up and restored based on the first disk difference set and the second disk difference set, including:
[0015] In the current disk set, the first disk difference set is deleted to obtain the intermediate target disk set;
[0016] In the intermediate target disk set, a second disk difference set is created to obtain the target disk set;
[0017] Read the disk backup data of each disk in the backup disk set, and write the disk backup data to each disk in the target disk set;
[0018] Read the virtual machine backup metadata that was backed up at the backup time in the backup disk set, and adjust the configuration of the virtual machine to be recovered according to the virtual machine backup metadata to complete the backup recovery of the virtual machine to be recovered.
[0019] Optionally, the step of rolling back the virtual machine to be restored that has not yet completed the backup and recovery to the state corresponding to the snapshot, and restoring it to the state of the configuration data, includes:
[0020] Delete the set of disk replicas newly added during the backup and recovery process, and create a second set of disk replicas that has been deleted from the set of disks corresponding to the snapshot, to obtain the recovery disk set, wherein the set of disk replicas is created synchronously when the second disk set is created;
[0021] Roll back each disk in the recovery disk set to the disk data state of the disk set corresponding to the snapshot;
[0022] Adjust the configuration parameters of the virtual machine to be restored to the configuration data corresponding to the snapshot.
[0023] Optionally, the method further includes:
[0024] If the backup recovery fails or succeeds, the system will prompt the user whether to perform a rollback operation.
[0025] In response to the user's confirmation of the rollback operation, the steps of rolling back the virtual machine to be restored that has not completed the backup to the state corresponding to the snapshot, and restoring it to the state of the configuration data are executed.
[0026] Optionally, after backing up and restoring the virtual machine to be recovered based on the current disk set and the backup disk set, the method further includes:
[0027] The system displays a message indicating whether the backup and recovery process was successful or failed.
[0028] Optionally, after backing up and restoring the virtual machine to be recovered based on the current disk set and the backup disk set, the method further includes:
[0029] Delete the snapshot, or delete the snapshot in response to a user's action of deleting the snapshot.
[0030] An emergency device for resuming virtual machine interruption, applied to an agent machine, the device comprising:
[0031] The disk set acquisition unit is used to acquire, in response to the recovery command of the virtual machine to be recovered, the current disk set currently mounted on the virtual machine to be recovered, the configuration data of the virtual machine to be recovered, and the backup disk set pre-backed up by the virtual machine to be recovered;
[0032] A snapshot creation unit is used to create a snapshot of the current disk set;
[0033] A backup and recovery unit is used to perform backup and recovery on the virtual machine to be recovered based on the current disk set and the backup disk set, wherein the backup and recovery unit includes a rollback unit;
[0034] The rollback unit is used to roll back the virtual machines that have not completed the backup recovery to the state corresponding to the snapshot and restore them to the state of the configuration data when the agent machine recovers normally if the backup recovery is interrupted due to an abnormality of the agent machine.
[0035] Optionally, the backup and recovery unit includes:
[0036] The disk difference calculation unit is used to calculate, based on the current disk set and the backup disk set, the first disk difference set to be deleted and the second disk difference set to be created during the disk recovery process;
[0037] The disk difference recovery unit is used to perform backup and recovery of the virtual machine to be recovered based on the first disk difference set and the second disk difference set.
[0038] Optionally, the disk differential recovery unit includes:
[0039] The difference set deletion unit is used to delete the first disk difference set in the current disk set to obtain an intermediate target disk set;
[0040] The difference set creation unit is used to create the second disk difference set in the intermediate target disk set to obtain the target disk set;
[0041] The disk backup and recovery unit is used to read the disk backup data of each disk in the backup disk set and write the disk backup data to each disk in the target disk set;
[0042] The virtual machine backup and recovery unit is used to read the virtual machine backup metadata that was backed up at the backup time in the backup disk set, and adjust the configuration of the virtual machine to be recovered according to the virtual machine backup metadata to complete the backup and recovery of the virtual machine to be recovered.
[0043] Optionally, the rollback unit includes:
[0044] The disk rollback unit is used to delete the set of disk copies newly added during the backup and recovery process, and to create a second set of disk copies that have been deleted from the set of disk copies corresponding to the snapshot, thereby obtaining a set of recoverable disk copies, wherein the set of disk copies is created synchronously when the second set of disk copies is created;
[0045] The disk data rollback unit is used to roll back each disk of the recovery disk set to the disk data state of the disk set corresponding to the snapshot;
[0046] The virtual machine rollback and recovery unit is used to adjust the configuration parameters of the virtual machine to be recovered to the configuration data corresponding to the snapshot.
[0047] Optionally, the device may also include:
[0048] The rollback prompt unit is used to prompt whether to perform a rollback operation after the backup recovery fails or succeeds.
[0049] A rollback execution unit is used to execute the rollback unit in response to a user's instruction to confirm the execution of the rollback operation.
[0050] Optionally, the device may also include:
[0051] The backup and recovery success elevation unit is used to display a prompt message indicating whether the backup and recovery execution was successful or failed after backing up and recovering the virtual machine to be recovered based on the current disk set and the backup disk set.
[0052] Optionally, the device may also include:
[0053] The snapshot deletion unit is used to delete the snapshot after backing up and restoring the virtual machine to be restored based on the current disk set and the backup disk set, or to delete the snapshot in response to a user's operation to delete the snapshot.
[0054] An emergency device for virtual machine recovery from interruption includes a memory and a processor;
[0055] The memory is used to store programs;
[0056] The processor is used to execute the program to implement the various steps of the emergency method for virtual machine recovery interruption as described above.
[0057] A storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the emergency method for virtual machine recovery interruption as described above.
[0058] By employing the above technical solution, this application, in response to the recovery command of the virtual machine to be recovered, obtains the current set of disks currently mounted on the virtual machine to be recovered, the set of backup disks pre-backed up by the virtual machine to be recovered, and the configuration data of the virtual machine to be recovered. It then creates snapshots of the current set of disks and the backup disk sets, and performs backup and recovery of the virtual machine to be recovered based on the current set of disks and the backup disk sets. If a backup and recovery is interrupted due to an agent machine malfunction, the virtual machine to be recovered, which was not fully backed up and recovered, is rolled back to the state corresponding to the snapshot when the agent machine recovers. This restores the virtual machine to the state consistent with the state before backup and recovery when backup and recovery is interrupted, thus ensuring the reversibility of the entire recovery process, improving the reliability and fault tolerance of virtual machine recovery, and guaranteeing the integrity of virtual machine data and business continuity. Attached Figure Description
[0059] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0060] Figure 1 This is a schematic diagram illustrating a process for emergency response to virtual machine recovery interruption provided in an embodiment of this application;
[0061] Figure 2 A schematic diagram of a device structure for emergency response to virtual machine recovery interruption provided in an embodiment of this application;
[0062] Figure 3 This is a schematic diagram of a device for emergency response to virtual machine recovery interruptions, provided as an embodiment of this application. Detailed Implementation
[0063] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0064] The solution proposed in this application can be implemented based on a terminal with data processing capabilities, which can be a proxy machine. Specifically, the proxy machine can perform disk operation recovery on behalf of the virtual machine, enabling automated execution of virtual machine recovery.
[0065] Next, combined Figure 1 The emergency method for virtual machine recovery interruption described in this application may include the following steps:
[0066] Step S110: In response to the recovery command of the virtual machine to be recovered, obtain the current set of disks currently mounted on the virtual machine to be recovered, the configuration data of the virtual machine to be recovered, and the set of backup disks that the virtual machine to be recovered has been backed up in advance.
[0067] In this process, while obtaining the set of backup disks for the virtual machine to be restored, the backup metadata of the virtual machine to be restored is also obtained. The backup metadata can represent the backup configuration parameters of the virtual machine to be restored at the time of backup of the set of backup disks, so as to ensure the consistency of data during backup and restoration.
[0068] Specifically, the recovery command for the virtual machine to be recovered can be provided by the user. When a user needs to recover a virtual machine, they can send the recovery command to the agent. After receiving the recovery command, the agent can obtain and record the configuration information of the virtual machine to be recovered, as well as all disks currently mounted on the virtual machine, by calling the interface provided by the FusionCompute cloud platform. The agent can also obtain the configuration data and status data of the virtual machine to be recovered at the time of backup from the backup system, as well as the disk set and backup data of each disk at that time.
[0069] Understandably, by obtaining the configuration information and current disk status of the virtual machine to be recovered, the current state of the virtual machine to be recovered can be clearly identified, laying the foundation for calculating the set of disks to be added and deleted, and ensuring that the recovery operation is targeted.
[0070] Step S120: Create a snapshot of the current disk set.
[0071] A snapshot can represent a copy of the current disk set, recording the number of disks in the current disk set and the data on each disk.
[0072] Understandably, when an unexpected event occurs during the recovery process of a virtual machine by the agent, causing an interruption or preventing the recovery from being completed, snapshots can serve as a reversibility guarantee in this situation. They can quickly restore the disk to its pre-recovery state, avoiding data corruption or abnormal state. Furthermore, snapshots completely record the current disk state, ensuring that the rollback operation accurately restores the original data and preventing data loss due to disk deletion, writing new data, or other operations during the recovery process. Combining snapshots ensures that the virtual machine to be recovered is only in one of two clearly defined states during the recovery process: "before recovery" or "recovery successful," eliminating intermediate abnormal states and improving system reliability.
[0073] Step S130: Based on the current disk set and the backup disk set, perform backup and recovery on the virtual machine to be recovered. If the backup and recovery is interrupted due to an agent machine malfunction, the virtual machine to be recovered that has not completed backup and recovery will be rolled back to the state corresponding to the snapshot and restored to the state of the configuration data when the agent machine recovers.
[0074] Understandably, the backup and recovery task of the virtual machine to be recovered involves restoring the current disks and their configuration data to the state at the time of backup. The agent machine needs to perform calculations on the disks to be deleted and added. During this process, the agent machine may malfunction due to some reason (network interruption, server power failure, natural disaster, etc.), causing an interruption in the recovery process. At this time, the agent machine may have deleted / partially deleted / not deleted the disks to be deleted, or it may have added / partially added / not added the disks to be added, or all disks may have been deleted and created but not written or only partially written with backup data. In this case of uncertain recovery extent, it is necessary to use snapshots to roll back each disk of the virtual machine to be recovered that is currently not fully backed up to the state corresponding to the snapshot, and to restore the virtual machine to be recovered to the state of the configuration data, so that the state of the virtual machine to be recovered is the same as before the backup and recovery.
[0075] The emergency method for virtual machine recovery interruption provided in this embodiment responds to the recovery command of the virtual machine to be recovered, obtains the current set of disks currently mounted on the virtual machine to be recovered, and the set of backup disks pre-backed up by the virtual machine to be recovered, creates a snapshot of the current set of disks and the configuration data of the virtual machine to be recovered, and performs backup and recovery of the virtual machine to be recovered based on the current set of disks and the set of backup disks. If the backup and recovery is interrupted due to an agent machine malfunction, the virtual machine to be recovered that was not fully backed up will be rolled back to the state corresponding to the snapshot when the agent machine recovers. Therefore, when backup and recovery is interrupted, the snapshot is used to restore the virtual machine to a consistent state before backup and recovery, thereby ensuring the reversibility of the entire recovery process, improving the reliability and fault tolerance of virtual machine recovery, and ensuring the integrity of virtual machine data and business continuity.
[0076] In some embodiments of this application, the process of backing up and restoring a virtual machine to be restored based on the current disk set and the backup disk set, as mentioned in the above embodiments, is described. This process may include:
[0077] S1. Based on the current disk set and the backup disk set, calculate the first disk difference set to be deleted and the second disk difference set to be created during the disk recovery process.
[0078] Specifically, the first disk difference can represent the set of disks that exist in the virtual machine currently being restored but did not exist during the backup; these disks need to be deleted during the backup and recovery process. The second disk difference can represent the set of disks identified from the backup state that do not exist in the current virtual machine; these disks need to be created / added during the backup and recovery process.
[0079] S2. Based on the first disk difference set and the second disk difference set, perform backup and recovery on the virtual machine to be recovered.
[0080] Specifically, during the backup and recovery process of the virtual machine to be recovered, it is necessary to add or delete certain disks to restore the current disk set to the backup disk set. This includes deleting the first disk difference set and the second disk difference set. The specific process may include:
[0081] S21. In the current disk set, delete the first disk difference set to obtain the intermediate target disk set.
[0082] It is understandable that if the intersection of the current disk set and the backup disk set is empty, the intermediate target disk set is an empty set; otherwise, the intermediate target disk set can represent a disk set that contains some or all of the disks in the backup disk set, which means that the intermediate target disk set is a subset of the backup disk set.
[0083] S22. In the intermediate target disk set, create a second disk difference set to obtain the target disk set.
[0084] Specifically, the intermediate target disk set is supplemented with a set of disks identified from the backup state that do not exist in the current virtual machine. In other words, the intermediate target disk set is added to the backup disk set to make the target disk set the same as the backup disk set.
[0085] Furthermore, during the creation of the second disk difference set, a disk replica set can be created synchronously in real time. For example, if the agent machine creates the second disk difference set {A, B, C} serially, after creating disk A, the disk replica set will be {A}. After creating disk B, B can be added to the disk replica set to get {A, B}. After creating disk C, C can be added to the disk replica set to get {A, B, C}.
[0086] Understandably, when an unexpected event occurs during the creation of the second disk difference set, the agent machine can automatically roll back during recovery by combining snapshots with the disk copy set, thereby improving the reliability and fault tolerance of virtual machine recovery.
[0087] S23. Read the disk backup data of each disk in the backup disk set and write the disk backup data to each disk in the target disk set.
[0088] It is understandable that after deleting the first disk difference set and creating the second disk difference set, the target disk set is the same as the backup disk set at the time of backup. Therefore, the disk backup data corresponds one-to-one with each disk in the target disk set, so the read disk backup data can be written to each disk in the target disk set.
[0089] S24. Read the virtual machine backup metadata that was backed up at the backup time in the backup disk set, and adjust the configuration of the virtual machine to be restored according to the virtual machine backup metadata to complete the backup and restoration of the virtual machine to be restored.
[0090] Specifically, the configuration of the virtual machine to be restored can include memory size, computing specifications, graphics card type, network card settings, etc. After the backup configuration of the virtual machine to be restored is completed, the disk information, data information of each disk, and the virtual machine's own configuration parameters are all the same as those of the virtual machine to be restored at the time of backup, which means that the backup and restoration of the virtual machine to be restored is complete.
[0091] In some embodiments of this application, when a backup and recovery is interrupted or fails due to an agent machine malfunction, and the agent machine recovers normally, the process of rolling back the virtual machine to be restored to the state corresponding to the snapshot, as mentioned in the above embodiments, and restoring it to the state of the configuration data, is described. This process may include:
[0092] S1. Delete the set of disk copies newly added during the backup and recovery process, and create a second set of disk copies that has been deleted from the set of disks corresponding to the snapshot, to obtain the set of disks to be recovered.
[0093] Understandably, since the backup and recovery process was unexpectedly interrupted and involved adding / deleting disks, the extent of these additions / deletions is unclear after the interruption. Furthermore, considering the agent machine's memory limitations prevent frequent snapshot recording during the backup and recovery process, it's necessary to restore the virtual machine's state to its pre-backup and recovery state. Specifically, this can be achieved by deleting the set of disk copies added during the backup and recovery process and creating a second set of disk copies that were deleted from the set of disks corresponding to the snapshots, thus obtaining the recovery disk set. The recovery disk set can represent the set of disks the virtual machine was on before the backup and recovery, i.e., the "current disk set."
[0094] The disk replica set is created synchronously when the second disk difference set is created.
[0095] S2. Roll back each disk in the recovery disk set to the disk data state of the disk set corresponding to the snapshot.
[0096] Understandably, since the backup and recovery process was unexpectedly interrupted, it's unclear whether the disk data has been altered after the recovery. Therefore, it's necessary to restore the state of the virtual machine to be recovered to its state before the backup and recovery. Since the recovery disk set is the same as the disk set of the virtual machine before the backup and recovery, each disk in the recovery disk set can be rolled back according to the disk data state of the disk set corresponding to the snapshot.
[0097] S3. Adjust the configuration parameters of the virtual machine to be restored to the configuration data corresponding to the snapshot.
[0098] Understandably, due to an unexpected interruption of backup and recovery, it's unclear whether the configuration parameters of the virtual machine to be recovered have been changed after the interruption is resolved. Therefore, it's necessary to restore the virtual machine's state to its state before the backup and recovery. The configuration parameters of the virtual machine to be recovered can be adjusted to match the configuration data corresponding to the snapshot. This enables fault-tolerant recovery of the virtual machine in the event of an unexpected interruption or failure of backup and recovery, preventing data loss, allowing normal business operations to continue, and ensuring virtual machine data integrity and business continuity.
[0099] To improve the reliability and operability of virtual machine recovery interruptions, the disk and data rollback mechanism can be manually controlled by the user. Specifically, the emergency method for virtual machine recovery interruptions provided in this application may also include:
[0100] S1. If the backup and restore fails, or if the backup and restore succeeds, prompt whether to perform a rollback operation.
[0101] For example, when the agent machine continuously performs backup and restore but ultimately fails, a prompt box "Perform rollback operation?" is displayed to ask the user whether to continue rolling back the virtual machine to be restored. As another example, when the agent machine continuously performs backup and restore but ultimately succeeds, a prompt box "Perform rollback operation?" is displayed to ask the user whether to continue rolling back the virtual machine to be restored.
[0102] When the backup and recovery process is completed and a success or failure result is obtained, the agent can display a message indicating whether the backup and recovery was successful or failed, to inform the user that the agent has completed the backup and recovery process.
[0103] S2. In response to the user's confirmation of the rollback operation, execute the steps mentioned in the foregoing embodiments to roll back the virtual machine to be restored that has not been fully backed up to the state corresponding to the snapshot, and restore it to the state of the configuration data.
[0104] Understandably, after the backup and recovery are completed, by asking the user whether to roll back, the user can decide whether to roll back based on the actual recovery effect. This makes the rollback operation of the virtual machine to be recovered more flexible and improves the reliability and operability of virtual machine recovery interruption.
[0105] Considering that snapshots contain various disk data of the virtual machine to be restored, which may consume a large amount of memory on the agent machine, to alleviate the memory pressure on the agent machine, snapshots can be deleted after each backup and restore is completed, thereby reducing the possibility of backup and restore being interrupted due to the agent machine's own reasons. Based on this, the emergency method for virtual machine recovery interruption provided in this application may also include:
[0106] Delete snapshot.
[0107] Specifically, the proxy server can automatically delete the snapshot after the backup and restore are completed, in order to release the large amount of memory currently occupied by the proxy server.
[0108] In addition, it can also delete snapshots in response to user actions to delete snapshots.
[0109] Specifically, snapshots can be deleted based on user instructions. Understandably, users need to confirm the state of the virtual machine to be restored. Once the user confirms that the restored virtual machine state meets expectations and that no rollback operation is necessary, the snapshot is deleted, ensuring the rigor of the virtual machine recovery interruption emergency plan.
[0110] The following describes the apparatus for emergency response to virtual machine recovery interruption provided in the embodiments of this application. The apparatus for emergency response to virtual machine recovery interruption described below can be referred to in correspondence with the emergency response method for virtual machine recovery interruption described above.
[0111] See Figure 2 , Figure 2 This is a schematic diagram of an emergency device structure for resuming virtual machine recovery from interruption, as disclosed in an embodiment of this application.
[0112] like Figure 2 As shown, the device may include:
[0113] The disk set acquisition unit 10 is used to acquire, in response to the recovery command of the virtual machine to be recovered, the current disk set currently mounted on the virtual machine to be recovered, the configuration data of the virtual machine to be recovered, and the backup disk set pre-backed up by the virtual machine to be recovered;
[0114] Snapshot creation unit 20 is used to create a snapshot of the current disk set;
[0115] Backup and recovery unit 30 is used to perform backup and recovery on the virtual machine to be recovered based on the current disk set and the backup disk set, wherein the backup and recovery unit includes a rollback unit 31;
[0116] The rollback unit 31 is used to roll back the virtual machine to be restored to the state corresponding to the snapshot and to the state of the configuration data when the agent machine recovers normally if the backup recovery is interrupted due to the abnormality of the agent machine.
[0117] Optionally, the backup and recovery unit includes:
[0118] The disk difference calculation unit is used to calculate, based on the current disk set and the backup disk set, the first disk difference set to be deleted and the second disk difference set to be created during the disk recovery process;
[0119] The disk difference recovery unit is used to perform backup and recovery of the virtual machine to be recovered based on the first disk difference set and the second disk difference set.
[0120] Optionally, the disk differential recovery unit includes:
[0121] The difference set deletion unit is used to delete the first disk difference set in the current disk set to obtain an intermediate target disk set;
[0122] The difference set creation unit is used to create the second disk difference set in the intermediate target disk set to obtain the target disk set;
[0123] The disk backup and recovery unit is used to read the disk backup data of each disk in the backup disk set and write the disk backup data to each disk in the target disk set;
[0124] The virtual machine backup and recovery unit is used to read the virtual machine backup metadata that was backed up at the backup time in the backup disk set, and adjust the configuration of the virtual machine to be recovered according to the virtual machine backup metadata to complete the backup and recovery of the virtual machine to be recovered.
[0125] Optionally, the rollback unit includes:
[0126] The disk rollback unit is used to delete the set of disk copies newly added during the backup and recovery process, and to create a second set of disk copies that have been deleted from the set of disk copies corresponding to the snapshot, thereby obtaining a set of recoverable disk copies, wherein the set of disk copies is created synchronously when the second set of disk copies is created;
[0127] The disk data rollback unit is used to roll back each disk of the recovery disk set to the disk data state of the disk set corresponding to the snapshot;
[0128] The virtual machine rollback and recovery unit is used to adjust the configuration parameters of the virtual machine to be recovered to the configuration data corresponding to the snapshot.
[0129] Optionally, the device may also include:
[0130] The rollback prompt unit is used to prompt whether to perform a rollback operation after the backup recovery fails or succeeds.
[0131] A rollback execution unit is used to execute the rollback unit in response to a user's instruction to confirm the execution of the rollback operation.
[0132] Optionally, the device may also include:
[0133] The backup and recovery success elevation unit is used to display a prompt message indicating whether the backup and recovery execution was successful or failed after backing up and recovering the virtual machine to be recovered based on the current disk set and the backup disk set.
[0134] Optionally, the device may also include:
[0135] The snapshot deletion unit is used to delete the snapshot after backing up and restoring the virtual machine to be restored based on the current disk set and the backup disk set, or to delete the snapshot in response to a user's operation to delete the snapshot.
[0136] The emergency device for virtual machine recovery interruption provided in this application embodiment can be applied to emergency devices for virtual machine recovery interruption, such as agent machines. Optionally, Figure 3 This diagram shows the hardware structure of an emergency device for resuming virtual machine recovery from interruption. (Refer to...) Figure 3 The hardware structure of an emergency device for virtual machine recovery interruption may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4.
[0137] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0138] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0139] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0140] The memory stores a program, which the processor can call. The program is used for:
[0141] In response to the recovery command of the virtual machine to be recovered, the set of currently mounted disks of the virtual machine to be recovered, the configuration data of the virtual machine to be recovered, and the set of backup disks of the virtual machine to be recovered are obtained.
[0142] Create a snapshot of the current disk set;
[0143] Based on the current disk set and the backup disk set, the virtual machine to be restored is backed up and restored. If the backup and restoration is interrupted due to an agent machine malfunction, the virtual machine to be restored that has not completed the backup and restoration will be rolled back to the state corresponding to the snapshot and restored to the state of the configuration data when the agent machine recovers.
[0144] Optionally, the refined and extended functions of the program can be found in the description above.
[0145] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor, the program being used for:
[0146] In response to the recovery command of the virtual machine to be recovered, the set of currently mounted disks of the virtual machine to be recovered, the configuration data of the virtual machine to be recovered, and the set of backup disks of the virtual machine to be recovered are obtained.
[0147] Create a snapshot of the current disk set;
[0148] Based on the current disk set and the backup disk set, the virtual machine to be restored is backed up and restored. If the backup and restoration is interrupted due to an agent machine malfunction, the virtual machine to be restored that has not completed the backup and restoration will be rolled back to the state corresponding to the snapshot and restored to the state of the configuration data when the agent machine recovers.
[0149] Optionally, the refined and extended functions of the program can be found in the description above.
[0150] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0151] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0152] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An emergency method for resuming virtual machine recovery from interruption, characterized in that, Applied to a proxy machine, the method includes: In response to the recovery command of the virtual machine to be recovered, the set of currently mounted disks of the virtual machine to be recovered, the configuration data of the virtual machine to be recovered, and the set of backup disks of the virtual machine to be recovered are obtained. Create a snapshot of the current disk set; Based on the current disk set and the backup disk set, the virtual machine to be restored is backed up and restored. If the backup and restoration is interrupted due to an abnormality of the agent machine, the virtual machine to be restored that has not completed the backup and restoration will be rolled back to the state corresponding to the snapshot and restored to the state of the configuration data when the agent machine recovers.
2. The method according to claim 1, characterized in that, Based on the current disk set and the backup disk set, the virtual machine to be recovered is backed up and restored, including: Based on the current disk set and the backup disk set, calculate the first disk difference set to be deleted and the second disk difference set to be created during the disk recovery process; The virtual machine to be recovered is backed up and restored based on the first disk difference set and the second disk difference set.
3. The method according to claim 2, characterized in that, Based on the first disk difference set and the second disk difference set, the virtual machine to be recovered is backed up and restored, including: In the current disk set, the first disk difference set is deleted to obtain the intermediate target disk set; In the intermediate target disk set, a second disk difference set is created to obtain the target disk set; Read the disk backup data of each disk in the backup disk set, and write the disk backup data to each disk in the target disk set; Read the virtual machine backup metadata that was backed up at the backup time in the backup disk set, and adjust the configuration of the virtual machine to be recovered according to the virtual machine backup metadata to complete the backup recovery of the virtual machine to be recovered.
4. The method according to claim 3, characterized in that, The step of rolling back the virtual machine to be restored that has not completed the backup restoration to the state corresponding to the snapshot, and restoring it to the state of the configuration data, includes: Delete the set of disk replicas newly added during the backup and recovery process, and create a second set of disk replicas that has been deleted from the set of disks corresponding to the snapshot, to obtain the recovery disk set, wherein the set of disk replicas is created synchronously when the second disk set is created; Roll back each disk in the recovery disk set to the disk data state of the disk set corresponding to the snapshot; Adjust the configuration parameters of the virtual machine to be restored to the configuration data corresponding to the snapshot.
5. The method according to claim 1, characterized in that, Also includes: If the backup recovery fails or succeeds, the system will prompt the user whether to perform a rollback operation. In response to the user's confirmation of the rollback operation, the steps of rolling back the virtual machine to be restored that has not completed the backup to the state corresponding to the snapshot, and restoring it to the state of the configuration data are executed.
6. The method according to any one of claims 1-5, characterized in that, After backing up and restoring the virtual machine to be recovered based on the current disk set and the backup disk set, the process further includes: The system displays a message indicating whether the backup and recovery process was successful or failed.
7. The method according to any one of claims 1-5, characterized in that, After backing up and restoring the virtual machine to be recovered based on the current disk set and the backup disk set, the process further includes: Delete the snapshot, or delete the snapshot in response to a user's action of deleting the snapshot.
8. An emergency device for resuming virtual machine interruption, characterized in that, Applied to a proxy machine, the device includes: The disk set acquisition unit is used to acquire, in response to the recovery command of the virtual machine to be recovered, the current disk set currently mounted on the virtual machine to be recovered, the configuration data of the virtual machine to be recovered, and the backup disk set pre-backed up by the virtual machine to be recovered; A snapshot creation unit is used to create a snapshot of the current disk set; A backup and recovery unit is used to perform backup and recovery on the virtual machine to be recovered based on the current disk set and the backup disk set, wherein the backup and recovery unit includes a rollback unit; The rollback unit is used to roll back the virtual machines that have not completed the backup recovery to the state corresponding to the snapshot and restore them to the state of the configuration data when the agent machine recovers normally if the backup recovery is interrupted due to an abnormality of the agent machine.
9. An emergency device for resuming virtual machine interruption, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the emergency method for virtual machine recovery interruption as described in any one of claims 1-7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the emergency method for virtual machine recovery interruption as described in any one of claims 1-7.
Citation Information
Patent Citations
System and method for realizing cross-cloud rapid recovery of virtual machine based on cloud platform volume
CN112506616A
Virtual machine increment recovery method and device, computer equipment and storage medium
CN117493074A
Data recovery method, computer equipment, storage medium and program product
CN118708406A
Data recovery method and electronic device
WO2024021861A1