A method, apparatus, device, and storage medium for consistent backup of virtual machines.

By using an agent to create snapshots of virtual machine volumes at the same time in the OpenStack environment, and dividing the member set by tenant isolation unit to process backups in parallel, the inconsistency problem of cross-tenant isolation unit data protection is solved, and efficient and secure data recovery is achieved.

CN120849019BActive Publication Date: 2026-03-13GUANGZHOU DINGJIA COMPUTER TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In the OpenStack environment, existing technologies cannot achieve data protection for virtual machine volumes across tenant isolation units, leading to inconsistent data recovery and service anomalies in multi-tenant environments.

Method used

A single agent machine creates snapshots of virtual machine volumes in all tenant isolation units at the same time, divides member sets according to tenant isolation units, logs into the target tenant isolation unit to create backup volumes, and mounts and transfers backup volumes to storage devices in parallel.

Benefits of technology

It achieves data recovery consistency across tenant isolation units, avoids service anomalies, improves backup efficiency and resource utilization, and reduces operational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120849019B_ABST
    Figure CN120849019B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and storage medium for consistent backup of virtual machines. The method includes: responding to an instruction to perform consistent backup of several virtual machines to be backed up, creating a snapshot of the volume of each virtual machine to be backed up at the current moment; adding the virtual machines to be backed up to their corresponding tenant isolation units according to the tenant isolation units to which they belong; logging into the target tenant isolation unit corresponding to the tenant isolation unit of the tenant isolation unit; creating backup volumes for each virtual machine to be backed up in the tenant isolation unit based on the snapshots; mounting all the backup volumes of the virtual machines to be backed up; and transferring all the backup volumes to the storage device. Therefore, by aggregating the volumes of all virtual machines to be backed up and creating snapshots at the same time, when mounting backups for each virtual machine volume, there will be no application data inconsistency due to time differences, resulting in strong consistency and thus avoiding service anomalies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data recovery technology, and more specifically, to a method, apparatus, device, and storage medium for consistent backup of virtual machines. Background Technology

[0002] With the development of virtualization technology, the amount of virtual machine data is increasing day by day, making data protection for virtual machines crucial.

[0003] In an OpenStack environment, virtual machines are backed up on a per-volume basis. Existing methods typically execute backups via single-volume snapshots, and the backup process itself usually executes correctly, generating recoverable data. The results of the backup process appear normal. For example, a single-volume snapshot can successfully store data, and the virtual machine can boot after recovery, leading users or operations personnel to believe the backup is effective. However, this "normality" only reflects the integrity of the data within a single volume. Whether the logical relationships between volumes are consistent cannot be determined by a simple backup success or failure; it can only be revealed through actual business operations.

[0004] Current virtual machine data protection is typically limited by the boundaries of tenant isolation units (TIUs), which are either projects or domains. This prevents cross-project and cross-domain data protection and makes it difficult to meet the implementation requirements of complex backup strategies in multi-tenant environments. Therefore, a single agent can only perform data backups on virtual machine volumes within a single tenant isolation unit. Backing up virtual machine volumes across multiple tenant isolation units requires multiple agent units. Furthermore, even when multiple agent units back up all virtual machine volumes, consistency across all volumes cannot be guaranteed, leading to inconsistencies or service anomalies after data recovery.

[0005] How to back up virtual machine volumes of all tenant isolation units through a single agent machine, ensuring data recovery consistency and avoiding service anomalies, is an issue that needs attention. Summary of the Invention

[0006] In view of the above problems, this application provides a method, apparatus, device and storage medium for consistent backup of virtual machines, so as to achieve backup of virtual machine volumes of all tenant isolation units through a single agent, ensuring the consistency of data recovery and avoiding service anomalies.

[0007] To achieve the above objectives, the following specific solutions are proposed:

[0008] A consistent backup method for virtual machines, applied to an agent machine, includes:

[0009] In response to an instruction to perform a consistent backup of several virtual machines to be backed up, a snapshot of the volume of each virtual machine to be backed up is created at the current moment.

[0010] For each virtual machine to be backed up, the virtual machine to be backed up is added to its corresponding virtual machine member set according to the tenant isolation unit to which it belongs; wherein, each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit.

