A method, device and equipment for creating a thick provisioning volume and a readable storage medium

CN116661701BActive Publication Date: 2026-10-09JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310778501.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2026-10-09
Estimated Expiration
2043-06-29

AI Technical Summary

Technical Problem

[0004]当批量创建厚置备卷,且存储池已存在的卷彻底删除的情况下,进行容量计算,容量计算则会有误,并进行报错,而报错则会导致批量创建厚置备卷任务失败

Benefits of technology

[0056] Using the method provided in the embodiments of this application, a batch creation command for thick provisioned volumes is obtained; during the process of obtaining the available capacity of the current storage pool, if a volume in the storage pool is completely deleted, the volume is skipped and the available capacity of the storage pool is calculated again; thick provisioned volumes are created according to the available capacity of the storage pool; if the currently created thick provisioned volume is not the last one created, the step of obtaining the available capacity of the current storage pool is returned until the currently created thick provisioned volume is the last one created.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116661701B_ABST
    Figure CN116661701B_ABST
Patent Text Reader

Abstract

The application discloses a kind of thick standby volume creation method, device, equipment and readable storage medium in storage technology field, in the method includes: obtaining batch creation thick standby volume creation command;In the process of obtaining current storage pool available capacity, if there is volume in storage pool complete deletion, then skip the volume, and continue to calculate storage pool available capacity;According to storage pool available capacity, create thick standby volume;If the thick standby volume currently created is not the last one, return to execute the step of obtaining current storage pool available capacity, until the thick standby volume currently created is the last one.Creation in the application, consider the process of batch creation thick standby volume, storage pool volume change situation, so as to skip the deleted volume that can cause capacity calculation error, avoid batch thick standby volume creation failure due to capacity calculation error, can improve the success rate of thick standby volume creation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technology, and in particular to a method, apparatus, device and readable storage medium for creating thick provisioned volumes. Background Technology

[0002] Thick provisioned volumes are created as thick disks that support clustering. The necessary space is allocated to the virtual disk during creation. Unlike flat formats, data reserved on the physical device is zeroed out during creation.

[0003] Creating this type of disk takes longer than creating other types of disks.

[0004] When creating thick provisioned volumes in batches, and all existing volumes in the storage pool are completely deleted, capacity calculations will fail, resulting in errors and causing the batch creation of thick provisioned volumes to fail. This reduces the success rate of creating thick provisioned volumes in batches.

[0005] In summary, how to effectively improve the success rate of creating batch thick backup volumes is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] The purpose of this application is to provide a method, apparatus, device, and readable storage medium for creating thick backup volumes, thereby improving the success rate of batch creation of thick backup volumes.

[0007] To solve the above-mentioned technical problems, this application provides the following technical solution:

[0008] A method for creating a thick provisioned volume includes:

[0009] Get the command to create thick provisioned volumes in batches;

[0010] If a volume in the storage pool is completely deleted during the process of obtaining the current available capacity of the storage pool, the volume is skipped and the calculation of the available capacity of the storage pool continues.

[0011] Create a thick provisioned volume based on the available capacity of the storage pool;

[0012] If the currently created thick provisioned volume is not the last one created, then return to the step of obtaining the available capacity of the current storage pool, until the currently created thick provisioned volume is the last one created.

[0013] Preferably, creating a thick provisioned volume based on the available capacity of the storage pool includes:

[0014] Determine whether the available capacity of the storage pool is greater than the required capacity of the thick standby volume to be created.

[0015] If so, then create the thick provisioned volume;

[0016] If not, then stop creating the thick provisioned volume.

[0017] Preferably, creating the thick provisioning volume includes:

[0018] Create a simplified volume;

[0019] After the simplified volume is created, add a volume attribute identifier field;

[0020] Fill all the space in the simplified volume with data;

[0021] After the data is populated, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the volume header object to complete the creation of the thick provisioned volume.

[0022] Preferably, obtaining the batch creation command for thick provisioned volumes includes:

[0023] Receive batch creation instructions;

[0024] The batch creation instruction is parsed at the block protocol layer, and it is determined whether there are tag parameters corresponding to the backup volume.

[0025] If so, then the batch creation instruction is determined to be the batch create thick provisioning volume creation command;

[0026] If not, then the batch creation instruction is determined to be a batch creation instruction for a thin volume.

[0027] Preferably, after determining that the batch creation instruction is a batch creation instruction for a thin volume, the process includes:

[0028] Create a thin volume and return the creation result;

[0029] Determine if the currently created thin volume is the last one created;

[0030] If so, creation is complete;

[0031] If not, return to the step of creating a thin volume and return the creation result.

[0032] Preferably, obtaining the current available capacity of the storage pool includes:

[0033] Retrieve volume information from the storage pool;

[0034] Based on the volume information, the available capacity of the storage pool is determined.

