Mirror image processing method and device and storage medium

By obtaining snapshot difference information of virtual machine volumes to generate backup images, and creating full images when the mirror backend device is idle, the problem of long mirror production time and insufficient independence is solved, and the timely availability and fault tolerance of mirrors are improved.

CN119938220APending Publication Date: 2025-05-06CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411898382.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the mirroring production of virtual machines, there are problems such as long mirroring production time, insufficient mirror independence and fault tolerance in the prior art, especially the waiting time caused by long uploading of full data and the dependence of differential data mirroring reduce fault tolerance.

Method used

Generate an alternate image by obtaining snapshot difference information of the virtual machine volume, and performing full mirror creation when the mirror backend device is idle. Use snapshot difference information and byte offset information to create images to ensure the timely availability and independence of the mirror.

Benefits of technology

It realizes the timely usability of mirrors and the independence of mirrors, reduces the time of mirror production, and improves fault tolerance, especially in the mirror production scenarios of super-large system disks or data disks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938220A_ABST
    Figure CN119938220A_ABST
Patent Text Reader

Abstract

The invention discloses a mirror image processing method and device and a storage medium, a mirror image back-end device can respond to snapshot difference information of a virtual machine volume sent by a cloud device, and a standby mirror image is generated according to the snapshot difference information; wherein the snapshot difference information represents difference information between current snapshot information and reference snapshot information of the virtual machine volume; the reference snapshot information represents snapshot information corresponding to a current mirror image file of the virtual machine; in response to a mirror image creation instruction sent by the cloud equipment, performing mirror image creation processing based on byte offset bit information corresponding to the snapshot difference information and the reference mirror image file to obtain a target mirror image file of the virtual machine; wherein the mirror image creation instruction is generated by the cloud equipment through monitoring the operation state of the mirror image back-end equipment under the condition that the operation state information meets the preset state condition. Based on the above scheme, timely availability of the mirror image can be realized, and independence and fault tolerance of the mirror image are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a mirror processing method, device and storage medium. Background Art

[0002] The system and data disks of the virtual machine exist in the storage cluster in the form of volumes. The unified cloud platform manages the metadata of the volumes through the volume management service. The images exist in the image backend cluster in the form of files. The unified cloud platform manages the metadata of the images through the image management service.

[0003] At present, there are two main ways to create virtual machine images. One way is to create a snapshot based on the current virtual machine volume, export data from the storage cluster by operating the snapshot, and then upload the exported data to the image backend cluster through the image management service. The image will become available only after all data is transferred. The amount of data is often large, and it usually takes a long time to complete the dump to use the image. The other way is based on the snapshot comparison function of the storage, compare the difference data between the current image production and the previous image production, and then directly read the difference data to form an image backup chain without uploading all data each time. Although this method can reduce the time of image production, each time a new image is created, data backtracking is required because the difference data cannot provide the full amount of data, which reduces the independence of the image and leads to poor fault tolerance. Summary of the invention

[0004] The embodiments of the present application provide a mirror processing method, device and storage medium, which can not only realize the timely availability of the mirror, but also improve the independence and fault tolerance of the mirror.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a mirror processing method, which is applied to a mirror backend device; the method comprises:

[0007] In response to snapshot difference information of the virtual machine volume sent by the cloud device, a backup image is generated according to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine;

[0008] In response to the image creation instruction sent by the cloud device, image creation processing is performed based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine; wherein, the image creation instruction is generated by the cloud device by monitoring the running status of the image backend device and determining that the running status information meets the preset status conditions.

[0009] In a second aspect, an embodiment of the present application provides a mirror processing method, which is applied to a cloud device; the method comprises:

[0010] Obtaining snapshot difference information of a virtual machine volume, and sending the snapshot difference information to an image backend device, so that the image backend device generates a backup image based on the snapshot difference information; wherein the snapshot difference information represents difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents snapshot information corresponding to the current image file of the virtual machine;

[0011] Obtain the running status information of the mirror back-end device, and if the running status information meets the preset status condition, send an image creation instruction to the mirror back-end device, so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

[0012] In a third aspect, an embodiment of the present application provides a mirroring backend device, the mirroring backend device comprising a generating unit and a creating unit;

[0013] The generating unit is used to generate a backup image according to the snapshot difference information of the virtual machine volume sent by the cloud device in response to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine;

[0014] The creation unit is used to respond to the image creation instruction sent by the cloud device, perform image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtain the target image file of the virtual machine; wherein, the image creation instruction is generated by the cloud device by monitoring the running status of the image backend device and determining that the running status information meets the preset status conditions.

[0015] In a fourth aspect, an embodiment of the present application provides a cloud device, the cloud device comprising a first sending unit and a second sending unit;

[0016] The first sending unit is used to obtain snapshot difference information of the virtual machine volume, and send the snapshot difference information to the mirror backend device, so that the mirror backend device generates a backup mirror based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current mirror file of the virtual machine;

[0017] The second sending unit is used to obtain the operating status information of the mirror back-end device, and when the operating status information meets the preset status condition, send an image creation instruction to the mirror back-end device, so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

[0018] In a fifth aspect, an embodiment of the present application provides a mirroring backend device, which includes a first processor and a first memory storing executable instructions of the first processor; when the executable instructions are executed by the first processor, the mirroring processing method of the first aspect is implemented.

[0019] In a sixth aspect, an embodiment of the present application provides a cloud device, which includes a second processor and a second memory storing executable instructions of the second processor; when the executable instructions are executed by the second processor, the mirror processing method of the second aspect is implemented.

[0020] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a first processor, implements the mirror processing method of the first aspect; and, when executed by a second processor, implements the mirror processing method of the second aspect.

