A method, device, equipment and medium for performing a flatten operation on a cloned volume

By automatically detecting updates to cloned volume metadata and performing a flatten operation in the background, the problem of cloned volumes depending on the parent snapshot is solved, enabling cloned volumes to be quickly put into use and improving performance, thereby increasing cluster space utilization.

CN115344209BActive Publication Date: 2026-07-24JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2022-08-19
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Cloned volumes depend on parent snapshots, which means that parent snapshots cannot be deleted before cloned volumes, thus consuming cluster storage space and affecting read and write performance. Furthermore, current technology cannot eliminate the need for manual flattening operations, which degrades cloned volume performance. Additionally, cloned volumes require manual flattening operations after creation, impacting performance and cluster space utilization.

Method used

After the cloned volume is created, it automatically detects updates to metadata information, performs a flatten operation through a background flatten process, deletes the parent snapshot, and enables the cloned volume to be put into use quickly, avoiding the need to manually trigger the flatten operation.

Benefits of technology

Cloned volumes offer improved performance and increased cluster space utilization. Once created, cloned volumes can be quickly put into use, reducing manual operation steps and improving system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115344209B_ABST
    Figure CN115344209B_ABST
Patent Text Reader

Abstract

The application discloses a flatten operation execution method and device of a clone volume, equipment and a medium, and relates to the technical field of computers. The method comprises the following steps: after a target clone volume is created, a message of successful creation is returned to a client, and metadata information of the target clone volume is stored in a target object. The metadata information is information of the target clone volume created based on a parent snapshot. Whether the metadata information in the target object is updated is detected. When it is detected that the metadata information in the target object is updated, a target flatten process is created. Then, in the target flatten process, a flatten operation is performed on the target clone volume. After the flatten operation is completed, the parent snapshot is deleted. It can be seen that, after the clone volume is created, a message of successful creation is returned to the client, so that the clone volume can be quickly put into use. Moreover, the flatten operation is performed on the clone volume through the target flatten process, and the flatten operation does not need to be manually triggered, so that the performance of the clone volume is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for performing a flatten operation on a cloned volume. Background Technology

[0002] Block storage typically offers snapshot functionality, similar to taking a photo—saving a record of block storage data at a specific point in time. New volumes, called cloned volumes, can be created using block storage snapshots. Currently, cloned volumes have the following drawbacks: 1. Cloned volumes are not completely independent volumes; they depend on a parent snapshot. This means the parent snapshot cannot be deleted before the cloned volume, and it continues to occupy cluster space, potentially leading to low cluster storage utilization. 2. When reading or writing to a cloned volume, if an object in the cloned volume does not exist, a query will be performed in the parent snapshot, impacting read / write performance. To address these drawbacks, existing technologies perform a flatten operation on cloned volumes, synchronizing all data from the parent snapshot to the cloned volume. This eliminates the dependency on the parent snapshot, allowing it to be deleted independently. However, the flatten operation usually requires manual triggering, which degrades cloned volume performance. Furthermore, in some scenarios, customers need cloned volumes to be readily available after creation.

[0003] Therefore, how to enable cloned volumes to be quickly put into use after successful creation without manually triggering the flatten operation is an urgent problem to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for performing a flatten operation on a cloned volume, which eliminates the need for manual triggering of the flatten operation and enables the cloned volume to be quickly put into use after successful creation. The specific solution is as follows:

[0005] Firstly, this application discloses a method for performing a flatten operation on a cloned volume, including:

[0006] After creating the target clone volume, a success message is returned to the client, and the metadata information of the target clone volume is stored in the target object; wherein, the metadata information is the information of the target clone volume created based on the parent snapshot;

[0007] Detect whether the metadata information in the target object has been updated;

[0008] When the metadata information in the target object is detected to be updated, a target flatten process is created. Then, in the target flatten process, a flatten operation is performed on the target clone volume. After the flatten operation is completed, the parent snapshot is deleted.

