A method, device, equipment and storage medium for expanding persistent volume
By obtaining and analyzing the capacity indicators of the storage system and persistent volumes, and automatically adjusting the capacity configuration to trigger expansion processing, it solves the problem of low expansion efficiency of persistent volumes in Kubernetes and achieves automated and timely storage expansion.
Patent Information
- Application Number
- CN202311076245.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-08-24
AI Technical Summary
In the container orchestration engine Kubernetes, the expansion of persistent volumes relies on manual operation by operation and maintenance personnel, resulting in low expansion efficiency. Moreover, operation and maintenance personnel cannot directly obtain the remaining space of the storage system that can be used for expansion, resulting in untimely expansion or failure.
By obtaining the total capacity of the storage system and the available capacity of the target persistent volume as expansion indicators, determine whether the preset expansion conditions are met, modify the capacity configuration according to the preset policy and send a capacity change event, triggering the storage system to expand the persistent volume. .
It realizes the automatic expansion of persistent volumes, improves the expansion efficiency, avoids the blindness and delay of manual operation by operation and maintenance personnel, and ensures the timely expansion of storage resources.
Smart Images

Figure CN117289857B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a method, device, equipment and storage medium for expanding a persistent volume. Background Art
[0002] In the container orchestration engine Kubernetes, expanding the capacity of persistent volumes can provide more storage space to meet the growing demand for data.
[0003] The expansion of persistent volumes usually relies on manual operations by operation and maintenance personnel. However, operation and maintenance personnel cannot directly obtain the remaining space of the storage system that can be used for expansion, resulting in low efficiency in the expansion of persistent volumes. Therefore, how to improve the efficiency of persistent volume expansion has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] In order to solve the above technical problems, an embodiment of the present disclosure provides a method for expanding the capacity of a persistent volume.
[0005] In a first aspect, the present disclosure provides a method for expanding a persistent volume, the method comprising:
[0006] Obtaining a capacity expansion index of the target persistent volume; wherein the capacity expansion index includes the total capacity of the storage system and / or the available capacity of the target persistent volume;
[0007] Determining whether the capacity expansion indicator meets a preset capacity expansion condition;
[0008] If it is determined that the capacity expansion indicator meets the preset capacity expansion condition, the capacity configuration of the target persistent volume is modified according to the preset capacity expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler; wherein the capacity change event is used to trigger the storage system to perform capacity expansion processing on the target persistent volume.
[0009] In an optional implementation manner, obtaining the expansion index of the target persistent volume includes:
[0010] Calling a storage system interface to obtain the total capacity of the storage system according to a first preset periodic frequency; and / or,
[0011] The available capacity of the target persistent volume is obtained from the monitoring system according to a second preset periodic frequency.
[0012] In an optional implementation manner, determining whether the capacity expansion indicator meets a preset capacity expansion condition includes:
[0013] Determining whether the total capacity of the storage system is greater than a preset first threshold;
[0014] Accordingly, if it is determined that the capacity expansion indicator satisfies the preset capacity expansion condition, modifying the capacity configuration of the target persistent volume according to the preset capacity expansion strategy, and controlling the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler, includes:
[0015] If it is determined that the total capacity of the storage system is greater than the preset first threshold, within the maximum capacity range of the target persistent volume, the capacity configuration of the target persistent volume is modified according to a preset ratio, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0016] In an optional implementation manner, determining whether the capacity expansion indicator meets a preset capacity expansion condition includes:
[0017] Determining whether the available capacity of the target persistent volume is less than a preset second threshold;
[0018] Accordingly, if it is determined that the capacity expansion indicator satisfies the preset capacity expansion condition, modifying the capacity configuration of the target persistent volume according to the preset capacity expansion strategy, and controlling the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler, includes:
[0019] If it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to a preset step size within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0020] In an optional implementation manner, determining whether the capacity expansion indicator meets a preset capacity expansion condition includes:
[0021] Determining whether the total capacity of the storage system is greater than a preset first threshold, and determining whether the available capacity of the target persistent volume is less than a preset second threshold;
[0022] Accordingly, if it is determined that the capacity expansion indicator satisfies the preset capacity expansion condition, modifying the capacity configuration of the target persistent volume according to the preset capacity expansion strategy, and controlling the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler, includes:
[0023] If it is determined that the total capacity of the storage system is greater than the preset first threshold, and it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to the preset capacity expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0024] In an optional implementation, the preset ratio is a growth ratio of the total capacity of the storage system within a preset period of time.
[0025] In an optional implementation, the method is applied to a controller of a container orchestration engine Kubernetes.
[0026] In a second aspect, the present disclosure provides a device for expanding a persistent volume, the device comprising:
[0027] An acquisition module, used to acquire a capacity expansion index of a target persistent volume; wherein the capacity expansion index includes a total capacity of a storage system and / or an available capacity of the target persistent volume;
[0028] A determination module, used to determine whether the expansion index meets a preset expansion condition;
[0029] A control module is used to modify the capacity configuration of the target persistent volume according to a preset capacity expansion strategy if it is determined that the capacity expansion indicator meets the preset capacity expansion condition, and control the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler; wherein the capacity change event is used to trigger the storage system to expand the target persistent volume.
[0030] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the above method.
[0031] In a fourth aspect, the present disclosure provides a device for expanding the capacity of a persistent volume, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0032] In a fifth aspect, the present disclosure provides a computer program product, wherein the computer program product comprises a computer program / instructions, and the computer program / instructions implement the above method when executed by a processor.
[0033] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has at least the following advantages:
[0034] The disclosed embodiment provides a method for expanding the capacity of a persistent volume, obtaining an expansion index of a target persistent volume, wherein the expansion index includes the total capacity of the storage system and / or the available capacity of the target persistent volume, determining whether the expansion index meets a preset expansion condition, and if it is determined that the expansion index meets the preset expansion condition, modifying the capacity configuration of the target persistent volume according to the preset expansion strategy, and controlling the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler, wherein the capacity change event is used to trigger the storage system to expand the target persistent volume. It can be seen that when the disclosed embodiment determines that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume can be modified according to the preset expansion strategy, and the target persistent volume can be controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, thereby triggering the storage system to expand the target persistent volume, thereby realizing automatic expansion of the target persistent volume and improving the expansion efficiency of the target persistent volume. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A flowchart of a method for expanding a persistent volume provided in an embodiment of the present disclosure;
[0038] Figure 2 A flowchart of another method for expanding a persistent volume provided by an embodiment of the present disclosure;
[0039] Figure 3 A schematic diagram of the structure of a persistent volume expansion device provided in an embodiment of the present disclosure;
[0040] Figure 4 A schematic diagram of the structure of a persistent volume expansion device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0041] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0043] Currently, the method for expanding the capacity of persistent volumes in the container orchestration engine Kubernetes has the following shortcomings:
[0044] Specifically, the expansion of persistent volumes usually relies on manual operations by operation and maintenance personnel. However, operation and maintenance personnel cannot directly obtain the remaining space of the storage system that can be used for expansion. Therefore, when expanding the persistent volume, it is easy to blindly set the size of the persistent volume, which ultimately leads to the failure of persistent volume expansion.
[0045] In addition, when expanding the capacity of persistent volumes, the operation and maintenance personnel may not expand the capacity in a timely manner during manual operations. For example, a large amount of data is written quickly to the persistent volume, but the operation and maintenance personnel cannot perceive it in time. When the expansion actually begins, the available controls of the persistent volume are often completely consumed, resulting in the loss of written data.
[0046] In order to improve the expansion efficiency of a target persistent volume, an embodiment of the present disclosure provides a method for expanding a persistent volume.
[0047] Specifically, the expansion index of the target persistent volume is obtained, wherein the expansion index includes the total capacity of the storage system and / or the available capacity of the target persistent volume, and it is determined whether the expansion index meets the preset expansion condition. If it is determined that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume is modified according to the preset expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, wherein the capacity change event is used to trigger the storage system to perform expansion processing on the target persistent volume. It can be seen that when the embodiment of the present disclosure determines that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume can be modified according to the preset expansion strategy, and the target persistent volume can be controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, thereby triggering the storage system to perform expansion processing on the target persistent volume, thereby realizing automatic expansion of the target persistent volume and improving the expansion efficiency of the target persistent volume.
[0048] Based on this, the present disclosure provides a method for expanding the capacity of a persistent volume. Figure 1 , is a flow chart of a method for expanding a persistent volume provided in an embodiment of the present disclosure, the method comprising:
[0049] S101: Obtain expansion indicators of the target persistent volume.
[0050] The expansion index includes the total capacity of the storage system and / or the available capacity of the target persistent volume.
[0051] The method provided in the embodiment of the present disclosure can be applied to the controller of the container orchestration engine Kubernetes.
[0052] In the disclosed embodiment, the controller may be a centralized controller for uniformly managing all persistent volumes in Kubernetes.
[0053] In the disclosed embodiment, the target persistent volume is any persistent volume in Kubernetes. Specifically, the target persistent volume is a storage resource in Kubernetes, which is used to store data persistently.
[0054] Specifically, there are multiple ways to obtain the expansion index of the target persistent volume. In an optional implementation, the storage system interface is called according to a first preset periodic frequency to obtain the total capacity of the storage system.
[0055] In the disclosed embodiment, the controller in Kubernetes calls the storage system interface at a first preset periodic frequency to obtain the total capacity of the storage system. After a new node is added to the storage system, that is, the total capacity of the storage system changes, the controller can quickly perceive it.
[0056] In another optional implementation, the available capacity of the target persistent volume is obtained from the monitoring system according to a second preset periodic frequency.
[0057] In the disclosed embodiment, the controller in Kubernetes calls the monitoring system interface at a second preset periodic frequency to obtain the available capacity of the target persistent volume from the monitoring system.
[0058] It should be noted that the first preset periodic frequency and the second preset periodic frequency may be the same preset periodic frequency or different preset periodic frequencies, and the embodiment of the present disclosure does not impose any limitation thereto.
[0059] In yet another optional implementation, the storage system interface is called at a first preset periodic frequency to obtain the total capacity of the storage system, and the available capacity of the target persistent volume is obtained from the monitoring system at a second preset periodic frequency.
[0060] Specifically, for the description of calling the storage system interface to obtain the total capacity of the storage system according to the first preset periodic frequency and obtaining the available capacity of the target persistent volume from the monitoring system according to the second preset periodic frequency, please refer to the above description of calling the storage system interface to obtain the total capacity of the storage system and the second preset periodic frequency, and the description of obtaining the available capacity of the target persistent volume from the monitoring system according to the second preset periodic frequency. The embodiments of the present disclosure are not elaborated here.
[0061] The above three methods are only examples, and the embodiments of the present disclosure do not limit the method of obtaining the expansion index of the target persistent volume.
[0062] S102: Determine whether the capacity expansion index meets the preset capacity expansion condition.
[0063] In the disclosed embodiment, different expansion indicators correspond to different preset expansion conditions. For example, when the expansion indicator is the total capacity of the storage system, the preset expansion condition is whether the total capacity of the storage system is greater than a preset first threshold. For another example, when the expansion indicator is the available capacity of the target persistent volume, the preset expansion condition is whether the available capacity of the target persistent volume is less than a preset second threshold.
[0064] It should be noted that the preset first threshold and the preset second threshold can be set as needed.
[0065] S103: If it is determined that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume is modified according to the preset expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0066] The capacity change event is used to trigger the storage system to expand the target persistent volume.
[0067] In the disclosed embodiment, if it is determined that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume is modified according to the preset expansion strategy. Instead of directly expanding the target persistent volume, the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, and then the capacity change event is used to trigger the storage system to expand the target persistent volume.
[0068] In an optional implementation, when the capacity expansion indicator is the total capacity of the storage system, it is determined whether the total capacity of the storage system is greater than a preset first threshold. If it is determined that the total capacity of the storage system is greater than the preset first threshold, the capacity configuration of the target persistent volume is modified according to a preset ratio within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0069] The maximum capacity range of the target persistent volume refers to the maximum capacity that the target persistent volume can support in the storage system.
[0070] In the embodiment of the present disclosure, the preset ratio may be any preset ratio.
[0071] In an optional implementation, the preset ratio may be a growth ratio of the total capacity of the storage system within a preset period of time.
[0072] For example, if the initial total capacity of the storage system is 5T and the total capacity of the storage system after growth is 10T, the preset ratio is 2.
[0073] In an embodiment of the present disclosure, if it is determined that the total capacity of the storage system is greater than a preset first threshold, the capacity configuration of the target persistent volume is modified according to a preset ratio within the maximum capacity range of the target persistent volume. Specifically, if the modified capacity configuration of the target persistent volume exceeds the maximum capacity of the target persistent volume, the maximum capacity of the target persistent volume is used as the modified capacity of the target persistent volume.
[0074] Exemplarily, taking the preset ratio as the growth ratio of the total capacity of the storage system within the preset period as an example, assuming that the growth ratio of the total capacity of the storage system within the preset period is 2, the initial capacity of the target persistent volume is 5G, and the maximum capacity of the target persistent volume is 7G, accordingly, the capacity configuration of the target persistent volume is modified according to the preset ratio, and the modified capacity configuration of the target persistent volume is 10G, which exceeds the maximum capacity of the target persistent volume (i.e., 7G), then 7G is used as the modified capacity configuration of the target persistent volume.
[0075] In another optional implementation, when the capacity expansion indicator is the available capacity of the target persistent volume, it is determined whether the available capacity of the target persistent volume is less than a preset second threshold; if it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to a preset step size within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0076] Among them, the preset step size can be set as needed.
[0077] In an embodiment of the present disclosure, if it is determined that the available capacity of the target persistent volume is less than a preset second threshold, the capacity configuration of the target persistent volume is modified according to a preset step size within the maximum capacity range of the target persistent volume. Specifically, if the modified capacity configuration of the target persistent volume exceeds the maximum capacity of the target persistence, the maximum capacity of the target persistent volume is used as the modified capacity of the target persistent volume.
[0078] Exemplarily, assuming that the initial capacity of the target persistent volume is 5G, the preset step size is 3G, and the maximum capacity of the target persistent volume is 7G, the capacity configuration of the target persistent volume is modified accordingly, and the modified capacity configuration of the target persistent volume is 8G, which exceeds the maximum capacity of the target persistent volume (i.e., 7G). In this case, 7G is used as the modified capacity configuration of the target persistent volume.
[0079] In another optional implementation, when the capacity expansion indicators are the total capacity of the storage system and the available capacity of the target persistent volume, it is determined whether the total capacity of the storage system is greater than a preset first threshold, and it is determined whether the available capacity of the target persistent volume is less than a preset second threshold. If it is determined that the total capacity of the storage system is greater than the preset first threshold, and it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to the preset capacity expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0080] In an embodiment of the present disclosure, if it is determined that the total capacity of the storage system is greater than a preset first threshold value, and it is determined that the available capacity of the target persistent volume is less than a preset second threshold value, then within the maximum capacity range of the target persistent volume, the capacity configuration of the target persistent volume is modified according to a preset ratio, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler. Specifically, if the modified capacity configuration of the target persistent volume exceeds the maximum capacity of the target persistence, the maximum capacity of the target persistent volume is used as the modified capacity of the target persistent volume.
[0081] In another embodiment of the present disclosure, if it is determined that the total capacity of the storage system is greater than a preset first threshold value, and it is determined that the available capacity of the target persistent volume is less than a preset second threshold value, the capacity configuration of the target persistent volume is modified according to a preset step size within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler. Specifically, if the modified capacity configuration of the target persistent volume exceeds the maximum capacity of the target persistence, the maximum capacity of the target persistent volume is used as the modified capacity of the target persistent volume.
[0082] In the method for expanding the capacity of a persistent volume provided in the embodiment of the present disclosure, an expansion index of a target persistent volume is obtained, wherein the expansion index includes the total capacity of the storage system and / or the available capacity of the target persistent volume, and it is determined whether the expansion index meets the preset expansion condition. If it is determined that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume is modified according to the preset expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, wherein the capacity change event is used to trigger the storage system to expand the target persistent volume. It can be seen that when the embodiment of the present disclosure determines that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume can be modified according to the preset expansion strategy, and the target persistent volume can be controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, thereby triggering the storage system to expand the target persistent volume, thereby realizing the automatic expansion of the target persistent volume and improving the expansion efficiency of the target persistent volume.
[0083] Based on the above embodiments, the present disclosure also provides a method for expanding the capacity of a persistent volume. Figure 2 , is a flow chart of another method for expanding a persistent volume provided by an embodiment of the present disclosure, the method comprising:
[0084] First, the expansion index of the target persistent volume is obtained. When the expansion index of the target persistent volume is the total capacity of the storage system, the storage system interface is polled periodically by the controller. Specifically, the storage system interface can be called according to a first preset periodic frequency to obtain the total capacity of the storage system, and determine whether the total capacity of the storage system is greater than a preset first threshold. If it is determined that the total capacity of the storage system is greater than the preset first threshold, the capacity configuration of the target persistent volume is modified according to a preset ratio within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0085] When the expansion indicator is the available capacity of the target persistent volume, the controller is used to periodically poll the monitoring system interface. Specifically, the monitoring system interface can be called at a second preset periodic frequency to obtain the available capacity of the target persistent volume from the monitoring system, and determine whether the available capacity of the target persistent volume is less than a preset second threshold. If it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to a preset step size within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0086] It can be seen that when the embodiment of the present disclosure determines that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume can be modified according to the preset expansion strategy, and the target persistent volume can be controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, thereby triggering the storage system to expand the target persistent volume, thereby realizing automatic expansion of the target persistent volume and improving the expansion efficiency of the target persistent volume.
[0087] Based on the above method embodiment, the present disclosure also provides a device for expanding the capacity of a persistent volume, referring to Figure 3 , is a schematic diagram of a structure of a persistent volume expansion device provided in an embodiment of the present disclosure, the device comprising:
[0088] The acquisition module 301 is used to acquire a capacity expansion index of a target persistent volume; wherein the capacity expansion index includes a total capacity of a storage system and / or an available capacity of the target persistent volume;
[0089] A determination module 302 is used to determine whether the expansion index meets a preset expansion condition;
[0090] The control module 303 is used to modify the capacity configuration of the target persistent volume according to the preset capacity expansion strategy if it is determined that the capacity expansion indicator meets the preset capacity expansion condition, and control the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler; wherein the capacity change event is used to trigger the storage system to expand the target persistent volume.
[0091] In an optional implementation, the acquisition module 301 includes:
[0092] A first acquisition submodule is configured to call a storage system interface to acquire the total capacity of the storage system according to a first preset periodic frequency; and / or,
[0093] The second acquisition submodule is used to obtain the available capacity of the target persistent volume from the monitoring system according to a second preset periodic frequency.
[0094] In an optional implementation manner, the determining module 302 is specifically configured to:
[0095] Determining whether the total capacity of the storage system is greater than a preset first threshold;
[0096] Accordingly, the control module 303 is specifically used for:
[0097] If it is determined that the total capacity of the storage system is greater than the preset first threshold, within the maximum capacity range of the target persistent volume, the capacity configuration of the target persistent volume is modified according to a preset ratio, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0098] In an optional implementation manner, the determining module 302 is specifically configured to:
[0099] Determining whether the available capacity of the target persistent volume is less than a preset second threshold;
[0100] Accordingly, the control module 303 is specifically used for:
[0101] If it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to a preset step size within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0102] In an optional implementation manner, the determining module 302 is specifically configured to:
[0103] Determining whether the total capacity of the storage system is greater than a preset first threshold, and determining whether the available capacity of the target persistent volume is less than a preset second threshold;
[0104] Accordingly, the control module 303 is specifically used for:
[0105] If it is determined that the total capacity of the storage system is greater than the preset first threshold, and it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to the preset capacity expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
[0106] In an optional implementation, the preset ratio is a growth ratio of the total capacity of the storage system within a preset period of time.
[0107] In an optional implementation, the method is applied to a controller of a container orchestration engine Kubernetes.
[0108] In the device for expanding the capacity of a persistent volume provided in the embodiment of the present disclosure, an expansion index of a target persistent volume is obtained, wherein the expansion index includes the total capacity of the storage system and / or the available capacity of the target persistent volume, and it is determined whether the expansion index meets the preset expansion condition. If it is determined that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume is modified according to the preset expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, wherein the capacity change event is used to trigger the storage system to expand the target persistent volume. It can be seen that when the embodiment of the present disclosure determines that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume can be modified according to the preset expansion strategy, and the target persistent volume can be controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, thereby triggering the storage system to expand the target persistent volume, thereby realizing the automatic expansion of the target persistent volume and improving the expansion efficiency of the target persistent volume.
[0109] In addition to the above-mentioned method and apparatus, the embodiments of the present disclosure further provide a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device implements the method for expanding the persistent volume described in the embodiments of the present disclosure.
[0110] The embodiment of the present disclosure further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the method for expanding the persistent volume described in the embodiment of the present disclosure is implemented.
[0111] In addition, the present disclosure also provides a device for expanding the capacity of a persistent volume, see Figure 4 As shown, it may include:
[0112] Processor 401, memory 402, input device 403 and output device 404. The number of processors 401 in the persistent volume expansion device can be one or more. Figure 4 In some embodiments of the present disclosure, the processor 401, the memory 402, the input device 403 and the output device 404 may be connected via a bus or other means, wherein: Figure 4 The example of connecting through bus is taken in the following.
[0113] The memory 402 can be used to store software programs and modules, and the processor 401 executes various functional applications and data processing of the expansion device of the persistent volume by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application required for a function, and the like. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The input device 403 may be used to receive input digital or character information, and to generate signal input related to user settings and function control of the expansion device of the persistent volume.
[0114] Specifically in this embodiment, the processor 401 will load the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 will run the applications stored in the memory 402, thereby realizing various functions of the above-mentioned persistent volume expansion device.
[0115] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0116] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for expanding the capacity of a persistent volume. It is characterized in that The method comprises: Obtaining a capacity expansion index of a target persistent volume; wherein the capacity expansion index includes a total capacity of a storage system; Determining whether the capacity expansion indicator meets a preset capacity expansion condition; If it is determined that the expansion index meets the preset expansion condition, the capacity configuration of the target persistent volume is modified according to the preset expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler; wherein the capacity change event is used to trigger the storage system to perform capacity expansion processing on the target persistent volume; If the determining whether the capacity expansion indicator satisfies the preset capacity expansion condition is determining whether the total capacity of the storage system is greater than a preset first threshold, then if it is determined that the capacity expansion indicator satisfies the preset capacity expansion condition, modifying the capacity configuration of the target persistent volume according to a preset capacity expansion strategy, and controlling the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler, including: If it is determined that a new node is added to the storage system and the total capacity of the storage system is greater than the preset first threshold, the capacity configuration of the target persistent volume is modified according to a preset ratio within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler, wherein the preset ratio is a growth ratio of the total capacity of the storage system within a preset duration.
2. The method according to claim 1, It is characterized in that The step of obtaining the expansion index of the target persistent volume includes: Calling a storage system interface to obtain the total capacity of the storage system according to a first preset periodic frequency; and / or, The available capacity of the target persistent volume is obtained from the monitoring system according to a second preset periodic frequency.
3. The method for expanding a persistent volume according to claim 1, It is characterized in that The capacity expansion index also includes the available capacity of the target persistent volume, and the determining whether the capacity expansion index meets the preset capacity expansion condition also includes: If the determining whether the capacity expansion indicator satisfies the preset capacity expansion condition is determining whether the available capacity of the target persistent volume is less than a preset second threshold, then if it is determined that the capacity expansion indicator satisfies the preset capacity expansion condition, modifying the capacity configuration of the target persistent volume according to a preset capacity expansion strategy, and controlling the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler, including: If it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to a preset step size within the maximum capacity range of the target persistent volume, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
4. The method for expanding a persistent volume according to claim 3, It is characterized in that The determining whether the capacity expansion indicator meets a preset capacity expansion condition includes: If the determining whether the capacity expansion indicator satisfies the preset capacity expansion condition is determining whether the total capacity of the storage system is greater than a preset first threshold, and determining whether the available capacity of the target persistent volume is less than a preset second threshold, then if it is determined that the capacity expansion indicator satisfies the preset capacity expansion condition, modifying the capacity configuration of the target persistent volume according to a preset capacity expansion strategy, and controlling the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler, including: If it is determined that the total capacity of the storage system is greater than the preset first threshold, and it is determined that the available capacity of the target persistent volume is less than the preset second threshold, the capacity configuration of the target persistent volume is modified according to the preset capacity expansion strategy, and the target persistent volume is controlled to send a capacity change event of the target persistent volume to the storage plug-in scaler.
5. The method according to claim 1, It is characterized in that The method is applied in a controller of a container orchestration engine Kubernetes.
6. A device for expanding the capacity of a persistent volume, It is characterized in that The device comprises: An acquisition module, used to acquire a capacity expansion index of a target persistent volume; wherein the capacity expansion index includes a total capacity of a storage system; A determination module, used to determine whether the expansion index meets a preset expansion condition; A control module, configured to modify the capacity configuration of the target persistent volume according to a preset capacity expansion strategy if it is determined that the capacity expansion indicator meets the preset capacity expansion condition, and control the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler; wherein the capacity change event is used to trigger the storage system to perform capacity expansion processing on the target persistent volume; The determination module is specifically used to determine whether the total capacity of the storage system is greater than a preset first threshold; The control module is specifically configured to modify the capacity configuration of the target persistent volume according to a preset ratio within the maximum capacity range of the target persistent volume if it is determined that a new node is added to the storage system and the total capacity of the storage system is greater than the preset first threshold, and control the target persistent volume to send a capacity change event of the target persistent volume to the storage plug-in scaler, wherein the preset ratio is a growth ratio of the total capacity of the storage system within a preset time period.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 5.
8. A device for expanding the capacity of a persistent volume, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method for expanding capacity of PVC module in Kubernetes and related device
CN111752489A
Automatic expansion method and system for storage volumes of cloud platform, terminal and storage medium
CN111949216A
Capacity expansion method and device for cloud hard disk, computer equipment and storage medium
CN112328170A
Storage volume expansion method and device and medium
CN114968110A
Method and system for online capacity expansion of container file system based on local disk
CN115017117A