[0035] Preferably, determining the available capacity of the storage pool based on the volume information includes:

[0036] Read the access information of each volume from the volume information;

[0037] In the process of sequentially accessing each volume in the storage pool based on the access information to obtain the volume size corresponding to each volume, it is determined whether the volume to be accessed currently exists.

[0038] If the volume being accessed exists, then access it to obtain the volume size.

[0039] If the volume being accessed does not exist, skip the step of obtaining the volume size corresponding to that volume;

[0040] After the last volume is accessed or skipped, the sizes of all the volumes currently accessed are summed to obtain the used capacity of the storage pool;

[0041] The available capacity of the storage pool is obtained by subtracting the storage pool capacity from the used capacity of the storage pool.

[0042] Accordingly, based on the available capacity of the storage pool, a thick provisioned volume is created, including:

[0043] If the size of the thick provisioned volume to be created is smaller than the available capacity of the storage pool, then a thin volume is created.

[0044] After the simplified volume is created, add a volume attribute identifier field;

[0045] Fill all spaces in the simplified volume with zero data;

[0046] After the data is populated, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the volume header object to complete the creation of the thick provisioned volume and return the creation result.

[0047] A thick provisioning roll creation apparatus, comprising:

[0048] The command acquisition module is used to obtain batch creation commands for thick standby volumes.

[0049] The capacity determination module is used to skip volumes that have been completely deleted in the storage pool during the process of obtaining the available capacity of the current storage pool, and continue to calculate the available capacity of the storage pool.

[0050] The volume creation module is used to create thick provisioned volumes based on the available capacity of the storage pool;

[0051] The determination module is used to return to the step of obtaining the available capacity of the current storage pool if the currently created thick standby volume is not the last one created, until the currently created thick standby volume is the last one created.

[0052] An electronic device, comprising:

[0053] Memory, used to store computer programs;

[0054] A processor is used to implement the steps of the above-described thick backup volume creation method when executing the computer program.

[0055] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described thick standby volume creation method.

[0056] Using the method provided in the embodiments of this application, a batch creation command for thick provisioned volumes is obtained; during the process of obtaining the available capacity of the current storage pool, if a volume in the storage pool is completely deleted, the volume is skipped and the available capacity of the storage pool is calculated again; thick provisioned volumes are created according to the available capacity of the storage pool; if the currently created thick provisioned volume is not the last one created, the step of obtaining the available capacity of the current storage pool is returned until the currently created thick provisioned volume is the last one created.

[0057] In this application, after receiving the batch creation command for thick provisioned volumes, during the process of obtaining the available capacity of the current storage pool, if a volume in the storage pool is found to have been permanently deleted, that volume is skipped, and the calculation of the available capacity of the storage pool continues. Since the skipped volume has been permanently deleted, meaning its space has been effectively released, it does not need to be counted further and will not affect the creation of the thick provisioned volume. Then, based on the calculated available capacity of the current storage pool, the thick provisioned volume is created. If the currently created thick provisioned volume is not the last one created, the process returns to the step of obtaining the available capacity of the current storage pool, thus continuing to create the next thick provisioned volume. If the currently created thick provisioned volume is the last one created, the batch creation of thick provisioned volumes is considered complete. That is, in this application, the changes in storage pool volumes during the batch creation of thick provisioned volumes are considered, thereby skipping deleted volumes that would cause capacity calculation errors, avoiding the failure of batch thick provisioned volume creation due to capacity calculation errors, and improving the success rate of thick provisioned volume creation.

[0058] Accordingly, embodiments of this application also provide a thick backup volume creation apparatus, device, and readable storage medium corresponding to the above-described thick backup volume creation method, which have the above-described technical effects, and will not be repeated here. Attached Figure Description

[0059] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0060] Figure 1 This is a flowchart illustrating the implementation of a thick backup volume creation method in this application.

[0061] Figure 2 This is a schematic diagram illustrating the specific process of a method for creating a thick reserve volume in an embodiment of this application.

[0062] Figure 3 This is a schematic diagram of the structure of a thick stock preparation roll creation device according to an embodiment of this application;

[0063] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;

[0064] Figure 5 This is a schematic diagram of the specific structure of an electronic device in an embodiment of this application. Detailed Implementation

[0065] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0066] Please refer to Figure 1 , Figure 1 This is a flowchart of a method for creating a thick provisioned volume according to an embodiment of this application. The method includes the following steps:

[0067] S101. Obtain the batch creation command for thick standby volumes.

[0068] The "Batch Create Thick Provisioned Volumes" command specifies that a batch of volumes need to be created, and that these volumes are thick provisioned volumes.

[0069] In the embodiments of this application, batch thick provisioning volume creation commands can be issued through a management interface or command line. The `create` command includes the parameter `-thick-provision` (a tag parameter corresponding to the thick provisioning volume). In other words, by monitoring the management interface or command line, batch thick provisioning volume creation commands can be obtained.

