Method and device for incremental backup of Ceph disk of cloud desktop virtual machine to file

By saving the virtual machine disk data to a local file during the OpenStack Ceph disk backup process, the problems of long backup time, large data volume and high cost in the existing technology are solved, and efficient and reliable incremental backup of the virtual machine disk is realized, reducing the cost. eliminate backup hardware costs.

CN118733343APending Publication Date: 2024-10-01INSPUR COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410832589.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the field of cloud computing and storage, existing technology backup solutions for virtual machine disks are not compatible with minimizing backup time and data volume, and cannot minimize storage costs, and the backup data is unavailable when a Ceph cluster fails.

Method used

On the basis of being compatible with the native OpenStack Ceph disk backup process, the extended backup_rbd_to_local_disk configuration item is added to save the full and incremental data of the Ceph virtual machine disk to local files, so that the backup data can be separated from the Ceph cluster through rbd diff-export and rbd diff. -import implements data fragmentation and compression, reducing the amount and time of backup data.

Benefits of technology

It improves the reliability of the backup function, avoids the problem of unavailability of backup data when the Ceph cluster fails, reduces the cost of backup hardware, and minimizes the amount and time of backup data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733343A_ABST
    Figure CN118733343A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing and storage, and particularly provides a method and a device for incremental backup of a Ceph disk of a cloud desktop virtual machine to a file, on the basis of being compatible with a native OpenStack Ceph disk backup process, newly adding an extended backuprbdlocaldisk configuration item, intercepting backup data of a Ceph rbd virtual machine disk, and enabling full-amount data and incremental data of the virtual machine disk to be stored in the Ceph rbd virtual machine disk. And a local file is directly stored, and full-amount and incremental backup of backup data separated from the Ceph cluster is realized. Compared with the prior art, the method has the advantages that the backup data of the virtual machine disk can be stored outside the Ceph cluster, so that the problem that the backup data cannot be used when the Ceph cluster fails is avoided, and the reliability of the backup function is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing and storage technology, and specifically provides a method and device for incrementally backing up a cloud desktop virtual machine ceph disk to a file. Background Art

[0002] Currently, traditional virtualization vendors mostly use open source OpenStack to store desktop virtual machine disks based on Ceph distributed storage. The OpenStack community only provides Cinder backup drivers based on Ceph backend and file system-based backup drivers.

[0003] The two backup drivers have their own advantages and disadvantages as follows:

[0004] 1. Ceph-based backup:

[0005] When using a ceph cluster to store backup data, you can use the advanced incremental data export function provided by Ceph distributed storage to achieve fast incremental backup and restore of disk data; at the same time, since the backup data is still stored in the same Ceph distributed storage cluster, if a disaster occurs in the Ceph cluster, the virtual machine data and the backup data will be unavailable at the same time. In addition, due to reliability requirements, the backup data stored in Ceph distributed storage needs to ensure 2-3 copies, and it is necessary to prepare 2-3 times the hard disk storage capacity of the backup data, which increases the backup disk hardware cost by 2-3 times.

[0006] 2. File-based backup:

[0007] The backup disk capacity only occupies one copy of the actual data of the virtual machine. However, since there is no incremental data export function for distributed storage, each backup and restore requires direct reading of the entire virtual machine's complete disk data. The amount of data and time for backup and restore are based on the size of the virtual machine's maximum disk capacity, which requires a lot of backup and restore time, while consuming a lot of CPU computing power and occupying a lot of disk read and write capacity and time; file backups often take too long, and users experience freezes during backups.

[0008] For the above two types of backup drivers, there is currently no reliable solution that is compatible with minimizing backup time and data volume and minimizing storage costs. Summary of the invention

[0009] The present invention aims at the deficiencies of the above-mentioned prior art and provides a method for incrementally backing up Ceph disks of cloud desktop virtual machines to files with strong practicality.

[0010] A further technical task of the present invention is to provide a reasonably designed, safe and applicable device for incrementally backing up Ceph disks of cloud desktop virtual machines to files.

[0011] The technical solution adopted by the present invention to solve its technical problem is:

[0012] A method for incrementally backing up Ceph disks of cloud desktop virtual machines to files. Based on compatibility with the native OpenStack Ceph disk backup process, a new extended backup_rbd_to_local_disk configuration item is added to intercept the backup data of Ceph rbd virtual machine disks, and the full and incremental data of the virtual machine disks are directly saved as local files, thus realizing full and incremental backup of backup data out of the Ceph cluster.

[0013] Further, the following steps are included:

[0014] S1. Take the disk test1 in the cinder-volumes pool of the cinderCeph backend as an example and create a backup test_backup.

[0015] S2. In the original OpenStack community Ceph full and incremental backup process, determine whether to enable local file backup;

[0016] S3. Create an empty backup disk in the original Ceph disk backup destination pool to be compatible with the original Ceph virtual machine disk backup process.

[0017] S4. Create a reference snapshot of the current backup time point for the newly created empty Ceph backup disk;

[0018] S5. Use rbd diff-export to split and compress the real differential backup data of the source backup disk test1 compared with the previous backup, and export it to the local backup file;

[0019] S6. For the above differential data, when the disk is backed up for the first time, the full data of this backup relative to the empty disk is exported. When the current backup has a previous backup, the differential data is the differential data of this backup relative to the previous backup.

[0020] S7. For the restore operation of the local file backup of the Ceph disk, compared with the original Ceph disk restore process of the OpenStack community, the operation object of reading the Ceph backup disk is replaced by reading the local file.

[0021] S8. If there are multiple backups of the backup data read from the local file in a certain order, parse the backup chains that depend on each other in the order of the multiple backups.

[0022] Furthermore, in step S3, in order to be compatible with the original Ceph backup process, when backing up data to local files is enabled, an empty backup disk is still created in the original Ceph backup pool, but data is not saved in the empty backup disk;

[0023] The reference command is rbd create --size 100cinder-backup / backup_test1.

[0024] Furthermore, in step S4, a reference snapshot named with the name and time point of this backup is created for the empty Ceph backup disk, and this snapshot is used as the time reference point of the backup. A snapshot is executed on the source Ceph backup disk to save the snapshot data of the source disk for this backup.

[0025] Further, in step S5, according to the current snapshot time point and the previous snapshot time point of the source backup disk cinder-volumes / test1, the data differential export capability of the Ceph disk is used, and rbd diff-export is used to fragment and compress the real differential backup data and export it to the backup file.

[0026] Furthermore, in step S6, when the disk is backed up for the first time, the full amount of data is exported;

[0027] If you export on an existing backup, what is exported is the relative data changes between the two backups. Only the relative data changes between the two backups are backed up, thus realizing incremental data backup.

[0028] Furthermore, in step S7, for the restore operation of the local file backup, the original operation of reading the Ceph backup disk is replaced by the operation of reading the local backup file, such as restoring to the new disk test3. If test3 has data, the data of test3 is cleared.

[0029] Furthermore, in step S8, the backup data read from the local file, if there are multiple backups, parse the backup chain, take test1->test2->test3 as an example, and use rbd diff import from front to back to import them into the target disk to be restored.

[0030] A device for incrementally backing up a Ceph disk of a cloud desktop virtual machine to a file, comprising: at least one memory and at least one processor;

[0031] The at least one memory is used to store a machine-readable program;

[0032] The at least one processor is used to call the machine-readable program to execute a method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file.

[0033] Compared with the prior art, the method and device for incrementally backing up a cloud desktop virtual machine Ceph disk to a file of the present invention has the following outstanding beneficial effects:

[0034] The present invention extends the original Ceph backup process to make it compatible with backing up virtual machine disk data to local files, and the actual user experience is consistent. By saving the virtual machine disk backup data outside the Ceph cluster, the problem of backup data unavailability when the Ceph cluster fails is avoided, and the reliability of the backup function is improved.

[0035] Compress and decompress local backup data to ensure the minimum backup data volume and backup time. Backing up data with a single file reduces the disk capacity occupied by the original Ceph cluster to store backup data. The cost is reduced to 1 / 2 and 1 / 3 compared to Ceph, and the hardware cost of the backup function is also reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Attached Figure 1 The present invention is a schematic diagram of the file backup process of a newly created volume in a method of incrementally backing up a Ceph disk of a cloud desktop virtual machine to a file;