[0009] Optionally, before returning a success message to the client after creating the target clone volume, the method further includes:

[0010] The parent snapshot is created based on the parent volume, and the target clone volume is created based on the parent snapshot.

[0011] Optionally, creating the parent snapshot based on the parent volume includes:

[0012] The parent snapshot is created by invoking the rbd clone command and based on the parent volume.

[0013] Optionally, detecting whether the metadata information in the target object has been updated includes:

[0014] At preset time intervals, it is detected whether the metadata information in the target object has been updated.

[0015] Optionally, detecting whether the metadata information in the target object has been updated at preset time intervals includes:

[0016] The metadata information in the target object is read at preset time intervals, and the metadata information in the target object is checked for updates based on the reading results.

[0017] Optionally, before reading the metadata information in the target object at preset time intervals and detecting whether the metadata information in the target object has been updated based on the reading results, the method further includes:

[0018] Create the target service process;

[0019] The target service process initializes environment variables and connects to the cluster, and creates the corresponding target scheduled task.

[0020] Optionally, reading the metadata information in the target object at preset time intervals includes:

[0021] The preset time interval is set by the target timed task, and the metadata information in the target object is read according to the preset time interval.

[0022] Secondly, this application discloses a device for performing a flatten operation on a cloned volume, comprising:

[0023] The message return module is used to return a message of successful creation to the client after the target clone volume is created;

[0024] A metadata information storage module is used to store the metadata information of the target clone volume into the target object; wherein, the metadata information is the information of the target clone volume created based on the parent snapshot;

[0025] The metadata information detection module is used to detect whether the metadata information in the target object has been updated;

[0026] The target flatten process creation module is used to create a target flatten process when it is detected that the metadata information in the target object has been updated.

[0027] The flatten operation execution module is used to perform a flatten operation on the target clone volume in the target flatten process, and delete the parent snapshot after the flatten operation is completed.

[0028] Thirdly, this application discloses an electronic device, including:

[0029] Memory, used to store computer programs;

[0030] A processor is configured to execute the computer program to implement the aforementioned method for performing the flatten operation of a cloned volume.

[0031] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned method for performing the flatten operation of a cloned volume.

[0032] As can be seen, this application proposes a method for performing a flatten operation on a cloned volume, comprising: after creating a target cloned volume, returning a successful creation message to the client and storing the metadata information of the target cloned volume in a target object; wherein, the metadata information is the information of the target cloned volume created based on a parent snapshot; detecting whether the metadata information in the target object has been updated; when the updated metadata information in the target object is detected, creating a target flatten process, and then performing a flatten operation on the target cloned volume in the target flatten process, and deleting the parent snapshot after the flatten operation is completed. It is evident that this application returns a successful creation message to the client immediately after creating the cloned volume, enabling the cloned volume to be quickly put into use. Furthermore, since this application performs the flatten operation on the cloned volume through a target flatten process, there is no need to manually trigger the flatten operation, thus improving the performance of the cloned volume. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0034] Figure 1 This is a flowchart of a method for performing a flatten operation on a cloned volume as disclosed in this application;

[0035] Figure 2 This is a flowchart of a specific method for performing a flatten operation on a cloned volume, as disclosed in this application.

[0036] Figure 3 This is a flowchart of a specific method for performing a flatten operation on a cloned volume, as disclosed in this application.

[0037] Figure 4 This is a schematic diagram of the structure of a flatten operation execution device for a cloned volume disclosed in this application;

[0038] Figure 5 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0040] Cloned volumes are not completely independent volumes; they depend on a parent snapshot. This means the parent snapshot cannot be deleted before the cloned volume, and it will continuously occupy cluster space, potentially leading to low cluster storage utilization. When reading or writing to a cloned volume, if an object in the cloned volume does not exist, a query will be performed on the parent snapshot, impacting read / write performance. To address these drawbacks, existing technologies perform a flatten operation on the cloned volume, synchronizing all data from the parent snapshot to the cloned volume. This way, the cloned volume no longer depends on the parent snapshot, allowing the parent snapshot to be deleted independently. However, in general, the flatten operation needs to be manually triggered, reducing cloned volume performance. Furthermore, in some scenarios, customers need the cloned volume to be quickly put into use after creation.