[0070] In one specific embodiment of this application, obtaining the batch creation command for thick provisioned volumes includes:

[0071] Step 1: Receive batch creation instructions;

[0072] Step 2: Parse the batch creation command in the block protocol layer and determine whether there are tag parameters corresponding to the backup volume;

[0073] Step 3: If so, confirm that the batch creation command is the batch creation command for thick provisioned volumes;

[0074] Step 4: If not, then confirm that the batch creation command is a batch creation command for thin volumes.

[0075] For ease of description, the above four steps will be explained in combination below.

[0076] This batch creation command can be issued from the management interface or via the command line.

[0077] Upon receiving the bulk creation command, the command is first parsed at the Block Protocol Layer (RBD, RADOS Block Device, a storage service middleware layer built on top of a RADOS cluster that provides a block device interface to clients; for ease of description, it will be referred to as the Block Protocol Layer in this document). This allows the basic attribute information of the created volume (such as name and size) to be obtained.

[0078] After parsing the batch creation command, it can be determined whether the command has a tag parameter corresponding to a backup volume. If the tag parameter for a backup volume exists, it is determined that the batch creation command refers to the batch creation of backup volumes; if the tag parameter for a backup volume does not exist, it is determined that the batch creation command refers to the batch creation of thin volumes.

[0079] Thin volumes, also known as thin volumes, use space on demand, meaning they only occupy storage pool space when data is written to the volume. Thin volumes ensure efficient use of storage space.

[0080] In one specific embodiment of this application, after determining that the batch creation instruction is a batch creation instruction for thin volumes, the following steps can be performed to complete the batch creation of thin volumes:

[0081] Step 1: Create a thin volume and return the creation result;

[0082] Step 2: Determine if the currently created simplified volume is the last one created;

[0083] Step 3: If yes, the creation is complete;

[0084] Step 4: If not, return to the step of creating a thin volume and return the creation result.

[0085] For ease of description, the above four steps will be explained in combination below.

[0086] When it is explicitly stated that a thin volume is to be created, the thin volume is created and the creation result is returned. Then, it is determined whether the thin volume currently being created is the last one created, that is, whether the volumes required by the current batch creation command have been created. If so, the creation is confirmed to be complete; if not, the batch thin volume creation is confirmed to be incomplete. At this time, it is necessary to return to step one, that is, to continue creating thin volumes and waiting for the creation result, until the thin volume currently being created is the last one created, at which point the creation is confirmed to be complete.

[0087] S102. During the process of obtaining the available capacity of the current storage pool, if a volume in the storage pool is completely deleted, skip that volume and continue to calculate the available capacity of the storage pool.

[0088] Before creating a thick provisioned volume, it is necessary to determine the available capacity of the current storage pool. In this application, considering that the batch creation of thick provisioned volumes takes a long time, it may involve the complete deletion of volumes in the storage pool. At this time, the available capacity of the storage pool will change. In particular, when a volume is completely created, performing capacity statistics will usually result in an error, which will prevent the creation of thick provisioned volumes from continuing.

[0089] In this application, considering that a volume that has been completely deleted no longer occupies space in the storage pool, and that during the batch creation of thick provisioned volumes, the available capacity of the storage pool needs to be obtained for each thick provisioned volume, the available capacity of the storage pool will not change significantly even if a volume is deleted, and will not suddenly become equivalent to the size of the thick provisioned volume to be created. Therefore, in this application, the volume that has been completely deleted is skipped in the capacity calculation stage, and the space occupied by other objects is calculated to calculate the available capacity of the storage pool. Since the available capacity of the storage pool is generally sufficient to create a thick provisioned volume, the complete deletion of several volumes has little impact on the judgment of whether the capacity is sufficient. In particular, after a volume is completely deleted, the space occupied by that volume will be included in the available capacity according to the processing flow. Of course, the space may not be usable when calculating the capacity, but it is considered usable and will not have a substantial impact. On the contrary, it avoids the situation where the batch creation of thick provisioned volumes fails due to capacity calculation errors. In other words, skipping one or more thick standby volumes that have been completely deleted during the capacity calculation process can effectively improve the success rate of creating thick standby volumes.

[0090] S103. Create a thick provisioned volume based on the available capacity of the storage pool.

[0091] Creating a thick provisioned volume requires that the current storage pool has sufficient unallocated available capacity. Therefore, the creation of a thick provisioned volume must be based on the available capacity of the storage pool.

[0092] In other words, a thick provisioned volume can only be created if the storage pool has sufficient available capacity; it cannot be created if the storage pool does not have sufficient available capacity. Sufficient capacity specifically means that the available capacity of the storage pool is at least greater than the size required to create the thick provisioned volume.