[0021] In an embodiment of the present application, an image processing method, device and storage medium are provided, wherein the image backend device can respond to snapshot difference information of a virtual machine volume sent by a cloud device, and generate a backup image according to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; in response to the image creation instruction sent by the cloud device, image creation processing is performed based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine; wherein the image creation instruction is generated by the cloud device by monitoring the running status of the image backend device and determining that the running status information meets the preset status conditions. The cloud device can obtain snapshot difference information of the virtual machine volume, and send the snapshot difference information to the mirror back-end device, so that the mirror back-end device generates a backup image based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; the operating status information of the mirror back-end device is obtained, and when the operating status information meets the preset status conditions, the mirror back-end device is sent an image creation instruction, so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine. It can be seen that when the present application creates a new image for a virtual machine, the cloud device can first obtain the snapshot difference information of the virtual machine volume corresponding to the virtual machine, that is, first obtain the difference information of the current snapshot information of the virtual machine volume and the snapshot information corresponding to the latest image file of the virtual machine, and then upload the difference data to the image back-end device first. At this time, the image back-end device can first generate a backup image based on the difference data to support the use of the image, thereby ensuring the timely availability of the image; then the cloud device will monitor the running status of the image back-end device. When it is determined that the running status of the image back-end device meets the preset status conditions, it means that the image back-end device is in a state of low computing power occupancy and relatively idle. At this time, the image creation instruction is sent to the image back-end device, so that the image back-end device can use the byte offset bit information corresponding to the previously uploaded difference data and the reference image file to perform a complete image creation, and obtain the target image corresponding to the virtual machine, which can provide a full amount of image data. If the image is created again in the future, a new image can also be created based on the target image without the need for a large amount of data backtracking, which greatly improves the independence and fault tolerance of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below.The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application.

[0023] Figure 1 Schematic diagram made for virtual machine images;

[0024] Figure 2 Schematic diagram of the implementation process of the mirror processing method proposed in the embodiment of the present application Figure 1 ;

[0025] Figure 3 Schematic diagram of the implementation of the mirror processing method proposed in the embodiment of the present application Figure 1 ;

[0026] Figure 4 Schematic diagram of the implementation process of the mirror processing method proposed in the embodiment of the present application Figure 2 ;

[0027] Figure 5 Schematic diagram of the implementation of the mirror processing method proposed in the embodiment of the present application Figure 2 ;

[0028] Figure 6 Schematic diagram of the implementation of the mirror processing method proposed in the embodiment of the present application Figure 3 ;

[0029] Figure 7 Schematic diagram of the composition structure of the mirror backend device proposed in the embodiment of the present application Figure 1 ;

[0030] Figure 8 Schematic diagram of the composition structure of the mirror backend device proposed in the embodiment of the present application Figure 2 ;

[0031] Fig. 9 Schematic diagram of the structure of the cloud device proposed in this application embodiment Figure 1 ;

[0032] Fig.10 Schematic diagram of the structure of the cloud device proposed in this application embodiment Figure 2 . DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for ease of description, only the parts related to the related applications are shown in the drawings.

[0034] The current mainstream cloud vendors provide customers with a variety of cloud computing products, among which virtual machines are the most representative. There are a series of ecological products around virtual machines. Image services are mainly used to record the current running status of virtual machines, running data products and services, which are of great significance to ensuring the data security of virtual machines.

[0035] For the current mainstream backend that is connected to a Ceph block storage cluster, or other storage clusters similar to Ceph, the process of making a virtual machine image can be as follows: Figure 1 As shown, the system and data disks of the virtual machine exist in the Ceph block storage cluster in the form of volumes. The unified cloud platform manages the metadata of the volumes through the volume management service. The images exist in the image backend cluster in the form of files. The unified cloud platform manages the metadata of the images through the image management service.

[0036] There are currently two methods for making images. One is to first take a snapshot of the volume, export data from the storage cluster by operating the snapshot, and then upload the exported data to the image backend cluster through the image management service, and wait for all data to be transferred. The data will exist in the form of an available image; the other method is based on the snapshot comparison function of the storage, compare the difference data between the current image production and the previous image production, and then directly read the difference data and save it, so as to form an image backup chain, and there is no need to upload all data every time. However, for the first method mentioned above, the image exists in a completely independent form, and the image data contains all the running data and running status of the virtual machine. When making an image, a snapshot is made based on the current volume, and then the data is fully uploaded. This will result in the image becoming available only after all data is uploaded. The image data is often very large, and it takes time to complete the dump of tens or even hundreds of GB of data, which causes the initiator of the image production to wait for a long time. For the second method, in actual use, the user virtual machine adds and deletes data on the volume generated by the source image in Ceph or Ceph-like storage cluster. Under normal circumstances, there are not many locations for such data addition and deletion, and most of the data has not been changed. Compared with the source image or the previous image of the virtual machine, the current system disk has a lot of redundant data, and this part of the data image can actually be reused. Assuming that the size of the virtual machine's system disk is S, and the storage cluster stores data in M ​​as the data block size, there are a total of S / M data blocks. If the virtual machine creates an image, only Y data blocks have data changes compared to the source image or the previous image. Compared with uploading all the image data, if only valid data is uploaded, the image creation time can be reduced by 1-YM / S. Under normal circumstances, YM is much smaller than S, so this method can greatly reduce the time for image creation, but multiple images share a large amount of public data, or rely on the image backup chain, which will lead to a decrease in image independence and fault tolerance. At the same time, when the image is used to create a new virtual machine later, the current image with only differential data cannot provide the full amount of data and needs to be traced back continuously.

[0037] In order to solve the problems existing in the current image processing methods, the embodiments of the present application provide an image processing method, device and storage medium, wherein the image back-end device can respond to the snapshot difference information of the virtual machine volume sent by the cloud device, and generate a backup image according to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; in response to the image creation instruction sent by the cloud device, image creation processing is performed based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine; wherein the image creation instruction is generated by the cloud device by monitoring the running status of the image back-end device and determining that the running status information meets the preset status conditions. The cloud device can obtain the snapshot difference information of the virtual machine volume, and send the snapshot difference information to the mirror backend device, so that the mirror backend device generates a backup image based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; the operating status information of the mirror backend device is obtained, and when the operating status information meets the preset status conditions, the mirror backend device sends the image creation instruction to the mirror backend device, so that the mirror backend device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine. Based on the above method, not only can the timely availability of the image be achieved, but also the independence and fault tolerance of the image can be improved.

[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0039] An embodiment of the present application provides a mirror processing method, such as Figure 2 As shown, the mirror processing method of the mirror backend device may include the following steps:

[0040] Step 101, in response to snapshot difference information of the virtual machine volume sent by the cloud device, generate a backup image according to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine.

[0041] In an embodiment of the present application, the mirror backend device can respond to the snapshot difference information of the virtual machine volume sent by the cloud device, and generate a backup image based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine.