[0041] Therefore, this application proposes a flatten operation execution scheme for cloned volumes, which eliminates the need to manually trigger the flatten operation and enables the cloned volumes to be quickly put into use after successful creation.

[0042] This application discloses a method for performing a flatten operation on a cloned volume. See also... Figure 1 As shown, the method includes:

[0043] Step S11: After creating the target clone volume, return a message of successful creation to the client and store the metadata information of the target clone volume in the target object; wherein, the metadata information is the information of the target clone volume created based on the parent snapshot.

[0044] In this embodiment, a parent snapshot is first created based on the parent volume, and then the target clone volume is created based on the parent snapshot. After creating the target clone volume, a success message is returned to the client. This allows the clone volume to be quickly put into use. Furthermore, this embodiment stores the metadata information of the target clone volume in the target object. This metadata information includes, but is not limited to, the target clone volume name and the name of the storage pool where the target clone volume resides. It should be noted that when creating the parent snapshot based on the parent volume, the rbd clone command is invoked, and the creation is performed based on the parent volume.

[0045] Step S12: Detect whether the metadata information in the target object has been updated.

[0046] In this embodiment, after creating the target clone volume, a message indicating successful creation is returned to the client, and the metadata information of the target clone volume is stored in the target object. Then, it is detected whether the metadata information in the target object has been updated. In this embodiment, detecting whether the metadata information in the target object has been updated specifically means: detecting whether new metadata information has been added to the target object.

[0047] Step S13: When the metadata information in the target object is detected to be updated, a target flatten process is created. Then, in the target flatten process, a flatten operation is performed on the target clone volume. After the flatten operation is completed, the parent snapshot is deleted.

[0048] In this embodiment, after detecting whether the metadata information in the target object has been updated, if the updated metadata information is detected, a target flatten process is created in the background. Then, in the target flatten process, a flatten operation is performed on the target cloned volume, and after the flatten operation is completed, the parent snapshot is deleted. In this way, since this application performs the flatten operation on the cloned volume through the target flatten process, there is no need to manually trigger the flatten operation, thus improving the performance of the cloned volume. Furthermore, deleting the parent snapshot improves the cluster's space utilization.

[0049] As can be seen, this application proposes a method for performing a flatten operation on a cloned volume, comprising: after creating a target cloned volume, returning a successful creation message to the client and storing the metadata information of the target cloned volume in a target object; wherein, the metadata information is the information of the target cloned volume created based on a parent snapshot; detecting whether the metadata information in the target object has been updated; when the updated metadata information in the target object is detected, creating a target flatten process, and then performing a flatten operation on the target cloned volume in the target flatten process, and deleting the parent snapshot after the flatten operation is completed. It is evident that this application returns a successful creation message to the client immediately after creating the cloned volume, enabling the cloned volume to be quickly put into use. Furthermore, since this application performs the flatten operation on the cloned volume through a target flatten process, there is no need to manually trigger the flatten operation, thus improving the performance of the cloned volume.

[0050] This application discloses a specific method for performing a flatten operation on a cloned volume. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. See also... Figure 2 As shown, it specifically includes:

[0051] Step S21: After creating the target clone volume, return a message of successful creation to the client and store the metadata information of the target clone volume in the target object; wherein, the metadata information is the information of the target clone volume created based on the parent snapshot.

[0052] In this embodiment, a parent snapshot is first created based on the parent volume, and then the target clone volume is created based on the parent snapshot. After creating the target clone volume, a success message is returned to the client. This allows the clone volume to be quickly put into use. Furthermore, this embodiment stores the metadata information of the target clone volume in the target object. This metadata information includes, but is not limited to, the target clone volume name and the name of the storage pool where the target clone volume resides. It should be noted that when creating the parent snapshot based on the parent volume, the rbd clone command is invoked, and the creation is performed based on the parent volume.

