A method, apparatus, electronic device, and storage medium for setting up a storage volume.
By determining whether expansion is possible based on the type of storage volume and the available capacity of the storage node in a new storage environment, the problem of inaccurate storage volume expansion is solved, and reliable expansion is achieved in both home and non-home volume systems.
Patent Information
- Application Number
- CN202311616996.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-11-29
AI Technical Summary
In new storage environments, storage volume expansion cannot be reliably performed because the creation location of storage volumes in the storage pool system is not fixed, making it impossible to reliably expand volumes according to the storage pool capacity, especially when both owned and unowned volumes exist simultaneously.
The expansion capacity of the volume to be expanded is obtained, and the storage domain is determined according to its volume type. The availability of all storage nodes in the storage domain is then considered to determine whether expansion is possible. This includes determining whether the availability of the primary storage node and backup storage node meets the expansion conditions. Expansion is only carried out after ensuring that the availability of all storage nodes meets the expansion requirements.
It enables reliable volume expansion in storage pool systems that are compatible with both owned and unowned volumes, improving the reliability and accuracy of expansion and avoiding erroneous expansion caused by storage pool capacity judgment.
Smart Images

Figure CN117608483B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage pools, and in particular to a storage volume setup method, apparatus, electronic device, and storage medium. Background Technology
[0002] Storage pool systems typically consist of multiple storage nodes, each of which can be configured with storage volumes. In related technologies, volume expansion is usually based on the storage pool's available capacity. However, in newer storage environments, the creation location of each storage volume within the storage pool system is not fixed; that is, the storage volumes stored on each storage node may differ, leading to unreliable volume expansion based solely on the storage pool's capacity. Summary of the Invention
[0003] The purpose of this invention is to provide a storage volume setup method, apparatus, electronic device, and storage medium that can determine whether the volume to be expanded can be expanded based on the available capacity of each storage node in the storage domain where the volume to be expanded is located, thereby enabling reliable volume expansion.
[0004] To address the aforementioned technical problems, this invention provides a storage volume configuration method applied to a storage pool system. The storage pool system comprises multiple storage nodes, which are paired to form storage domains. A homeped volume is configured in a selected storage domain, and unhomeped volumes are configured in all storage domains. The method includes:
[0005] Get the expansion capacity of the volume to be expanded;
[0006] The storage domain where the volume to be expanded is located is determined based on the volume type of the volume to be expanded, and whether the volume to be expanded can be expanded is determined based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located; the volume type includes owned volume type and unowned volume type;
[0007] If it is determined that the volume to be expanded can be expanded, then the volume to be expanded is expanded.
[0008] Optionally, the step of determining the storage domain where the volume to be expanded is located based on its volume type, and determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located, includes:
[0009] If the volume type is determined to be the home volume type, then the home storage domain of the volume to be expanded is determined.
[0010] Identify the primary storage node and backup storage node in the home storage domain, and determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the expansion capacity.
[0011] If so, then the volume to be expanded is determined to be expandable;
[0012] If not, then the volume to be expanded is determined to be unexpandable.
[0013] Optionally, the step of determining the storage domain where the volume to be expanded is located based on its volume type, and determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located, includes:
[0014] If the volume type is determined to be the unowned volume type, then the volume to be expanded is set in all the storage domains, and the first storage domain in the storage pool system is set as the storage domain to be processed.
[0015] Identify the primary storage node and backup storage node in the storage domain to be processed, and determine the number of first storage domains in the storage pool system that contain the primary storage node and the number of second storage domains in the storage pool system that contain the backup storage node;
[0016] The first actual expansion size corresponding to the primary storage node is determined using the expansion capacity and the number of the first storage domains, and the second actual expansion size corresponding to the backup storage node is determined using the expansion capacity and the number of the second storage domains.
[0017] Determine whether both the primary storage node and the backup storage node meet the expansion conditions; the expansion conditions are that the available capacity of the primary storage node is greater than the first actual expansion size and the available capacity of the backup storage node is greater than the second actual expansion size.
[0018] If it is determined that both the primary storage node and the backup storage node meet the expansion conditions, then it is determined whether the storage domain to be processed is the last storage domain in the storage pool system; if yes, then it is determined that the volume to be expanded can be expanded; if no, then the next storage domain in the storage pool system is set as the storage domain to be processed, and the process proceeds to the step of determining the primary storage node and backup storage node included in the storage domain to be processed.
[0019] If it is determined that the primary storage node or the backup storage node does not meet the expansion conditions, then the volume to be expanded is deemed unsuitable for expansion.
[0020] Optionally, obtaining the expansion capacity of the volume to be expanded includes:
[0021] Obtain the historical capacity of each storage volume in the storage pool system at the current moment;
[0022] Determine whether the historical capacity of the storage volume is greater than the current capacity of the storage volume;
[0023] If so, the storage volume is set as the volume to be expanded, and the difference between the historical capacity of the storage volume and the current capacity of the storage volume is used as the expansion capacity.
[0024] Optionally, after determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded resides, the method further includes:
[0025] If it is determined that the volume to be expanded cannot be expanded, then other storage volumes in the storage domain where the volume to be expanded is located are identified, and it is determined whether there are other storage volumes that meet the preset shrinkage conditions.
[0026] If so, output a preset alarm message indicating that the volume to be expanded cannot be expanded, as well as storage volume information that meets the preset shrinkage conditions.
[0027] Optionally, after outputting the preset alarm information indicating that the volume to be expanded cannot be expanded and the storage volume information that meets the preset shrinkage conditions, the method further includes:
[0028] If volume information for a volume to be scaled down is received, the volume to be scaled down is scaled down, and after scaling down, the step of determining whether the volume to be scaled up can be scaled up is performed based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be scaled up is located.
[0029] Optionally, it also includes:
[0030] Get the volume capacity of the volume to be created;
[0031] Determine the total available capacity corresponding to each of the aforementioned storage domains; the total available capacity is the sum of the available capacities of the two storage nodes contained in the storage domain;
[0032] Identify the primary storage node and backup storage node in the target storage domain with the largest total available capacity, and determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the volume capacity;
[0033] If so, the volume to be created will be created in the target storage domain.
[0034] The present invention also provides a storage volume setting device for a storage pool system, the storage pool system comprising multiple storage nodes, the storage nodes forming storage domains in pairs, a home volume being set in a selected storage domain, and unhome volumes being set in all storage domains, the device comprising:
[0035] The acquisition module is used to obtain the expansion capacity of the volume to be expanded;
[0036] The determination module is used to determine the storage domain where the volume to be expanded is located based on the volume type of the volume to be expanded, and to determine whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located; the volume type includes owned volume type and unowned volume type;
[0037] The expansion module is used to expand the volume to be expanded if it is determined that the volume to be expanded can be expanded.
[0038] The present invention also provides an electronic device, comprising:
[0039] Memory, used to store computer programs;
[0040] A processor for implementing the storage volume setup method as described above when executing the computer program.
[0041] The present invention also provides a computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the storage volume setup method described above.
[0042] This invention provides a storage volume configuration method applied to a storage pool system. The storage pool system includes multiple storage nodes, which are paired to form storage domains. A homeped volume is configured in a selected storage domain, and unhomeped volumes are configured in all storage domains. The method includes: obtaining the expansion capacity of the volume to be expanded; determining the storage domain where the volume to be expanded is located based on its volume type; and determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located; the volume type includes a homeped volume type and an unhomeped volume type; if it is determined that the volume to be expanded is expandable, then the volume to be expanded is expanded.
[0043] As can be seen, in this invention, multiple storage nodes in the storage pool system are paired to form storage domains, and the storage pool system is compatible with two types of storage volumes: a homeped volume is set in a selected storage domain, and an unhomeped volume is set in all storage domains. For the expansion of these two types of storage volumes, after obtaining the expansion capacity of the volume to be expanded, this invention determines the storage domain where the volume to be expanded is located based on its volume type, and then determines whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located. Subsequently, this invention only determines that the volume to be expanded is expandable when it is determined that the available capacity of all storage nodes in all storage domains where the volume to be expanded is located meets the expansion requirements, and then performs the expansion. In short, this invention does not determine whether the volume to be expanded is expandable based on the storage pool capacity, but rather based on the available capacity of each storage node in the storage domain where the volume to be expanded is located, thereby enabling reliable volume expansion in a storage pool system that is compatible with both homeped and unhomeped volumes. The present invention also provides a storage volume setting device, an electronic device, and a computer-readable storage medium, which have the above-mentioned beneficial effects. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0045] Figure 1 A schematic diagram of a home volume provided in an embodiment of the present invention;
[0046] Figure 2 This is a schematic diagram of an unowned volume provided in an embodiment of the present invention;
[0047] Figure 3 A flowchart illustrating a storage volume setup method provided in an embodiment of the present invention;
[0048] Figure 4 A flowchart illustrating a storage volume expansion method provided in an embodiment of the present invention;
[0049] Figure 5 This is a structural block diagram of a storage volume setting device provided in an embodiment of the present invention;
[0050] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] Storage pool systems typically contain multiple storage nodes. To enable data backup, storage nodes in a storage pool system can also be paired to form storage domains, allowing a pair of nodes to store the same data. For example, a storage pool system might contain four nodes: node 0, node 1, node 2, and node 3. Node 0 and node 1 form storage domain 0, node 1 and node 2 form storage domain 1, node 2 and node 3 form storage domain 2, and node 3 and node 0 form storage domain 3. Each storage domain can further contain a primary storage node and a backup storage node. The primary storage node stores user data, and the backup storage node backs up the primary storage node. For example, in the previous example, the first storage node in each storage domain (e.g., node 0) is the primary storage node, and the second storage node (e.g., node 1) is the backup storage node.
[0053] Furthermore, in new storage environments, storage volumes are not necessarily created simultaneously on all storage nodes; they may only be created on some storage nodes. In other words, the creation location of storage volumes within the storage pool system is not fixed. For example, a storage pool system can configure two types of storage volumes: owned volumes and unowned volumes. Owned volumes will be created only in one storage domain, while unowned volumes will be created in all storage domains. Please refer to [reference needed]. Figure 1 , Figure 1 This is a schematic diagram of a home volume provided in an embodiment of the present invention. Figure 1 In the diagram, the home volume is created in the selected storage domain 0, and gray blocks represent the home volume. Since node 0 is the primary storage node and node 1 is the backup storage node, the dark gray blocks in node 0 represent the home volume that can be accessed by users, and the light gray blocks in node 1 represent the home volume backup. Arrows indicate the backup relationship. Please refer to [reference needed]. Figure 2 , Figure 2 This is a schematic diagram of a non-homed volume provided in an embodiment of the present invention. Figure 2In this diagram, unclaimed volumes (UKVs) will be created in all storage domains, and all data within an UKV will be evenly distributed across all storage domains. Gray blocks represent UKVs. It's important to note that primary storage nodes in all storage domains store data from UKVs that can be directly accessed by users, while backup storage nodes are used to back up data from the primary storage nodes within the same storage domain. Since there may be overlap between storage domains—for example, the backup storage node (node 1) of storage domain 0 might be the primary storage node of storage domain 1—each storage node stores both user-accessible data from UKVs (represented by dark gray blocks) and backup data from UKVs (represented by light gray blocks). Arrows indicate the backup relationship.
[0054] In related technologies, the expansion of storage volumes is usually based on the storage pool capacity available from the storage pool system. However, as mentioned above, new storage environments may simultaneously have both owned and unowned volumes, which directly leads to the inability to reliably expand volumes according to the storage pool capacity. For example, in the aforementioned storage pool system, nodes 0-4 each have a capacity of 20GB. Since the nodes serve as backups for each other, the effective capacity of the storage pool is 40GB. In this case, if all storage domains have unowned volumes, and storage domain 0 (corresponding to nodes 0 and 1) and storage domain 2 (corresponding to nodes 2 and 3) further have owned volumes, and storage domain 0 is full, then if it is necessary to expand the owned volume in storage domain 2, since storage domain 0 is full, the system assumes that all nodes have the same usage as nodes 0 and 1, thus determining that the storage pool has no remaining space and that the owned volume in storage domain 2 cannot be expanded. However, since storage domain 2 is not actually full, the owned volume in storage domain 2 still has the potential for expansion. Clearly, expanding capacity based on storage pool capacity is not suitable for setting up new storage environments with both owned and unowned volumes simultaneously. Therefore, this invention provides a storage volume setup method that determines whether a volume can be expanded based on the available capacity of each storage node in the storage domain where the volume to be expanded resides, thereby enabling reliable volume expansion.
[0055] It should be noted that the embodiments of the present invention do not limit the configuration of storage domains, as long as storage nodes can be paired to form storage domains, other grouping methods can be used to configure storage domains. The embodiments of the present invention also do not limit the specific hardware device for executing this method, and can be selected according to actual application requirements. It is understood that the execution entity of this method is the management device of the storage pool system.
[0056] Based on the above description, the storage volume setting method provided by the embodiments of the present invention will be described in detail below. Please refer to... Figure 3 , Figure 3This is a flowchart of a storage volume setting method provided in an embodiment of the present invention. The method is applied to a storage pool system, which includes multiple storage nodes. The storage nodes are paired to form storage domains. A homeped volume is set in a selected storage domain, and unhomeped volumes are set in all storage domains. The method includes:
[0057] S301. Obtain the expansion capacity of the volume to be expanded.
[0058] It should be noted that the expansion capacity refers to the size of the volume to be expanded. This embodiment of the invention does not limit how the expansion capacity of the volume to be expanded is obtained; for example, it can be input by the user or automatically detected. Specifically, the storage capacity of storage volumes in the storage pool system can be recorded at various time periods, and the current capacity of each storage volume at the current moment can be compared with its historical capacity during the same period. If it is determined that the historical capacity of a storage volume is greater than its current capacity, the storage volume can be set as the volume to be expanded, and the difference between the historical capacity and the current capacity of the storage volume can be used as the expansion capacity. In other words, the storage volume can be automatically expanded based on its historical capacity to improve the ease of use of the storage volume.
[0059] Based on this, obtaining the expansion capacity of the volume to be expanded may include:
[0060] Step 11: Obtain the historical capacity of each storage volume in the storage pool system at the current moment;
[0061] Step 12: Determine whether the historical capacity of the storage volume is greater than the current capacity of the storage volume; if yes, proceed to step 13; if no, ignore or reduce the size of the storage volume.
[0062] Step 13: If yes, then set the storage volume as the volume to be expanded, and use the difference between the historical capacity of the storage volume and the current capacity of the storage volume as the expansion capacity.
[0063] It should be noted that the embodiments of the present invention do not limit how the historical capacity of the storage volume is recorded. For example, it can be recorded in real time or periodically, and can be set according to actual application needs.
[0064] S302. Determine the storage domain where the volume to be expanded is located based on the volume type of the volume to be expanded, and determine whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located; the volume type includes owned volume type and unowned volume type.
[0065] As mentioned above, in new storage environments, both owned and unowned volumes may coexist, making it impossible to expand storage volumes according to the capacity of the storage pool system. Therefore, this embodiment of the invention determines whether a storage volume can be expanded based on the available capacity of each storage node where the storage volume resides, thereby improving the reliability of the expansion determination. Similarly, as mentioned above, since owned and unowned volumes reside in different storage domains, this embodiment of the invention needs to determine the storage domain of the volume to be expanded based on its volume type. Subsequently, this embodiment of the invention can determine whether the volume to be expanded is expandable based on the expansion capacity of the volume to be expanded and the available capacity of all storage nodes in all storage domains where the volume to be expanded resides. The above process will be described below based on the two volume types: owned and unowned volumes.
[0066] In one possible scenario, determining the storage domain where the volume to be expanded resides based on its volume type, and determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded resides, includes:
[0067] Step 21: If the volume type is determined to be the home volume type, then determine the home storage domain where the volume to be expanded is located;
[0068] Step 22: Determine the primary storage node and backup storage node in the home storage domain, and determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the expansion capacity; if yes, proceed to step 23; if no, proceed to step 24.
[0069] Step 23: Determine that the volume to be expanded can be expanded;
[0070] Step 24: Determine that the volume to be expanded cannot be expanded.
[0071] The home storage domain is the storage domain where the volume to be expanded resides (of the home volume type). After determining the home storage domain, this embodiment of the invention further determines the primary storage node and backup storage node within the home storage domain, and determines whether the available capacity of both the primary and backup storage nodes is greater than the expansion capacity. This is to avoid unreliable determinations due to inconsistencies between the available capacities of the primary and backup storage nodes. If it is determined that the available capacity of both the primary and backup storage nodes is greater than the expansion capacity, then the volume to be expanded can be determined to be expandable; conversely, if the available capacity of either the primary or backup storage node is less than the expansion capacity, then the volume to be expanded can be determined to be expandable.
[0072] In one possible scenario, determining the storage domain where the volume to be expanded resides based on its volume type, and determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded resides, may include:
[0073] Step 31: If the volume type is determined to be the unowned volume type, then the volume to be expanded is set in all the storage domains, and the first storage domain in the storage pool system is set as the storage domain to be processed;
[0074] Step 32: Determine the primary storage node and backup storage node in the storage domain to be processed, and determine the number of first storage domains in the storage pool system that contain the primary storage node and the number of second storage domains in the storage pool system that contain the backup storage node;
[0075] Step 33: Determine the first actual expansion size corresponding to the primary storage node using the expansion capacity and the number of the first storage domains, and determine the second actual expansion size corresponding to the backup storage node using the expansion capacity and the number of the second storage domains;
[0076] Step 34: Determine whether both the primary storage node and the backup storage node meet the expansion conditions; the expansion conditions are that the available capacity of the primary storage node is greater than the first actual expansion size and the available capacity of the backup storage node is greater than the second actual expansion size; if it is determined that both the primary storage node and the backup storage node meet the expansion conditions, proceed to step 35; if it is determined that either the primary storage node or the backup storage node does not meet the expansion conditions, proceed to step 38.
[0077] Step 35: Determine whether the storage domain to be processed is the last storage domain in the storage pool system; if yes, proceed to step 36; if no, proceed to step 37.
[0078] Step 36: Determine that the volume to be expanded can be expanded;
[0079] Step 37: Set the next storage domain in the storage pool system as the storage domain to be processed, and proceed to the step of determining the primary storage node and backup storage node included in the storage domain to be processed;
[0080] Step 38: Determine that the volume to be expanded cannot be expanded.
[0081] When it is determined that the volume to be expanded is an unowned volume, it can be determined that the volume to be expanded is set in all storage domains. Then, in this embodiment of the invention, it will sequentially determine whether each storage domain meets the expansion conditions of the volume to be expanded. Taking the first storage domain as an example, the primary storage node and backup storage node contained in the first storage domain will be determined first. Then, considering that there may be node overlap between storage domains, it is also necessary to separately determine the number of storage domains in which the primary storage node is located in the storage pool system (i.e., the number of first storage domains) and the number of storage domains in which the backup storage node is located in the storage pool system (i.e., the number of second storage domains). Then, the first actual expansion size corresponding to the primary storage node will be determined by using the expansion capacity and the number of first storage domains, and the second actual expansion size corresponding to the backup storage node will be determined by using the expansion capacity and the number of second storage domains. For example, if the primary storage node is configured in two storage domains, it will need to back up data for other storage nodes. Since unowned volumes are evenly distributed across all storage domains, the primary storage node will contain two copies of the same unowned volume. These two copies will be the same size, and logically, the unowned volume will occupy two identical storage spaces within the primary storage node. Expansion requires scaling up both storage spaces by the same amount. The backup storage node follows the same logic. Therefore, it can be determined whether both the primary and backup storage nodes meet the expansion conditions. The expansion conditions are that the available capacity of the primary storage node is greater than the first actual expansion size, and the available capacity of the backup storage node is greater than the second actual expansion size. If both the primary and backup storage nodes meet the expansion conditions, the first storage domain meets the expansion conditions, and the process can proceed to the next storage domain. If either the primary or backup storage node does not meet the expansion conditions, the first storage domain does not meet the expansion conditions, and the process can exit. Furthermore, if it is determined that all storage domains meet the expansion conditions, the unowned volume can be expanded; conversely, if any storage domain does not meet the expansion conditions, the unowned volume cannot be expanded.
[0082] S303. If it is determined that the volume to be expanded can be expanded, then the volume to be expanded is expanded.
[0083] It should be noted that the embodiments of the present invention do not limit how to expand the capacity of the volume; relevant technologies of storage devices can be referred to.
[0084] Furthermore, if it is determined that the volume to be expanded cannot be expanded, a preset alarm message indicating that the volume cannot be expanded can be output to the user to facilitate understanding of the non-expansion situation. This preset alarm message can be an error code, and the error code format is as follows:
[0085] Table 1 Error Code Format
[0086]
[0087] Furthermore, considering that when it is determined that the volume to be expanded cannot be expanded, other storage volumes in the storage pool system may have conditions for shrinking, such as having more free space or the current capacity of other storage volumes being greater than the historical usage during the same period. Therefore, when it is determined that the volume to be expanded cannot be expanded, other storage volumes in the storage domain where the volume to be expanded is located can be identified, and it can be determined whether there are other storage volumes that meet the preset shrinking conditions. If so, the information of the storage volumes that meet the preset shrinking conditions can be further output so that the user can shrink the volume.
[0088] Based on this, after determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded resides, the method may further include:
[0089] Step 41: If it is determined that the volume to be expanded cannot be expanded, then identify other storage volumes in the storage domain where the volume to be expanded is located, and determine whether there are other storage volumes that meet the preset shrinkage conditions; if yes, proceed to step 42; if no, proceed to step 43.
[0090] Step 42: Output a preset alarm message indicating that the volume to be expanded cannot be expanded, and storage volume information that meets the preset shrinkage conditions.
[0091] Step 43: Output a preset alarm message indicating that the volume to be expanded cannot be expanded.
[0092] It should be noted that the embodiments of the present invention do not limit the specific content of the storage volume information. For example, it may include the storage volume name, the name of the storage domain, the storage volume capacity, the storage volume free capacity, the storage volume shrinkable capacity, etc., and can be set according to actual application needs.
[0093] Furthermore, after outputting the storage volume information that meets the preset shrinkage conditions, the user can select which storage volume to shrink in the operation interface. In this embodiment of the invention, after receiving the volume information of the volume to be shrunk, the volume to be shrunk can be shrunk, and after shrinking, the system actively re-determines whether the volume to be expanded can be expanded, thereby improving ease of use.
[0094] Based on this, after outputting the preset alarm information indicating that the volume to be expanded cannot be expanded and the storage volume information that meets the preset shrinkage conditions, it may further include:
[0095] Step 51: If volume information of the volume to be scaled down is received, the volume to be scaled down is scaled down, and after scaling down, the step of determining whether the volume to be scaled up can be scaled up based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be scaled up is located is entered.
[0096] Based on the above embodiments, in this invention, multiple storage nodes in the storage pool system are paired to form storage domains, and the storage pool system is compatible with two types of storage volumes: a home volume is set in a selected storage domain, and an unhome volume is set in all storage domains. For the expansion of these two types of storage volumes, after obtaining the expansion capacity of the volume to be expanded, this invention determines the storage domain where the volume to be expanded is located based on its volume type, and determines whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located. Subsequently, this invention only determines that the volume to be expanded is expandable when it is determined that the available capacity of all storage nodes in all storage domains where the volume to be expanded is located meets the expansion requirements, and then performs the expansion. In short, this invention does not determine whether the volume to be expanded is expandable based on the storage pool capacity, but rather based on the available capacity of each storage node in the storage domain where the volume to be expanded is located, thereby enabling reliable volume expansion in a storage pool system that is compatible with both home and unhome volumes.
[0097] The following section will provide an overall overview of the storage volume expansion methods described above, based on a specific flowchart. Please refer to the provided text. Figure 4 , Figure 4 This is a flowchart illustrating a storage volume expansion method provided in an embodiment of the present invention. The specific operation flow for the owned volume is as follows:
[0098] 1. Set up the environment, create a cluster, iogrp (input / output group, consisting of multiple storage nodes), storage pool, and multiple volumes (including owned volumes and unowned volumes);
[0099] 2. Select one of the volumes to be expanded, and set the expansion capacity t (this is the capacity that the volume will increase).
[0100] 3. The volume to be expanded is the home volume. Obtain the home domain of the home volume and the information of the two nodes within the domain.
[0101] 4. Determine whether the remaining available capacity of the master node within the domain exceeds the volume expansion capacity t. If the remaining available capacity of the master node exceeds the volume expansion capacity t, proceed to step 5; if the remaining available capacity of the master node is less than the volume expansion capacity t, the volume expansion operation fails and the operation ends.
[0102] 5. Determine whether the remaining available capacity of the backup node within the home domain exceeds the volume expansion capacity t. If the remaining available capacity of the backup node exceeds the volume expansion capacity t, proceed to step 6; if the remaining available capacity of the backup node is less than the volume expansion capacity t, the home volume expansion operation fails and the operation ends.
[0103] 6. First, expand the volume on the backup node;
[0104] 7. The volume is expanded on the master node;
[0105] 8. The volume expansion operation was successfully executed.
[0106] The specific operation procedure for unclaimed volumes is as follows:
[0107] 1. Set up the environment, create the cluster, iogrp, and storage pool, and create multiple volumes (including owned volumes and unowned volumes);
[0108] 2. Select one of the unowned volumes to expand, and set the expansion capacity t (this is the capacity that the volume will increase).
[0109] 3. The volume to be expanded is an unowned volume, so set variable i = 0;
[0110] 4. Obtain the information of the unowned volume domain_i and the two nodes within domain_i;
[0111] 5. Determine whether the remaining available capacity of the primary node in domain_i exceeds the volume expansion capacity t. If the remaining available capacity of the primary node in domain_i exceeds the product of the volume expansion capacity t and the number of storage domains where the primary node is located, proceed to step 6. If the remaining available capacity of the primary node in domain_i is less than the product of the volume expansion capacity t and the number of storage domains where the primary node is located, the unowned volume expansion operation fails and the operation ends.
[0112] 6. Determine whether the remaining available capacity of the backup node in the current domain exceeds the product of the volume expansion capacity t and the number of storage domains where the backup node is located. If the remaining available capacity of the backup node in the current domain_i exceeds the product of the volume expansion capacity t and the number of storage domains where the backup node is located, proceed to step 7; if the remaining available capacity of the backup node in the current domain_i is less than the product of the volume expansion capacity t and the number of storage domains where the backup node is located, the unowned volume expansion operation fails and the operation ends.
[0113] 7. Increment variable i, check if i is less than 4. If i is less than 4, skip to step 4 and continue execution; if i is not less than 4, skip to step 8 and execute.
[0114] 8. Set variable j = 0;
[0115] 9. Unowned volumes should first be expanded on the current domain_j backup node;
[0116] 10. Unowned volumes are expanded on the current domain_j master node;
[0117] 11. Increment variable j, check if j is less than 4. If j is less than 4, skip to step nine and continue execution; if j is not less than 4, skip to step twelve and execute.
[0118] 12. The expansion operation of the unowned volume was successfully executed.
[0119] Based on the above embodiments, to ensure that the home volume is evenly distributed across all storage nodes to achieve load balancing and improve the scalability of unclaimed volumes, when creating a home volume, it is not necessary to specify which storage domain the home volume should be created in; instead, the home volume can be created in the storage domain with the largest available space. Based on this, the method may further include:
[0120] S401. Obtain the volume capacity of the volume to be created;
[0121] S402. Determine the total available capacity corresponding to each of the storage domains; the total available capacity is the sum of the available capacities of the two storage nodes contained in the storage domain;
[0122] S403. Determine the primary storage node and backup storage node in the target storage domain with the largest total available capacity, and determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the volume capacity; if yes, proceed to step S404; if no, output a preset alarm message indicating that a home volume cannot be created.
[0123] S404. Create the volume to be created in the target storage domain.
[0124] This invention, when creating volumes in a novel storage device environment, considers the available capacity of nodes rather than the available capacity of the storage pool. This method is suitable for the capacity utilization of novel storage device environments and can improve the capacity utilization rate of the device. For example, in a 4-node environment with four storage domains, storage domain 0 corresponds to nodes 0 and 1, storage domain 1 corresponds to nodes 1 and 2, storage domain 2 corresponds to nodes 2 and 3, and storage domain 3 corresponds to nodes 3 and 0. The first node in each storage domain is the primary node, and the second node is the backup node (the node pair combinations in the domain include, but are not limited to, this method). If the storage pool capacity is considered, if a storage domain is full, the system will determine that all nodes are full and will not allow the creation of a new owned volume. However, if the capacity is considered based on nodes, if storage domain 0 is full but storage domain 2 is not full, a owned volume can still be created in storage domain 2. Based on this, by using node capacity to determine whether to create a volume and always creating the owned volume in the storage domain with the largest available capacity, the utilization rate of node capacity can be greatly improved.
[0125] The storage volume setting apparatus, electronic device, and computer-readable storage medium provided in the embodiments of the present invention are described below. The storage volume setting apparatus, electronic device, and computer-readable storage medium described below can be referred to in correspondence with the storage volume setting method described above.
[0126] Please refer to Figure 5 , Figure 5 This is a structural block diagram of a storage volume setting device provided in an embodiment of the present invention. The device is applied to a storage pool system, which includes multiple storage nodes. The storage nodes are paired to form storage domains. A homeped volume is set in a selected storage domain, and unhomeped volumes are set in all storage domains. The device includes:
[0127] The acquisition module 501 is used to acquire the expansion capacity of the volume to be expanded;
[0128] The determination module 502 is used to determine the storage domain where the volume to be expanded is located based on the volume type of the volume to be expanded, and to determine whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located; the volume type includes owned volume type and unowned volume type;
[0129] The expansion module 503 is used to expand the volume to be expanded if it is determined that the volume to be expanded can be expanded.
[0130] Optionally, the determination module 502 may include:
[0131] The storage domain determination submodule is used to determine the storage domain where the volume to be expanded is located if the volume type is determined to be the assigned volume type.
[0132] The first judgment submodule is used to determine the primary storage node and backup storage node in the belonging storage domain, and to determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the expansion capacity; if so, the volume to be expanded is determined to be expandable; if not, the volume to be expanded is determined to be non-expandable.
[0133] Optionally, the determination module 502 may include:
[0134] The storage domain determination submodule is used to determine that if the volume type is determined to be the unowned volume type, the volume to be expanded is set in all the storage domains, and the first storage domain in the storage pool system is set as the storage domain to be processed.
[0135] The storage domain number determination submodule is used to determine the primary storage node and backup storage node in the storage domain to be processed, and to determine the number of the first storage domain in the storage pool system that contains the primary storage node and the number of the second storage domain in the storage pool system that contains the backup storage node.
[0136] The actual expansion size determination submodule is used to determine the first actual expansion size corresponding to the primary storage node using the expansion capacity and the number of the first storage domains, and to determine the second actual expansion size corresponding to the backup storage node using the expansion capacity and the number of the second storage domains.
[0137] The second judgment submodule is used to determine whether both the primary storage node and the backup storage node meet the expansion conditions. The expansion conditions are that the available capacity of the primary storage node is greater than the first actual expansion size and the available capacity of the backup storage node is greater than the second actual expansion size. If it is determined that both the primary storage node and the backup storage node meet the expansion conditions, it is then determined whether the storage domain to be processed is the last storage domain in the storage pool system. If yes, it is determined that the volume to be expanded can be expanded. If no, the next storage domain in the storage pool system is set as the storage domain to be processed, and the process proceeds to the step of determining the primary storage node and backup storage node included in the storage domain to be processed. If it is determined that either the primary storage node or the backup storage node does not meet the expansion conditions, it is determined that the volume to be expanded cannot be expanded.
[0138] Optionally, the acquisition module 501 may include:
[0139] The historical capacity acquisition submodule is used to acquire the historical capacity of each storage volume in the storage pool system at the current moment.
[0140] The determination submodule is used to determine whether the historical capacity of the storage volume is greater than the current capacity of the storage volume;
[0141] The volume to be expanded setting submodule is used to set the storage volume as the volume to be expanded if the condition is met, and to use the difference between the historical capacity of the storage volume and the current capacity of the storage volume as the expansion capacity.
[0142] Optionally, the device may further include:
[0143] The shrinkage determination module is used to determine other storage volumes in the storage domain where the volume to be expanded is located if it is determined that the volume to be expanded cannot be expanded, and to determine whether there are other storage volumes that meet the preset shrinkage conditions; if so, it outputs preset alarm information indicating that the volume to be expanded cannot be expanded and information on the storage volumes that meet the preset shrinkage conditions.
[0144] Optionally, the device may further include:
[0145] The shrinking module is used to shrink the volume to be shrunk if it receives volume information of the volume to be shrunk, and after shrinking, proceed to the step of determining whether the volume to be shrunk can be expanded based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located.
[0146] Optionally, the device may further include:
[0147] The volume capacity acquisition module is used to obtain the volume capacity of the volume to be created;
[0148] The total available capacity determination module is used to determine the total available capacity corresponding to each of the storage domains; the total available capacity is the sum of the available capacities of the two storage nodes contained in the storage domain;
[0149] A judgment module is created to determine the primary storage node and backup storage node in the target storage domain with the largest total available capacity, and to determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the volume capacity; if so, the volume to be created is created in the target storage domain.
[0150] Please refer to Figure 6 , Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. The present invention provides an electronic device 60, including a processor 61 and a memory 62; wherein, the memory 62 is used to store a computer program; the processor 61 is used to execute the storage volume setting method provided in the foregoing embodiment when executing the computer program.
[0151] For details on the specific process of setting up the storage volume described above, please refer to the relevant content provided in the foregoing embodiments, which will not be repeated here.
[0152] Furthermore, the memory 62, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, and the storage method can be temporary storage or permanent storage.
[0153] In addition, the electronic device 60 also includes a power supply 63, a communication interface 64, an input / output interface 65, and a communication bus 66; wherein, the power supply 63 is used to provide operating voltage for the various hardware devices on the electronic device 60; the communication interface 64 can create a data transmission channel between the electronic device 60 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this invention, and is not specifically limited here; the input / output interface 65 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0154] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the storage volume setup method described in any of the above embodiments.
[0155] Since the embodiments of the computer-readable storage medium portion correspond to the embodiments of the storage volume setup method portion, the embodiments of the storage medium portion are described in the description of the embodiments of the storage volume setup method portion, and will not be repeated here.
[0156] 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 the method section.
[0157] 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 implementations should not be considered beyond the scope of this invention.
[0158] 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.
[0159] The foregoing has provided a detailed description of a storage volume setup method, apparatus, electronic device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A method for setting up a storage volume, characterized in that, Applied to a storage pool system comprising multiple storage nodes, the storage nodes forming storage domains in pairs, with a home volume set in a selected storage domain and unhome volumes set in all storage domains, the method includes: Get the expansion capacity of the volume to be expanded; The storage domain where the volume to be expanded is located is determined based on the volume type of the volume to be expanded, and whether the volume to be expanded can be expanded is determined based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located; the volume type includes owned volume type and unowned volume type; If it is determined that the volume to be expanded can be expanded, then the volume to be expanded is expanded. The step of determining the storage domain where the volume to be expanded is located based on its volume type, and determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located, includes: If the volume type is determined to be the home volume type, then the home storage domain of the volume to be expanded is determined. Identify the primary storage node and backup storage node in the home storage domain, and determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the expansion capacity. If so, then the volume to be expanded is determined to be expandable; If not, then the volume to be expanded is determined to be unexpandable; If the volume type is determined to be the unowned volume type, then the volume to be expanded is set in all the storage domains, and the first storage domain in the storage pool system is set as the storage domain to be processed. Identify the primary storage node and backup storage node in the storage domain to be processed, and determine the number of first storage domains in the storage pool system that contain the primary storage node and the number of second storage domains in the storage pool system that contain the backup storage node; The first actual expansion size corresponding to the primary storage node is determined using the expansion capacity and the number of the first storage domains, and the second actual expansion size corresponding to the backup storage node is determined using the expansion capacity and the number of the second storage domains. Determine whether both the primary storage node and the backup storage node meet the expansion conditions; the expansion conditions are that the available capacity of the primary storage node is greater than the first actual expansion size and the available capacity of the backup storage node is greater than the second actual expansion size. If it is determined that both the primary storage node and the backup storage node meet the expansion conditions, then it is determined whether the storage domain to be processed is the last storage domain in the storage pool system; if yes, then it is determined that the volume to be expanded can be expanded; if no, then the next storage domain in the storage pool system is set as the storage domain to be processed, and the process proceeds to the step of determining the primary storage node and backup storage node included in the storage domain to be processed. If it is determined that the primary storage node or the backup storage node does not meet the expansion conditions, then the volume to be expanded is deemed unsuitable for expansion.
2. The storage volume setup method according to claim 1, characterized in that, The process of obtaining the expansion capacity of the volume to be expanded includes: Obtain the historical capacity of each storage volume in the storage pool system at the current moment; Determine whether the historical capacity of the storage volume is greater than the current capacity of the storage volume; If so, the storage volume is set as the volume to be expanded, and the difference between the historical capacity of the storage volume and the current capacity of the storage volume is used as the expansion capacity.
3. The storage volume setup method according to claim 1, characterized in that, After determining whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded resides, the process further includes: If it is determined that the volume to be expanded cannot be expanded, then other storage volumes in the storage domain where the volume to be expanded is located are identified, and it is determined whether there are other storage volumes that meet the preset shrinkage conditions. If so, output a preset alarm message indicating that the volume to be expanded cannot be expanded, as well as storage volume information that meets the preset shrinkage conditions.
4. The storage volume setup method according to claim 3, characterized in that, After outputting the preset alarm information indicating that the volume to be expanded cannot be expanded and the storage volume information that meets the preset shrinkage conditions, the method further includes: If volume information for a volume to be scaled down is received, the volume to be scaled down is scaled down, and after scaling down, the step of determining whether the volume to be scaled up can be scaled up is performed based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be scaled up is located.
5. The storage volume setup method according to any one of claims 1 to 4, characterized in that, Also includes: Get the volume capacity of the volume to be created; Determine the total available capacity corresponding to each of the aforementioned storage domains; The total available capacity is the sum of the available capacities of the two storage nodes contained in the storage domain; Identify the primary storage node and backup storage node in the target storage domain with the largest total available capacity, and determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the volume capacity; If so, the volume to be created is created in the target storage domain.
6. A storage volume setting device, characterized in that, Applied to a storage pool system, the storage pool system comprising multiple storage nodes, the storage nodes forming storage domains in pairs, a home volume being set in a selected storage domain, and unhome volumes being set in all storage domains, the device includes: The acquisition module is used to obtain the expansion capacity of the volume to be expanded; The determination module is used to determine the storage domain where the volume to be expanded is located based on the volume type of the volume to be expanded, and to determine whether the volume to be expanded is expandable based on the expansion capacity and the available capacity of all storage nodes in all storage domains where the volume to be expanded is located; the volume type includes owned volume type and unowned volume type; An expansion module is used to expand the volume to be expanded if it is determined that the volume to be expanded can be expanded. The judgment module includes: The storage domain determination submodule is used to determine the storage domain where the volume to be expanded is located if the volume type is determined to be the volume type to be expanded. The first judgment submodule is used to determine the primary storage node and backup storage node in the belonging storage domain, and to determine whether the available capacity of the primary storage node and the available capacity of the backup storage node are both greater than the expansion capacity; if so, the volume to be expanded is determined to be expandable; if not, the volume to be expanded is determined to be non-expandable. The storage domain determination submodule is used to determine that if the volume type is determined to be the unowned volume type, the volume to be expanded is set in all the storage domains, and the first storage domain in the storage pool system is set as the storage domain to be processed. The storage domain number determination submodule is used to determine the primary storage node and backup storage node in the storage domain to be processed, and to determine the number of the first storage domain in the storage pool system that contains the primary storage node and the number of the second storage domain in the storage pool system that contains the backup storage node. The actual expansion size determination submodule is used to determine the first actual expansion size corresponding to the primary storage node using the expansion capacity and the number of the first storage domains, and to determine the second actual expansion size corresponding to the backup storage node using the expansion capacity and the number of the second storage domains. The second judgment submodule is used to determine whether both the primary storage node and the backup storage node meet the expansion conditions. The expansion conditions are that the available capacity of the primary storage node is greater than the first actual expansion size and the available capacity of the backup storage node is greater than the second actual expansion size. If it is determined that both the primary storage node and the backup storage node meet the expansion conditions, it is then determined whether the storage domain to be processed is the last storage domain in the storage pool system. If yes, it is determined that the volume to be expanded can be expanded. If no, the next storage domain in the storage pool system is set as the storage domain to be processed, and the process proceeds to the step of determining the primary storage node and backup storage node included in the storage domain to be processed. If it is determined that either the primary storage node or the backup storage node does not meet the expansion conditions, it is determined that the volume to be expanded cannot be expanded.
7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the storage volume setup method as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the storage volume setup method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Distributed storage cluster capacity expansion method, device, equipment and storage medium
CN108776579A
Storage pool capacity expansion method and system, equipment and medium
CN111722959A