[0093] In one specific embodiment of this application, creating a thick provisioned volume based on the available capacity of the storage pool includes:

[0094] Step 1: Determine if the available capacity of the storage pool is greater than the required capacity of the thick provisioned volume to be created.

[0095] Step 2: If so, create a thick provisioned volume;

[0096] Step 3: If not, stop creating the thick provisioned volume.

[0097] The required size of the thick provisioned volume to be created can be determined by parsing the basic attribute information of the volume obtained from the batch creation of thick provisioned volumes.

[0098] If the available capacity of the storage pool is greater than the required capacity of the thick provisioned volume to be created, it indicates that the available space of the current storage pool is sufficient, and the thick provisioned volume can be created directly. If the available capacity of the storage pool is less than the required capacity of the thick provisioned volume to be created, it indicates that the available space of the current storage pool is scarce, especially for the creation of the volume, where the available resource space is scarce, and the creation of the thick provisioned volume can be stopped.

[0099] When there is sufficient available resource space in the storage pool, a thick provisioned volume is created. The specific creation process includes:

[0100] Step two, creating a thick provisioned volume, includes:

[0101] Step 1: Create a simplified volume;

[0102] Step 2: After the simplified volume is created, add a volume attribute identifier field;

[0103] Step 3: Fill all the space in the simplified volume with data;

[0104] Step 4: After the data is populated, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the volume header object to complete the creation of the thick provisioned volume.

[0105] When creating a thick provisioned volume, first create a thin volume, and then add a volume attribute identifier field after the thin volume is created.

[0106] Generally, after a thin volume is created, its space is not populated with data. However, in this application, during the creation of a thick provisioned volume, a thin volume is created first, and then a volume attribute field is added after the thin volume is created. This allows the volume attribute identifier field to be changed to the parameter value of the thick provisioned volume after all the space of the thin volume is populated with data, and is stored in the volume's header object, thus completing the creation of the thick provisioned volume.

[0107] S104. If the currently created thick standby volume is not the last one created, return to the step of obtaining the available capacity of the current storage pool until the currently created thick standby volume is the last one created.

[0108] After each thick provisioning volume is created, a check is performed to determine whether the currently created thick provisioning volume is the last one created, thus confirming whether the batch creation of thick provisioning volumes has been completed.

[0109] If the currently created thick standby volume is not the last one created, it indicates that the batch creation of thick standby volumes has not been completed. In this case, it is necessary to return to the step of obtaining the available capacity of the current storage pool and perform the creation of thick standby volumes until the currently created thick standby volume is the last one created.

[0110] If the currently created thick provisioned volume is the last one created, it indicates that the batch creation of thick provisioned volumes has been completed, and the volume creation can be ended at this time.

[0111] Using the method provided in the embodiments of this application, a batch creation command for thick provisioned volumes is obtained; during the process of obtaining the available capacity of the current storage pool, if a volume in the storage pool is completely deleted, the volume is skipped and the available capacity of the storage pool is calculated again; thick provisioned volumes are created according to the available capacity of the storage pool; if the currently created thick provisioned volume is not the last one created, the step of obtaining the available capacity of the current storage pool is returned until the currently created thick provisioned volume is the last one created.

[0112] In this application, after receiving the batch creation command for thick provisioned volumes, during the process of obtaining the available capacity of the current storage pool, if a volume in the storage pool is found to have been permanently deleted, that volume is skipped, and the calculation of the available capacity of the storage pool continues. Since the skipped volume has been permanently deleted, meaning its space has been effectively released, it does not need to be counted further and will not affect the creation of the thick provisioned volume. Then, based on the calculated available capacity of the current storage pool, the thick provisioned volume is created. If the currently created thick provisioned volume is not the last one created, the process returns to the step of obtaining the available capacity of the current storage pool, thus continuing to create the next thick provisioned volume. If the currently created thick provisioned volume is the last one created, the batch creation of thick provisioned volumes is considered complete. That is, in this application, the changes in storage pool volumes during the batch creation of thick provisioned volumes are considered, thereby skipping deleted volumes that would cause capacity calculation errors, avoiding the failure of batch thick provisioned volume creation due to capacity calculation errors, and improving the success rate of thick provisioned volume creation.

[0113] It should be noted that, based on the above embodiments, the embodiments of this application also provide corresponding improvement schemes. In the preferred / improved embodiments, the same or corresponding steps as in the above embodiments can be referred to each other, and the corresponding beneficial effects can also be referred to each other; however, these will not be elaborated upon in the preferred / improved embodiments herein.

[0114] In one specific embodiment of this application, obtaining the current available capacity of the storage pool includes:

[0115] Step 1: Obtain volume information from the storage pool;

[0116] The volume information includes relevant information for each volume in the storage pool, such as volume size and volume name.