[0053] Step S22: Detect whether the metadata information in the target object has been updated at preset time intervals.

[0054] In this embodiment, after creating the target clone volume, a success message is returned to the client, and the metadata information of the target clone volume is stored in the target object. Then, at preset time intervals, it is checked whether the metadata information in the target object has been updated. Specifically, this includes: reading the metadata information in the target object at preset time intervals, and checking whether the metadata information in the target object has been updated based on the reading result. It should be noted that before reading the metadata information in the target object at preset time intervals and checking whether the metadata information in the target object has been updated based on the reading result, the method further includes: creating a target service process; initializing environment variables and connecting to the cluster through the target service process, and creating a corresponding target scheduled task. In this way, this application can set the preset time interval through the target scheduled task and read the metadata information in the target object at the preset time interval.

[0055] Step S23: When the metadata information in the target object is detected to be updated, a target flatten process is created. Then, in the target flatten process, a flatten operation is performed on the target clone volume. After the flatten operation is completed, the parent snapshot is deleted.

[0056] In this embodiment, after detecting whether the metadata information in the target object has been updated, if the updated metadata information is detected, a target flatten process is created in the background. Then, in the target flatten process, a flatten operation is performed on the target cloned volume. After the flatten operation is completed, the parent snapshot is deleted. In this way, since this application performs the flatten operation on the cloned volume through the target flatten process, there is no need to manually trigger the flatten operation, thus improving the performance of the cloned volume. Furthermore, deleting the parent snapshot improves the cluster's space utilization.

[0057] As can be seen, this application proposes a method for performing a flatten operation on a cloned volume, comprising: after creating a target cloned volume, returning a successful creation message to the client and storing the metadata information of the target cloned volume in a target object; wherein, the metadata information is the information of the target cloned volume created based on a parent snapshot; detecting whether the metadata information in the target object has been updated at preset time intervals; when the metadata information in the target object is detected to have been updated, creating a target flatten process, and then performing a flatten operation on the target cloned volume in the target flatten process, and deleting the parent snapshot after the flatten operation is completed; as can be seen, this application returns a successful creation message to the client after creating the cloned volume, enabling the cloned volume to be put into use quickly, and since this application performs the flatten operation on the cloned volume through the target flatten process, there is no need to manually trigger the flatten operation, thus improving the performance of the cloned volume.

[0058] See Figure 3 As shown, based on the flatten operation execution method of the cloned volume, this application can include the following:

[0059] In this application, the `rbd clone` command is invoked to create a parent snapshot based on the parent volume, and then a clone volume is created based on the parent snapshot. Upon completion, a success message is returned, allowing the clone volume to be quickly put into use. Furthermore, the clone volume information is recorded to a specific object, and a background service process is created. This background service process first initializes environment variables and connects to the cluster, then creates a scheduled task. This scheduled task periodically reads information from the specific object to determine if the information has been updated. If updated, a flatten thread is created to perform the flatten operation and delete the parent snapshot. Because this application performs the flatten operation on the clone volume through the target flatten process, manual triggering of the flatten operation is unnecessary, thus improving the performance of the clone volume.

[0060] Accordingly, embodiments of this application also disclose a device for performing a flatten operation on a cloned volume, see [link to relevant documentation]. Figure 4 As shown, the device includes:

[0061] The message return module 11 is used to return a message of successful creation to the client after the target clone volume is created;

[0062] After creating the target clone volume, a success message is returned to the client, allowing the clone volume to be put into use quickly.

[0063] Metadata information storage module 12 is used to store the metadata information of the target clone volume to the target object; wherein, the metadata information is the information of the target clone volume created based on the parent snapshot;

[0064] The metadata information of the target cloned volume is stored in the target object. The metadata information includes, but is not limited to, the target cloned volume name and the name of the storage pool where the target cloned volume is located.

