Method, device, storage medium and system for flattening and restoring data clone volumes

By providing a shooting and restoration method in the data storage solution, the problem of cloning shooting and down operation cannot be restored, and the rapid release of storage space and the flexibility of data management is achieved.

CN117785058BActive Publication Date: 2025-03-18云和恩墨(北京)信息技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311845427.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-03-18
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

In the existing data storage solutions, cloning and shooting operation cannot be restored, resulting in poor data management flexibility and difficult to release storage space caused by shooting.

Method used

Provide a method for shooting and restoring the data cloning volume. By responding to the shooting command, the first snapshot data of the parent volume is stored in the second snapshot of the cloning volume, and the cloning relationship is deleted; in response to the shooting and restoring command, the cloning relationship is re-established and the second snapshot is deleted.

Benefits of technology

It realizes shooting and restoration of the storage structure, frees up storage space, improves the flexibility of data management, and simplifies the rapid release of storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117785058B_ABST
    Figure CN117785058B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, storage medium and system for flattening and restoring a data clone volume. The method includes: responding to a flattening instruction acting on a parent volume and a clone volume, storing the clone data of the first snapshot in the parent volume to the second snapshot of the clone volume, and deleting the clone association relationship, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store the clone data; responding to a flattening and restoring instruction acting on the parent volume and the clone volume, re-establishing the clone association relationship between the parent volume and the clone volume based on the first snapshot, and deleting the second snapshot. The present application solves the technical problems in existing data storage solutions that the flattening operation cannot be restored, resulting in poor data management flexibility, and that it is difficult to release the storage space occupied by the flattening.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data storage, and in particular to a method, device, storage medium and system for flattening and restoring a data clone volume. Background Art

[0002] In the data storage process of computer systems, data cloning is often involved. In the clone structure, too deep a clone level may cause the system's read input / output (I / O) performance to degrade, and may also limit operations such as deletion and rollback of the parent volume snapshot. In this regard, through the clone flattening operation, the data in the parent volume snapshot is copied to the first snapshot of the clone volume (that is, the first snapshot created), and then the clone relationship between the parent volume snapshot and the clone volume is deleted, so that the clone volume contains complete data and no longer needs to reference the data in the parent volume. However, after the clone flattening operation, there will be two independent copies of the data referenced by the clone volume in the parent volume snapshot. Although it can achieve non-interference between the parent volume and the clone volume, it increases the storage space occupied.

[0003] In application scenarios, it is often necessary to cancel the clone flattening operation, for example, the storage space occupied by the flattening operation needs to be released due to insufficient storage space during the flattening process, or the flattening operation is triggered by the user by mistake. However, in the data storage solutions provided by the prior art, no effective solution is proposed to cancel the above clone flattening operation. Once the flattening operation is executed, it is difficult to roll back the system to the state before the flattening operation, and it is difficult to release the storage space occupied by the flattening operation.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a method, device, storage medium and system for flattening and restoring a data clone volume, so as to at least solve the technical problems in existing data storage solutions that the flattening operation cannot be restored, resulting in poor data management flexibility and difficulty in releasing the storage space occupied by the flattening.

[0006] According to one aspect of an embodiment of the present application, a method for flattening and restoring a data clone volume is provided, comprising: in response to a flattening instruction acting on a parent volume and a clone volume, storing cloned data of a first snapshot in the parent volume to a second snapshot of the clone volume, and deleting a clone association relationship, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize a data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store cloned data; in response to a flattening and restoring instruction acting on the parent volume and the clone volume, re-establishing a clone association relationship between the parent volume and the clone volume based on the first snapshot, and deleting the second snapshot.

[0007] Optionally, the flattening and restoring method of the data clone volume further includes: creating a clone volume based on a first snapshot of the parent volume; and establishing a clone association relationship between the parent volume and the clone volume based on the first snapshot.

[0008] Optionally, the clone volume includes at least: a reserved snapshot number, and storing the clone data of the first snapshot in the parent volume to the second snapshot of the clone volume includes: copying the snapshot data of the first snapshot to obtain clone data; creating a second snapshot corresponding to the reserved snapshot number in the clone volume; and storing the clone data in the second snapshot.

[0009] Optionally, the write data of the clone volume is stored in at least one third snapshot, and the creation time of the third snapshot is after the preset time corresponding to the reserved snapshot number.

