A method for enabling thin and thick volumes to share storage space
By pre-configuring Thick volumes in the storage space and controlling the writing and creation of Thin and Thick volumes according to policies, the problem that Thin and Thick volumes cannot share storage space is solved, achieving resource conservation and effective space management.
Patent Information
- Application Number
- CN202211144899.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-09-20
AI Technical Summary
In existing technologies, Thin volumes and Thick volumes cannot share the same hard disk pool storage space. This can cause Thin volumes to preempt Thick volume space during write operations, resulting in insufficient Thick volume space for writes.
By pre-configuring at least one Thick volume in the storage space and determining whether to allow writing to the Thin volume or creating a new Thick volume based on the pre-configured write and creation policies, the system ensures that the Thick volume is not preempted when writing and sends an alarm message when the remaining space is insufficient.
This allows Thin and Thick volumes to share storage space, avoiding space contention, saving resources, ensuring normal writing to the Thick volume, and providing timely alerts when space is insufficient.
Smart Images

Figure CN115454348B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage development technology, and in particular to a method for enabling thin volumes and thick volumes to share storage space. Background Technology
[0002] Thin volumes, also known as thin provisioning, do not occupy space during creation; space is only used when data is actually written. Therefore, within a disk pool, Thin volumes much larger than the pool's capacity can be created. For example, if a Thin volume is 500GB and the disk pool is 10TB, the number of Thin volumes that can be created can far exceed the pool's capacity—tens of thousands are possible, allowing for over-provisioning. When the disk pool is nearing full, it must be expanded to prevent service interruptions due to insufficient space.
[0003] Thick volumes, also known as thick configurations, require precise space calculations during creation and do not allow over-provisioning. For example, if a Thick volume is 512GB, then only two 1TB disk pools can be created, thus avoiding concerns about insufficient space causing service interruptions.
[0004] In existing technologies, Thin volumes and Thick volumes cannot be created in the same disk pool. This is because Thin volumes can be overprovisioned and almost an unlimited number can be created (in reality, Thin volumes also occupy some metadata space when they are created, so the number is not unlimited). Thick volumes cannot be overprovisioned. If they share a disk pool, Thin volumes will compete for space when writing, which will cause Thick volumes to be unable to write due to insufficient disk pool space. Summary of the Invention
[0005] The technical problem to be solved by this invention is: in view of the lack of existing technology that Thin volumes and Thick volumes cannot be created in the same hard disk pool (storage space), this invention provides a method to enable Thin volumes and Thick volumes to share storage space.
[0006] The technical solution adopted in this invention is a method for enabling thin volumes and thick volumes to share storage space. The storage space is pre-configured with at least one thick volume. The method includes: creating at least one thin volume in the storage space; determining whether to allow the thin volume to perform a write operation according to a pre-configured write policy; determining whether to allow the creation of a new thick volume in the storage space according to a pre-configured creation policy; and always allowing the write operation when the thick volume in the storage space performs a write operation.
[0007] In one implementation, determining whether to allow the thin volume to perform a write operation according to a pre-configured write policy includes: determining the current remaining capacity of the storage space and the capacity required to write to the thin volume; determining the current total configured capacity of the thick volume and the used capacity of the thick volume; allowing the write operation to the thin volume when the difference between the current remaining capacity of the storage space and the required capacity to write to the thin volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume; and blocking the write operation to the thin volume when the difference between the current remaining capacity of the storage space and the required capacity to write to the thin volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume.
[0008] In one implementation, determining whether to allow the creation of a new thick volume in the storage space according to a pre-configured creation policy includes: determining the current remaining capacity of the storage space and the capacity required for creating the thick volume; determining the current total configured capacity of the thick volume and the used capacity of the thick volume, wherein the current total configured capacity of the thick volume does not include the capacity required for creating the thick volume; allowing the creation operation of the thick volume when the difference between the current remaining capacity of the storage space and the required capacity for creating the thick volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume; and blocking the creation operation of the thick volume when the difference between the current remaining capacity of the storage space and the required capacity for creating the thick volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume.
[0009] In one embodiment, the method for enabling thin and thick volumes to share storage space further includes: sending an alarm message to the outside when the remaining capacity of the storage space minus the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume is less than 20% of the total capacity of the storage space.
[0010] Another aspect of the present invention provides a system for enabling thin volumes and thick volumes to share a storage space, wherein the storage space is pre-configured with at least one thick volume, the system comprising: a thin volume creation module configured to create at least one thin volume in the storage space; a thin volume writing module configured to determine whether to allow the thin volume to perform a write operation according to a pre-configured write policy; a thick volume creation module configured to determine whether to allow the creation of a new thick volume in the storage space according to a pre-configured creation policy; and a thick volume writing module configured to always allow the write operation when the thick volume in the storage space performs a write operation.
[0011] In one embodiment, the thin volume write module is further configured to: determine the current remaining capacity of the storage space and the capacity required to write to the thin volume this time; determine the current total configured capacity of the thick volume and the used capacity of the thick volume; allow the write operation to the thin volume when the difference between the current remaining capacity of the storage space and the required capacity to write to the thin volume this time is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume; and prevent the write operation to the thin volume when the difference between the current remaining capacity of the storage space and the required capacity to write to the thin volume this time is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume.
[0012] In one implementation, the thick volume creation module is further configured to: determine the current remaining capacity of the storage space and the capacity required for creating the thick volume; determine the current total configured capacity of the thick volume and the used capacity of the thick volume, wherein the current total configured capacity of the thick volume does not include the capacity required for creating the thick volume; allow the creation operation of the thick volume when the difference between the current remaining capacity of the storage space and the required capacity for creating the thick volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume; and prevent the creation operation of the thick volume when the difference between the current remaining capacity of the storage space and the required capacity for creating the thick volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume.
[0013] In one embodiment, the system further includes an alarm module configured to send an alarm message to the outside when the remaining capacity of the storage space minus the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume is less than 20% of the total capacity of the storage space.
[0014] Another aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for implementing thin and thick volumes sharing storage space as described in any of the preceding claims.
[0015] Another aspect of the present invention provides a computer storage medium storing a computer program that, when executed by a processor, implements the steps of the method for implementing a shared storage space for a thin volume and a thick volume as described in any of the preceding claims.
[0016] By adopting the above technical solution, the present invention has at least the following advantages:
[0017] The method for enabling thin and thick volumes to share storage space as described in this invention allows thin and thick volumes to share the same storage space, achieving the technical effect of saving resources. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a method for implementing shared storage space between thin and thick volumes according to an embodiment of the present invention;
[0019] Figure 2 This is a schematic diagram of the storage space according to an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of the apparatus for implementing shared storage space between thin and thick volumes according to an embodiment of the present invention.
[0021] Figure 4 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0022] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments.
[0023] The steps described in the specification and the flowcharts in the accompanying drawings of this invention are not necessarily to be strictly followed according to the step numbers; the execution order of the steps can be changed. Furthermore, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be broken down into multiple steps.
[0024] The first embodiment of the present invention provides a method for enabling thin volumes and thick volumes to share storage space, such as... Figures 1 to 2 As shown, the specific steps include the following:
[0025] Step S1: Create at least one thin volume in the storage space.
[0026] Step S2: Determine whether to allow the thin volume to perform write operations based on the pre-configured write policy.
[0027] Step S3: Determine whether to allow the creation of a new thick volume in the storage space based on the pre-configured creation strategy.
[0028] Step S4: When a write operation is performed on the thick volume in the storage space, the write operation is always allowed.
[0029] The following will describe in detail the method provided in this example for implementing shared storage space between thin and thick volumes.
[0030] Step S1: Create at least one thin volume in the storage space.
[0031] In this embodiment, the storage space can be provided by a hard disk, or by a resource pool, storage pool, or other device with storage capabilities.
[0032] In this embodiment, a Thin volume is called a thin provisioning. It doesn't occupy space when created; space is only used when data is actually written. Therefore, Thin volumes much larger than the disk pool's capacity can be created within a single disk pool. For example, if a Thin volume is 500GB and the disk pool is 10TB, the number of Thin volumes we can create can far exceed the disk pool's capacity—tens of thousands are possible, meaning overprovisioning is allowed. When the disk pool is about to fill up, to prevent service interruptions due to insufficient space, the disk pool must be expanded.
[0033] Thick volumes, also known as thick configurations, require precise space calculations during creation and do not allow over-provisioning. For example, if a Thick volume is 512GB, then only two 1TB disk pools can be created, thus avoiding concerns about insufficient space causing service interruptions.
[0034] In this embodiment, at least one thick volume can be pre-configured in the storage space. Obviously, the total space occupied by the pre-configured thick volume is less than the total space of the storage space. The thick volume can be either already written to or not yet written to.
[0035] In this embodiment, the process of creating at least one thin volume in the storage space will always be allowed by the execution system. Since the thin volume that has not been written to will not occupy storage space (it will only occupy a small amount of storage space, which can usually be ignored), one or more thin volumes can be created in the storage space according to the actual situation.
[0036] Step S2: Determine whether to allow the thin volume to perform write operations based on the pre-configured write policy.
[0037] In this embodiment, the write strategy may be: sequentially determining the current remaining capacity of the storage space, the capacity required to write to the thin volume this time, the current total configured capacity of the thick volume in the storage space, and the used capacity of the thick volume in the storage space.
[0038] Write operations to the thin volume are permitted when the difference between the current remaining capacity of the storage space and the capacity required to write to the thin volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume.
[0039] If the difference between the current remaining capacity of the storage space and the capacity required to write to the thin volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the write operation to the thin volume is blocked.
[0040] For a more intuitive description, it can be shown in the following formula (1):
[0041] Current remaining storage capacity - current write capacity to thin volume > (current total configured capacity of thin volume - used capacity of thin volume) (1)
[0042] In other words, when equation (1) is true, the write operation on the thin volume will be allowed; otherwise, the write operation on the thin volume will be prevented.
[0043] Step S3: Determine whether to allow the creation of a new thick volume in the storage space based on the pre-configured creation policy.
[0044] In this embodiment, the creation strategy may be: sequentially determining the current remaining capacity of the storage space, the required capacity for creating the thick volume this time, the current total configured capacity of all thick volumes in the storage space (excluding the required capacity for creating the thick volume this time), and the used capacity of all thick volumes.
[0045] The creation of the thick volume is permitted when the difference between the current remaining capacity of the storage space and the required capacity for this creation is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume.
[0046] If the difference between the current remaining storage capacity and the required capacity for creating the thick volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the creation operation for the thick volume is blocked.
[0047] For a more intuitive description, it can be shown in the following formula (2):
[0048] Current remaining storage space - the capacity required to create this thick volume > (total current capacity of all thick volumes (excluding the capacity to be created this time) - the capacity already used by all thick volumes) (2)
[0049] In other words, when equation (2) is true, the creation of the current thick volume will be allowed; otherwise, the creation of the current thick volume will be prevented.
[0050] It should be noted that in step S3 and the preceding step S2, the corresponding strategy is formulated by determining factors such as the remaining storage space and the capacity of the thick volume. In some possible implementations, the strategy can also be formulated by determining relevant parameters such as the space occupied by the write traffic of the thin volume. Any method obtained by reasonable modification based on this document should be included within the scope of protection defined herein.
[0051] Step S4: When a write operation is performed on the thick volume in the storage space, the write operation is always allowed.
[0052] Based on this embodiment, the processing of steps S1 to S3 above can ensure that the thick volume in the storage space can always be written to, and the space occupied by all write operations will not exceed the space that the storage space can provide.
[0053] In this embodiment, alarms can be set based on the usage status of the storage space so that the usage status of the storage space can be synchronized with the user in a timely manner.
[0054] Specifically, it could be:
[0055] An alarm message is sent externally when the remaining storage capacity minus the difference between the current total configured capacity and the used capacity of the thick volume is less than 20% of the total storage capacity.
[0056] For a more intuitive description, it can be shown in the following formula (3):
[0057] [Remaining storage space - (Total current capacity of the thick volume - Used capacity of the thick volume)] < 20% * Total storage space (3)
[0058] In other words, when the above formula (3) is true, an alarm is sent to the user to remind the user that the remaining storage space is less than 20% of the total space.
[0059] It is understandable that the alarm threshold ("20%" in the above formula) can be reasonably adjusted according to actual needs. The above formula (3) is only an exemplary value and does not mean that the alarm threshold is a fixed value.
[0060] A second embodiment of the present invention provides a system for enabling thin and thick volumes to share storage space, as described in the reference. Figure 3 For implementing the method as in the first embodiment, the system includes at least one thick volume pre-configured in the storage space, comprising:
[0061] The thin volume creation module is configured to create at least one thin volume in the storage space;
[0062] The thin volume write module is configured to determine whether to allow the thin volume to perform write operations based on a pre-configured write policy.
[0063] The thick volume creation module is configured to determine whether to allow the creation of new thick volumes in the storage space based on a pre-configured creation policy.
[0064] The thick volume write module is configured to always allow a write operation when a thick volume in the storage space is being written.
[0065] In this embodiment, the thin volume write module is further configured as follows:
[0066] Determine the current remaining capacity of the storage space, and the capacity required to write to the thin volume this time;
[0067] Determine the total current capacity of the thick volume, as well as the used capacity of the thick volume;
[0068] Write operations to the thin volume are permitted when the difference between the current remaining capacity of the storage space and the capacity required to write to the thin volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume.
[0069] If the difference between the current remaining capacity of the storage space and the capacity required to write to the thin volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the write operation to the thin volume is blocked.
[0070] In this embodiment, the thick volume creation module is further configured as follows:
[0071] Determine the current remaining capacity of the storage space, and the capacity required to create this thick volume;
[0072] Determine the current total capacity of the thick volume and the used capacity of the thick volume. The current total capacity of the thick volume does not include the capacity required for creating the thick volume in this operation.
[0073] If the difference between the current remaining capacity of the storage space and the capacity required to create the thick volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the creation operation of the thick volume is allowed.
[0074] If the difference between the current remaining storage capacity and the required capacity for creating the thick volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the creation operation for the thick volume will be blocked.
[0075] In this embodiment, the system further includes an alarm module, configured to send an alarm message to the outside when the remaining capacity of the storage space minus the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume is less than 20% of the total capacity of the storage space.
[0076] The third embodiment of the present invention, an electronic device, referenced Figure 4 It can be understood as a physical device, including a processor and a memory storing processor-executable instructions, which, when executed by the processor, perform the steps of the method for implementing thin and thick volumes to share storage space as described in the first embodiment.
[0077] In the fourth embodiment of the present invention, the process of implementing the shared storage space of thin and thick volumes is the same as that of the first embodiment. The difference lies in the engineering implementation: this embodiment can be implemented using software plus necessary general-purpose hardware platforms. While hardware implementation is also possible, the former is often a better approach. Based on this understanding, the method of the present invention can be embodied in the form of a computer software product stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including several instructions to cause a device (which may be a network device such as a base station) to execute the method described in the embodiments of the present invention.
[0078] Compared with the prior art, the present invention has at least the following advantages:
[0079] 1) The method for realizing the sharing of storage space between thin and thick volumes as described in this invention enables thin and thick volumes to share the same storage space, thereby achieving the technical effect of saving resources.
[0080] 2) The writing and creation strategies adopted in this invention provide a method for space planning of storage space.
[0081] Through the description of specific embodiments, a more in-depth and specific understanding should be gained of the technical means and effects adopted by the present invention to achieve the intended purpose. However, the accompanying drawings are only for reference and illustration and are not intended to limit the present invention.
Claims
1. A method for implementing shared storage space between thin and thick volumes, characterized in that, The storage space is pre-configured with at least one thick volume, and the method includes: Create at least one thin volume in the storage space; Based on the pre-configured write policy, determine whether to allow the thin volume to perform write operations; Based on the pre-configured creation policy, determine whether to allow the creation of a new thick volume in the storage space; When a write operation is performed on the thick volume in the storage space, the write operation is always allowed; The step of determining whether to allow the thin volume to perform write operations based on a pre-configured write policy includes: Determine the current remaining capacity of the storage space, and the capacity required to write to the thin volume this time; Determine the current total configured capacity of the thick volume, and the used capacity of the thick volume; When the difference between the current remaining capacity of the storage space and the capacity required to write to the thin volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, the write operation to the thin volume is allowed. If the difference between the current remaining capacity of the storage space and the capacity required to write to the thin volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the current write operation to the thin volume is blocked.
2. The method for implementing shared storage space for thin and thick volumes according to claim 1, characterized in that, The step of determining whether to allow the creation of a new thick volume in the storage space based on a pre-configured creation policy includes: Determine the current remaining capacity of the storage space, and the required capacity for creating the thick volume; Determine the current total configured capacity of the thick volume and the used capacity of the thick volume, wherein the current total configured capacity of the thick volume does not include the capacity required for creating the thick volume in this instance; When the difference between the current remaining capacity of the storage space and the required capacity for creating the thick volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, the creation operation for the thick volume is allowed. If the difference between the current remaining capacity of the storage space and the required capacity for creating the thick volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the creation operation for the thick volume is blocked.
3. The method for implementing shared storage space for thin and thick volumes according to claim 1, characterized in that, The method for enabling thin and thick volumes to share storage space further includes: When the remaining capacity of the storage space minus the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume is less than 20% of the total capacity of the storage space, an alarm message is sent to the outside.
4. A system for implementing shared storage space between thin and thick volumes, characterized in that, The storage space is pre-configured with at least one thick volume, and the system includes: The thin volume creation module is configured to create at least one thin volume in the storage space; The thin volume write module is configured to determine whether to allow the thin volume to perform a write operation based on a pre-configured write policy. The thick volume creation module is configured to determine whether to allow the creation of a new thick volume in the storage space based on a pre-configured creation strategy. The thick volume write module is configured to always allow a write operation when a write operation is performed on a thick volume in the storage space; The thin volume write module is further configured as follows: Determine the current remaining capacity of the storage space, and the capacity required to write to the thin volume this time; Determine the current total configured capacity of the thick volume, and the used capacity of the thick volume; When the difference between the current remaining capacity of the storage space and the capacity required to write to the thin volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, the write operation to the thin volume is allowed. If the difference between the current remaining capacity of the storage space and the capacity required to write to the thin volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the current write operation to the thin volume is blocked.
5. The system for implementing shared storage space for thin and thick volumes according to claim 4, characterized in that, The thick volume creation module is further configured as follows: Determine the current remaining capacity of the storage space, and the required capacity for creating the thick volume; Determine the current total configured capacity of the thick volume and the used capacity of the thick volume, wherein the current total configured capacity of the thick volume does not include the capacity required for creating the thick volume in this instance; When the difference between the current remaining capacity of the storage space and the required capacity for creating the thick volume is greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, the creation operation for the thick volume is allowed. If the difference between the current remaining capacity of the storage space and the required capacity for creating the thick volume is not greater than the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume, then the creation operation for the thick volume is blocked.
6. The system for implementing shared storage space for thin and thick volumes according to claim 4, characterized in that, The system also includes: The alarm module is configured to send an alarm message to the outside when the remaining capacity of the storage space minus the difference between the current total configured capacity of the thick volume and the used capacity of the thick volume is less than 20% of the total capacity of the storage space.
7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for implementing a thin volume and a thick volume sharing a common storage space as claimed in any one of claims 1 to 3.
8. A computer storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method for implementing a thin volume and a thick volume sharing storage space as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Distributed storage system and storage method thereof
CN111208942A