[0117] Step 2: Determine the available capacity of the storage pool based on the volume information.

[0118] That is, the available capacity of the storage pool can be determined by statistically analyzing the allocated space in the storage pool based on the volume information.

[0119] Specifically, step two, based on volume information, determines the available capacity of the storage pool, including:

[0120] Read the access information for each volume from the volume information;

[0121] Step 1: In the process of sequentially accessing each volume in the storage pool based on access information to obtain the volume size corresponding to each volume, determine whether the volume to be accessed currently exists.

[0122] Step 2: If the volume being accessed exists, obtain the volume size by accessing it.

[0123] Step 3: If the volume being accessed does not exist, skip the step of obtaining the volume size.

[0124] Step 4: After the last volume is accessed or skipped, sum up the sizes of all currently acquired volumes to obtain the used capacity of the storage pool;

[0125] Step 5: Calculate the difference between the storage pool capacity and the used capacity of the storage pool to obtain the available capacity of the storage pool;

[0126] Accordingly, based on the available capacity of the storage pool, thick provisioned volumes are created, including:

[0127] Step 1: If the size of the thick provisioned volume to be created is smaller than the available capacity of the storage pool, then create a thin volume.

[0128] Step 2: After the simplified volume is created, add a volume attribute identifier field;

[0129] Step 3: Fill all spaces in the simplified volume with zero data;

[0130] Step 4: After the data is populated, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the volume header object to complete the creation of the thick provisioned volume and return the creation result.

[0131] That is, in this embodiment of the application, when determining the available space of the storage pool based on the volume information, each volume can be accessed based on the volume information to obtain the volume size of each volume. When a volume is completely deleted, i.e., its volume size cannot be obtained, the volume is skipped directly; for the currently accessed volume, which exists, its volume size is directly obtained. Then, the sizes of all accessible volumes are summed, and the sum is determined as the current used capacity of the storage pool. Then, the difference between the current storage pool capacity and the current used capacity of the storage pool is the available capacity of the storage pool.

[0132] Once the available capacity of the storage pool is determined, it can be compared with the required size of the thick provisioned volume to be created. If the available capacity of the storage pool is greater than the required size, the thick provisioned volume can be created.

[0133] Specifically, creating the thick provisioned volume involves first creating a thin volume, then adding a volume attribute identifier field, and then filling the thin volume with zero data. After the data is filled, the volume attribute identifier field automatically changes to the parameter value corresponding to the thick provisioned volume and is stored in the volume header object, thus completing the creation of the thick provisioned volume and returning the creation result.

[0134] The critical volume attribute identifier field, represented by `thick_stat`, is set to 2 during data population. At this time, the volume status is displayed as formatted in the management interface, and the volume thinned attribute is displayed as a thick provisioned volume. After all space is filled with zero data, the volume attribute identifier field `thick_stat` is changed to 1, and the volume status is restored.

[0135] In other words, thick standby volumes allocate space according to the actual volume size, which is beneficial for ensuring space for critical business operations. The main feature of thick standby volumes is that they provide a pre-formatted volume filled with data, with the actual occupied space matching the allocated space. A thick standby volume can be understood as a thin volume that has already been formatted and filled with zero data. The creation process of a thick standby volume can be divided into two parts: thin volume creation and zero data writing. Therefore, it maintains consistency with thin volumes in terms of volume functionality and feature support. In actual implementation, the existing thin volume creation process can be used, and the creation interface can be consistent with that of thin volumes. After creating a thin volume, if the target is to create a thick standby volume, zero data is filled into the created thin volume to format and fill the space, thus completing the creation of the thick standby volume.

[0136] To facilitate those skilled in the art to better understand and implement the thick backup volume creation method provided in the embodiments of this application, the creation process of the thick backup volume creation method will be described in detail below with reference to a specific creation scenario.

[0137] Please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the specific process of a thick backup volume creation method in an embodiment of this application.

[0138] In AS13000 product block scenarios, only thin volumes are available with this provisioning method. Thin volumes require metadata writing and data block allocation during the first data write, which takes time. Thick provisioned volumes, on the other hand, perform direct formatting and pre-create data objects, allowing for direct data writing without waiting for any new I / O operations.

[0139] Typically, thick standby volumes allocate space according to the actual volume size, which is beneficial for ensuring space availability for critical business operations. The main feature of thick standby volumes is that they provide a pre-formatted volume filled with data, with the actual occupied space matching the allocated space. A thick standby volume can be understood as a thin volume that has already been formatted and filled with zero data. The creation process of a thick standby volume can be divided into two parts: thin volume creation and zero data writing. Therefore, it maintains consistency with thin volumes in terms of volume functionality and feature support. In actual implementation, based on the existing thin volume creation process, the creation interface remains consistent with thin volumes. After a thin volume is created, if the target is to create a thick standby volume, zero data is filled into the created thin volume to format and fill the space.