[0010] Optionally, deleting the second snapshot includes: deleting the second snapshot from the clone volume and reserving the reserved snapshot number.

[0011] Optionally, the flattening and restoring method for the data clone volume further includes: in response to the flattening and restoring instruction, adjusting the parent volume and the first snapshot to an undeletable state.

[0012] Optionally, the flattening and restoring method for the data clone volume further includes: when at least one of the parent volume and the first snapshot is deleted, generating an error prompt message in response to the flattening and restoring instruction, wherein the error prompt message is used to indicate that the flattening and restoring cannot be performed.

[0013] According to another aspect of an embodiment of the present application, a flattening and restoring device for a data clone volume is also provided, including: a flattening module, used to respond to a flattening instruction acting on a parent volume and a clone volume, store the cloned data of a first snapshot in the parent volume to a second snapshot of the clone volume, and delete the clone association relationship, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship of the clone volume to the first snapshot, and the second snapshot is only used to store the cloned data; a restoration module, used to respond to a flattening and restoring instruction acting on the parent volume and the clone volume, re-establish the clone association relationship between the parent volume and the clone volume based on the first snapshot, and delete the second snapshot.

[0014] Optionally, the flattening and restoring device for a data clone volume further includes a creating module, which is used to: create a clone volume based on a first snapshot of a parent volume; and establish a clone association relationship between the parent volume and the clone volume based on the first snapshot.

[0015] Optionally, the clone volume includes at least: a reserved snapshot number; the flattening module is further used to: copy the snapshot data of the first snapshot to obtain clone data; create a second snapshot corresponding to the reserved snapshot number in the clone volume; and store the clone data in the second snapshot.

[0016] Optionally, in the above-mentioned flattening and restoring device for a data clone volume, the write data of the clone volume is stored in at least one third snapshot, and the creation time of the third snapshot is after the preset time corresponding to the reserved snapshot number.

[0017] Optionally, the restoration module is further configured to: delete the second snapshot from the clone volume and reserve the reserved snapshot number.

[0018] Optionally, the above-mentioned data clone volume flattening and restoration device further includes a restriction module, which is used to: in response to the flattening and restoration instruction, adjust the parent volume and the first snapshot to an undeletable state.

[0019] Optionally, the flattening and restoring device for the data clone volume further comprises a prompt module, which is used to: when at least one of the parent volume and the first snapshot is deleted, generate an error prompt message in response to the flattening and restoring instruction, wherein the error prompt message is used to indicate that the flattening and restoring cannot be performed.

[0020] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any of the above-mentioned methods for flattening and restoring a data clone volume.

[0021] According to another aspect of an embodiment of the present application, a flattening and restoring system for a data clone volume is also provided, characterized by a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any one of the above-mentioned flattening and restoring methods for a data clone volume.

[0022] In an embodiment of the present application, in response to a flattening instruction acting on a parent volume and a clone volume, the clone data of the first snapshot in the parent volume is stored in the second snapshot of the clone volume, and the clone association relationship is deleted, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store the clone data; in response to a flattening and restoring instruction acting on the parent volume and the clone volume, the clone association relationship is re-established between the parent volume and the clone volume based on the first snapshot, and the second snapshot is deleted. Thus, the present application achieves the purpose of restoring the flattened storage structure and releasing storage space, thereby achieving the technical effect of improving data management flexibility and realizing the rapid release of storage space, and further solves the technical problems in existing data storage solutions that the flattening operation cannot be restored, resulting in poor data management flexibility and difficulty in releasing the occupied storage space due to flattening. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0024] Figure 1 is a schematic diagram of an optional cloning logic according to the prior art;

[0025] Figure 2 It is a flow chart of a method for flattening and restoring a data clone volume according to an embodiment of the present application;

[0026] Figure 3 is a schematic diagram of an optional data storage structure before flattening according to the related art;

[0027] Figure 4 is a schematic diagram of an optional flattened data storage structure according to the related art;

[0028] Figure 5 is a schematic diagram of an optional data storage structure before flattening according to an embodiment of the present application;

[0029] Figure 6 is a schematic diagram of an optional flattened data storage structure according to an embodiment of the present application;

[0030] Figure 7 is a schematic diagram of an optional flattened and restored data storage structure according to an embodiment of the present application;