[0042] In the embodiment of the present application, the image backend device may be any device in the image backend cluster, and may be a server or storage device for storing and processing image files.

[0043] In an embodiment of the present application, the cloud device may be a device corresponding to a cloud platform for managing image management services and volume management services, for example, the cloud device may be a server.

[0044] In an embodiment of the present application, a virtual machine volume refers to a storage device used by a virtual machine, such as a hard disk, a logical partition or volume on a solid-state drive (Solid State Disk or Solid State Drive, SSD); a virtual machine volume can be used to store files such as a virtual machine operating system, application programs, and data.

[0045] In an embodiment of the present application, when creating an image for a virtual machine, a snapshot operation may be first performed on the current virtual machine volume to obtain current snapshot information.

[0046] In an embodiment of the present application, the reference snapshot information may be snapshot information corresponding to the latest image of the virtual machine, that is, snapshot information of the virtual machine corresponding to the image file obtained by the previous image creation of the current virtual machine.

[0047] In an embodiment of the present application, snapshot information can reflect the state of a virtual machine volume at a certain point in time, including disk data and memory status, etc.; snapshot difference information can be used to reflect the difference between the current snapshot information and the reference snapshot information, for example, the snapshot difference information can be the addition, deletion or modification of certain data, etc.

[0048] In an embodiment of the present application, when the image back-end device receives snapshot difference information, it can first use the snapshot difference information and the current image file of the stored virtual machine to generate a backup image. Since the amount of snapshot difference data is very small, the time for uploading data can be greatly reduced. When the user needs to use the image at this time, the backup image can be supported for use, thereby enabling the timely availability of the image.

[0049] Step 102, in response to the image creation instruction sent by the cloud device, image creation processing is performed based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine; wherein, the image creation instruction is generated by the cloud device by monitoring the operating status of the image backend device and determining that the operating status information meets the preset status conditions.

[0050] In an embodiment of the present application, the image back-end device can respond to the snapshot difference information of the virtual machine volume sent by the cloud device, generate a backup image according to the snapshot difference information, and then respond to the image creation instruction sent by the cloud device, perform image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, to obtain the target image file of the virtual machine; wherein the image creation instruction is generated by the cloud device by monitoring the operating status of the image back-end device and determining that the operating status information meets the preset status conditions.

[0051] In an embodiment of the present application, the cloud device can monitor the operating status of the mirror backend device in real time. When it is determined that the mirror backend device is in an idle state or the computing power usage is low, an image creation instruction can be sent to the mirror backend device, so that the mirror backend device can create the image during the idle period to obtain a full image file, that is, the target image file; when a new image is subsequently created, the image can be created directly based on the currently generated target image file. Compared with the method of creating a new virtual machine based on the image backup chain in the current related technology, it can avoid continuous data backtracking and effectively improve the independence and stability of the image file.

[0052] In an embodiment of the present application, the byte offset bit information can be used to indicate the offset bit of the data block corresponding to the snapshot difference information; that is, the byte offset bit information can be used to indicate the data block or byte that has changed compared to the reference snapshot information, as well as the specific offset of the data block or byte.

[0053] In some embodiments of the present application, the image back-end device responds to the image creation instruction sent by the cloud device, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and before obtaining the target image file of the virtual machine, it can scan and process the data blocks in the current snapshot information and the reference snapshot information respectively to obtain a first scanning result corresponding to the current snapshot information and a second scanning result corresponding to the reference snapshot information; determine the byte offset bit information based on the first scanning result and the second scanning result.

[0054] In an embodiment of the present application, the data blocks in the current snapshot information and the reference snapshot information may be scanned and processed based on the diff_iterate function of the Ceph block storage to determine the byte offset information.

[0055] It can be understood that in an embodiment of the present application, the first scanning result can be used to indicate the physical position of the data block in the current snapshot information, and the second scanning result can be used to indicate the physical position of the data block in the reference snapshot information; thus, the second scanning result and the first scanning result can be compared to obtain specific information on the offset or change of the corresponding data block, thereby obtaining the byte offset bit information.

[0056] For example, Figure 3 As shown, the physical locations of the data blocks in snapshot 1 (reference snapshot information) and snapshot 2 (current snapshot information) can be obtained through scanning processing; assuming that snapshot 1 is the snapshot information corresponding to the source image of the virtual machine volume and there is no data yet, the snapshot difference information can be directly determined based on the data existing in snapshot 2; and then, through scanning processing, it is obtained that snapshot 2 includes four data blocks A, B, C, and Y, each of which has a size of M, M=4MB. In the first scanning result corresponding to snapshot 2, the physical locations of these four data blocks are respectively represented as: A~A+M, B~B+M, C~C+M, and Y~Y+M; thus, the byte offset bit information can be determined based on the positions of the corresponding data blocks in the first scanning result corresponding to snapshot 2 and the second scanning result corresponding to snapshot 1 as: 0~M, M~2M, 2M~3M...(N-1)M~NM, that is, the offset range of each data block is M.

[0057] In some embodiments of the present application, after obtaining the snapshot difference information and the byte offset information, the mirror backend device can determine the comparison relationship between the two based on the snapshot difference information and the byte offset information, and store the snapshot difference information, the byte offset information and the comparison relationship information in the mirror metadata corresponding to the target image.

[0058] Exemplarily, based on snapshot 1 and snapshot 2 in the aforementioned example, since snapshot 1 has no data, the snapshot difference information between snapshot 1 and snapshot 2 can be directly determined based on the data blocks in snapshot 2, as shown on the left side of Table 1 below. The snapshot difference information can be four data blocks A, B, C, and Y; the byte offset information can be: 0~M, M~2M, 2M~3M...(N-1)M~NM; then the mirroring backend device can determine the comparison relationship information between the snapshot difference information and the byte offset information. The comparison relationship information can include each data block in the snapshot difference information and the byte offset corresponding to each data block. The obtained comparison relationship information can be shown in Table 1 below:

[0059] Table 1

[0060] Snapshot difference information Byte offset information A~A+M 0~M B~B+M M~2M C~C+M 2M~3M Y~Y+M (N-1)M~NM