[0065] Metadata information detection module 13 is used to detect whether the metadata information in the target object has been updated;

[0066] Specifically, detecting whether the metadata information in the target object has been updated means detecting whether new metadata information has been added to the target object.

[0067] The target flatten process creation module 14 is used to create a target flatten process when it is detected that the metadata information in the target object has been updated.

[0068] When the metadata information in the target object is detected to be updated, a target flatten process is created in the background.

[0069] The flatten operation execution module 15 is used to perform a flatten operation on the target clone volume in the target flatten process, and delete the parent snapshot after the flatten operation is completed.

[0070] In the target flatten process, a flatten operation is performed on the target cloned volume, and after the flatten operation is completed, the parent snapshot is deleted. In this way, since this application performs the flatten operation on the cloned volume through the target flatten process, there is no need to manually trigger the flatten operation, thus improving the performance of the cloned volume.

[0071] As can be seen, this application proposes a method for performing a flatten operation on a cloned volume, comprising: after creating a target cloned volume, returning a successful creation message to the client and storing the metadata information of the target cloned volume in a target object; wherein, the metadata information is the information of the target cloned volume created based on a parent snapshot; detecting whether the metadata information in the target object has been updated; when the updated metadata information in the target object is detected, creating a target flatten process, and then performing a flatten operation on the target cloned volume in the target flatten process, and deleting the parent snapshot after the flatten operation is completed. It is evident that this application returns a successful creation message to the client immediately after creating the cloned volume, enabling the cloned volume to be quickly put into use. Furthermore, since this application performs the flatten operation on the cloned volume through a target flatten process, there is no need to manually trigger the flatten operation, thus improving the performance of the cloned volume.

[0072] In some specific embodiments, the message return module 11 may further include:

[0073] The target clone volume creation unit is used to create the parent snapshot based on the parent volume, and to create the target clone volume based on the parent snapshot.

[0074] In some specific embodiments, the target clone volume creation unit can be used for:

[0075] The parent snapshot is created by invoking the rbd clone command and based on the parent volume.

[0076] In some specific embodiments, the metadata information detection module 13 may specifically include:

[0077] The metadata information detection unit is used to detect whether the metadata information in the target object has been updated at preset time intervals.

[0078] In some specific embodiments, the metadata information detection unit may be used for:

[0079] The metadata information in the target object is read at preset time intervals, and the metadata information in the target object is checked for updates based on the reading results.

[0080] In some specific embodiments, the metadata information detection unit may further include:

[0081] The service process creation unit is used to create the target service process;

[0082] The scheduled task creation unit is used to initialize environment variables and connect to the cluster through the target service process, and create the corresponding target scheduled task.

[0083] In some specific embodiments, the metadata information detection unit may specifically include:

[0084] The preset time interval is set by the target timed task, and the metadata information in the target object is read according to the preset time interval.

[0085] Furthermore, embodiments of this application also provide an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0086] Figure 5 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the following steps:

[0087] After creating the target clone volume, a success message is returned to the client, and the metadata information of the target clone volume is stored in the target object; wherein, the metadata information is the information of the target clone volume created based on the parent snapshot;

[0088] Detect whether the metadata information in the target object has been updated;

[0089] When the metadata information in the target object is detected to be updated, a target flatten process is created. Then, in the target flatten process, a flatten operation is performed on the target clone volume. After the flatten operation is completed, the parent snapshot is deleted.

[0090] In some specific embodiments, the processor may further perform the following steps by executing a computer program stored in the memory:

[0091] The parent snapshot is created based on the parent volume, and the target clone volume is created based on the parent snapshot.

[0092] In some specific embodiments, the processor executes a computer program stored in the memory, specifically implementing the following steps:

[0093] The parent snapshot is created by invoking the rbd clone command and based on the parent volume.

[0094] In some specific embodiments, the processor executes a computer program stored in the memory, specifically implementing the following steps:

[0095] The metadata information in the target object is read at preset time intervals, and the metadata information in the target object is checked for updates based on the reading results.