[0038] Attached Figure 2 The present invention is a flowchart of restoring a file backup to a new volume in a method of incrementally backing up a Ceph disk of a cloud desktop virtual machine to a file. DETAILED DESCRIPTION

[0039] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] A best embodiment is given below:

[0041] like Figure 1-2As shown, a method for incrementally backing up the ceph disk of a cloud desktop virtual machine to a file in this embodiment is compatible with the native OpenStack Ceph disk backup process, and a new extended backup_rbd_to_local_disk configuration item is added to intercept the backup data of the Ceph rbd virtual machine disk, and the full and incremental data of the virtual machine disk are directly saved as local files, so as to realize full and incremental backup of the backup data out of the Ceph cluster.

[0042] The steps are as follows:

[0043] S1. Take the disk test1 in the cinder-volumes pool of the cinderCeph backend as an example and create a backup test_backup.

[0044] S2. In the original OpenStack community Ceph full and incremental backup process, determine whether to enable local file backup;

[0045] S3. Create an empty backup disk in the original Ceph disk backup destination pool to be compatible with the original Ceph virtual machine disk backup process.

[0046] To be compatible with the original Ceph backup process, when backing up data to local files is enabled, an empty backup disk is still created in the original Ceph backup pool, but data is not saved in the empty backup disk.

[0047] The reference command is rbd create --size 100cinder-backup / backup_test1.

[0048] S4. Create a reference snapshot of the current backup time point for the newly created empty Ceph backup disk;

[0049] For the empty Ceph backup disk, create a reference snapshot named with the name and time point of this backup, use this snapshot as the time reference point of the backup, and take a snapshot of the source Ceph backup disk to save the snapshot data of this backup of the source disk.

[0050] Refer to the command rbd snap create cinder-backup / backup_test1@backup_test1;

[0051] rbd snap create cinder-volumes / test1@backup_test1.

[0052] S5. Use rbd diff-export to split and compress the real differential backup data of the source backup disk test1 compared with the previous backup, and export it to the local backup file;

[0053] According to the current snapshot time point and the previous snapshot time point of the source backup disk cinder-volumes / test1, rbd diff-export uses the data differential export capability of the Ceph disk to slice and compress the real differential backup data and export it to the backup file.

[0054] rbdexport-diff --from-snapcinder-volumes / test1@backup_te st1cinder-volumes / test1 / var / lib / cinder / backups / cinder.backu ps / backup_test1.

[0055] S6. For the above differential data, when the disk is backed up for the first time, the full data of this backup relative to the empty disk is exported. When the current backup has a previous backup, the differential data is the differential data of this backup relative to the previous backup.

[0056] When backing up the disk for the first time, all data is exported;

[0057] If you export on an existing backup, what is exported is the relative data changes between the two backups. Only the relative data changes between the two backups are backed up, thus realizing incremental data backup.

[0058] Take the example of creating a backup of test2 after the backup of test1 is completed;

[0059] rbd export-diff--from-snap cinder-volumes / test2@backup_test1cinder-volumes / test1@backup_test1

[0060] / var / lib / cinder / backups / cinder.backups / backup_test2.

[0061] S7. For the restore operation of the local file backup of the Ceph disk, compared with the original Ceph disk restore process of the OpenStack community, the operation object of reading the Ceph backup disk is replaced by reading the local file.

[0062] For the restore operation of local file backup, the original operation of reading Ceph backup disk is replaced by the operation of reading local backup file, such as restoring to new disk test3. If there is data in test3, the data of test3 is cleared.

[0063] cluster=rados.Rados(conffile='my_Ceph.conf')

[0064] cluster.connect()

[0065] ioctx=cluster.open_ioctx('mypool')

[0066] rbd_image=rbd.Image(ioctx,'cinder-volumes / test1')

[0067] rbd_image.discard(offset+chunks*limit,rem).

[0068] S8. If there are multiple backups of the backup data read from the local file in a certain order, parse the dependent backup chains between the multiple backups;

[0069] Take test1->test2->test3 as an example, and use rbd diff import from front to back to import them to the target disk that needs to be restored.