[0011] For each set of virtual machine members to be backed up, log in to the target tenant isolation unit corresponding to the set of virtual machine members to be backed up, and under the target tenant isolation unit, create backup volumes for each virtual machine to be backed up in the set of virtual machine members to be backed up based on the snapshot;

[0012] Mount the backup volumes of all virtual machines to be backed up and transfer all backup volumes to the storage device.

[0013] Optionally, in response to an instruction to perform a consistent backup of several virtual machines to be backed up, creating a snapshot of the volume of each virtual machine to be backed up at the current moment includes:

[0014] In response to an instruction to perform a consistent backup of several virtual machines to be backed up, for each virtual machine to be backed up, a volume list of the virtual machine to be backed up is obtained, and a volume set of the virtual machine to be backed up is created based on the volumes in the volume list.

[0015] Add the collection of volumes of each virtual machine to be backed up to the pre-created volume group used to store the volumes of the virtual machines;

[0016] Create a snapshot of the volume group at the current moment.

[0017] Optionally, based on the snapshot, create backup volumes for each virtual machine in the virtual machine member set to be backed up, including:

[0018] Filter out the snapshot volume information of each virtual machine to be backed up in the virtual machine member set to be backed up from the snapshot;

[0019] Based on the snapshot volume information, create backup volumes for each virtual machine in the virtual machine member set to be backed up.

[0020] Optionally, for each set of virtual machines to be backed up, logging into the target tenant isolation unit corresponding to the set of virtual machines to be backed up, and creating backup volumes for each virtual machine in the set of virtual machines to be backed up based on the snapshot within the target tenant isolation unit, includes:

[0021] Log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up in parallel;

[0022] Under each target tenant isolation unit, based on the snapshot, backup volumes for each virtual machine to be backed up in the virtual machine member set corresponding to that target tenant isolation unit are created in parallel.

[0023] The process of mounting the backup volumes of all virtual machines to be backed up and transferring all backup volumes to the storage device includes:

[0024] The backup volumes of each virtual machine to be backed up are mounted in parallel within the member set of each virtual machine to be backed up, and the mounted backup volumes are transferred to the storage device in real time until all backup volumes have been transferred.

[0025] Optionally, the method further includes:

[0026] After all backup volumes in each virtual machine member set to be backed up have been transferred to the storage device, the mount of all backup volumes in that virtual machine member set to be backed up is removed, and all backup volumes in that virtual machine member set to be backed up are deleted.

[0027] A consistent backup device for virtual machines, applied to an agent machine, includes:

[0028] The consistent snapshot creation unit is used to create a snapshot of the volume of each virtual machine to be backed up at the current moment in response to an instruction to perform a consistent backup of several virtual machines to be backed up.

[0029] The member set partitioning unit is used to add each virtual machine to be backed up to its corresponding virtual machine member set according to the tenant isolation unit to which the virtual machine to be backed up belongs; wherein, each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit.

[0030] A consistent backup volume creation unit is used to log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up, and create backup volumes for each virtual machine in the virtual machine member set to be backed up based on the snapshot under the target tenant isolation unit.

[0031] Mount storage units are used to mount the backup volumes of all virtual machines to be backed up and transfer all backup volumes to the storage device.

[0032] Optionally, the consistent snapshot creation unit includes:

[0033] The volume information collection unit is used to respond to the instruction to perform a consistent backup of several virtual machines to be backed up, and for each virtual machine to be backed up, obtain the volume list of the virtual machine to be backed up, and create a volume set of the virtual machine to be backed up based on the volumes in the volume list.

[0034] The volume addition unit is used to add the set of volumes of each virtual machine to be backed up to a pre-created volume group for storing virtual machine volumes.

[0035] A snapshot creation unit is used to create a snapshot of the volume group at the current moment.

[0036] Optionally, the consistent backup volume creation unit includes:

[0037] The snapshot volume information filtering unit is used to log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up, and filter out the snapshot volume information of each virtual machine to be backed up in the snapshot of the virtual machine member set to be backed up.