[0061] It is understandable that in the embodiment of the present application, the cloud device can monitor the operating status of the mirroring backend device in real time and record the operating status information, so as to determine whether the mirroring backend device meets the preset status conditions according to the operating status information.

[0062] In an embodiment of the present application, the preset state condition indicates that the mirroring backend device is in an idle state.

[0063] In some embodiments of the present application, the cloud device can determine an operating status reference value based on the operating status information; when the operating status reference value is less than or equal to a preset threshold, it is determined that the operating status information meets the preset status condition; when the operating status reference value is greater than the preset threshold, it is determined that the operating status information does not meet the preset status condition; wherein the operating status information may include at least one of central processing unit occupancy information, memory occupancy information, input / output occupancy information and bandwidth occupancy information.

[0064] In some embodiments of the present application, when the operating status information includes multiple types of information, a weighted calculation can be performed based on the multiple types of information in the operating status information to obtain an operating status reference value, thereby comparing the operating status reference value with a preset threshold to determine whether the operating status information meets the preset status conditions.

[0065] In the embodiments of the present application, the specific value of the preset threshold is not limited in the present application; for example, the preset threshold is C, when the real-time calculated operating status reference value is greater than C, it is determined that the current mirror backend device is in a busy business period and does not meet the preset status condition; and if the operating status reference value is less than or equal to C, it can be determined that the current mirror backend device is in an idle period, meets the preset status condition, and can perform a complete image file production operation.

[0066] In some embodiments of the present application, when the mirroring back-end device performs mirror creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine, the mirroring difference data can be determined according to the snapshot difference information; then, data integration processing is performed on the mirroring difference data and the reference image file according to the byte offset bit information to obtain the target image file.

[0067] It is understandable that the image difference data may be image data determined according to the snapshot difference information, so that the image difference data may be overwritten at the corresponding position in the reference image file according to the byte offset information to complete the data integration process and obtain the target image file.

[0068] In some embodiments of the present application, since the target image file is a complete image file generated for the virtual machine, after obtaining the target image file, the backup image file can be deleted and the target image file can be used directly.

[0069] In some embodiments of the present application, the image back-end device responds to the image creation instruction sent by the cloud device, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and after obtaining the target image file of the virtual machine, it can store the target snapshot in the image metadata corresponding to the target image when receiving the target snapshot sent by the cloud device.

[0070] In an embodiment of the present application, after each image file is created, the cloud device can send a snapshot creation instruction to the device in the block storage cluster through the volume management service, so that the device in the block storage cluster responds to the snapshot creation instruction, generates a target snapshot corresponding to the target image, and receives the target snapshot sent by the device in the block storage cluster, and sends the target snapshot to the image back-end device, so that the image back-end device can store the target snapshot in the image metadata corresponding to the target image for use in subsequent image creation.

[0071] In some embodiments of the present application, after receiving the target snapshot sent by the cloud device, the image back-end device stores the target snapshot in the image metadata corresponding to the target image. If the reference snapshot information is the snapshot information corresponding to the source image of the virtual machine, the reference snapshot information may be stored; and if the reference snapshot information is not the snapshot information corresponding to the source image of the virtual machine, the reference snapshot information may be deleted.

[0072] It should be noted that, in an embodiment of the present application, the image backend device at least stores snapshot information corresponding to the source image of the virtual machine, that is, the original snapshot of the virtual machine volume; and the snapshot information corresponding to the source image will accompany the entire life cycle of the virtual machine; if the source image is a public image, the snapshot can be shared by multiple virtual machines, if it is a private image, the snapshot is exclusive to the user; the snapshot contains the initial state of the virtual machine, at which time the user has not written any data.

[0073] In some embodiments of the present application, a corresponding snapshot will be retained each time an image is created, and the snapshot information will be written into the image metadata. The snapshot information will be deleted synchronously after the corresponding image file is deleted or a subsequent complete image file of the virtual machine is created.

[0074] It should be noted that in the embodiments of the present application, each time a complete image file is created, the snapshot information corresponding to the previous image file will be deleted. However, if the previous snapshot information is the snapshot information corresponding to the source image, the snapshot information will not be deleted, that is, the snapshot information corresponding to the source image will be retained.

[0075] In an embodiment of the present application, a mirror processing method is provided, in which a mirror backend device can generate a backup mirror according to the snapshot difference information of a virtual machine volume sent by a cloud device; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current mirror file of the virtual machine; in response to the mirror creation instruction sent by the cloud device, the mirror creation processing is performed based on the byte offset bit information corresponding to the snapshot difference information and the reference mirror file to obtain the target mirror file of the virtual machine; wherein the mirror creation instruction is generated by the cloud device by monitoring the running status of the mirror backend device and determining that the running status information meets the preset status conditions. It can be seen that when the present application creates a new image for a virtual machine, the cloud device can first obtain the snapshot difference information of the virtual machine volume corresponding to the virtual machine, that is, first obtain the difference information of the current snapshot information of the virtual machine volume and the snapshot information corresponding to the latest image file of the virtual machine, and then upload the difference data to the image back-end device first. At this time, the image back-end device can first generate a backup image based on the difference data to support the use of the image, thereby ensuring the timely availability of the image; then the cloud device will monitor the running status of the image back-end device. When it is determined that the running status of the image back-end device meets the preset status conditions, it means that the image back-end device is in a state of low computing power occupancy and relatively idle. At this time, the image creation instruction is sent to the image back-end device, so that the image back-end device can use the byte offset bit information corresponding to the previously uploaded difference data and the reference image file to perform a complete image creation, and obtain the target image corresponding to the virtual machine, which can provide a full amount of image data. If the image is created again in the future, a new image can also be created based on the target image without the need for a large amount of data backtracking, which greatly improves the independence and fault tolerance of the image.

[0076] Based on the above embodiment, in another embodiment of the present application, a mirror processing method is provided, which is applied to a cloud device; Figure 4 As shown, the image processing method of the cloud device may include the following steps:

[0077] Step 201, obtain snapshot difference information of the virtual machine volume, and send the snapshot difference information to the mirror backend device, so that the mirror backend device generates a backup image based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine.

[0078] In an embodiment of the present application, a cloud device can obtain snapshot difference information of a virtual machine volume and send the snapshot difference information to a mirror backend device so that the mirror backend device generates a backup image based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine.