[0031] Figure 8 It is a structural block diagram of a device for flattening and restoring a data clone volume according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution 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. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] In a computer system, a snapshot is created to save the data of a volume at a certain moment. The data in the snapshot is read-only data. Snapshots are usually used for daily backup and quick recovery of data. Based on this, Redirect On Write (ROW) snapshot refers to a snapshot technology that allocates new storage space to store the modified data in the snapshot.

[0035] When creating a clone volume based on a snapshot of the parent volume, the data content in the newly created clone volume is completely consistent with the data content in the parent volume snapshot, and subsequent modifications to the data content of a clone volume will not affect other clone volumes corresponding to the parent volume snapshot and the attached snapshot. Clone volumes support reading and writing data.

[0036] like Figure 1 The figure shows a schematic diagram of clone logic, where V2 and V4 are clone volumes created based on snapshot V1:997 of V1, and V3 is a clone volume created based on snapshot V2:998 of V2. Correspondingly, some clone relationships are as follows: data in snapshots V1:997, V1:998, and V1:999 are referenced by V2, V3, and V4, and data in snapshots V2:998 and V2:999 are referenced by V3.

[0037] It is easy to find that the cloning logic between the clone volume and the parent volume includes: the clone volume references the data of the parent volume snapshot, the clone volume can support writing new data and creating snapshots, and when reading the data of the clone volume, it may be necessary to read the data in the parent volume of the clone volume (or even the parent volume of the parent volume). For example, Figure 1 As shown, when reading data in the snapshot V3:999 of the V3 volume, it may be necessary to read data from the snapshot V1:999 of the V1 volume (that is, the parent volume of the parent volume).

[0038] In a clone structure, too deep a clone level may cause the system's read input / output (I / O) performance to degrade, and may also limit operations such as deletion and rollback of parent volume snapshots. To address this, through a clone-leveling operation, the data in the parent volume snapshot is copied to the oldest snapshot of the clone volume (that is, the first snapshot created), and then the clone relationship between the parent volume snapshot and the clone volume is deleted. In this way, the clone volume contains complete data and no longer needs to reference data in the parent volume. However, after the clone-leveling operation, there will be two independent copies of the data in the parent volume snapshot referenced by the clone volume. Although this allows the parent volume and the clone volume to not interfere with each other, it increases storage space usage.

[0039] In application scenarios, it is often necessary to undo the clone flattening operation, for example, when insufficient storage space is required during the flattening process and the storage space occupied by the flattening operation needs to be released, or when the user triggers the flattening operation by mistake. In these cases, flattening recovery is required to re-establish the cloning relationship between the clone volume and the parent volume snapshot, and delete the data copied from the parent volume snapshot during the flattening operation from the clone volume to release storage space.

[0040] However, when performing a flattening operation in the prior art, the data of the first snapshot of the parent volume is overwritten into the second snapshot of the clone volume. When the flattening operation needs to be undone, it is difficult to determine the partial data from the parent volume from the clone volume, and it is also difficult to release the storage space of the clone volume occupied by the flattening operation.

[0041] That is to say, before this application, no effective solution has been proposed in the relevant technical field to realize the cancellation of the above clone flattening operation. In the field of data storage technology, the inability to restore the clone flattening operation has led to difficulty in data storage management and low flexibility, which has become one of the important technical problems.

[0042] According to an embodiment of the present application, a flattening method and a corresponding flattening and restoration method of a data clone volume are provided, which can quickly rebuild the clone relationship and release the space occupied by the flattening operation when flattening and restoration are required, thereby reducing the difficulty of data storage management and improving the flexibility of data storage management.

[0043] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0044] Under the above operating environment, the embodiment of the present application provides the following Figure 2 The flattening and restoring method of the data clone volume shown in the figure is: Figure 2 is a flow chart of a method for flattening and restoring a data clone volume according to an embodiment of the present application. Figure 2 As shown, the method includes the following implementation steps:

[0045] Step S201, in response to a flatten instruction acting on the parent volume and the clone volume, storing the clone data of the first snapshot in the parent volume into the second snapshot of the clone volume, and deleting the clone association relationship, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store the clone data;

[0046] Step S202 , in response to the flatten restore instruction acting on the parent volume and the clone volume, re-establish the clone association relationship between the parent volume and the clone volume based on the first snapshot, and delete the second snapshot.

[0047] The flattening and restoring process refers to the process of deleting the flattened data from the clone volume and rebuilding the clone relationship. The flattened data refers to the data copied from the parent volume to the clone volume during the flattening process. According to the above execution process of the present application, a snapshot is created in the clone volume, and the data from the parent volume is written to the snapshot during the flattening process. The data in the reserved snapshot is cleared during the flattening and restoring process.

