The present disclosure relates to backup management systems and methods, and particularly to a backup management system and method for backing up a virtual machine (VM) of an electronic device.
Data of an electronic device can be backed up. The backed up data can be used to restore data of the electronic device.
Implementations of the present technology will now be described, by way of example only, with reference to the attached figures.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein, However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures and components have not been described in detail so as not to obscure the related relevant feature being described. Also, the description is not to be considered as limiting the scope of the embodiments described herein. The drawings are not necessarily to scale and the proportions of certain parts have been exaggerated to better illustrate details and features of the present disclosure.
Definitions that apply throughout this disclosure will now be presented.
The references “a plurality of” and “a number of” mean “at least two.”
The term “comprising,” when utilized, means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in the so-described combination, group, series, and the like.
In general, the word “module” as used hereinafter refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language such as, for example, but not limited to, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware such as in an erasable-programmable read-only memory (EPROM). It will be appreciated that the modules may comprise connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage device.
Each agent 20 can include a virtual machine (VM) 210 (shown in
The first receiving module 1102 can obtain information including a current amount of free space of each agent 20 at predetermined regular time intervals, and further receive a backup request from the first agent 20. The determining module 1104 can determine whether the first VM 210 of the first agent 20 has been backed up before. If the determining module 1104 determines that the VM 210 of the first agent 20 has not been backed up before, the determining module 1104 determines which agent 20 of the other agents 20 has a largest current amount of free space. The determining module 1104 designates the agent 20 having the largest current amount of free space as the second agent 20. After the determining module 1104 designates the second agent 20, the first sending module 1103 sends a first message to the first agent 20 instructing the first agent 20 to back up the VM 210 to the second agent 20. For example, the first message can include the designated second agent 20 and the current amount of free space of the second agent 20. If the VM 210 has been backed up before, the determining module 1104 determines which agent 20 of the other agents 20 the first VM 210 was backed up to before, and the first sending module 1103 sends a second message to the first agent 20 informing the first agent 20 that the VM 210 was backed up to the second agent 20 before.
Referring to
In at least one embodiment, the second sending module 2212 can send information including the current amount of free space to the first receiving module 1102 of the BAS 110, and further send the backup request to the first receiving module 1102 of the BAS 110. The second receiving module 2213 can receive the first message and the second message from the first sending module 1103 of the BAS 110.
The calculating module 2214 can calculate a required amount of backup space of the backup storage 240 of the second agent 20 to back up the VM 210 of the first agent 20. In detail, the calculating module 2214 first obtains a size of each LV 211 of the VM 210, and adds the sizes of all of the LVs 211 together to obtain a total size. The calculating module 2214 multiplies the total size by a compression ratio to obtain the required amount of backup space. For example, if the calculating module calculates the total size “total_size” and the compression ratio is 70%, the required amount of backup space “backup_space” is calculated by the following formula: backup_space=total_size*70%.
The comparing module 2215 can compare whether the required amount of backup space is less than or equal to the current amount of backup space of the backup storage 240 of the second agent 20. When the required amount of backup space is less than or equal to the current amount of backup space, the VM 210 of the first agent 20 can continue to be backed up to the second agent 20. Otherwise, when the required amount of backup space is greater than the current amount of free space, the second sending module 2212 can send a message to a display (not shown) of the first agent 20 to inform a user.
The dividing module 2216 can divide each LV 211 into a plurality of files according to a predetermined rule. The creating module 2217 can create a temporary file from each file. For example, the temporary files can be of the form “*.img.gz” wherein * represents a serial order of creating the corresponding temporary file. The calculating module 2214 can further calculate an md5 value of each temporary file. The saving module 2218 can save each md5 value to the storage 120 of the backup manager 10. The copying module 2219 can copy each temporary file to the backup storage 240 of the second agent 20.
Referring to
The naming module 2221 can assign an LV name to each LV 221 of the VM 210 before the dividing module 2216 divides each LV 221 into the plurality of files. The creating module 2217 can create a snapshot of each LV name. In at least one embodiment, the snapshot is used to record an operation status of the corresponding LV 221 at a time when the LV name was created. The compressing unit 2220 can compress the temporary files before being copied to the backup storage 240 of the second agent 20. The deleting unit 2223 can delete the temporary files and the LV names from the first agent 20 after the temporary files are copied to the second agent 20.
When the VM 210 of the first agent 20 has been backed up to the second agent 20 before, the calculating module 2214 can divide the plurality of files of the LVs 221 according to the predetermined rule. For example, the temporary files can be of the form “*.img” wherein * represents a serial order of creating the corresponding temporary file. After the calculating module 2214 calculates the md5 values of the temporary files, the comparing module 2215 can compare the md5 values of the temporary files to corresponding md5 values stored in the storage 120 of the backup manager 10. When the md5 values of the temporary files are the same as the corresponding md5 values stored in the storage 120 of the backup manager 10, the deleting module 2223 can delete the corresponding temporary files from the first agent 20. When the md5 values of the temporary files are different from the corresponding md5 values stored in the storage 120 of the backup manager 10, the saving module 2218 can save the corresponding md5 values to the storage 120 of the backup manager 10 to replace the corresponding md5 values that were saved a previous time, and the copying module 2219 can copy the corresponding temporary files to the backup storage 240 of the second agent 20 to replace the corresponding temporary files that were copied to the second agent 20 the previous time. For example, the compressing module 2220 can compress the temporary files “*.img” as “*.img.gz” to replace the corresponding temporary files in the backup storage 240 of the second agent 20. Thus, only data in the temporary files that has been changed is copied to the second agent 20, thereby decreasing a required amount of time and bandwidth to back up the VM 210 a second or more time.
When the first agent 20 needs to recover the backup of the VM 210, the second sending module 2212 of the first agent 20 can send a backup recovery request to the first receiving module 1102 of the backup manager 10. After the first receiving module 1102 receives the backup recovery request, the determining module 1104 can determine which agent 20 the VM 210 was backed up to before, and the first sending unit 1103 can send the second message to the second receiving module 2213. The copying module 2219 can copy the temporary files from the backup storage 240 of the second agent 20 to a logical volume manager (not shown) of the VM 210. The verifying module 2224 can verify the temporary files with the corresponding md5 values stored in the storage 120 of the backup manager 10. After the temporary files are verified, the creating module 2217 can combine the temporary files in a sequence of copying the temporary files to the second agent 20, thereby recovering each LV 221 of the VM 210.
Referring to
At block 400, information including a current amount of free space of a plurality of electronic devices is obtained at predetermined regular time intervals.
At block 401, a backup request is received from one of the plurality of electronic devices requesting that a virtual machine (VM) of the electronic device be backed up.
At block 402, whether the VM of the requesting electronic device has been previously backed up is determined. If the VM has been previously backed up, block 415 is implemented. If the VM has not been previously backed up, block 403 is implemented.
At block 403, an electronic device of the non-requesting electronic devices having a largest current amount of backup space is determined.
At block 404, a required amount of backup space of the determined non-requesting electronic device to back up the VM and whether the required amount of backup space is large enough to back up the VM are determined. If the current amount of backup space of the non-requesting electronic device is not large enough, block 414 is implemented. If the current amount of backup space is large enough, block 405 is implemented.
At block 405, a logical volume (LV) name is assigned to each of a plurality of LVs of the virtual machine.
At block 406, a snapshot of each LV name is created.
At block 407, each LV of the VM is divided into a plurality of files according to a predetermined rule.
At block 408, a temporary file is created from each file.
At block 409, an md5 value of each temporary file is calculated and saved.
At block 410, the temporary files are compressed.
At block 411, the temporary files are copied to the non-requesting electronic device.
At block 412, the temporary files and the snapshots are deleted from the requesting electronic device, and then the method ends.
At block 413, a message indicating that the VM cannot be backed up is displayed on a display of the requesting electronic device.
At block 414, the requesting electronic device is instructed to back up the VM to the non-requesting electronic device to which the VM was previously backed up.
At block 415, an LV name is assigned to each LV of the VM.
At block 416, a snapshot of each LV name is created.
At block 417, each LV of the VM is divided into a plurality of files according to a predetermined rule.
At block 418, a temporary file is created from each file.
At block 419, an md5 value of each temporary file is calculated.
At block 420, each md5 value is compared to a corresponding previously saved md5 value.
At block 421, the temporary files having md5 values that are the same as the corresponding previously-saved md5 values are deleted.
At block 422, the temporary files that have not been deleted are compressed
At block 423, the temporary files having md5 values that are different from the corresponding previously-saved md5 values are copied to the non-requesting electronic device.
At block 424, the md5 values that are different from the corresponding previously-saved md5 values are saved to replace the corresponding previously-saved md5 values.
At block 425, the temporary files and the snapshots are deleted from the requesting electronic device.
At block 501, a first electronic device sends a backup recovery request of a virtual machine (VM) to a backup manager.
At block 502, the backup manager determines a second electronic device where the VM was backed up to before.
At block 503, the first electronic device copies temporary files of logical volumes (LVs) of the VM to a logical volume manager of the VM. The first electronic device verifies the temporary files with corresponding md5 values stored in the backup manager.
At block 504, the first electronic device combines the temporary files in a sequence corresponding to a sequence of copying the temporary files to the second electronic device, thereby recovering the LVs of the VM.
At block 505, the first electronic device turns off the VM.
The embodiments shown and described above are only examples. Many details are often found in the art. Therefore, many such details are neither shown nor described. Even though numerous characteristics and advantages of the present technology have been set forth in the foregoing description, together with details of the structure and function of the present disclosure, the disclosure is illustrative only, and changes may be made in the detail, including in matters of shape, size, and arrangement of the parts within the principles of the present disclosure, up to and including the full extent established by the broad general meaning of the terms used in the claims. It will therefore be appreciated that the embodiments described above may be modified within the scope of the claims.
Number | Date | Country | Kind |
---|---|---|---|
201310493949.5 | Oct 2013 | CN | national |