[0140] When a volume in a storage pool is completely deleted from the storage pool, during the batch creation of thick provisioned volumes, if the volume in the storage pool does not exist, an error will be generated, causing the storage pool capacity calculation to fail and the task creation to fail.

[0141] In other words, the current batch creation of thick standby volumes does not take into account changes in storage pool volumes. When a batch of thick standby volumes is created while an existing volume in the storage pool is completely deleted, capacity calculation is performed. If the capacity calculation is incorrect, an error will be reported, causing the batch creation of thick standby volumes to fail. The process of creating thick standby volumes fails in the middle.

[0142] When using the thick standby volume creation method provided in this application, during the batch creation of thick standby volumes while existing volumes in the storage pool are completely deleted, capacity calculation is performed. First, the storage pool volume information is queried; if the volume does not exist, it is skipped without capacity statistics, and subsequent volume capacity statistics are continued. This avoids capacity calculation errors caused by the complete deletion of volumes. It effectively prevents batch creation of thick standby volumes from failing due to capacity statistics errors.

[0143] The detailed steps for creating a thick provisioned volume are as follows:

[0144] 1. Issue batch thick provisioning provisioning volume creation commands via management interface / command line (add the parameter -thick-provision to the create command);

[0145] 2. RBD layer parsing instructions to obtain basic attribute information of the created volume (such as name, size, quantity, etc.);

[0146] 3. Check if the parameter -thick-provision exists. If it does, proceed to step 4, which is to create a thick provisioning.

[0147] 4. Compare the required size of a single volume to be created with the available capacity of the storage pool. If the capacity requirement is met, create a thin volume first.

[0148] During the process of calculating the available capacity of the storage pool, if a volume is completely deleted, it is skipped, and the calculation of the capacity occupied by other objects continues to avoid errors.

[0149] In other words, during the batch creation of thick provisioned volumes, the capacity calculation operation takes into account scenarios involving changes in storage pool volumes. When a batch of thick provisioned volumes is created while an existing volume in the storage pool is completely deleted, when calculating the capacity, if the previous volume in the storage pool no longer exists, that object will be skipped and its capacity will not be included in the calculation; instead, the capacity calculation for subsequent volumes will proceed.

[0150] 5. After the thin volume is created, add a volume attribute identifier field thick_stat. During data population, thick_stat = 2. (At this time, in the management interface, the volume status is displayed as formatted, and the thin volume attribute is displayed as a thick provisioned volume), and save it to the volume header object;

[0151] 6. Perform data filling operation on all space of the thin volume. After the data writing is completed, modify the volume status flag thick_stat=1 and restore the volume status.

[0152] 7. Repeat the above operations to create batch thick backup volumes.

[0153] As can be seen, in this application, the batch creation of thick provisioned volumes takes into account the scenario of storage pool volume changes during capacity calculation. When a volume already existing in the storage pool is completely deleted while batch creating thick provisioned volumes, the calculated capacity will be adjusted according to the actual situation and will not affect subsequent statistics. The batch creation of thick provisioned volumes will not fail due to capacity calculation errors occurring midway.

[0154] Corresponding to the above method embodiments, this application also provides a thick backup volume creation apparatus. The thick backup volume creation apparatus described below can be referred to in correspondence with the thick backup volume creation method described above.

[0155] See Figure 3 As shown, the device includes the following modules:

[0156] Command acquisition module 101 is used to acquire batch creation commands for thick standby volumes;

[0157] The capacity determination module 102 is used to skip a volume that has been completely deleted in the storage pool during the process of obtaining the available capacity of the current storage pool, and continue to calculate the available capacity of the storage pool.

[0158] Volume creation module 103 is used to create thick provisioned volumes based on the available capacity of the storage pool;

[0159] The judgment module 104 is used to return to the step of obtaining the available capacity of the current storage pool if the currently created thick standby volume is not the last one created, until the currently created thick standby volume is the last one created.

[0160] Using the apparatus provided in the embodiments of this application, a batch creation command for thick provisioned volumes is obtained; during the process of obtaining the available capacity of the current storage pool, if a volume in the storage pool is completely deleted, the volume is skipped and the available capacity of the storage pool is calculated again; thick provisioned volumes are created according to the available capacity of the storage pool; if the currently created thick provisioned volume is not the last one created, the step of obtaining the available capacity of the current storage pool is returned until the currently created thick provisioned volume is the last one created.