[0038] The backup volume creation unit is used to create backup volumes for each virtual machine to be backed up in the virtual machine member set based on the snapshot volume information.

[0039] Optionally, the consistent backup volume creation unit includes:

[0040] The parallel login unit is used to log in to the target tenant isolation unit corresponding to each set of virtual machines to be backed up in parallel.

[0041] The backup volume parallel creation unit is used to create backup volumes for each virtual machine to be backed up in parallel under each target tenant isolation unit, based on the snapshot;

[0042] The mounted storage unit includes:

[0043] The parallel mounting storage unit is used to mount the backup volumes of each virtual machine to be backed up in the member set of each virtual machine to be backed up in parallel, and to transfer the mounted backup volumes to the storage device in real time until all backup volumes have been transferred.

[0044] Optionally, the device may also include:

[0045] The unmount unit is used to unmount all backup volumes in each virtual machine member set to be backed up after all backup volumes have been transferred to the storage device.

[0046] The Delete Backup Volume unit is used to delete all backup volumes in the member set of the virtual machine to be backed up.

[0047] A consistent backup device for virtual machines, comprising memory and a processor;

[0048] The memory is used to store programs;

[0049] The processor is used to execute the program to implement the various steps of the virtual machine consistent backup method described above.

[0050] A storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the consistent backup method for virtual machines as described above.

[0051] By employing the above technical solution, this application, in response to an instruction to perform a consistent backup of several virtual machines to be backed up, creates a snapshot of the volume of each virtual machine to be backed up at the current moment. For each virtual machine to be backed up, based on the tenant isolation unit to which it belongs, the virtual machine to be backed up is added to its corresponding virtual machine member set. Each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit. For each virtual machine member set, the application logs into the target tenant isolation unit corresponding to the virtual machine member set. Under the target tenant isolation unit, backup volumes for each virtual machine to be backed up in the virtual machine member set are created based on the snapshot, all backup volumes are mounted, and all backup volumes are transferred to the storage device. Therefore, by aggregating the volumes of all virtual machines to be backed up and creating snapshots at the same time, strong consistency is achieved when mounting backups for each virtual machine volume, preventing application data from becoming out of sync due to time differences, thus avoiding service anomalies. Attached Figure Description

[0052] 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:

[0053] Figure 1 A schematic diagram illustrating a process for implementing consistent backup of virtual machines, provided in an embodiment of this application;

[0054] Figure 2 A schematic diagram of a device structure illustrating a process for implementing consistent backup of virtual machines, provided in an embodiment of this application;

[0055] Figure 3 This is a schematic diagram of the structure of a device that illustrates a process for implementing consistent backup of virtual machines, as provided in an embodiment of this application. Detailed Implementation

[0056] 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 skilled in the art without creative effort are within the scope of protection of this application.

[0057] This solution can be implemented using a terminal with data processing capabilities, which can be a proxy machine. Specifically, the proxy machine can be deployed on an OpenStack cloud platform. A backup user can be created on the OpenStack cloud platform, and this backup user has management privileges within the target tenant isolation unit. The tenant isolation unit can be a domain or a project. The proxy machine can be used for mounting, backing up, and transferring storage data to virtual machine volumes.

[0058] Next, combined Figure 1 The consistent backup method for virtual machines described in this application may include the following steps:

[0059] Step S110: In response to the instruction to perform a consistent backup of several virtual machines to be backed up, create a snapshot of the volume of each virtual machine to be backed up at the current moment.

[0060] Understandably, this step achieves atomic point-in-time synchronization by performing snapshot operations on all volumes of several virtual machines to be backed up at the current moment, ensuring that the snapshot times of all volumes within the snapshot are consistent, and that the snapshots of each volume will not have logical errors due to time asynchrony.

[0061] Step S120: For each virtual machine to be backed up, add the virtual machine to be backed up to its corresponding virtual machine member set according to the tenant isolation unit to which the virtual machine to be backed up belongs.

[0062] Each set of virtual machines to be backed up can contain all virtual machines to be backed up under a single tenant isolation unit. One set of virtual machines to be backed up corresponds to one tenant isolation unit, and different sets of virtual machines to be backed up correspond to different tenant isolation units. Therefore, step S120 is equivalent to classifying all virtual machines to be backed up according to their respective tenant isolation units.