[0048] In an embodiment of the present application, in response to a flattening instruction acting on a parent volume and a clone volume, the clone data of the first snapshot in the parent volume is stored in the second snapshot of the clone volume, and the clone association relationship is deleted, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store the clone data; in response to a flattening and restoring instruction acting on the parent volume and the clone volume, the clone association relationship is re-established between the parent volume and the clone volume based on the first snapshot, and the second snapshot is deleted. Thus, the present application achieves the purpose of restoring the flattened storage structure and releasing storage space, thereby achieving the technical effect of improving data management flexibility and realizing the rapid release of storage space, and further solves the technical problems in existing data storage solutions that the flattening operation cannot be restored, resulting in poor data management flexibility and difficulty in releasing the occupied storage space due to flattening.

[0049] Optionally, the flattening and restoring method of the data clone volume may further include the following method steps:

[0050] Step S231, creating a clone volume based on the first snapshot of the parent volume;

[0051] Step S232: establishing a clone association relationship between the parent volume and the clone volume based on the first snapshot.

[0052] In an exemplary application scenario, Figure 3As shown, based on the snapshot V1:998 of the parent volume V1, the clone volume V2 is created. In this process, the snapshot data of the snapshot V1:998 is merged with the snapshot data of the bottom snapshot of the clone volume (that is, the snapshot created first). Furthermore, a clone association relationship is established between the snapshot V1:998 of the parent volume V1 and the snapshot V2:999 of the clone volume V2. Specifically, as Figure 3 As shown, the clone volume V2 writes the number 2 to the 3rd and 4th blocks of data, and takes a snapshot, and the snapshot id is 999; the clone volume V2 writes the number 0 to the 1st block of data, and takes a snapshot, and the snapshot id is 998.

[0053] On this basis, if the flattening method provided in the related art is used to flatten the parent volume V1 and the clone volume V2, such as Figure 4 As shown, when leveling, it is necessary to merge the snapshot data of the parent volume V1 and the snapshot data of the clone volume V2, and take each latest block of data and write it over the snapshot of the clone volume. For example: the first block of data has only been written by the snapshot V1:999 of the parent volume V1, so it is copied to the corresponding position of the clone volume; the second block of data has been written twice in the parent volume (that is, snapshot V1:999 and snapshot V1:998), and the latest data (that is, the number 8 in snapshot V1:998) is copied to the corresponding position of the clone volume V2; the third block of data is considered the latest because the clone volume V2 itself has been written, and there is no need to copy it from the parent volume V1. After leveling, the clone association relationship between the clone volume V2 and the parent volume V1 is deleted, so that the clone volume V2 and the parent volume V1 are independent of each other.

[0054] However, if Figure 4 As shown, after flattening, the underlying snapshot of clone volume V2 (i.e. snapshot V2:999) contains both the data copied from parent volume V1 and the data written by clone volume V2 itself. If flattening and restoration are required to release the data storage space occupied by flattening, it is necessary to distinguish which data is copied from parent volume V1 and which data is written by clone volume V2 itself. In this regard, the above solution provided by this application can be used to distinguish data.

[0055] Optionally, the clone volume at least includes: a reserved snapshot number, the write data of the clone volume is stored in at least one third snapshot, and the creation time of the third snapshot is after the preset time corresponding to the reserved snapshot number.

[0056] Optionally, in the above step S201, storing the cloned data of the first snapshot in the parent volume in the second snapshot of the cloned volume may further include the following execution steps:

[0057] Step S211, copying the snapshot data of the first snapshot to obtain clone data;

[0058] Step S212, creating a second snapshot corresponding to the reserved snapshot number in the clone volume;

[0059] Step S213: storing the cloned data in the second snapshot.

[0060] According to the above steps, if Figure 5 As shown, when a clone volume is created based on snapshot V1:999 of the parent volume V1, a snapshot number is reserved at the bottom layer of the clone volume snapshot. In the initial state, the snapshot number corresponds to an empty snapshot. This empty snapshot does not support writing to the clone volume and is only used to store the clone data corresponding to the parent volume during flattening.