[0161] In this application, after receiving the batch creation command for thick provisioned volumes, during the process of obtaining the available capacity of the current storage pool, if a volume in the storage pool is found to have been permanently deleted, that volume is skipped, and the calculation of the available capacity of the storage pool continues. Since the skipped volume has been permanently deleted, meaning its space has been effectively released, it does not need to be counted further and will not affect the creation of the thick provisioned volume. Then, based on the calculated available capacity of the current storage pool, the thick provisioned volume is created. If the currently created thick provisioned volume is not the last one created, the process returns to the step of obtaining the available capacity of the current storage pool, thus continuing to create the next thick provisioned volume. If the currently created thick provisioned volume is the last one created, the batch creation of thick provisioned volumes is considered complete. That is, in this application, the changes in storage pool volumes during the batch creation of thick provisioned volumes are considered, thereby skipping deleted volumes that would cause capacity calculation errors, avoiding the failure of batch thick provisioned volume creation due to capacity calculation errors, and improving the success rate of thick provisioned volume creation.

[0162] In one specific embodiment of this application, the volume creation module 103 is specifically used to determine whether the available capacity of the storage pool is greater than the required capacity of the thick provisioned volume to be created.

[0163] If so, create a thick provisioned volume;

[0164] If not, then stop creating thick provisioned volumes.

[0165] In one specific embodiment of this application, the volume creation module 103 is specifically used to create a thin volume;

[0166] After the simplified volume is created, add a volume attribute identifier field;

[0167] Fill all the space in the simplified volume with data;

[0168] After the data is populated, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the volume header object to complete the creation of the thick provisioned volume.

[0169] In one specific embodiment of this application, the command acquisition module 101 is specifically used to receive batch creation instructions;

[0170] The batch creation command is parsed at the block protocol layer, and it is determined whether there are tag parameters corresponding to the backup volume.

[0171] If so, then the batch creation command is determined to be the batch creation command for thick provisioned volumes;

[0172] If not, then confirm that the batch creation command is a batch creation command for thin volumes.

[0173] In one specific embodiment of this application, the simplified volume creation module, after determining that the batch creation instruction is a batch creation simplified volume creation instruction, creates a simplified volume and returns the creation result;

[0174] Determine if the currently created thin volume is the last one created;

[0175] If so, creation is complete;

[0176] If not, return to the step of creating a thin volume and return the creation result.

[0177] In one specific embodiment of this application, the capacity determination module 102 is specifically used to obtain volume information in the storage pool;

[0178] Based on the volume information, determine the available capacity of the storage pool.

[0179] In one specific embodiment of this application, the capacity determination module 102 is specifically used to read the access information of each volume from the volume information;

[0180] In the process of sequentially accessing each volume in the storage pool based on access information to obtain the volume size corresponding to each volume, it is determined whether the volume to be accessed currently exists.

[0181] If the volume being accessed exists, then access it to obtain the volume size.

[0182] If the volume being accessed does not exist, skip the step of obtaining the volume size corresponding to that volume;

[0183] After the last volume is accessed or skipped, the sizes of all currently accessed volumes are summed to obtain the used capacity of the storage pool.

[0184] The available capacity of the storage pool is obtained by subtracting the storage pool capacity from the used capacity of the storage pool.

[0185] Accordingly, the volume creation module 103 is specifically used to create a thin volume if the volume size of the thick provisioned volume to be created is smaller than the available capacity of the storage pool;

[0186] After the simplified volume is created, add a volume attribute identifier field;

[0187] Fill all spaces in the simplified volume with zero data;

[0188] After the data is populated, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the volume header object to complete the creation of the thick provisioned volume and return the creation result.

[0189] Corresponding to the above method embodiments, this application also provides an electronic device. The electronic device described below and the thick backup volume creation method described above can be referred to in correspondence.

[0190] See Figure 4 As shown, the electronic device includes:

[0191] Memory 332 is used to store computer programs;

[0192] The processor 322 is used to implement the steps of the thick standby volume creation method of the above method embodiments when executing a computer program.

[0193] For details, please refer to Figure 5 , Figure 5 This is a schematic diagram of a specific structure of an electronic device provided in this embodiment. The electronic device can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) 322 (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer programs 342 or data 344. The memory 332 can be temporary or permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the data processing device. Furthermore, the processor 322 may be configured to communicate with the memory 332 and execute the series of instruction operations stored in the memory 332 on the electronic device 301.

[0194] Electronic device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.

[0195] The steps in the thick standby volume creation method described above can be implemented by the structure of the electronic device.

[0196] Corresponding to the above method embodiments, this application also provides a readable storage medium. The readable storage medium described below can be referred to in conjunction with the thick provisioning volume creation method described above.

[0197] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the thick standby volume creation method described in the above method embodiments.

[0198] The readable storage medium can specifically be a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or any other readable storage medium capable of storing program code.

[0199] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0200] 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.

[0201] 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.

[0202] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely 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 "include," "contain," or any other variations 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.