[0063] Understandably, in the OpenStack cloud platform, the tenant isolation unit is a core resource isolation mechanism, and resources from different tenants typically have strict access permission boundaries. This step ensures that subsequent backup operations (such as login and data transfer) are performed only within the corresponding tenant's permission scope by dividing the virtual machine member set to be backed up by tenant isolation unit. Grouping by tenant isolation unit allows for precise matching of permission scopes, avoiding unauthorized access and ensuring data security and isolation in a multi-tenant environment.

[0064] Step S130: For each set of virtual machine members to be backed up, log in to the target tenant isolation unit corresponding to the set of virtual machine members to be backed up. Under the target tenant isolation unit, create backup volumes for each virtual machine to be backed up in the set of virtual machine members based on the snapshot.

[0065] Specifically, the agent can log in as the backup user to the target tenant isolation unit corresponding to each set of virtual machines to be backed up. In the OpenStack cloud platform, the agent can use the command "openstack volume create –snapshot snap vol" to create backup volumes based on snapshots for all volumes of each virtual machine in the set of virtual machines to be backed up.

[0066] Understandably, since the data of each virtual machine volume in the snapshot is recorded at the same time, the backup volume created based on the snapshot will not cause application data to be out of sync due to time difference, thus achieving data consistency backup across domains / projects.

[0067] Step S140: Mount the backup volumes of all virtual machines to be backed up and transfer all backup volumes to the storage device.

[0068] Specifically, the agent can mount each backup volume in parallel. After each backup volume is mounted, it is transferred to the storage device until all backup volumes are transferred to the storage device, thereby completing the backup of all virtual machines to be backed up at the same time.

[0069] The consistent backup method for virtual machines provided in this embodiment, in response to an instruction to perform a consistent backup of several virtual machines to be backed up, creates a snapshot of the volume of each virtual machine to be backed up at the current moment. For each virtual machine to be backed up, according to the tenant isolation unit to which it belongs, the virtual machine to be backed up is added to its corresponding virtual machine member set. Each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit. For each virtual machine member set, the method logs into the target tenant isolation unit corresponding to the virtual machine member set. Under the target tenant isolation unit, backup volumes for each virtual machine to be backed up in the virtual machine member set are created based on the snapshot. All backup volumes of the virtual machines to be backed up are mounted and transferred to the storage device. Therefore, by aggregating the volumes of all virtual machines to be backed up and creating snapshots at the same time, strong consistency is achieved when mounting backups for each virtual machine volume, preventing application data from becoming out of sync due to time differences, thus avoiding service anomalies.

[0070] In some embodiments of this application, the process of creating a snapshot of the volume of each virtual machine to be backed up at the current moment in response to the instruction to perform a consistent backup of a plurality of virtual machines to be backed up is described. This process may include:

[0071] S111. In response to the instruction to perform a consistent backup of several virtual machines to be backed up, for each virtual machine to be backed up, obtain a volume list of the virtual machine to be backed up, and create a volume set of the virtual machine to be backed up based on the volumes in the volume list.

[0072] Specifically, when the agent receives an instruction to perform a consistent backup of several virtual machines to be backed up, it can obtain the volume list of each virtual machine to be backed up through the OpenStack cloud platform interface. The volume set corresponding to the N virtual machines to be backed up can be denoted as volume1, volume2, ..., volumeN.

[0073] At this point, the volume sets obtained by the agent are all volume indexes, and the volume data of each virtual machine to be backed up is still being updated and changed according to the operation of its respective virtual machine.

[0074] S112. Add the volume sets of each virtual machine to be backed up to the pre-created volume group used to store the virtual machine volumes.

[0075] Understandably, the purpose of this step is to aggregate the volumes of virtual machines to be backed up across tenant isolation units (domains / projects).

[0076] In the OpenStack cloud platform, the pre-creation process of volume groups can be performed using the command "openstackconsistency group create --name vg --volume-type volume_type" to create a consistent volume group named vg and specify the volume type of the volumes within it as volume_type.

[0077] S113. Create a snapshot of the volume group at the current moment.