[0061] Furthermore, if Figure 6 As shown, when leveling is performed, the data referenced by the clone volume V2 (that is, the snapshot data of snapshot V1:998 of the parent volume V1) is copied to the empty snapshot corresponding to the reserved snapshot number. Since the control snapshot is at the bottom layer of the clone volume (considered to be the earliest created snapshot), it complies with the data reading specification of ROW, thereby ensuring the correctness of the data.

[0062] Optionally, in the above step S202, deleting the second snapshot may further include the following execution steps:

[0063] Step S221: delete the second snapshot from the clone volume and keep the reserved snapshot number.

[0064] based on Figure 5 and Figure 6 In the data structure of, during the flattening process, all the cloned data of the parent volume V1 in the clone volume V2 is stored in the snapshot corresponding to the preset number (that is, snapshot V2:1000), and all the data written by the clone volume V2 itself is stored in other snapshots, such as Figure 7 As shown, when flattening and restoring, the data in the snapshot corresponding to the above preset number (ie, snapshot V2:1000) is deleted and the clone association relationship between the parent volume V1 and the clone volume V2 is rebuilt.

[0065] It is easy to notice that, through the above execution steps of the present application, it is possible to quickly distinguish which data in the clone volume is the copy data of the parent volume data during the flattening process, and which data is the write data of the clone volume itself, thereby quickly releasing the storage space occupied by the clone volume caused by flattening. Moreover, according to the above execution steps, when flattening and flattening restoration are performed, there is no need to introduce additional metadata, which will not affect the write performance of the system, and the whole process is convenient, economical and practical.

[0066] Optionally, the flattening and restoring method of the data clone volume may further include the following method steps:

[0067] Step S25, in response to the flatten restore instruction, adjusting the parent volume and the first snapshot to an undeletable state;

[0068] Step S26: When at least one of the parent volume and the first snapshot is deleted, an error prompt message is generated in response to the flatten restore instruction, wherein the error prompt message is used to indicate that the flatten restore cannot be executed.

[0069] In the application scenario, since flattening and flattening restoration are completed asynchronously, during the flattening and restoration process, it is necessary to restrict the deletion of the snapshots corresponding to the parent volume and the cloned volume in the parent volume, that is, to adjust the parent volume and the first snapshot to a non-deletable state. In other words, when the cloned volume V1 is flattened and restored, the parent volume V1 and snapshot V1:998 are both in a non-deletable state, but other snapshots in the parent volume V1 except snapshot V1:998 can be deleted.

[0070] In addition, after the parent volume and clone volume are flattened, before the flattening and restoration, the snapshots corresponding to the parent volume or the clone volume in the parent volume may be deleted. At this time, the flattening and restoration function is unavailable, and the error message "Cannot restore" is displayed to the user.

[0071] The related art also proposes a solution of using a data bitmap to describe the data source in the clone volume to achieve flattening and restoration. However, the introduction of the data bitmap in this solution increases the storage space usage. An additional I / O is required in the data storage structure to write the data bitmap, which reduces the system's write performance. Moreover, each modification of the data bitmap is an overwrite write operation, which increases the degree of fragmentation of the storage space. Therefore, the above-mentioned related art solution cannot show a good effect in the flattening and restoration scenario.

[0072] However, in the solution provided in the embodiment of the present application, in response to the flattening instruction acting on the parent volume and the clone volume, the clone data of the first snapshot in the parent volume is stored in the second snapshot of the clone volume, and the clone association relationship is deleted, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store the clone data; in response to the flattening and restoring instruction acting on the parent volume and the clone volume, the clone association relationship is re-established between the parent volume and the clone volume based on the first snapshot, and the second snapshot is deleted. Therefore, the present application can restore the flattened storage structure and release storage space, achieving the technical effect of improving data management flexibility and realizing the rapid release of storage space, thereby solving the technical problems in the existing data storage solutions that the flattening operation cannot be restored, resulting in poor data management flexibility and difficulty in releasing the occupied storage space due to flattening.

[0073] In this embodiment, a device for flattening and restoring a data clone volume is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, a "module" is a combination of software and / or hardware that can implement a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0074] Figure 8 is a structural block diagram of a device for flattening and restoring a data clone volume according to an embodiment of the present application, such as Figure 8 As shown, the device includes: a flattening module 801, which is used to respond to a flattening instruction acting on a parent volume and a clone volume, store the clone data of a first snapshot in the parent volume to a second snapshot of the clone volume, and delete the clone association relationship, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store the clone data; a restore module 802, which is used to respond to a flattening restore instruction acting on the parent volume and the clone volume, re-establish the clone association relationship between the parent volume and the clone volume based on the first snapshot, and delete the second snapshot.