[0079] In an embodiment of the present application, the cloud device may be a device corresponding to a cloud platform for managing image management services and volume management services, for example, the cloud device may be a server.

[0080] In an embodiment of the present application, a virtual machine volume refers to a storage device used by a virtual machine, such as a logical partition or volume on a hard disk or SSD; a virtual machine volume can be used to store files such as a virtual machine operating system, application programs, and data.

[0081] In an embodiment of the present application, snapshot information can reflect the state of a virtual machine volume at a certain point in time, including disk data and memory status, etc.; snapshot difference information can be used to reflect the difference between the current snapshot information and the reference snapshot information, for example, the snapshot difference information can be the addition, deletion or modification of certain data, etc.

[0082] In an embodiment of the present application, the cloud device may receive snapshot difference information sent by a storage device corresponding to the virtual machine volume.

[0083] Step 202: Obtain the operating status information of the mirror backend device, and when the operating status information meets the preset status conditions, send an image creation instruction to the mirror backend device, so that the mirror backend device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

[0084] In an embodiment of the present application, after the cloud device obtains snapshot difference information of the virtual machine volume and sends the snapshot difference information to the mirror back-end device so that the mirror back-end device generates a backup image based on the snapshot difference information, it can obtain the operating status information of the mirror back-end device, and when the operating status information meets the preset status conditions, send an image creation instruction to the mirror back-end device so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

[0085] In an embodiment of the present application, the byte offset bit information can be used to indicate the offset bit of the data block corresponding to the snapshot difference information; that is, the byte offset bit information can be used to indicate the data block or byte that has changed compared to the reference snapshot information, as well as the specific offset of the data block or byte.

[0086] In an embodiment of the present application, the preset state condition indicates that the mirroring backend device is in an idle state.

[0087] In some embodiments of the present application, the operating status information may include at least one of central processing unit occupancy information, memory occupancy information, input / output occupancy information, and bandwidth occupancy information.

[0088] In some embodiments of the present application, the cloud device can determine an operating status reference value based on the operating status information; when the operating status reference value is less than or equal to a preset threshold, it is determined that the operating status information meets the preset status condition; when the operating status reference value is greater than the preset threshold, it is determined that the operating status information does not meet the preset status condition.

[0089] In some embodiments of the present application, the cloud device can obtain the operating status information of the mirror back-end device, and send an image creation instruction to the mirror back-end device when the operating status information meets the preset status conditions, so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the snapshot difference information, the byte offset bit information and the reference image file, and after obtaining the target image of the virtual machine, send a snapshot creation instruction to the storage device, so that the storage device responds to the snapshot creation instruction and generates a target snapshot corresponding to the target image; receive the target snapshot sent by the storage device, and send the target snapshot to the mirror back-end device, so that the mirror back-end device stores the target snapshot in the image metadata corresponding to the target image.

[0090] In an embodiment of the present application, a mirror processing method is provided, in which a cloud device can obtain snapshot difference information of a virtual machine volume, and send the snapshot difference information to a mirror back-end device, so that the mirror back-end device generates a backup mirror based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current mirror file of the virtual machine; the operating status information of the mirror back-end device is obtained, and when the operating status information meets the preset status conditions, a mirror creation instruction is sent to the mirror back-end device, so that the mirror back-end device responds to the image creation instruction, performs mirror creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference mirror file, and obtains the target image of the virtual machine. It can be seen that when the present application creates a new image for a virtual machine, the cloud device can first obtain the snapshot difference information of the virtual machine volume corresponding to the virtual machine, that is, first obtain the difference information of the current snapshot information of the virtual machine volume and the snapshot information corresponding to the latest image file of the virtual machine, and then upload the difference data to the image back-end device first. At this time, the image back-end device can first generate a backup image based on the difference data to support the use of the image, thereby ensuring the timely availability of the image; then the cloud device will monitor the running status of the image back-end device. When it is determined that the running status of the image back-end device meets the preset status conditions, it means that the image back-end device is in a state of low computing power occupancy and relatively idle. At this time, the image creation instruction is sent to the image back-end device, so that the image back-end device can use the byte offset bit information corresponding to the previously uploaded difference data and the reference image file to perform a complete image creation, and obtain the target image corresponding to the virtual machine, which can provide a full amount of image data. If the image is created again in the future, a new image can also be created based on the target image without the need for a large amount of data backtracking, which greatly improves the independence and fault tolerance of the image.

[0091] Based on the above embodiment, in another embodiment of the present application, illustratively, as Figure 5 As shown, a virtual machine volume may correspond to a snapshot corresponding to a source image. After image A is created, the image backend device may store the snapshot corresponding to the created image A. If a new image B is created again, the creation of image B may be completed based on the latest image currently in use, that is, image A and the snapshot corresponding to image A. If image A does not exist, the snapshot corresponding to the source image may be used. That is to say, when creating image B, for the image file used, image A has a higher priority than the source image.

[0092] In the embodiments of the present application, a new virtual machine image creation logic and virtual machine snapshot management logic are proposed, and the image and snapshot are associated, which can provide a data source for image creation and can also serve as a backup for user data.

[0093] In some embodiments of the present application, there is an original snapshot for the virtual machine, which accompanies the entire life cycle of the virtual machine; if it is a public image, the snapshot can be shared by multiple virtual machines, and if it is a private image, the snapshot is exclusive to the user; the snapshot is the initial state of the virtual machine, at which time the user has no data written.

[0094] In some embodiments of the present application, each time an image is created, a generated snapshot is retained and the snapshot information is written into the image metadata, but the snapshot is deleted synchronously after the image is deleted or a subsequent complete image of the same virtual machine is created.

[0095] In some embodiments of the present application, the current image production will correspond to a current snapshot, which is used to compare data with the previous image snapshot or the source image snapshot. The source image snapshot will be used only if the previous image snapshot does not exist, that is, the previous image snapshot has a higher priority; both snapshot information used for comparison need to be written into the image metadata; after the current image file is generated, the current snapshot is retained and the previous image snapshot is deleted; if it is compared with the original snapshot, the original snapshot continues to be retained.

[0096] In some embodiments of the present application, a virtual machine may have at most three image-associated snapshots in the image backend cluster at the same time, namely, the original snapshot, the previous image snapshot, and the current image snapshot; at least the original snapshot may exist.