[0078] It is understandable that when a snapshot of a volume group is created at the current moment, the volume data of all virtual machines to be backed up is recorded in the current state. Therefore, the snapshot time of all volumes within the snapshot is consistent, and there will be no logical errors in the snapshots of each volume due to time asynchrony.

[0079] Specifically, in the OpenStack cloud platform, you can use the command `openstack consistency groupsnapshot create --consistency-group vg snap` to create a consistency snapshot group named `snap` as a snapshot.

[0080] In some embodiments of this application, the process of creating backup volumes for each virtual machine in the virtual machine member set to be backed up based on snapshots, as mentioned in the above embodiments, is described. This process may include:

[0081] S1 filters out the snapshot volume information of each virtual machine to be backed up in the virtual machine member set.

[0082] It is understandable that the snapshot contains the volume information of all virtual machines to be backed up, that is, it contains the volume information of each virtual machine to be backed up except the current virtual machine to be backed up member set. Therefore, it is necessary to filter out the volume information of each virtual machine to be backed up in the current virtual machine to be backed up member set.

[0083] S2. Create backup volumes for each virtual machine to be backed up in the virtual machine member set based on the snapshot volume information.

[0084] Understandably, creating backup volumes using the filtered snapshot volume information of each virtual machine in the current virtual machine member set ensures that the created backup volumes correspond correctly to each virtual machine in the current virtual machine member set, further preventing the use of snapshot volume information of virtual machines in other virtual machine member sets for backup volume creation, thus guaranteeing the accuracy of backup volume creation.

[0085] In some embodiments of this application, the process of step S130 above, which involves logging into the target tenant isolation unit corresponding to each virtual machine member set to be backed up, and creating backup volumes for each virtual machine in the virtual machine member set based on snapshots within the target tenant isolation unit, is described. This process may include:

[0086] S131. Log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up in parallel.

[0087] Specifically, the agent can use the backup user to log in to the target tenant isolation unit.

[0088] Understandably, the agent can simultaneously initiate backup processes within different tenant isolation units, avoiding process blockages caused by serial logins and significantly reducing overall backup time in multi-tenant scenarios. This is particularly suitable for large cloud platforms containing a large number of tenant isolation units. Since the backup user is an administrator role granted to each target tenant isolation unit, possessing full cross-tenant operation permissions, unified parallel login via the backup user ensures that backup operations within all tenant isolation units adhere to the same permission boundaries and operational standards. This avoids issues such as inconsistent permissions and chaotic operation processes caused by multiple user logins, reduces the risk of human error, and guarantees the standardization of cross-tenant backups.

[0089] S132. Under each target tenant isolation unit, based on snapshots, create backup volumes for each virtual machine to be backed up in parallel within the virtual machine member set corresponding to that target tenant isolation unit.

[0090] Understandably, for multiple virtual machines within the same tenant isolation unit, parallel creation of backup volumes can handle the snapshot generation and backup volume creation processes of multiple volumes simultaneously, avoiding the time accumulation caused by processing them sequentially. This significantly shortens the backup cycle within a single tenant isolation unit. Especially in scenarios where the tenant contains a large number of virtual machines or volumes, it can greatly improve overall backup efficiency and reduce the time spent on business system resources.

[0091] Based on this, the process of step S140 of the aforementioned embodiment, which involves mounting backup volumes of all virtual machines to be backed up and transferring all backup volumes to the storage device, will be described. This process may include:

[0092] S141. Parallel mount the backup volumes of each virtual machine to be backed up in the member set of each virtual machine to be backed up, and transfer the mounted backup volumes to the storage device in real time until all backup volumes have been transferred.

[0093] Understandably, by mounting multiple backup volumes simultaneously and transmitting data in real time, the time accumulation caused by serial mounting and one-by-one transmission is avoided. Especially in scenarios with a large number of virtual machines to be backed up and large volume capacity, the total backup process time can be significantly reduced, the time occupied by cloud platform resources can be reduced, and the impact on business operations can be reduced.