[0070] rbd import-diff / var / lib / cinder / backups / cinder.backups / backup_test1cinder-volumes / <new disk name>;

[0071] rbd import-diff / var / lib / cinder / backups / cinder.backups / backup_test2cinder-volumes / <new disk name>;

[0072] rbd import-diff / var / lib / cinder / backups / cinder.backups / backup_test3cinder-volumes / <new disk name>.

[0073] Based on the above method, a device for incrementally backing up a ceph disk of a cloud desktop virtual machine to a file in this embodiment includes: at least one memory and at least one processor;

[0074] The at least one memory is used to store a machine-readable program;

[0075] The at least one processor is used to call the machine-readable program to execute a method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file.

[0076] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any technical solutions that comply with the claims of the present invention and any appropriate changes or substitutions made by ordinary technicians in the relevant technical field shall fall within the patent protection scope of the present invention.

[0077] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file, characterized in that: On the basis of being compatible with the native OpenStack Ceph disk backup process, the new extended backup_rbd_to_local_disk configuration item is added to intercept the backup data of the Ceph rbd virtual machine disk, and directly save the full and incremental data of the virtual machine disk into local files, so as to realize full and incremental backup of backup data out of the Ceph cluster.

2. According to claim 1, a method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file is characterized in that: The steps are as follows: S1. Take the disk test1 in the cinder-volumes pool of the cinderCeph backend as an example and create a backup test_backup. S2. In the original OpenStack community Ceph full and incremental backup process, determine whether to enable local file backup; S3. Create an empty backup disk in the original Ceph disk backup destination pool to be compatible with the original Ceph virtual machine disk backup process. S4. Create a reference snapshot of the current backup time point for the newly created empty Ceph backup disk; S5. Use rbd diff-export to split and compress the real differential backup data of the source backup disk test1 compared with the previous backup, and export it to the local backup file. S6. For the above differential data, when the disk is backed up for the first time, the full data of this backup relative to the empty disk is exported. When the current backup has a previous backup, the differential data is the differential data of this backup relative to the previous backup. S7. For the restore operation of the Ceph disk local file backup, compared with the original Ceph disk restore process of the OpenStack community, the operation object of reading the Ceph backup disk is replaced by reading the local file. S8. If there are multiple backups of the backup data read from the local file in a certain order, parse the dependent backup chains of the multiple backups in order.

3. A method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file according to claim 2, characterized in that: In step S3, in order to be compatible with the original Ceph backup process, when backing up data to local files is enabled, an empty backup disk is still created in the original Ceph backup pool, but data is not saved in the empty backup disk; The reference command is rbd create --size 100cinder-backup / backup_test1.

4. A method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file according to claim 3, characterized in that: In step S4, a reference snapshot named with the name and time point of this backup is created for the empty Ceph backup disk, and this snapshot is used as the time reference point of the backup. A snapshot is executed on the source Ceph backup disk to save the snapshot data of the source disk for this backup.

5. A method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file according to claim 4, characterized in that: In step S5, according to the current snapshot time point and the previous snapshot time point of the source backup disk cinder-volumes / test1, the data differential export capability of the Ceph disk is used, and rbd diff-export is used to fragment and compress the real differential backup data and export it to the backup file.

6. A method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file according to claim 5, characterized in that: In step S6, when the disk is backed up for the first time, the full amount of data is exported; If you export on an existing backup, what is exported is the relative data changes between the two backups. Only the relative data changes between the two backups are backed up, thus realizing incremental data backup.

7. A method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file according to claim 6, characterized in that: In step S7, for the restore operation of the local file backup, the original operation of reading the Ceph backup disk is replaced by the operation of reading the local backup file, such as restoring to the new disk test3. If test3 has data, the data of test3 is cleared.

8. A method for incrementally backing up a cloud desktop virtual machine Ceph disk to a file according to claim 7, characterized in that: In step S8, the backup data read from the local file is parsed if there are multiple backups. Taking test1->test2->test3 as an example, rbd diff import is used to import the backup data from the front to the back to the target disk to be restored.

9. A device for incrementally backing up a Ceph disk of a cloud desktop virtual machine to a file, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 8.