[0097] In some embodiments of the present application, the byte offset information of the snapshot difference information can be obtained based on the diff_iterate function of the Ceph block storage; the comparison relationship information between the snapshot difference information and the byte offset information can be recorded in the image metadata.

[0098] In some embodiments of the present application, the mirroring backend device can perform a complete mirroring file creation operation when the system is idle, overwrite the mirroring difference data on the reference mirroring file according to the byte offset information, to complete the data integration process and obtain the target mirroring file.

[0099] For example, Figure 6 As shown, according to the specific offset of each data block indicated by the byte offset bit information, the mirror difference data of the corresponding data block is overwritten on the reference mirror file to complete the data integration process, thereby obtaining the target mirror file.

[0100] In some embodiments of the present application, assuming that the mirroring backend device is in a low period of business processing at night, and the cloud device monitors that the mirroring backend device is in an idle state at this time, a mirroring creation instruction can be sent to the mirroring backend device. The mirroring backend device can respond to the mirroring creation instruction, start a background task, load snapshot difference information and reference image files, and create image files.

[0101] In some embodiments of the present application, after obtaining the target image file, the target image file can be stored, and when the reference snapshot information is the snapshot information corresponding to the source image of the virtual machine, the reference snapshot information is stored; when the reference snapshot information is not the snapshot information corresponding to the source image of the virtual machine, the reference snapshot information is deleted, thereby completing the delayed production and storage of the final complete image file.

[0102] In some embodiments of the present application, if the image backend device receives a download request for a target image during the creation of the target image, it is still necessary to complete the creation of the target image before responding to the download request.

[0103] In some embodiments of the present application, before the image creation is completed, if a new image creation task for a virtual machine is received, the currently unfinished image can be skipped, and a complete image can be traced back to serve as a reference image to produce a new image. At this time, the metadata of the complete image needs to be updated to record its association with the new image. At the same time, if the complete images used by the two images to be created, that is, the reference image information is the same image file, it is also necessary to retain the reference image information and the corresponding reference snapshot information after the previous image is created.

[0104] In some embodiments of the present application, before a complete target image is generated, if there is a request to delete a reference image file, the generation of the target image needs to be executed immediately in the background to ensure that the reference image file is deleted after the target image is generated.

[0105] In summary, the embodiments of the present application propose a new virtual machine snapshot management logic and a new virtual machine image production scheme, which can realize delayed uploading of complete images during business low periods; the creation of images is mainly based on snapshot difference information and byte offset information as well as the current latest complete image, and the comparison relationship between the snapshot difference information and the byte offset information is written into the image metadata; the delayed uploading method can not only improve the speed of image production, but also realize the rapid availability of virtual machine images on the basis of ensuring the complete independence of the images, and its application effect is particularly significant in the scenario of image production of ultra-large system disks or data disks.

[0106] Based on the above embodiment, in another embodiment of the present application, a mirroring backend device is provided, such as Figure 7 As shown, the mirroring backend device 1 may include a generating unit 11 , a creating unit 12 , a storing unit 13 and a first determining unit 14 .

[0107] The generation unit 11 is used to generate a backup image according to the snapshot difference information of the virtual machine volume sent by the cloud device; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine.

[0108] The creation unit 12 is used to respond to the image creation instruction sent by the cloud device, perform image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtain the target image file of the virtual machine; wherein the image creation instruction is generated by the cloud device by monitoring the operating status of the image backend device and determining that the operating status information meets the preset status conditions.

[0109] The storage unit 13 is used to perform image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file in response to the image creation instruction sent by the cloud device when the creation unit 12 obtains the target image file of the virtual machine, and then, when the target snapshot sent by the cloud device is received, the target snapshot is stored in the image metadata corresponding to the target image.

[0110] In some embodiments of the present application, the storage unit 13 is also used to, after receiving the target snapshot sent by the cloud device, store the target snapshot in the image metadata corresponding to the target image, and when the reference snapshot information is the snapshot information corresponding to the source image of the virtual machine, store the reference snapshot information; and when the reference snapshot information is not the snapshot information corresponding to the source image of the virtual machine, delete the reference snapshot information.

[0111] The first determination unit 14 is used to perform image creation processing based on the byte offset information corresponding to the snapshot difference information and the reference image file when the creation unit 12 responds to the image creation instruction sent by the cloud device, and before obtaining the target image file of the virtual machine, scan the data blocks in the current snapshot information and the reference snapshot information respectively to obtain a first scanning result corresponding to the current snapshot information and a second scanning result corresponding to the reference snapshot information; determine the byte offset information according to the first scanning result and the second scanning result; wherein the byte offset information is used to indicate the offset of the data block corresponding to the snapshot difference information.

[0112] In some embodiments of the present application, the creation unit 12 is further used to determine the image difference data according to the snapshot difference information; and perform data integration processing on the image difference data and the reference image file according to the byte offset bit information to obtain the target image file.

[0113] Based on the above embodiment, in another embodiment of the present application, Figure 8 Schematic diagram of the composition structure of the mirror backend device proposed in the embodiment of the present application Figure 2 ,like Figure 8 As shown, the mirroring back-end device 1 proposed in the embodiment of the present application may also include a first processor 15 and a first memory 16 storing executable instructions of the first processor 15; further, the electronic device 1 may also include a first communication interface 17, and a first bus 18 for connecting the first processor 15, the first memory 16 and the first communication interface 17.

[0114] In the embodiment of the present application, the first processor 15 can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiment of the present application is not specifically limited. The electronic device 1 can also include a first memory 16, which can be connected to the first processor 15, wherein the first memory 16 is used to store executable program code, the program code includes computer operation instructions, and the first memory 16 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.

[0115] In the embodiment of the present application, the first bus 18 is used to connect the first communication interface 17, the first processor 15 and the first memory 16, and the mutual communication between these devices.

[0116] In the embodiment of the present application, the first memory 16 is used to store instructions and data.

[0117] Furthermore, in an embodiment of the present application, the above-mentioned first processor 15 is used to respond to the snapshot difference information of the virtual machine volume sent by the cloud device, and generate a backup image according to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; in response to the image creation instruction sent by the cloud device, image creation processing is performed based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine; wherein the image creation instruction is generated by the cloud device by monitoring the running status of the image backend device and determining that the running status information meets the preset status conditions.