[0094] Because centralized backup is achieved using only one agent machine, parallel operations can efficiently utilize the agent machine's computing, network, and I / O resources. For example, while one volume is transferring data, other volumes can be mounted and prepared for transfer in parallel, avoiding the waste of idle resources (such as network bandwidth and CPU) during single-threaded processing and improving the resource utilization of the agent virtual machine.

[0095] Real-time transmission ensures that data transmission begins immediately after the backup volume is mounted, reducing intermediate waiting time and minimizing the possibility of the backup volume occupying storage resources for too long due to delayed transmission after mounting.

[0096] Considering that the backup volumes mounted on the agent machine consume a significant amount of memory, to alleviate the pressure on the agent machine's memory resources, the backup volumes of each virtual machine member set to be backed up can be unmounted and deleted after the backup transfer is completed. This reduces the possibility of the agent machine interrupting the backup process due to excessive memory load. Based on this, the virtual machine consistency backup scheme provided in this application may further include:

[0097] After all backup volumes in each virtual machine member set to be backed up have been transferred to the storage device, unmount all backup volumes in that virtual machine member set to be backed up and delete all backup volumes in that virtual machine member set to be backed up.

[0098] It's understandable that backup volumes are temporary resources created based on snapshots, used solely for data transfer. As backup tasks increase, temporary volumes continuously occupy storage space, and the cumulative number of mount points can lead to a decrease in agent virtual machine I / O performance. This resource waste is amplified, especially in multi-tenant, large-volume scenarios. Timely unmounting and deletion of backup volumes can promptly release the storage resources they occupy. Furthermore, residual backup volumes and mount relationships increase the complexity of cloud platform resource management. For example, undeleted backup volumes may be accidentally remounted or modified, and unremoved mount relationships may cause resource conflicts when agent virtual machines restart. Timely cleanup of backup volumes maintains the simplicity of agent machine resource status, reduces potential faults caused by redundant resources, and lowers the difficulty for operations personnel to troubleshoot resource usage issues.

[0099] The apparatus for implementing consistent backup of virtual machines provided in the embodiments of this application will be described below. The apparatus for implementing consistent backup of virtual machines described below can be referred to in correspondence with the method for implementing consistent backup of virtual machines described above.

[0100] See Figure 2 , Figure 2 This is a schematic diagram of a device structure for implementing consistent backup of virtual machines, as disclosed in an embodiment of this application.

[0101] like Figure 2 As shown, the device may include:

[0102] The consistent snapshot creation unit 11 is used to create a snapshot of the volume of each virtual machine to be backed up at the current moment in response to an instruction to perform a consistent backup of several virtual machines to be backed up.

[0103] Member set partitioning unit 12 is used to add each virtual machine to be backed up to its corresponding virtual machine member set according to the tenant isolation unit to which the virtual machine to be backed up belongs; wherein, each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit.

[0104] The consistent backup volume creation unit 13 is used to log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up, and create backup volumes for each virtual machine in the virtual machine member set to be backed up based on the snapshot under the target tenant isolation unit.

[0105] Mount storage unit 14 is used to mount the backup volumes of all virtual machines to be backed up and transfer all backup volumes to the storage device.

[0106] Optionally, the consistent snapshot creation unit includes:

[0107] The volume information collection unit is used to respond to the instruction to perform a consistent backup of several virtual machines to be backed up, and for each virtual machine to be backed up, obtain the volume list of the virtual machine to be backed up, and create a volume set of the virtual machine to be backed up based on the volumes in the volume list.

[0108] The volume addition unit is used to add the set of volumes of each virtual machine to be backed up to a pre-created volume group for storing virtual machine volumes.

[0109] A snapshot creation unit is used to create a snapshot of the volume group at the current moment.

[0110] Optionally, the consistent backup volume creation unit includes:

[0111] The snapshot volume information filtering unit is used to log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up, and filter out the snapshot volume information of each virtual machine to be backed up in the snapshot of the virtual machine member set to be backed up.

[0112] The backup volume creation unit is used to create backup volumes for each virtual machine to be backed up in the virtual machine member set based on the snapshot volume information.

[0113] Optionally, the consistent backup volume creation unit includes:

[0114] The parallel login unit is used to log in to the target tenant isolation unit corresponding to each set of virtual machines to be backed up in parallel.