[0203] This document uses specific examples 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 methods 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 creating a thick provisioned volume, characterized in that, include: Get the command to create thick provisioned volumes in batches; If a volume in the storage pool is completely deleted during the process of obtaining the current available capacity of the storage pool, the volume is skipped and the calculation of the available capacity of the storage pool continues. Create a thick provisioned volume based on the available capacity of the storage pool; If the currently created thick provisioned volume is not the last one created, then return to the step of obtaining the available capacity of the current storage pool, until the currently created thick provisioned volume is the last one created; The step of obtaining the current available capacity of the storage pool includes: Retrieve volume information from the storage pool; Based on the volume information, determine the available capacity of the storage pool; Determining the available capacity of the storage pool based on the volume information includes: Read the access information of each volume from the volume information; In the process of sequentially accessing each volume in the storage pool based on the access information to obtain the volume size corresponding to each volume, it is determined whether the volume to be accessed currently exists. If the volume being accessed exists, then access it to obtain the volume size. If the volume being accessed does not exist, skip the step of obtaining the volume size corresponding to that volume; After the last volume is accessed or skipped, the sizes of all the volumes currently accessed are summed to obtain the used capacity of the storage pool; The available capacity of the storage pool is obtained by subtracting the storage pool capacity from the used capacity of the storage pool. Accordingly, based on the available capacity of the storage pool, a thick provisioned volume is created, including: If the size of the thick provisioned volume to be created is smaller than the available capacity of the storage pool, then a thin volume is created. After the simplified volume is created, add a volume attribute identifier field; Fill all spaces in the simplified volume with zero data; After the data is populated, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the volume header object to complete the creation of the thick provisioned volume and return the creation result.

2. The method for creating a thick prepared roll according to claim 1, characterized in that, Based on the available capacity of the storage pool, create a thick provisioned volume, including: Determine whether the available capacity of the storage pool is greater than the required capacity of the thick standby volume to be created. If so, then create the thick provisioned volume; If not, then stop creating the thick provisioned volume.

3. The method for creating a thick prepared roll according to claim 2, characterized in that, Creating the thick provisioned volume includes: Create a simplified volume; After the simplified volume is created, add a volume attribute identifier field; Fill all the space in the simplified volume with data; After the data is populated, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the volume header object to complete the creation of the thick provisioned volume.

4. The method for creating a thick prepared roll according to claim 1, characterized in that, The command to obtain the batch creation command for thick provisioned volumes includes: Receive batch creation instructions; The batch creation instruction is parsed at the block protocol layer, and it is determined whether there are tag parameters corresponding to the backup volume. If so, then the batch creation instruction is determined to be the batch create thick provisioning volume creation command; If not, then the batch creation instruction is determined to be a batch creation instruction for a thin volume.

5. The method for creating a thick prepared roll according to claim 4, characterized in that, After determining that the batch creation instruction is a batch creation instruction for a thin volume, the following steps are included: Create a thin volume and return the creation result; Determine if the currently created thin volume is the last one created; If so, creation is complete; If not, return to the step of creating a thin volume and return the creation result.

6. A thick roll preparation device, characterized in that, include: The command acquisition module is used to obtain batch creation commands for thick standby volumes. The capacity determination module is used to skip volumes that have been completely deleted in the storage pool during the process of obtaining the available capacity of the current storage pool, and continue to calculate the available capacity of the storage pool. The volume creation module is used to create thick provisioned volumes based on the available capacity of the storage pool; The determination module is used to return to the step of obtaining the available capacity of the current storage pool if the currently created thick standby volume is not the last one created, until the currently created thick standby volume is the last one created; The capacity determination module is specifically used to obtain volume information in the storage pool; and determine the available capacity of the storage pool based on the volume information. Determining the available capacity of the storage pool based on the volume information includes: reading access information of each volume from the volume information; during the process of sequentially accessing each volume in the storage pool based on the access information to obtain the volume size corresponding to each volume, determining whether the currently accessed volume exists; if the currently accessed volume exists, obtaining the volume size corresponding to that volume through access; if the currently accessed volume does not exist, skipping the step of obtaining the volume size corresponding to that volume; after the last volume is accessed or skipped, accumulating all the currently obtained volume sizes to obtain the used capacity of the storage pool; and subtracting the storage pool capacity from the used capacity of the storage pool to obtain the available capacity of the storage pool. Accordingly, the volume creation module is specifically used to create a thin volume if the volume size of the thick provisioned volume to be created is smaller than the available capacity of the storage pool; after the thin volume is created, a volume attribute identifier field is added; all space of the thin volume is filled with 0 data; after the data is filled, the volume attribute identifier field is changed to the parameter value of the thick provisioned volume and stored in the header object of the volume to complete the creation of the thick provisioned volume and return the creation result.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the thick backup volume creation method as described in any one of claims 1 to 5 when executing the computer program.

8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the thick standby volume creation method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Storage system and method therefor

    CN104636080A

  • Volume configuration method and device

    CN110673787A