[0075] Optionally, the flattening and restoring device for the data clone volume includes, in addition to all the above modules, a creation module (not shown in the figure), which is used to: create a clone volume based on the first snapshot of the parent volume; and establish a clone association relationship between the parent volume and the clone volume based on the first snapshot.

[0076] Optionally, the clone volume includes at least: a reserved snapshot number; the flattening module 801 is further used to: copy the snapshot data of the first snapshot to obtain clone data; create a second snapshot corresponding to the reserved snapshot number in the clone volume; and store the clone data in the second snapshot.

[0077] Optionally, in the above-mentioned flattening and restoring device for a data clone volume, the write data of the clone volume is stored in at least one third snapshot, and the creation time of the third snapshot is after the preset time corresponding to the reserved snapshot number.

[0078] Optionally, the restoration module 802 is further configured to: delete the second snapshot from the clone volume and reserve the reserved snapshot number.

[0079] Optionally, the flattening and restoring device for the data clone volume includes, in addition to all the above modules, a restriction module (not shown in the figure), for adjusting the parent volume and the first snapshot to an undeletable state in response to a flattening and restoring instruction.

[0080] Optionally, the flattening and restoring device for the data clone volume includes, in addition to all the above modules, a prompt module (not shown in the figure), which is used to: when at least one of the parent volume and the first snapshot is deleted, generate an error prompt message in response to the flattening and restoring instruction, wherein the error prompt message is used to indicate that the flattening and restoring cannot be performed.

[0081] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0082] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, the storage medium including a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any of the above-mentioned methods for flattening and restoring a data clone volume.

[0083] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store a computer program for performing the following steps: in response to a flatten instruction acting on the parent volume and the clone volume, storing the clone data of the first snapshot in the parent volume to the second snapshot of the clone volume, and deleting the clone association relationship, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store the clone data; in response to a flatten and restore instruction acting on the parent volume and the clone volume, re-establishing the clone association relationship between the parent volume and the clone volume based on the first snapshot, and deleting the second snapshot.

[0084] Optionally, in this embodiment, the storage medium may be configured to store a computer program for executing the following steps: creating a clone volume based on the first snapshot of the parent volume; and establishing a clone association relationship between the parent volume and the clone volume based on the first snapshot.

[0085] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store a computer program for performing the following steps: cloning a volume includes at least: reserving a snapshot number; copying the snapshot data of the first snapshot to obtain cloned data; creating a second snapshot corresponding to the reserved snapshot number in the cloned volume; and storing the cloned data in the second snapshot.

[0086] Optionally, in this embodiment, the storage medium may be configured to store a computer program for executing the following steps: the write data of the clone volume is stored in at least one third snapshot, and the creation time of the third snapshot is after the preset time corresponding to the reserved snapshot number.

[0087] Optionally, in this embodiment, the storage medium may be configured to store a computer program for executing the following steps: deleting the second snapshot from the clone volume and retaining the reserved snapshot number.

[0088] Optionally, in this embodiment, the storage medium may be configured to store a computer program for executing the following steps: in response to a flatten restore instruction, adjusting the parent volume and the first snapshot to an undeletable state.

[0089] Optionally, in this embodiment, the storage medium may be configured to store a computer program for executing the following steps: when at least one of the parent volume and the first snapshot is deleted, in response to a flatten restore instruction, generating an error prompt message, wherein the error prompt message is used to indicate that the flatten restore cannot be executed.

[0090] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0091] According to another aspect of an embodiment of the present application, a flattening and restoring system for a data clone volume is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any one of the aforementioned methods for flattening and restoring a data clone volume.

[0092] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: in response to a flatten instruction acting on the parent volume and the clone volume, storing the clone data of the first snapshot in the parent volume to the second snapshot of the clone volume, and deleting the clone association relationship, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, and the second snapshot is only used to store the clone data; in response to a flatten and restore instruction acting on the parent volume and the clone volume, re-establishing the clone association relationship between the parent volume and the clone volume based on the first snapshot, and deleting the second snapshot.

[0093] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program: creating a clone volume based on the first snapshot of the parent volume; and establishing a clone association relationship between the parent volume and the clone volume based on the first snapshot.