[0115] The backup volume parallel creation unit is used to create backup volumes for each virtual machine to be backed up in parallel under each target tenant isolation unit, based on the snapshot;

[0116] The mounted storage unit includes:

[0117] The parallel mounting storage unit is used to mount the backup volumes of each virtual machine to be backed up in the member set of each virtual machine to be backed up in parallel, and to transfer the mounted backup volumes to the storage device in real time until all backup volumes have been transferred.

[0118] Optionally, the device may also include:

[0119] The unmount unit is used to unmount all backup volumes in each virtual machine member set to be backed up after all backup volumes have been transferred to the storage device.

[0120] The Delete Backup Volume unit is used to delete all backup volumes in the member set of the virtual machine to be backed up.

[0121] The virtual machine consistency backup apparatus provided in this application embodiment can be applied to devices for virtual machine consistency backup, such as agent machines. Optionally, Figure 3 The diagram shows the hardware structure of the device for consistent backup of virtual machines. (Refer to...) Figure 3 The hardware structure of a device for consistent backup of virtual machines 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.

[0122] 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;

[0123] 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.

[0124] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;

[0125] The memory stores a program, which the processor can call. The program is used for:

[0126] In response to an instruction to perform a consistent backup of several virtual machines to be backed up, a snapshot of the volume of each virtual machine to be backed up is created at the current moment.

[0127] For each virtual machine to be backed up, the virtual machine to be backed up is added to its corresponding virtual machine member set according to the tenant isolation unit to which it belongs; wherein, each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit.

[0128] For each set of virtual machine members to be backed up, log in to the target tenant isolation unit corresponding to the set of virtual machine members to be backed up, and under the target tenant isolation unit, create backup volumes for each virtual machine to be backed up in the set of virtual machine members to be backed up based on the snapshot;

[0129] Mount the backup volumes of all virtual machines to be backed up and transfer all backup volumes to the storage device.

[0130] Optionally, the refined and extended functions of the program can be found in the description above.

[0131] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor, the program being used for:

[0132] In response to an instruction to perform a consistent backup of several virtual machines to be backed up, a snapshot of the volume of each virtual machine to be backed up is created at the current moment.

[0133] For each virtual machine to be backed up, the virtual machine to be backed up is added to its corresponding virtual machine member set according to the tenant isolation unit to which it belongs; wherein, each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit.

[0134] For each set of virtual machine members to be backed up, log in to the target tenant isolation unit corresponding to the set of virtual machine members to be backed up, and under the target tenant isolation unit, create backup volumes for each virtual machine to be backed up in the set of virtual machine members to be backed up based on the snapshot;

[0135] Mount the backup volumes of all virtual machines to be backed up and transfer all backup volumes to the storage device.

[0136] Optionally, the refined and extended functions of the program can be found in the description above.

[0137] 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.

[0138] 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.

[0139] 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. A method for consistent backup of virtual machines, characterized in that, Applied to agent machines, including: In response to an instruction to perform a consistent backup of several virtual machines to be backed up, a snapshot of the volume of each virtual machine to be backed up is created at the current moment. For each virtual machine to be backed up, the virtual machine to be backed up is added to its corresponding virtual machine member set according to the tenant isolation unit to which it belongs; wherein, each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit. For each set of virtual machine members to be backed up, log in to the target tenant isolation unit corresponding to the set of virtual machine members to be backed up, and under the target tenant isolation unit, create backup volumes for each virtual machine to be backed up in the set of virtual machine members to be backed up based on the snapshot; Mount the backup volumes of all virtual machines to be backed up and transfer all backup volumes to the storage device; For each set of virtual machines to be backed up, logging into the target tenant isolation unit corresponding to that set, and creating backup volumes for each virtual machine in the set based on the snapshot within that target tenant isolation unit, includes: Log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up in parallel; Under each target tenant isolation unit, based on the snapshot, backup volumes for each virtual machine to be backed up in the virtual machine member set corresponding to that target tenant isolation unit are created in parallel. The process of mounting the backup volumes of all virtual machines to be backed up and transferring all backup volumes to the storage device includes: The backup volumes of each virtual machine to be backed up are mounted in parallel within the member set of each virtual machine to be backed up, and the mounted backup volumes are transferred to the storage device in real time until all backup volumes have been transferred.