[0096] In some specific embodiments, the processor may further perform the following steps by executing a computer program stored in the memory:

[0097] Create the target service process;

[0098] The target service process initializes environment variables and connects to the cluster, and creates the corresponding target scheduled task.

[0099] In some specific embodiments, the processor executes a computer program stored in the memory, specifically implementing the following steps:

[0100] The preset time interval is set by the target timed task, and the metadata information in the target object is read according to the preset time interval.

[0101] In this embodiment, the power supply 26 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 24 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0102] Furthermore, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored thereon may include computer programs 221, and the storage method may be temporary storage or permanent storage. The computer programs 221 may include, in addition to computer programs capable of performing the flatten operation execution method of the cloned volume executed by the electronic device 20 as disclosed in any of the foregoing embodiments, computer programs capable of performing other specific tasks.

[0103] Furthermore, embodiments of this application also disclose a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned method for performing the flatten operation of a cloned volume.

[0104] For the specific steps of this method, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0105] The various embodiments in this application are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. For the same or similar parts between the various embodiments, refer to each other. As for the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and relevant parts can be referred to in the method section.

[0106] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0107] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0108] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0109] The foregoing has provided a detailed description of the method, apparatus, device, and storage medium for performing a flatten operation on a cloned volume. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for performing a flatten operation on a cloned volume, characterized in that, include: After creating the target clone volume, a success message is returned to the client, and the metadata information of the target clone volume is stored in the target object; wherein, the metadata information is the information of the target clone volume created based on the parent snapshot; Detect whether the metadata information in the target object has been updated; When the metadata information in the target object is detected to be updated, a target flatten process is created. Then, in the target flatten process, a flatten operation is performed on the target clone volume. After the flatten operation is completed, the parent snapshot is deleted. The step of returning a success message to the client after creating the target clone volume also includes: The parent snapshot is created based on the parent volume, and the target clone volume is created based on the parent snapshot; The step of detecting whether the metadata information in the target object has been updated includes: The metadata information in the target object is read at preset time intervals, and the metadata information in the target object is checked for updates based on the reading results.

2. The method for performing a flatten operation on a cloned volume according to claim 1, characterized in that, The creation of the parent snapshot based on the parent volume includes: The parent snapshot is created by invoking the rbd clone command and based on the parent volume.

3. The method for performing a flatten operation on a cloned volume according to claim 1, characterized in that, Before reading the metadata information in the target object at preset time intervals and detecting whether the metadata information in the target object has been updated based on the reading results, the method further includes: Create the target service process; The target service process initializes environment variables and connects to the cluster, and creates the corresponding target scheduled task.

4. The method for performing a flatten operation on a cloned volume according to claim 3, characterized in that, The step of reading metadata information from the target object at preset time intervals includes: The preset time interval is set by the target timed task, and the metadata information in the target object is read according to the preset time interval.

5. A device for performing a flatten operation on a cloned volume, characterized in that, include: The message return module is used to return a message of successful creation to the client after the target clone volume is created; A metadata information storage module is used to store the metadata information of the target clone volume into the target object; wherein, the metadata information is the information of the target clone volume created based on the parent snapshot; The metadata information detection module is used to detect whether the metadata information in the target object has been updated; The target flatten process creation module is used to create a target flatten process when it is detected that the metadata information in the target object has been updated. The flatten operation execution module is used to perform a flatten operation on the target cloned volume in the target flatten process, and delete the parent snapshot after the flatten operation is completed; The step of returning a success message to the client after creating the target clone volume also includes: The parent snapshot is created based on the parent volume, and the target clone volume is created based on the parent snapshot; The step of detecting whether the metadata information in the target object has been updated includes: The metadata information in the target object is read at preset time intervals, and the metadata information in the target object is checked for updates based on the reading results.

6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the method for performing the flatten operation of a cloned volume as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the flatten operation execution method for cloned volumes as described in any one of claims 1 to 4.