[0094] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: cloning the volume includes at least: reserving a snapshot number; copying the snapshot data of the first snapshot to obtain cloned data; creating a second snapshot corresponding to the reserved snapshot number in the cloned volume; and storing the cloned data in the second snapshot.

[0095] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: the write data of the clone volume is stored in at least one third snapshot, and the creation time of the third snapshot is after the preset time corresponding to the reserved snapshot number.

[0096] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: deleting the second snapshot from the clone volume and retaining the reserved snapshot number.

[0097] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program: in response to the flatten restore instruction, adjusting the parent volume and the first snapshot to an undeletable state.

[0098] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program: when at least one of the parent volume and the first snapshot is deleted, in response to a flatten restore instruction, an error prompt message is generated, wherein the error prompt message is used to indicate that the flatten restore cannot be executed.

[0099] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiment and its optional implementation manners, which will not be described in detail here.

[0100] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0101] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0102] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0104] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0105] If the integrated unit is implemented in the form of a software functional unit and 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 the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0106] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for flattening and restoring a data clone volume, characterized in that: include: In response to a flatten instruction acting on a parent volume and a clone volume, the clone data of a first snapshot in the parent volume is stored in a second snapshot of the clone volume, and the clone association relationship is deleted, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize the data reference relationship between the clone volume and the first snapshot, the second snapshot is only used to store the clone data, and the clone volume at least includes: a reserved snapshot number; In response to a flatten restore instruction acting on the parent volume and the clone volume, re-establishing the clone association relationship between the parent volume and the clone volume based on the first snapshot, and deleting the second snapshot; Establishing the clone association relationship includes: creating the clone volume based on a first snapshot of the parent volume; establishing the clone association relationship between the parent volume and the clone volume based on the first snapshot; Storing the cloned data of the first snapshot in the parent volume in the second snapshot of the cloned volume includes: copying the snapshot data of the first snapshot to obtain the cloned data; creating the second snapshot corresponding to the reserved snapshot number in the cloned volume; and storing the cloned data in the second snapshot.

2. The method for flattening and restoring a data clone volume according to claim 1, characterized in that: The write data of the clone volume is stored in at least one third snapshot, and the creation time of the third snapshot is after the preset time corresponding to the reserved snapshot number.

3. The method for flattening and restoring a data clone volume according to claim 1, characterized in that: Deleting the second snapshot includes: The second snapshot is deleted from the clone volume, and the reserved snapshot number is reserved.

4. The method for flattening and restoring a data clone volume according to claim 1, characterized in that: The flattening and restoring method of the data clone volume also includes: In response to the flatten restore instruction, the parent volume and the first snapshot are adjusted to be in an undeletable state.

5. The method for flattening and restoring a data clone volume according to claim 1, characterized in that: The flattening and restoring method of the data clone volume also includes: When at least one of the parent volume and the first snapshot is deleted, an error prompt message is generated in response to the flatten restore instruction, wherein the error prompt message is used to indicate that the flatten restore cannot be executed.

6. A device for flattening and restoring a data clone volume, characterized in that: include: a flattening module, configured to respond to a flattening instruction acting on a parent volume and a clone volume, store clone data of a first snapshot in the parent volume into a second snapshot of the clone volume, and delete a clone association relationship, wherein the clone volume is created based on the first snapshot, the clone association relationship is used to characterize a data reference relationship between the clone volume and the first snapshot, the second snapshot is only used to store the clone data, and the clone volume at least includes: a reserved snapshot number; a restoration module, configured to respond to a flattening restoration instruction acting on the parent volume and the clone volume, re-establish the clone association relationship between the parent volume and the clone volume based on the first snapshot, and delete the second snapshot; The flattening and restoring device for a data clone volume also includes a creation module, which is used to create a clone volume based on a first snapshot of a parent volume; and to establish a clone association relationship between the parent volume and the clone volume based on the first snapshot; The flattening module is further used for: copying the snapshot data of the first snapshot to obtain clone data; creating a second snapshot corresponding to the reserved snapshot number in the clone volume; and storing the clone data in the second snapshot.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the flattening and restoring method of the data clone volume according to any one of claims 1 to 5.

8. A flattening and restoring system for a data clone volume, characterized in that: A memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the flattening and restoring method of the data clone volume according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Volume information query method and system for distributed storage system, and related components

    CN111078157A

  • Data storage method and device, electronic equipment and storage medium

    CN114968069A