[0118] In practical applications, the first memory 16 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the first processor 15.

[0119] An embodiment of the present application provides an image backend device, including a generation unit and a creation unit; the generation unit is used to respond to snapshot difference information of a virtual machine volume sent by a cloud device, and generate a backup image according to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; the creation unit is used to respond to the image creation instruction sent by the cloud device, perform image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtain the target image file of the virtual machine; wherein the image creation instruction is generated by the cloud device by monitoring the running status of the image backend device and determining that the running status information meets the preset status condition. It can be seen that when the present application creates a new image for a virtual machine, the cloud device can first obtain the snapshot difference information of the virtual machine volume corresponding to the virtual machine, that is, first obtain the difference information of the current snapshot information of the virtual machine volume and the snapshot information corresponding to the latest image file of the virtual machine, and then upload the difference data to the image back-end device first. At this time, the image back-end device can first generate a backup image based on the difference data to support the use of the image, thereby ensuring the timely availability of the image; then the cloud device will monitor the running status of the image back-end device. When it is determined that the running status of the image back-end device meets the preset status conditions, it means that the image back-end device is in a state of low computing power occupancy and relatively idle. At this time, the image creation instruction is sent to the image back-end device, so that the image back-end device can use the byte offset bit information corresponding to the previously uploaded difference data and the reference image file to perform a complete image creation, and obtain the target image corresponding to the virtual machine, which can provide a full amount of image data. If the image is created again in the future, a new image can also be created based on the target image without the need for a large amount of data backtracking, which greatly improves the independence and fault tolerance of the image.

[0120] Based on the above embodiment, in another embodiment of the present application, a cloud device is provided, such as Fig. 9 As shown, the cloud device 2 may include a first sending unit 21 , a second sending unit 22 , a third sending unit 23 and a second determining unit 24 .

[0121] The first sending unit 21 is used to obtain snapshot difference information of the virtual machine volume and send the snapshot difference information to the mirror backend device so that the mirror backend device generates a backup mirror based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current mirror file of the virtual machine.

[0122] The second sending unit 22 is used to obtain the operating status information of the mirror backend device, and when the operating status information meets the preset status conditions, send the mirror backend device an image creation instruction, so that the mirror backend device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

[0123] The third sending unit 23 is used to obtain the operating status information of the mirror back-end device from the second sending unit 22, and send an image creation instruction to the mirror back-end device when the operating status information meets the preset status conditions, so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the snapshot difference information, the byte offset bit information and the reference image file, and after obtaining the target image of the virtual machine, sends a snapshot creation instruction to the storage device, so that the storage device responds to the snapshot creation instruction and generates a target snapshot corresponding to the target image; and receives the target snapshot sent by the storage device, and sends the target snapshot to the mirror back-end device, so that the mirror back-end device stores the target snapshot in the image metadata corresponding to the target image.

[0124] The second determination unit 24 is used to determine the operating status reference value according to the operating status information; and when the operating status reference value is less than or equal to a preset threshold, determine that the operating status information meets the preset status condition; and when the operating status reference value is greater than the preset threshold, determine that the operating status information does not meet the preset status condition.

[0125] Based on the above embodiment, in another embodiment of the present application, Fig.10 Schematic diagram of the structure of the cloud device proposed in this application embodiment Figure 2 ,like Fig.10 As shown, the cloud device 2 proposed in the embodiment of the present application may also include a second processor 25 and a second memory 26 storing executable instructions of the second processor 25; further, the cloud device 2 may also include a second communication interface 27, and a second bus 28 for connecting the second processor 25, the second memory 26 and the second communication interface 27.

[0126] In an embodiment of the present application, the second processor 25 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the above-mentioned processor function may also be other, and the embodiment of the present application is not specifically limited. The cloud device 2 may also include a second memory 26, which may be connected to the second processor 25, wherein the second memory 26 is used to store executable program code, the program code including computer operation instructions, and the second memory 26 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.

[0127] In the embodiment of the present application, the second bus 28 is used to connect the second communication interface 27, the second processor 25 and the second memory 26, and the mutual communication between these devices.

[0128] In the embodiment of the present application, the second memory 26 is used to store instructions and data.

[0129] Furthermore, in an embodiment of the present application, the second processor 25 is used to obtain snapshot difference information of the virtual machine volume, and send the snapshot difference information to the mirror back-end device, so that the mirror back-end device generates a backup image based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; obtain the running status information of the mirror back-end device, and send the image creation instruction to the mirror back-end device when the running status information meets the preset status conditions, so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

[0130] In practical applications, the second memory 26 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the second processor 25.

[0131] An embodiment of the present application provides a cloud device, including a first sending unit and a second sending unit; the first sending unit is used to obtain snapshot difference information of a virtual machine volume, and send the snapshot difference information to a mirror backend device, so that the mirror backend device generates a backup image based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; the second sending unit is used to obtain the running status information of the mirror backend device, and when the running status information meets the preset status condition, send an image creation instruction to the mirror backend device, so that the mirror backend device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine. It can be seen that when the present application creates a new image for a virtual machine, the cloud device can first obtain the snapshot difference information of the virtual machine volume corresponding to the virtual machine, that is, first obtain the difference information of the current snapshot information of the virtual machine volume and the snapshot information corresponding to the latest image file of the virtual machine, and then upload the difference data to the image back-end device first. At this time, the image back-end device can first generate a backup image based on the difference data to support the use of the image, thereby ensuring the timely availability of the image; then the cloud device will monitor the running status of the image back-end device. When it is determined that the running status of the image back-end device meets the preset status conditions, it means that the image back-end device is in a state of low computing power occupancy and relatively idle. At this time, the image creation instruction is sent to the image back-end device, so that the image back-end device can use the byte offset bit information corresponding to the previously uploaded difference data and the reference image file to perform a complete image creation, and obtain the target image corresponding to the virtual machine, which can provide a full amount of image data. If the image is created again in the future, a new image can also be created based on the target image without the need for a large amount of data backtracking, which greatly improves the independence and fault tolerance of the image.

[0132] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.

[0133] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0134] Specifically, a program instruction corresponding to an image processing method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, or a USB flash drive. When the program instruction corresponding to an image processing method in the storage medium is read or executed by the first processor, the following steps are included:

[0135] In response to snapshot difference information of the virtual machine volume sent by the cloud device, a backup image is generated according to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine;

[0136] In response to the image creation instruction sent by the cloud device, image creation processing is performed based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine; wherein, the image creation instruction is generated by the cloud device by monitoring the operating status of the image backend device and determining that the operating status information meets the preset status conditions.

[0137] When a program instruction corresponding to an image processing method in a storage medium is read or executed by a second processor, the method includes the following steps:

[0138] Obtaining snapshot difference information of the virtual machine volume, and sending the snapshot difference information to the mirroring backend device, so that the mirroring backend device generates a backup mirror based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current mirror file of the virtual machine;

[0139] Obtain the running status information of the mirror backend device, and when the running status information meets the preset status conditions, send an image creation instruction to the mirror backend device, so that the mirror backend device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

[0140] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware.

[0141] The present application is described with reference to implementation 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 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 generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. 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.

[0142] These computer program instructions may also be stored in a computer-readable memory that can direct 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 a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.

[0144] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application.

Claims

1. A mirror processing method, characterized in that: Applied to mirroring backend equipment; the method comprises: In response to snapshot difference information of the virtual machine volume sent by the cloud device, a backup image is generated according to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; In response to the image creation instruction sent by the cloud device, image creation processing is performed based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine; wherein, the image creation instruction is generated by the cloud device by monitoring the running status of the image backend device and determining that the running status information meets the preset status conditions.

2. The mirror processing method according to claim 1, characterized in that: In response to the image creation instruction sent by the cloud device, after performing image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine, the method further includes: When the target snapshot sent by the cloud device is received, the target snapshot is stored in the image metadata corresponding to the target image.

3. The mirror processing method according to claim 2, characterized in that: In the case of receiving the target snapshot sent by the cloud device, after storing the target snapshot in the image metadata corresponding to the target image, the method further includes: When the reference snapshot information is snapshot information corresponding to a source image of the virtual machine, storing the reference snapshot information; When the reference snapshot information is not the snapshot information corresponding to the source image of the virtual machine, the reference snapshot information is deleted.

4. The mirror processing method according to claim 3, characterized in that: In response to the image creation instruction sent by the cloud device, before performing image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine, the method further includes: Scanning the data blocks in the current snapshot information and the reference snapshot information respectively to obtain a first scanning result corresponding to the current snapshot information and a second scanning result corresponding to the reference snapshot information; The byte offset information is determined according to the first scanning result and the second scanning result; wherein the byte offset information is used to indicate the offset of the data block corresponding to the snapshot difference information.

5. The mirror processing method according to any one of claims 1 to 4, characterized in that: The performing image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file to obtain the target image file of the virtual machine includes: Determine mirror difference data according to the difference information; The image difference data and the reference image file are subjected to data integration processing according to the byte offset information to obtain the target image file.

6. A mirror processing method, characterized in that: Applied to cloud devices; the method comprises: Obtaining snapshot difference information of a virtual machine volume, and sending the snapshot difference information to an image backend device, so that the image backend device generates a backup image based on the snapshot difference information; wherein the snapshot difference information represents difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents snapshot information corresponding to the current image file of the virtual machine; Obtain the running status information of the mirror back-end device, and if the running status information meets the preset status condition, send an image creation instruction to the mirror back-end device, so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

7. The mirror processing method according to claim 6, characterized in that: The method further comprises: obtaining the operating status information of the mirroring backend device, and sending an image creation instruction to the mirroring backend device when the operating status information meets a preset status condition, so that the mirroring backend device responds to the image creation instruction, performs image creation processing based on the snapshot difference information, the byte offset bit information and the reference image file, and obtains the target image of the virtual machine. Sending a snapshot creation instruction to a storage device, so that the storage device generates a target snapshot corresponding to the target image in response to the snapshot creation instruction; The target snapshot sent by the storage device is received, and the target snapshot is sent to the mirror backend device, so that the mirror backend device stores the target snapshot in the mirror metadata corresponding to the target image.

8. The mirror processing method according to claim 6 or 7, characterized in that: The method further comprises: Determine an operating state reference value according to the operating state information; When the operating state reference value is less than or equal to a preset threshold, determining that the operating state information meets a preset state condition; When the operating state reference value is greater than the preset threshold, it is determined that the operating state information does not meet the preset state condition.

9. A mirroring backend device, characterized in that: The mirroring backend device includes a generating unit and a creating unit; The generating unit is used to generate a backup image according to the snapshot difference information of the virtual machine volume sent by the cloud device in response to the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current image file of the virtual machine; The creation unit is used to respond to the image creation instruction sent by the cloud device, perform image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtain the target image file of the virtual machine; wherein, the image creation instruction is generated by the cloud device by monitoring the running status of the image backend device and determining that the running status information meets the preset status conditions.

10. A cloud device, characterized in that: The cloud device includes a first sending unit and a second sending unit; The first sending unit is used to obtain snapshot difference information of the virtual machine volume, and send the snapshot difference information to the mirror backend device, so that the mirror backend device generates a backup mirror based on the snapshot difference information; wherein the snapshot difference information represents the difference information between the current snapshot information of the virtual machine volume and the reference snapshot information; the reference snapshot information represents the snapshot information corresponding to the current mirror file of the virtual machine; The second sending unit is used to obtain the running status information of the mirror back-end device, and send an image creation instruction to the mirror back-end device when the running status information meets the preset status condition, so that the mirror back-end device responds to the image creation instruction, performs image creation processing based on the byte offset bit information corresponding to the snapshot difference information and the reference image file, and obtains the target image of the virtual machine.

11. A mirroring backend device, characterized in that: The mirroring backend device includes a first processor and a first memory storing executable instructions of the first processor; when the executable instructions are executed by the first processor, the method according to any one of claims 1 to 5 is implemented.

12. A cloud device, characterized in that: The cloud device includes a second processor and a second memory storing executable instructions of the second processor; when the executable instructions are executed by the second processor, the method described in any one of claims 6 to 8 is implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a first processor, the method according to any one of claims 1 to 5 is implemented; when the computer program is executed by a second processor, the method according to any one of claims 6 to 8 is implemented.