2. The method according to claim 1, characterized in that, The step of responding to an instruction to perform a consistent backup of several virtual machines to be backed up, and creating a snapshot of the volume of each virtual machine to be backed up at the current moment, includes: In response to an instruction to perform a consistent backup of several virtual machines to be backed up, for each virtual machine to be backed up, a volume list of the virtual machine to be backed up is obtained, and a volume set of the virtual machine to be backed up is created based on the volumes in the volume list. Add the collection of volumes of each virtual machine to be backed up to the pre-created volume group used to store the volumes of the virtual machines; Create a snapshot of the volume group at the current moment.

3. The method according to claim 1, characterized in that, Based on the snapshot, create backup volumes for each virtual machine in the virtual machine member set to be backed up, including: Filter out the snapshot volume information of each virtual machine to be backed up in the virtual machine member set to be backed up from the snapshot; Based on the snapshot volume information, create backup volumes for each virtual machine in the virtual machine member set to be backed up.

4. The method according to claim 1, characterized in that, Also includes: After all backup volumes in each virtual machine member set to be backed up have been transferred to the storage device, the mount of all backup volumes in that virtual machine member set to be backed up is removed, and all backup volumes in that virtual machine member set to be backed up are deleted.

5. A virtual machine consistency backup device, characterized in that, Applied to agent machines, including: The consistent snapshot creation unit is used to create a snapshot of the volume of each virtual machine to be backed up at the current moment in response to an instruction to perform a consistent backup of several virtual machines to be backed up. The member set partitioning unit is used to add each virtual machine to be backed up to its corresponding virtual machine member set according to the tenant isolation unit to which the virtual machine to be backed up belongs; wherein, each virtual machine member set contains all virtual machines to be backed up under a single tenant isolation unit. A consistent backup volume creation unit is used to log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up, and create backup volumes for each virtual machine in the virtual machine member set to be backed up based on the snapshot under the target tenant isolation unit. Mount storage units to mount the backup volumes of all virtual machines to be backed up, and transfer all backup volumes to the storage device; The consistent backup volume creation unit includes: The parallel login unit is used to log in to the target tenant isolation unit corresponding to each set of virtual machines to be backed up in parallel. The backup volume parallel creation unit is used to create backup volumes for each virtual machine to be backed up in parallel under each target tenant isolation unit, based on the snapshot; The mounted storage unit includes: The parallel mounting storage unit is used to mount the backup volumes of each virtual machine to be backed up in the member set of each virtual machine to be backed up in parallel, and to transfer the mounted backup volumes to the storage device in real time until all backup volumes have been transferred.

6. The apparatus according to claim 5, characterized in that, The consistent snapshot creation unit includes: The volume information collection unit is used to respond to the instruction to perform a consistent backup of several virtual machines to be backed up, and for each virtual machine to be backed up, obtain the volume list of the virtual machine to be backed up, and create a volume set of the virtual machine to be backed up based on the volumes in the volume list. The volume addition unit is used to add the set of volumes of each virtual machine to be backed up to a pre-created volume group for storing virtual machine volumes. A snapshot creation unit is used to create a snapshot of the volume group at the current moment.

7. The apparatus according to claim 5, characterized in that, The consistent backup volume creation unit includes: The snapshot volume information filtering unit is used to log in to the target tenant isolation unit corresponding to each virtual machine member set to be backed up, and filter out the snapshot volume information of each virtual machine to be backed up in the snapshot of the virtual machine member set to be backed up. The backup volume creation unit is used to create backup volumes for each virtual machine to be backed up in the virtual machine member set based on the snapshot volume information.

8. A virtual machine consistency backup device, 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 consistent backup method for virtual machines as described in any one of claims 1-4.

9. 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 consistent backup method for virtual machines as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Virtual machine backup and recovery method based on vSAN hyper-converged virtualization platform

    CN116185720A

  • Virtual machine backup recovery method and device, equipment and medium

    CN119961061A