Virtual machine backup method and device
By dividing the backup cluster into multiple address pools and distributed storage, and using the primary backup node to distribute tasks to multiple backup nodes for virtual machine data backup, the problems of backup server failure and performance bottlenecks are solved, and efficient virtual machine data backup and recovery are achieved.
Patent Information
- Application Number
- CN202111140682.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-09-28
AI Technical Summary
In existing virtualization platform backup technologies, backup server failures can result in virtual machine data being unable to be backed up or restored, performance bottlenecks can prevent replication performance from meeting fast backup and recovery requirements, and excessive resource usage on a single backup server.
The backup cluster is divided into multiple address pools, each of which includes multiple backup nodes. Distributed storage is established, task requests are received through the master backup node, backup tasks are created and distributed to multiple backup nodes for concurrent backup, and data backup and recovery are performed using the distributed storage pool.
Improves virtual machine backup performance, reduces RPO (Recovery Point Objective), and increases backup and recovery reliability, ensuring that data backup and recovery can continue normally when the backup server fails.
Smart Images

Figure CN113986450B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtualization technology, and in particular to a virtual machine backup method and device. Background Art
[0002] Virtualization platforms deploy various business virtual machines (VMs) to achieve centralized resource configuration and management. Distributed backup integrated storage provides VM backup services. VM data is organized as objects in the backup storage and distributed across various hosts. Multiple production VMs are backed up to the backup storage, which retains complete copies of the VMs. If the original virtualization platform suffers a disaster or VM data is corrupted, the VM backup data can be used for recovery. Therefore, to ensure user data security, distributed backup integrated storage must offer comprehensive protection, rapid recovery, remote disaster recovery, and excellent manageability.
[0003] One existing backup technology for virtualization platforms involves installing backup software on one or more backup servers. The backup servers use local storage or mount third-party storage to store data. By taking snapshots of the virtual machines to be backed up on the production side, the virtual machine data files are backed up. If the virtual machine becomes corrupted, data can be restored from the backup server. Existing implementations support both full and incremental backups of virtual machines.
[0004] However, when the backup server uses local storage or mounts third-party storage to back up virtual machine data files, when the backup server fails, the virtual machine backup or recovery tasks related to the backup server cannot be performed. In addition, the performance bottleneck of a single backup server and the excessive concurrency occupy the backup server's CPU resources and network resources. The replication performance cannot meet the requirements of fast backup and recovery, and may even cause backup or recovery data failure. Summary of the Invention
[0005] The present application provides a virtual machine backup method and device to solve the problem in the prior art that virtual machine data cannot be backed up / restored due to backup server failure / virtual machine performance bottleneck.
[0006] In a first aspect, the present application provides a virtual machine backup method, which is applied to a primary backup node of a backup cluster, wherein the backup cluster is divided into multiple address pools, one address pool includes multiple backup nodes, and the backup nodes included in any address pool respectively establish a communication link with the corresponding host machine running the virtual machine, and the backup nodes included in the backup cluster constitute distributed storage, and the backup cluster is divided into at least one storage pool; the method includes:
[0007] Receive a backup task request, wherein the backup task request includes target host information and target virtual machine information to be backed up in each target host;
[0008] For each target virtual machine, create a backup task corresponding to the target virtual machine, and obtain data of the target virtual machine from the target host machine based on the backup task, wherein the data of the target virtual machine includes the disk file and configuration file of the target virtual machine;
[0009] The obtained disk files and configuration files of the target virtual machine are backed up to the designated storage pool of the backup cluster.
[0010] Optionally, the primary backup node in the backup cluster maintains communication link information between each target host machine and the backup nodes included in the corresponding address pool; before obtaining the data of the target virtual machine from the target host machine based on the backup task, the method further includes:
[0011] Determining whether a communication link between the target host machine and a backup node included in the corresponding address pool is normal, wherein if the communication link between the target host machine and at least one backup node included in the corresponding address pool is normal, then determining that the communication link between the target host machine and the backup node included in the corresponding address pool is normal;
[0012] If it is determined that the communication link between the target host machine and the backup node included in the corresponding address pool is normal, a step of obtaining the data of the target virtual machine from the target host machine based on the backup task is executed.
[0013] Optionally, the steps of creating a backup task corresponding to the target virtual machine and obtaining data of the target virtual machine from the target host machine based on the backup task include:
[0014] Based on the number of disk files and configuration files of the target virtual machine, a corresponding number of backup tasks are created.
[0015] Determining a target backup node for executing the corresponding number of backup tasks based on the current backup task execution status of each backup node included in the backup cluster;
[0016] Each backup task is sent to the corresponding target backup node, so that the target backup node obtains the corresponding disk file / configuration file from the target host machine based on the received backup task.
[0017] Optionally, the step of sending each backup task to a corresponding target backup node so that the target backup node obtains the corresponding disk file / configuration file from the target host machine based on the received backup task includes:
[0018] Creating a volume group corresponding to the target virtual machine, wherein the volume group includes multiple volume pairs, and each backup task corresponds to one volume pair;
[0019] Send the volume pair corresponding to each backup task to the target backup node, so that the target backup node instructs the target host to create a target volume corresponding to the disk file / configuration file corresponding to the volume pair;
[0020] Based on the backup execution instruction issued by the primary backup node, the disk file / configuration file corresponding to the target volume in the target host is backed up to the volume pair.
[0021] Optionally, the method further includes:
[0022] receiving a recovery task request, wherein the recovery task request includes information of the virtual machine to be recovered and information of a host machine for recovering the virtual machine;
[0023] Create a corresponding volume group for each virtual machine to be restored, where a volume group includes multiple volume pairs, and a file recovery task corresponds to one volume pair;
[0024] Each volume pair is sent to the corresponding backup node respectively, so that each backup node instructs the host machine used to restore the virtual machine to create the corresponding target file; each backup node restores the locally stored disk file / configuration file to the target file respectively, so that the host machine creates and runs the virtual machine based on the target file.
[0025] In a second aspect, the present application provides a virtual machine backup device, which is applied to a primary backup node of a backup cluster, wherein the backup cluster is divided into multiple address pools, one address pool includes multiple backup nodes, and the backup nodes included in any address pool respectively establish a communication link with the corresponding host machine running the virtual machine, and the backup nodes included in the backup cluster constitute distributed storage, and the backup cluster is divided into at least one storage pool; the device includes:
[0026] A receiving unit, configured to receive a backup task request, wherein the backup task request includes target host information and target virtual machine information to be backed up in each target host;
[0027] a creation unit, configured to create, for each target virtual machine, a backup task corresponding to the target virtual machine, and obtain data of the target virtual machine from the target host machine based on the backup task, wherein the data of the target virtual machine includes a disk file and a configuration file of the target virtual machine;
[0028] The backup unit is used to back up the acquired disk files and configuration files of the target virtual machine to a designated storage pool of the backup cluster.
[0029] Optionally, the device further comprises:
[0030] a determination unit, configured to determine whether a communication link between the target host machine and a backup node included in the corresponding address pool is normal, wherein if the communication link between the target host machine and at least one backup node included in the corresponding address pool is normal, then determining that the communication link between the target host machine and the backup node included in the corresponding address pool is normal;
[0031] If it is determined that the communication link between the target host machine and the backup node included in the corresponding address pool is normal, a step of obtaining the data of the target virtual machine from the target host machine based on the backup task is executed.
[0032] Optionally, when creating a backup task corresponding to the target virtual machine and obtaining data of the target virtual machine from the target host machine based on the backup task, the creating unit is specifically configured to:
[0033] Based on the number of disk files and configuration files of the target virtual machine, a corresponding number of backup tasks are created.
[0034] Determining a target backup node for executing the corresponding number of backup tasks based on the current backup task execution status of each backup node included in the backup cluster;
[0035] Each backup task is sent to the corresponding target backup node, so that the target backup node obtains the corresponding disk file / configuration file from the target host machine based on the received backup task.
[0036] Optionally, when each backup task is sent to a corresponding target backup node, so that the target backup node obtains a corresponding disk file / configuration file from the target host machine based on the received backup task, the creation unit is specifically configured to:
[0037] Creating a volume group corresponding to the target virtual machine, wherein the volume group includes multiple volume pairs, and each backup task corresponds to one volume pair;
[0038] Send the volume pair corresponding to each backup task to the target backup node, so that the target backup node instructs the target host to create a target volume corresponding to the disk file / configuration file corresponding to the volume pair;
[0039] Based on the backup execution instruction issued by the primary backup node, the disk file / configuration file corresponding to the target volume in the target host is backed up to the volume pair.
[0040] Optionally, the receiving unit is further configured to:
[0041] receiving a recovery task request, wherein the recovery task request includes information of the virtual machine to be recovered and information of a host machine for recovering the virtual machine;
[0042] Create a corresponding volume group for each virtual machine to be restored, where a volume group includes multiple volume pairs, and a file recovery task corresponds to one volume pair;
[0043] Each volume pair is sent to the corresponding backup node respectively, so that each backup node instructs the host machine used to restore the virtual machine to create the corresponding target file; each backup node restores the locally stored disk file / configuration file to the target file respectively, so that the host machine creates and runs the virtual machine based on the target file.
[0044] In a third aspect, an embodiment of the present application provides a virtualized backup device, the virtualized backup device comprising:
[0045] a memory for storing program instructions;
[0046] The processor is configured to call the program instructions stored in the memory and execute the steps of the method as described in any one of the first aspects above according to the obtained program instructions.
[0047] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method described in any one of the above-mentioned first aspects.
[0048] In summary, the virtual machine backup method provided in the embodiment of the present application is applied to the main backup node of the backup cluster, and the backup cluster is divided into multiple address pools, one address pool includes multiple backup nodes, and the backup nodes included in any address pool respectively establish communication links with the corresponding host machines running virtual machines. The backup nodes included in the backup cluster constitute distributed storage, and the backup cluster is divided into at least one storage pool; the method includes: receiving a backup task request, wherein the backup task request includes target host machine information and target virtual machine information to be backed up in each target host machine; for each target virtual machine, creating a backup task corresponding to the target virtual machine, and obtaining the data of the target virtual machine from the target host machine based on the backup task, wherein the data of the target virtual machine includes the disk files and configuration files of the target virtual machine; backing up the obtained disk files and configuration files of the target virtual machine to the designated storage pool of the backup cluster.
[0049] By adopting the virtual machine backup method provided in the embodiment of the present application, a host machine establishes a communication link with multiple backup nodes in the backup cluster, the virtual machine data backup task is divided into multiple subtasks, and the backup task of a virtual machine is executed by multiple execution nodes. Distributed concurrent backup storage is adopted, which greatly improves the virtual machine backup performance and greatly reduces the RPO; if any replication task execution node fails, it automatically switches to other execution nodes, thereby improving the reliability of backup and recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments of the present application or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present application.
[0051] Figure 1 A detailed flowchart of a virtual machine backup method provided in an embodiment of the present application;
[0052] Figure 2 A system structure diagram of a virtualized backup system provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of the structure of a virtualized backup system provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of the structure of a virtual machine backup device provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of the structure of another virtual machine backup device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The terms used in the embodiments of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms "a," "the," and "the" used in this application and claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.
[0057] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" used may also be interpreted as "at the time of" or "when" or "in response to determining".
[0058] For example, see Figure 1 The figure is a detailed flow chart of a virtual machine backup method provided in an embodiment of the present application. The method is applied to the primary backup node of a backup cluster, wherein the backup cluster is divided into multiple address pools, one address pool includes multiple backup nodes, and the backup nodes included in any address pool respectively establish a communication link with the corresponding host machine running the virtual machine. The backup nodes included in the backup cluster constitute distributed storage, and the backup cluster is divided into at least one storage pool. The method includes the following steps:
[0059] Step 100: Receive a backup task request, wherein the backup task request includes target host information and target virtual machine information to be backed up in each target host.
[0060] For example, see Figure 2 As shown, it is a system structure diagram of the virtualization backup system provided in an embodiment of the present application, which includes a virtualization platform (a production end running a business virtual machine, such as a host machine) and a backup cluster (distributed storage cluster) for backing up virtual machine data, wherein the backup cluster includes multiple backup nodes (such as node 1, node 2, ..., node n), and the backup cluster is divided into multiple address pools (such as address pool 10 including node 1, node 2 and node 3; address pool 11 including node 4, node 5 and node 6). In actual applications, a host machine at the production end can establish communication links with each backup node included in one or more address pools, such as the host machine at the production end 1 establishes communication links with node 1, node 2 and node 3 included in address pool 10, and the host machine at the production end 2 establishes communication links with node 4, node 5 and node 63 included in address pool 11. In the embodiment of the present application, multiple communication links are used to connect each host machine and the backup cluster. In this way, the robustness of communication between the host machine and the backup cluster is guaranteed. When any one of the multiple communication links is normal, the communication between the host machine and the backup cluster is normal.
[0061] In practice, you can install an agent on the production host and configure the network addresses of multiple backup nodes belonging to an address pool. Based on these network addresses, communication links to each of these backup nodes are established. Each backup node in the backup cluster can maintain the status of the communication links between the multiple backup nodes in its corresponding address pool.
[0062] Specifically, the communication link status can be maintained in the following manner: the communication link from a host machine on the production side to the backup cluster is abstracted as a remote device, and multiple backup nodes are managed through an address pool (address pool). Optionally, the remote device can be represented as fsid:ip, where fsid represents the identifier of the cluster to which the host machine on the production side belongs, and ip represents the IP address of the host machine; of course, the host machine can also maintain a mapping relationship with multiple backup nodes in the address pool, which is represented as fsid:ip, where fsid is the identifier of the backup cluster, and ip identifies the IP addresses of each backup node included in the corresponding address pool.
[0063] Optionally, the primary and backup nodes of the backup cluster maintain the status of remote devices. When the communication links from all backup nodes in an address pool to the host fail, the device status fails and the backup / restore task cannot be run.
[0064] Optionally, all backup nodes in the backup cluster detect the communication link established with the corresponding host machine and report it to the primary backup node, which maintains the status of the remote device. One detection implementation of the communication link is: the link sends heartbeat messages periodically and reports the detection to the backup primary node of the backup cluster.
[0065] Then, in the embodiment of the present application, when executing step 100, after the primary backup node receives the backup task request, it determines the production end (generation cluster information) targeted by the backup task and the virtual machine information to be backed up (which virtual machines on the production end need to be backed up) based on the backup task request. In other words, the backup task request triggered by the user includes at least virtualization platform information (e.g., host machine x on production end 1), a list of virtual machines (e.g., which virtual machines on host machine x need to be backed up), and further, storage pool information (virtual machine data is backed up to a specified storage pool) and backup method (full backup / incremental backup).
[0066] Step 110: For each target virtual machine, create a backup task corresponding to the target virtual machine, and obtain the data of the target virtual machine from the target host machine based on the backup task, wherein the data of the target virtual machine includes the disk file and configuration file of the target virtual machine.
[0067] Then, in the embodiment of the present application, since the primary backup node in the backup cluster maintains the communication link information between each target host machine and the backup nodes included in the corresponding address pool, then, before obtaining the data of the target virtual machine from the target host machine based on the backup task, the method further includes:
[0068] Determine whether the communication link between the target host machine and the backup node included in the corresponding address pool is normal, wherein, if the communication link between the target host machine and at least one backup node included in the corresponding address pool is normal, then determine that the communication link between the target host machine and the backup node included in the corresponding address pool is normal; if it is determined that the communication link between the target host machine and the backup node included in the corresponding address pool is normal, execute the step of obtaining the data of the target virtual machine from the target host machine based on the backup task.
[0069] In an embodiment of the present application, when creating a backup task corresponding to the target virtual machine and obtaining the data of the target virtual machine from the target host machine based on the backup task, a preferred implementation method is:
[0070] Based on the number of disk files and configuration files of the target virtual machine, a corresponding number of backup tasks are created respectively; based on the current backup task execution status of each backup node included in the backup cluster, a target backup node for executing the corresponding number of backup tasks is determined; each backup task is sent to the corresponding target backup node respectively, so that the target backup node obtains the corresponding disk file / configuration file from the target host machine based on the received backup task.
[0071] Furthermore, in an embodiment of the present application, when each backup task is sent to the corresponding target backup node, so that the target backup node obtains the corresponding disk file / configuration file from the target host machine based on the received backup task, a preferred implementation method is as follows:
[0072] Create a volume group corresponding to the target virtual machine, where the volume group includes multiple volume pairs, and one backup task corresponds to one volume pair; send the volume pair corresponding to each backup task to the target backup node, so that the target backup node instructs the target host machine to create a target volume corresponding to the disk file / configuration file corresponding to the volume pair; based on the backup execution instruction issued by the primary backup node, back up the disk file / configuration file corresponding to the target volume in the target host machine to the volume pair.
[0073] In actual applications, the primary backup node receives a backup task request, which includes virtualization platform information, virtual machine list, backup pool and backup method. The virtual machine list contains one or more virtual machines under the virtualization platform; the primary backup node decomposes the backup task into virtual machines, obtains the platform cluster ID and host management network IP of the virtual machine through the platform interface, searches the link table according to fsid:ip, and checks whether the remote device communicating with the backup cluster and the node is normal. If the device fails, the backup will not be started.
[0074] If the backup is started, the backup creation time point of the virtual machine that performs the backup task is preset to the status of "Creating" and the DB is recorded; the primary backup node calls the virtualization platform Rest interface according to the virtual machine ID to create a virtual machine synchronization snapshot; after the primary backup node successfully creates the snapshot, it obtains the virtual machine synchronization snapshot information, including: details of each virtual disk and virtual machine configuration information.
[0075] The master and backup nodes mentioned above are elected by the backup cluster. Optionally, a backup cluster is implemented to perform Master election and configuration data synchronization based on Zookeeper.
[0076] Optionally, the name of the virtual machine synchronization snapshot is composed of a backup task ID, a time point, and a current backup index, and the index increases monotonically to distinguish the same virtual machine backup snapshots under different backup tasks.
[0077] Optionally, the acquired virtual machine configuration file data may be stored in the backup storage pool in the form of an object, and the object name may be recorded in the database as an attribute at a time point.
[0078] When accessing the virtualization platform through the REST interface, you must provide the platform IP, port, username, and password input parameters. The backup side supports management of each virtualization platform information. If the platform information changes, the corresponding platform information can be modified on the backup side.
[0079] Furthermore, a volume group is created for each virtual machine to be backed up. The virtual machine multi-disk backup is managed through the volume group. The backup end backup pool creates a target volume for each virtual disk, creates a pair, associates a link and adds it to the group.
[0080] Get the virtual machine backup volume group. The volume group manages multiple pair backups, including start, stop, modification, and event reporting. It also records the latest backup index, historical backup index list, and pair information. If obtaining the volume group fails, create a volume group.
[0081] After the backup is started, the volume group receives the backup request and obtains the corresponding pair in the volume group based on the incoming virtual machine disk ID and remote device ID;
[0082] Optionally, if pair acquisition fails, a target volume is created in the backup pool, and then a pair is created and added to the volume group. The pair includes source file and target volume details, remote device information, current synchronization information, and a list of completed synchronization indexes. The pair is used to control virtual disk data backup.
[0083] The target volume corresponds to a virtual disk file and has the same size. Optionally, the target volume can be named as group_id+vm_device_name+timestamp, where group_id is the volume group ID, vm_device_name is the virtual disk name, and timestamp is the current timestamp.
[0084] The process of obtaining a consistent snapshot of the volume group is as follows: first, obtain the index of the last successful backup, then search the schedule based on the index. Optionally, if no consistent snapshot is found, change the backup mode to a full backup.
[0085] In an embodiment of the present application, the backup task of a virtual machine can be divided into multiple sub-backup tasks based on the number of disk files of the virtual machine, and a backup task can be decomposed into multiple sub-backup tasks, and the backup task can be executed by multiple backup nodes (execution nodes) in the backup cluster.
[0086] For example, when starting a pair backup, the execution node of the pair synchronization task is obtained through the backup cluster, and then the replication task is assigned to the execution node. Optional execution node selection methods include:
[0087] Determine the backup node list of the address pool under the remote device based on the volume group to which the pair belongs, and select from the list; obtain the online backup node and select from the online backup nodes; select a backup node with the least current tasks; and distribute the pair task and other pair tasks in the volume group to different backup nodes.
[0088] Step 120: Back up the acquired disk files and configuration files of the target virtual machine to a designated storage pool of the backup cluster.
[0089] Specifically, the backup cluster can be divided into at least one storage pool (backup pool) based on business needs. In this way, when a virtual machine backup task is executed, the virtual machine data can be backed up to any designated storage pool.
[0090] In the embodiment of the present application, the volume group determines whether the backup of each virtual disk data of the virtual machine is completed according to the Pair execution result. If completed, the backup virtual machine configuration file is obtained and the time point is created.
[0091] After the primary and backup node volume groups receive all pair synchronization completion events, they generate a consistent snapshot based on the current backup index, current time, and volume group ID, and create snapshots for each target volume in turn;
[0092] Update the virtual machine's backup point-in-time information, including the consistency snapshot, point-in-time status, synchronized data volume, virtual machine configuration file information, etc.
[0093] Optionally, if some pairs fail to synchronize, the backup task virtual machine fails to be backed up this time, the created time point is cleaned up, and the current synchronization snapshot of the virtual machine is deleted.
[0094] That is, only after all volume pairs (disk files / configuration files) of a virtual machine are synchronized successfully can the data backup of the virtual machine be determined to be successful; otherwise, the data backup of the virtual machine fails.
[0095] In an embodiment of the present application, when a virtual machine data needs to be recovered, a recovery task request is received, wherein the recovery task request includes the virtual machine information to be recovered, which is used to recover the host machine information of the virtual machine; a corresponding volume group is created for each virtual machine to be recovered, wherein a volume group includes multiple volume pairs, and a file recovery task corresponds to one volume pair; each volume pair is sent to a corresponding backup node, so that each backup node instructs the host machine used to recover the virtual machine to create a corresponding target file; each backup node restores the locally stored disk file / configuration file to the target file, so that the host machine creates and runs the virtual machine based on the target file.
[0096] That is, virtual machine data recovery can include the following steps:
[0097] Step 1: Determine the data to be restored, ie, the consistent snapshot information and the virtual machine configuration information, based on the identifier and time point information of the single virtual machine to be restored.
[0098] For example, the primary backup node receives a recovery task request, which includes target virtualization platform information, backup virtual machine information, backup time point information, and recovery virtual machine information;
[0099] The primary and backup nodes decompose the recovery tasks into virtual machines and determine the status of the remote devices. If the status of the remote devices is abnormal, the recovery fails.
[0100] The primary and backup nodes determine the synchronization snapshot information according to the time point of the virtual machine, and obtain the detailed virtual machine configuration according to the configuration information recorded at the time point.
[0101] Step 2: Create a volume group for each virtual machine to be restored. Use the volume group to manage multi-disk recovery of the virtual machine. Create the recovery target file on the production side, create a pair, associate the link, and add it to the group.
[0102] After recovery is started, the volume group receives the recovery request, creates the target file in the production-side storage pool, and then creates a pair and adds it to the volume group.
[0103] Step 3: Start pair recovery. The backup cluster determines the execution node where the virtual disk copy task runs. The execution node performs data recovery and notifies the volume group after the recovery is complete.
[0104] After the execution node is determined, the execution node receives the creation replication task from the primary and backup nodes and asynchronously completes the data replication. After the replication task is completed, a synchronization task completion event is sent and handed over to the volume group for processing.
[0105] In step 4, the volume group determines whether the backup data is restored based on the Pair execution result. If it is complete, the virtual machine configuration file is restored and the target virtual machine is created on the production side.
[0106] After the primary and backup node volume groups receive all pair synchronization completion events, the virtual machine data synchronization is completed;
[0107] Restore the VM configuration file and create the target VM through the virtualization platform REST interface.
[0108] For example, see Figure 3 FIG. 1 is a schematic diagram of a virtualized backup system according to an embodiment of the present application, wherein the virtualized backup system includes:
[0109] The backup control module is used to receive backup task requests, control the backup of each virtual machine, perform snapshot-related operations, virtual machine configuration management, and backup time point management;
[0110] The recovery control module is used to receive backup task requests and control the start of the backup time point to restore the virtual machine;
[0111] The backup cluster management module is used to select the backup cluster leader, select the replication execution node, and manage replication tasks;
[0112] The volume group management module is used to control the virtual disk backup of the virtual machine. It controls it through pairs. When all pairs are synchronized successfully, the virtual machine creation time point is reached.
[0113] The volume pair module is used to control volume pair data replication, copy volume data according to the currently selected backup method, and report the replication time based on the execution result;
[0114] The link management module is used to manage the communication link between a host machine and the backup end address pool of the virtual platform, provide a reliable replication communication link for the volume group, manage the operating status of the remote communication device, and report the Pair remote device disconnection event when the remote device is disconnected.
[0115] For example, see Figure 4 FIG. 1 is a schematic diagram of the structure of a virtualized backup device provided in an embodiment of the present application, which is applied to a primary backup node of a backup cluster. The backup cluster is divided into multiple address pools, each address pool includes multiple backup nodes, and the backup nodes included in any address pool respectively establish communication links with corresponding host machines running virtual machines. The backup nodes included in the backup cluster constitute distributed storage, and the backup cluster is divided into at least one storage pool. The device includes:
[0116] The receiving unit 40 is configured to receive a backup task request, wherein the backup task request includes target host information and target virtual machine information to be backed up in each target host;
[0117] A creating unit 41 is configured to create, for each target virtual machine, a backup task corresponding to the target virtual machine, and obtain data of the target virtual machine from the target host machine based on the backup task, wherein the data of the target virtual machine includes a disk file and a configuration file of the target virtual machine;
[0118] The backup unit 42 is configured to back up the acquired disk files and configuration files of the target virtual machine to a designated storage pool of the backup cluster.
[0119] Optionally, the device further comprises:
[0120] a determination unit, configured to determine whether a communication link between the target host machine and a backup node included in the corresponding address pool is normal, wherein if the communication link between the target host machine and at least one backup node included in the corresponding address pool is normal, then determining that the communication link between the target host machine and the backup node included in the corresponding address pool is normal;
[0121] If it is determined that the communication link between the target host machine and the backup node included in the corresponding address pool is normal, a step of obtaining the data of the target virtual machine from the target host machine based on the backup task is executed.
[0122] Optionally, when creating a backup task corresponding to the target virtual machine and obtaining data of the target virtual machine from the target host machine based on the backup task, the creating unit 41 is specifically configured to:
[0123] Based on the number of disk files and configuration files of the target virtual machine, a corresponding number of backup tasks are created.
[0124] Determining a target backup node for executing the corresponding number of backup tasks based on the current backup task execution status of each backup node included in the backup cluster;
[0125] Each backup task is sent to the corresponding target backup node, so that the target backup node obtains the corresponding disk file / configuration file from the target host machine based on the received backup task.
[0126] Optionally, when each backup task is sent to a corresponding target backup node, so that the target backup node obtains a corresponding disk file / configuration file from the target host machine based on the received backup task, the creation unit 41 is specifically configured to:
[0127] Creating a volume group corresponding to the target virtual machine, wherein the volume group includes multiple volume pairs, and each backup task corresponds to one volume pair;
[0128] Send the volume pair corresponding to each backup task to the target backup node, so that the target backup node instructs the target host to create a target volume corresponding to the disk file / configuration file corresponding to the volume pair;
[0129] Based on the backup execution instruction issued by the primary backup node, the disk file / configuration file corresponding to the target volume in the target host is backed up to the volume pair.
[0130] Optionally, the receiving unit 40 is further configured to:
[0131] receiving a recovery task request, wherein the recovery task request includes information of the virtual machine to be recovered and information of a host machine for recovering the virtual machine;
[0132] Create a corresponding volume group for each virtual machine to be restored, where a volume group includes multiple volume pairs, and a file recovery task corresponds to one volume pair;
[0133] Each volume pair is sent to the corresponding backup node respectively, so that each backup node instructs the host machine used to restore the virtual machine to create the corresponding target file; each backup node restores the locally stored disk file / configuration file to the target file respectively, so that the host machine creates and runs the virtual machine based on the target file.
[0134] The above units may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), one or more digital singnal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a unit is implemented by scheduling program code through a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0135] Furthermore, the virtualized backup device provided in the embodiment of the present application, from the hardware level, the hardware architecture diagram of the virtualized backup device can be found in Figure 5 As shown, the virtualized backup device may include: a memory 50 and a processor 51,
[0136] The memory 50 is used to store program instructions. The processor 51 calls the program instructions stored in the memory 50 and executes the above method embodiment according to the obtained program instructions. The specific implementation method and technical effect are similar and will not be repeated here.
[0137] Optionally, the present application also provides a master backup node, comprising at least one processing element (or chip) for executing the above method embodiment.
[0138] Optionally, the present application also provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the above method embodiments.
[0139] Here, the machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage media, or a combination thereof.
[0140] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.
[0141] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0142] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0143] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0144] Furthermore, these computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0146] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A virtual machine backup method, characterized in that: A primary backup node applied to a backup cluster, wherein each backup node included in the backup cluster is divided into multiple address pools, one address pool includes multiple backup nodes, the backup nodes included in any address pool respectively establish a communication link with a corresponding host machine running a virtual machine, the backup nodes included in the backup cluster form a distributed storage, and the backup cluster is divided into at least one storage pool; the method includes: Receive a backup task request, wherein the backup task request includes target host information and target virtual machine information to be backed up in each target host; For each target virtual machine, create a backup task corresponding to the target virtual machine, and obtain data of the target virtual machine from the target host machine based on the backup task, wherein the data of the target virtual machine includes the disk file and configuration file of the target virtual machine; Backing up the obtained disk files and configuration files of the target virtual machine to the designated storage pool of the backup cluster; The steps of creating a backup task corresponding to the target virtual machine and obtaining data of the target virtual machine from the target host machine based on the backup task include: Based on the number of disk files and configuration files of the target virtual machine, a corresponding number of backup tasks are created. Determining a target backup node for executing the corresponding number of backup tasks based on the current backup task execution status of each backup node included in the backup cluster; Creating a volume group corresponding to the target virtual machine, wherein the volume group includes multiple volume pairs, and each backup task corresponds to one volume pair; Send the volume pair corresponding to each backup task to the target backup node, so that the target backup node instructs the target host to create a target volume corresponding to the disk file / configuration file corresponding to the volume pair; Based on the backup execution instruction issued by the primary backup node, the disk file / configuration file corresponding to the target volume in the target host is backed up to the volume pair.
2. The method according to claim 1, wherein The primary backup node in the backup cluster maintains communication link information between each target host and the backup nodes included in the corresponding address pool; Before obtaining the data of the target virtual machine from the target host machine based on the backup task, the method further includes: Determining whether a communication link between the target host machine and a backup node included in the corresponding address pool is normal, wherein if the communication link between the target host machine and at least one backup node included in the corresponding address pool is normal, then determining that the communication link between the target host machine and the backup node included in the corresponding address pool is normal; If it is determined that the communication link between the target host machine and the backup node included in the corresponding address pool is normal, a step of obtaining the data of the target virtual machine from the target host machine based on the backup task is executed.
3. The method according to claim 1, wherein The method further comprises: receiving a recovery task request, wherein the recovery task request includes information of the virtual machine to be recovered and information of a host machine for recovering the virtual machine; Create a corresponding volume group for each virtual machine to be restored, where a volume group includes multiple volume pairs, and a file recovery task corresponds to one volume pair; Each volume pair is sent to the corresponding backup node respectively, so that each backup node instructs the host machine used to restore the virtual machine to create the corresponding target file; each backup node restores the locally stored disk file / configuration file to the target file respectively, so that the host machine creates and runs the virtual machine based on the target file.
4. A virtual machine backup device, characterized in that: A primary backup node applied to a backup cluster, wherein the backup cluster is divided into multiple address pools, each address pool includes multiple backup nodes, the backup nodes included in any address pool respectively establish a communication link with a corresponding host machine running a virtual machine, the backup nodes included in the backup cluster form a distributed storage, and the backup cluster is divided into at least one storage pool; the device includes: A receiving unit, configured to receive a backup task request, wherein the backup task request includes target host information and target virtual machine information to be backed up in each target host; a creation unit, configured to create, for each target virtual machine, a backup task corresponding to the target virtual machine, and obtain data of the target virtual machine from the target host machine based on the backup task, wherein the data of the target virtual machine includes a disk file and a configuration file of the target virtual machine; A backup unit, configured to back up the acquired disk files and configuration files of the target virtual machine to a designated storage pool of the backup cluster; When creating a backup task corresponding to the target virtual machine and obtaining data of the target virtual machine from the target host machine based on the backup task, the creation unit is specifically configured to: Based on the number of disk files and configuration files of the target virtual machine, a corresponding number of backup tasks are created. Determining a target backup node for executing the corresponding number of backup tasks based on the current backup task execution status of each backup node included in the backup cluster; Creating a volume group corresponding to the target virtual machine, wherein the volume group includes multiple volume pairs, and each backup task corresponds to one volume pair; Send the volume pair corresponding to each backup task to the target backup node, so that the target backup node instructs the target host to create a target volume corresponding to the disk file / configuration file corresponding to the volume pair; Based on the backup execution instruction issued by the primary backup node, the disk file / configuration file corresponding to the target volume in the target host is backed up to the volume pair.
5. The device according to claim 4, characterized in that The primary backup node in the backup cluster maintains communication link information between each target host and the backup nodes included in the corresponding address pool; Before obtaining the data of the target virtual machine from the target host machine based on the backup task, the device further includes: a determination unit, configured to determine whether a communication link between the target host machine and a backup node included in the corresponding address pool is normal, wherein if the communication link between the target host machine and at least one backup node included in the corresponding address pool is normal, then determining that the communication link between the target host machine and the backup node included in the corresponding address pool is normal; If it is determined that the communication link between the target host machine and the backup node included in the corresponding address pool is normal, a step of obtaining the data of the target virtual machine from the target host machine based on the backup task is executed.
6. The device according to claim 4, characterized in that The receiving unit is further configured to: receiving a recovery task request, wherein the recovery task request includes information of the virtual machine to be recovered and information of a host machine for recovering the virtual machine; Create a corresponding volume group for each virtual machine to be restored, where a volume group includes multiple volume pairs, and a file recovery task corresponds to one volume pair; Each volume pair is sent to the corresponding backup node respectively, so that each backup node instructs the host machine used to restore the virtual machine to create the corresponding target file; each backup node restores the locally stored disk file / configuration file to the target file respectively, so that the host machine creates and runs the virtual machine based on the target file.
Citation Information
Patent Citations
Backup method and system of virtual machines in cluster
CN104182300A