Resource allocation method and system, computer device and storage medium
By leveraging the collaborative work of the node management cluster and compute nodes, and periodically monitoring and adjusting resource allocation, the problem of insufficient critical business resources in multi-controller storage systems has been resolved, achieving reasonable resource allocation and improved business stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2025-01-06
- Publication Date
- 2026-04-10
AI Technical Summary
In multi-controller storage systems, it is difficult to ensure that critical business operations are allocated sufficient resources, leading to anomalies in business processing.
By leveraging the collaborative work of the node management cluster and computing nodes, the performance of critical business virtual disks is monitored periodically, resource allocation ratios are adjusted, and the resource allocation value of the virtual disks for critical businesses is ensured to be greater than or equal to the resource guarantee value. When necessary, resources are reallocated, thereby achieving performance monitoring and reasonable resource allocation for all virtual disks.
It ensures that critical business operations are allocated sufficient resources, improves business operation stability and product adaptability, expands the scenarios that the storage system can handle, and solves anomalies caused by uneven resource allocation.
Smart Images

Figure CN119960682B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a resource allocation method and system, computer equipment and storage medium. BACKGROUND
[0002] Multi-control cluster refers to a multi-control storage system composed of multiple controllers, and each controller can process business in parallel. When one or more controllers fail, other surviving controllers can continue to work, ensuring that the business does not interrupt and data is not lost. The multi-control storage system is composed of a node management cluster and multiple computing nodes. The node management cluster has functions such as communication between controllers, business takeover, configuration data saving, and information synchronization. The computing node contains the above-mentioned controller, and the virtual disk of the business is also in the computing node.
[0003] In the current multi-control storage system, the way to allocate resources for different businesses is generally whole division or self-occupation, which leads to the fact that in some multi-business coexistence scenarios, critical businesses are affected by other non-critical businesses, resulting in critical businesses failing to obtain resources or insufficient allocation of resources, and abnormal business processing.
[0004] Therefore, the related technology has the problem that it is difficult to ensure that critical businesses are allocated enough resources in the multi-control storage system, resulting in abnormal business processing. SUMMARY
[0005] Therefore, the present application provides a resource allocation method and system, computer equipment and storage medium to solve the problem that it is difficult to ensure that critical businesses are allocated enough resources in the multi-control storage system, resulting in abnormal business processing.
[0006] In a first aspect, the present application provides a resource allocation method, which is applied to a node management cluster, and the method comprises:
[0007] In the case of receiving a resource guarantee instruction, the target virtual disk and the resource guarantee value of the target virtual disk are determined according to the resource guarantee instruction, wherein the target virtual disk is a virtual disk that is preferentially guaranteed in resource allocation;
[0008] Send a performance value acquisition instruction to the first preset number of computing nodes, wherein the performance value acquisition instruction is used to acquire the performance values of the second preset number of virtual disks, the virtual disks are from the computing nodes, and the target virtual disk is included in the second preset number of virtual disks;
[0009] Determine the resource allocation ratio according to the performance values, and obtain the resource allocation values of the second preset number of virtual disks according to the resource allocation ratio and the resource guarantee value, wherein the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value;
[0010] According to the resource allocation value, the second preset number of virtual disks are allocated with resources.
[0011] The resource allocation method provided in the embodiment, the node management cluster determines the target virtual disk and the resource guarantee value through the resource guarantee instruction. The resource allocation ratio is determined according to the performance value of the virtual disk, and the resource allocation value of each virtual disk is determined according to the resource guarantee value and the resource allocation ratio, so as to ensure that the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value. It is ensured that the key business corresponding to the target virtual disk can be allocated with sufficient resources, so that the key business can be protected by resources, the business operation stability and product adaptability are improved, and the scenarios that the storage system can cope with are expanded. The problem that it is difficult to ensure that the key business is allocated with sufficient resources in the multi-control storage system is solved, and the abnormality of business processing is avoided.
[0012] In some optional embodiments, after the second preset number of virtual disks are allocated with resources, the method further comprises:
[0013] The identification information of the target virtual disk, the resource guarantee value and the resource allocation value are sent to the corresponding computing node, wherein the identification information is used to determine the target virtual disk;
[0014] In the case that the resource allocation exception information sent by the computing node is received, the virtual disk to be analyzed and the first current resource allocation value of the virtual disk to be analyzed in the target virtual disk are determined according to the resource allocation exception information;
[0015] If the first current resource allocation value is less than the resource guarantee value of the virtual disk to be analyzed, a resource reallocation instruction is sent to the computing node, wherein the resource reallocation instruction is used to reallocate resources for the virtual disk.
[0016] In the embodiment, the node management cluster sends the identification information, the resource guarantee value and the resource allocation value to the computing node, and uses the computing node to monitor whether the performance of the target virtual disk meets the resource guarantee value. If not, the computing node is instructed to reallocate resources for the target virtual disk through the resource reallocation instruction, so as to guarantee the operation of the key business, thereby realizing the performance monitoring of all virtual disks and the reasonable allocation of resources.
[0017] In some optional embodiments, the resource allocation ratio is determined according to the performance value, comprising:
[0018] It is judged whether the performance values of the second preset number of virtual disks have a common divisor;
[0019] In the case that there is a common divisor, the performance value is repeatedly divided by the common divisor until there is a performance value that cannot be divided by the common divisor, then the process is stopped, and the resource allocation ratio is obtained according to the current performance value.
[0020] In the absence of a common divisor, the performance value is repeatedly divided by a preset value until the performance value is less than a first preset threshold, and then the process is stopped. According to the current performance value, the resource allocation ratio is obtained.
[0021] In a second aspect, the present application provides a resource allocation method, which is applied to a computing node, and the method comprises:
[0022] In the case that the performance value acquisition instruction sent by the node management cluster is received, the performance values of a second preset number of virtual disks are acquired, wherein the second preset number of virtual disks include the target virtual disk;
[0023] The performance values are sent to the node management cluster, so that the node management cluster performs resource allocation on the second preset number of virtual disks according to the resource allocation value, wherein the resource allocation value is obtained according to the resource allocation ratio and the resource guarantee value, the resource allocation ratio is determined according to the performance values, the resource guarantee value and the target virtual disk are determined according to the resource guarantee instruction, and the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value.
[0024] The resource allocation method provided in the embodiment is that the computing node acquires the performance values of the virtual disks and sends the performance values to the node management cluster. The node management cluster determines the resource allocation ratio according to the performance values of the virtual disks, and determines the resource allocation value of each virtual disk according to the resource guarantee value and the resource allocation ratio, so as to ensure that the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value. It is ensured that the key business corresponding to the target virtual disk can be allocated to sufficient resources, so that the key business can be protected by resources, the business operation stability and product adaptability are improved, and the scenarios that can be coped with by the storage system are expanded. The problem that it is difficult to ensure that the key business is allocated to sufficient resources in the multi-control storage system is solved, and the problem that the business processing is abnormal is solved.
[0025] In some optional embodiments, the method further comprises:
[0026] In the case that the identification information, the resource guarantee value and the resource allocation value of the target virtual disk sent by the node management cluster are received, the identification information, the resource guarantee value and the resource allocation value are saved, wherein the identification information is used to determine the target virtual disk;
[0027] A first current resource allocation value of the target virtual disk is acquired, and the target virtual disk whose first current resource allocation value is less than the resource guarantee value is regarded as an analyzed virtual disk;
[0028] Resource allocation exception information containing the analyzed virtual disk and the first current resource allocation value of the analyzed virtual disk is generated;
[0029] In a case where the preset timer reaches the preset time, resource allocation exception information is sent to a node management cluster, where the node management cluster is configured to determine whether to send a resource reallocation instruction to the computing node according to the resource allocation exception information, and the resource reallocation instruction is configured to perform resource reallocation on the virtual disk.
[0030] In a case where the resource reallocation instruction is received, a second current resource allocation value of other virtual disks is obtained, and the resources of the other virtual disks are released according to the second current resource allocation value and the resource allocation value, and the released resources are allocated to the virtual disk to be analyzed, where the other virtual disks are virtual disks other than the target virtual disk in the second preset number of virtual disks.
[0031] In the embodiment, the computing node monitors whether the resources of the target virtual disk of the key service meet the resource guarantee value, and when the resources of the target virtual disk are insufficient, the other virtual disks are evaluated for resources, and the virtual disk occupying more resources releases part of the resources, and the released resources are allocated to the virtual disk to be analyzed, so as to guarantee the normal operation of the key service corresponding to the virtual disk to be analyzed, and realize the performance monitoring of all virtual disks and the reasonable allocation of resources.
[0032] In some optional embodiments, according to the second current resource allocation value and the resource allocation value, the resources of the other virtual disks are released, and the released resources are allocated to the virtual disk to be analyzed, including:
[0033] Determining a ratio of the second current resource allocation value of the other virtual disk to the corresponding resource allocation value;
[0034] The other virtual disk with a ratio greater than a second preset threshold and less than a third preset threshold is taken as a first virtual disk to be processed, and the second current resource allocation value of the first virtual disk to be processed is set as an upper limit of resources of the first virtual disk to be processed;
[0035] The other virtual disk with a ratio greater than the third preset threshold is taken as a second virtual disk to be processed, and a first difference between the first current resource allocation value of the virtual disk to be analyzed and the resource guarantee value is determined;
[0036] A second difference between the second current resource allocation value of the second virtual disk to be processed and the first difference is determined, and the second virtual disk to be processed is controlled to release the released resources, where the size of the released resources is the first difference;
[0037] The second difference is set as an upper limit of resources of the second virtual disk to be processed;
[0038] The second virtual disk to be processed releasing the released resources is recorded, and a corresponding relationship between the second virtual disk to be processed releasing the released resources and the virtual disk to be analyzed obtaining the released resources is recorded.
[0039] In the embodiment, the computing node performs resource evaluation on the virtual disks, determines a first to-be-processed virtual disk with less resource occupation, sets a resource upper limit for the first to-be-processed virtual disk, so that the first to-be-processed virtual disk no longer occupies more resources. A second to-be-processed virtual disk with more resource occupation is determined, and the second to-be-processed virtual disk is caused to release a released resource with a first difference and re-allocate the released resource to a to-be-analyzed virtual disk, so as to guarantee normal operation of a key service corresponding to the to-be-analyzed virtual disk, and realize reasonable allocation of resources.
[0040] In some optional embodiments, the method further includes:
[0041] In a case where the resource guarantee deletion instruction sent by the node management cluster is received, the identification information and the resource guarantee value of the target virtual disk are deleted;
[0042] The resource upper limit of the first to-be-processed virtual disk and the resource upper limit of the second to-be-processed virtual disk are deleted.
[0043] In a third aspect, the present application provides a resource allocation system, which includes a node management cluster and a computing node.
[0044] The node management cluster is configured to, in a case where a resource guarantee instruction is received, determine a target virtual disk and a resource guarantee value of the target virtual disk according to the resource guarantee instruction, wherein the target virtual disk is a virtual disk that is preferentially guaranteed in resource allocation;
[0045] The node management cluster is configured to send a performance value acquisition instruction to a first preset number of computing nodes, wherein the performance value acquisition instruction is used to acquire performance values of a second preset number of virtual disks, the virtual disks are from the computing nodes, and the target virtual disk is included in the second preset number of virtual disks.
[0046] The computing node is configured to, in a case where the performance value acquisition instruction sent by the node management cluster is received, acquire the performance values of the second preset number of virtual disks.
[0047] The computing node is configured to send the performance values to the node management cluster.
[0048] The node management cluster is configured to determine a resource allocation ratio according to the performance values, and obtain resource allocation values of the second preset number of virtual disks according to the resource allocation ratio and the resource guarantee value, wherein the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value.
[0049] The node management cluster is configured to perform resource allocation on the second preset number of virtual disks according to the resource allocation values.
[0050] In a fourth aspect, the present application provides a computer device, comprising a memory and a processor, which are connected to each other in communication, and the memory stores computer instructions, and the processor executes the resource allocation method of the first aspect or any of the corresponding embodiments thereof or the resource allocation method of the second aspect or any of the corresponding embodiments thereof by executing the computer instructions.
[0051] In a fifth aspect, the present application provides a computer readable storage medium, which stores computer instructions for making a computer execute the resource allocation method of the first aspect or any of the corresponding embodiments thereof or the resource allocation method of the second aspect or any of the corresponding embodiments thereof.
[0052] In a sixth aspect, the present application provides a computer program product, which comprises computer instructions for making a computer execute the resource allocation method of the first aspect or any of the corresponding embodiments thereof or the resource allocation method of the second aspect or any of the corresponding embodiments thereof. BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the specific embodiments or the related art of the present application, the drawings needed to be used in the specific embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0054] Figure 1 is a flowchart of a resource allocation method applied to a node management cluster according to an embodiment of the present application;
[0055] Figure 2 is a schematic diagram of a virtual disk minimum performance guarantee strategy based on a multi-control storage system according to an embodiment of the present application;
[0056] Figure 3 is a flowchart of a resource allocation method applied to a computing node according to an embodiment of the present application;
[0057] Figure 4 is a structural block diagram of a resource allocation device deployed in a node management cluster according to an embodiment of the present application;
[0058] Figure 5 is a structural block diagram of a resource allocation device deployed in a computing node according to an embodiment of the present application;
[0059] Figure 6 is a hardware structure schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0061] In the current multi-control storage system, the resource usage mode of business IO (Input / Output) is basically overall equal division or self-occupying, if all businesses are tasks of the same type, there will be almost no impact, but if there are businesses with higher priority, it is not appropriate to allow self-occupying resources, if resource occupation is insufficient or not occupied, the key business may be affected by other non-key businesses, and even in some special scenarios, the key business cannot occupy resources and application anomalies occur. Therefore, in the storage system of the multi-control cluster, the flow limiting mode is not perfect, and is realized by the load balancing mode between nodes, which has relatively large constraint and even dependence on other characteristics.
[0062] Based on the above, the embodiments of the present application provide a resource allocation method, under the storage framework of the multi-control cluster, the performance of the virtual disk of the key business is perceived by using the timing monitoring mode whether it meets the expectation, then through the overall resource evaluation analysis, the virtual disks with less occupied resources are no longer occupied, and the virtual disks with more occupied resources release part of the resources, so as to protect the running of the key business, thereby realizing the performance monitoring of all virtual disks and the reasonable allocation of resources. The minimum performance guarantee function is designed to supervise and evaluate the traffic of all virtual disks on the storage system, and a reasonable allocation of overall resources is achieved according to the business demand. In the multi-business coexistence scene, the key business can be protected by resources, the business running stability and product adaptability are improved, the storage system can be applied to more industries, and the effect of greatly expanding the scenarios that the storage system can cope with and widening the application field of the product is achieved.
[0063] According to the embodiments of the present application, a resource allocation embodiment is provided, and it should be noted that the steps shown in the flowchart can be executed in the node management cluster, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0064] In the present embodiment, a resource allocation method is provided, which can be used in a node management cluster, Figure 1 is a flowchart of the resource allocation method according to the embodiments of the present application, asFigure 1 As shown, the flow includes the following steps:
[0065] Step S101, in the case of receiving the resource guarantee instruction, determining the target virtual disk and the resource guarantee value of the target virtual disk according to the resource guarantee instruction, wherein the target virtual disk is a virtual disk that is preferentially guaranteed in resource allocation.
[0066] Specifically, the multi-control storage system is composed of a node management cluster and a first preset number of computing nodes, and the node management cluster is responsible for configuration management of each computing node and communication between computing nodes. The first preset number is, for example, 5, 6, 7, or other values that meet actual needs.
[0067] The user can input the resource guarantee instruction through the command line to set the minimum performance guarantee strategy of a certain virtual disk. In the resource guarantee instruction, the target virtual disk that needs to be guaranteed in terms of minimum performance and the resource guarantee value of the target virtual disk are indicated. The target virtual disk is, for example, a virtual disk corresponding to a certain key business in the computing node, and the resources of the target virtual disk need to be preferentially guaranteed in resource allocation. The resource guarantee value is, for example, the minimum capacity, minimum bandwidth, disk type, etc. that needs to be allocated to the target virtual disk, and the resource guarantee value must be less than the actual performance value that the virtual disk can run.
[0068] After the node management cluster receives the resource guarantee instruction, the resource guarantee instruction will indicate the target virtual disk and the resource guarantee value of the target virtual disk. For example, Figure 2 As shown, the minimum performance guarantee parameter value and the virtual disk object that needs to be guaranteed are input through the command line, and the node management cluster performs data summarization and temporary storage on the minimum performance guarantee parameter value and the virtual disk object that needs to be guaranteed.
[0069] Step S102, sending a performance value acquisition instruction to the first preset number of computing nodes, wherein the performance value acquisition instruction is used to acquire the performance values of a second preset number of virtual disks, the virtual disks are from the computing nodes, and the target virtual disk is included in the second preset number of virtual disks.
[0070] Specifically, as shown in Figure 2As shown, after data summarization and temporary storage of the information of the target virtual disk and the resource guarantee value of the target virtual disk, the node management cluster sends a function start notification to the first preset number of computing nodes as a performance value acquisition instruction. In this embodiment, two timers are provided in the computing nodes. Timer 1 has a period of, for example, 1 second, and is used to monitor the performance value of each virtual disk on each node. The performance value is, for example, the IOPS (Input / Output Operations Per Second, the number of read / write operations per second) of the virtual disk, the bandwidth, etc. Timer 2 has a period of, for example, 5 seconds, and is used to report the performance value of the virtual disk monitored on each node to the node management cluster. Timer 2 is set to control the reporting frequency of the performance value, so as to avoid affecting the overall event processing of the node management cluster. In addition, timer 2 can be used to control the reporting time of the computing node to the node management cluster. The reporting time is, for example, when the minimum performance guarantee function is initially set, when the performance changes, when a special event occurs, etc.
[0071] After receiving the notification as the performance value acquisition instruction, the computing node starts timer 1 to perform performance statistics and time monitoring, and acquires the performance value of the second preset number of virtual disks. Then, timer 2 is started. When timer 2 reaches the set time (for example, 5 seconds), the performance value of the virtual disk is sent to the node management cluster.
[0072] In step S103, the resource allocation ratio is determined according to the performance value, and the resource allocation value of the second preset number of virtual disks is obtained according to the resource allocation ratio and the resource guarantee value. The resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value.
[0073] Specifically, the resource allocation ratio is determined according to the performance value. For example, the performance value of each virtual disk is divided, and the result of the division is taken as the resource allocation ratio. The resource allocation ratio is saved in the node management cluster.
[0074] When allocating resources, the resources of the target virtual disk need to be preferentially guaranteed. First, the resource allocation value of the target virtual disk is set to a value greater than or equal to the resource guarantee value. Then, the resource allocation values of all virtual disks are calculated according to the resource allocation ratio and the resource allocation value of the target virtual disk. For example, the resource allocation ratio of virtual disk 1, virtual disk 2 and the target virtual disk is 3:2:1, the resource guarantee value of the target virtual disk is x, the resource allocation value of the target virtual disk is set to x, and according to the resource allocation ratio of 3:2:1, the resource allocation value of virtual disk 1 is 3x, and the resource allocation value of virtual disk 2 is 2x.
[0075] For example, as shown in FIG. 6, the resource allocation value of virtual disk 1 is 3x, the resource allocation value of virtual disk 2 is 2x, and the resource allocation value of the target virtual disk is x. Figure 2As shown, the node management cluster performs allocation ratio calculation according to the performance values and events reported by the computing nodes; each node performs allocation value calculation and saves the allocation value.
[0076] At step S104, resources are allocated to the second preset number of virtual disks according to the resource allocation values.
[0077] Specifically, resources corresponding to the resource allocation values are allocated to the virtual disks. If the resources of the multi-control storage system are limited when the resources are allocated, the resources of the target virtual disks are preferentially guaranteed.
[0078] After the allocation is completed, the node management cluster sends the allocation values to the corresponding nodes and saves the allocation values, as shown in Figure 2 As shown, the allocation values are sent to the nodes; the computing node data records are saved.
[0079] The resource allocation method provided in this embodiment includes the following steps: the node management cluster determines a target virtual disk and a resource guarantee value through a resource guarantee instruction; a resource allocation ratio is determined according to the performance value of the virtual disk; and a resource allocation value of each virtual disk is determined according to the resource guarantee value and the resource allocation ratio, so as to ensure that the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value. This ensures that the key business corresponding to the target virtual disk can be allocated sufficient resources, so that the key business can be protected by resources, improving the business operation stability and product adaptability, and expanding the scenarios that the storage system can cope with. The problem that it is difficult to ensure that the key business is allocated sufficient resources in the multi-control storage system is solved, so that the business processing does not appear abnormal.
[0080] In some optional embodiments, after the resource allocation is performed on the second preset number of virtual disks, the method further includes:
[0081] The identification information of the target virtual disk, the resource guarantee value, and the resource allocation value are sent to the corresponding computing node, wherein the identification information is used to determine the target virtual disk;
[0082] In the case where the resource allocation exception information sent by the computing node is received, the target virtual disk to be analyzed and a first current resource allocation value of the target virtual disk to be analyzed are determined according to the resource allocation exception information;
[0083] If the first current resource allocation value is less than the resource guarantee value of the virtual disk to be analyzed, a resource reallocation instruction is sent to the computing node, wherein the resource reallocation instruction is used to perform resource reallocation on the virtual disk.
[0084] Specifically, after the resource allocation is performed on the virtual disk, the node management cluster sends the identification information of the target virtual disk, the resource guarantee value, and the resource allocation value to the corresponding computing node, and the computing node saves the identification information, the resource guarantee value, and the resource allocation value.
[0085] The second function of the timer 1 in the computing node is to monitor all target virtual disks with the minimum performance guarantee function enabled, obtain a first current resource allocation value of the target virtual disk, and compare the first current resource allocation value with the resource guarantee value received from the node management cluster. If it is detected that the first current resource allocation value is less than the resource guarantee value, the target virtual disk is taken as an analyzed virtual disk, resource allocation exception information containing the analyzed virtual disk and the first current resource allocation value is generated, and the resource allocation exception information is reported to the node management cluster.
[0086] After receiving the resource allocation exception information sent by the computing node, the node management cluster reads the analyzed virtual disk and the first current resource allocation value of the analyzed virtual disk included in the resource allocation exception information.
[0087] The node management cluster compares and analyzes the first current resource allocation value of the analyzed virtual disk reported by the computing node with the resource guarantee value, and further determines whether the analyzed virtual disk meets the minimum performance guarantee requirement. If the first current resource allocation value is less than the resource guarantee value of the analyzed virtual disk, it is determined that the analyzed virtual disk does not meet the minimum performance guarantee requirement, a resource reallocation instruction is sent to the computing node to instruct the computing node to evaluate and analyze the performance of the virtual disk, and the virtual disk is reallocated according to the analysis result. In addition, the node management cluster can calculate the difference between the first current resource allocation value and the resource guarantee value, and send the difference to the computing node through the resource reallocation instruction. As shown in Figure 2 The computing node reports events through the timer 2, uploads the resource allocation exception information to the node management cluster, the node management cluster compares and analyzes the first current resource allocation value of the analyzed virtual disk in the resource allocation exception information, judges whether the minimum performance guarantee requirement is met, if yes, no processing is performed, and if not, a notification, i.e. a resource reallocation instruction, is sent to each node. After receiving the resource reallocation instruction, the computing node evaluates and analyzes all virtual disks with business.
[0088] After receiving the resource reallocation instruction, the computing node re-obtains the performance of all virtual disks by using the timer 1 to evaluate and analyze, reallocates resources to the virtual disks according to the analysis result, for example, makes other virtual disks with less occupied resources no longer occupy resources, makes virtual disks with more occupied resources release part of the resources, and allocates the released resources to the analyzed virtual disk to guarantee the operation of the critical business, so as to realize the performance monitoring of all virtual disks and the reasonable allocation of resources.
[0089] In the embodiment, the node management cluster sends the identification information, the resource guarantee value and the resource allocation value to the computing node, monitors whether the performance of the target virtual disk meets the resource guarantee value by the computing node, if not, instructs the computing node to reallocate resources for the target virtual disk by the resource reallocation instruction, so as to guarantee the running of the key service, thereby realizing the performance monitoring of all virtual disks and the reasonable allocation of resources.
[0090] In some optional embodiments, the resource allocation ratio is determined according to the performance values, comprising:
[0091] determining whether the performance values of the second preset number of virtual disks have a common divisor;
[0092] in the case that the common divisor exists, repeatedly dividing the performance values by the common divisor until there is a performance value that cannot be divided by the common divisor, then stopping, and obtaining the resource allocation ratio according to the current performance value;
[0093] in the case that the common divisor does not exist, repeatedly dividing the performance values by the preset numerical value until the performance value is less than the first preset threshold, then stopping, and obtaining the resource allocation ratio according to the current performance value.
[0094] Specifically, it is determined whether the performance values of the second preset number of virtual disks have a common divisor, for example, the performance value is IOPS, the IOPS of the virtual disk 3 is 30000, the IOPS of the virtual disk 4 is 60000, and the IOPS of the virtual disk 5 is 75000, and the above performance values have a common divisor of 3.
[0095] in the case that the common divisor exists, repeatedly dividing the performance values by the common divisor until there is a performance value that cannot be divided by the common divisor, then stopping, for example, dividing 30000, 60000 and 75000 by 3 respectively to obtain 10000, 20000 and 25000, dividing the above results by 3 again, and so on, until there is a performance value that cannot be divided by the common divisor, at this time the results are 2, 4 and 5. According to the current performance value, the resource allocation ratio is obtained, for example, the resource allocation ratio of the virtual disk 3, the virtual disk 4 and the virtual disk 5 is 2:4:5.
[0096] The preset value is, for example, 2, 3, 5, or the like, and the first preset threshold is, for example, 10, 11, 12, or the like. In the absence of a common divisor, the performance value is repeatedly divided by the preset value until the performance value is less than the first preset threshold, and then the division is stopped. For example, the performance value is IOPS, the IOPS of the virtual disk 6 is 20000, and the IOPS of the virtual disk 7 is 32000. 20000 and 32000 are divided by 2 to obtain 10000 and 16000, respectively. In this way, the division is continued until the performance value is less than the first preset threshold. At this time, the results are 5 and 8. According to the current performance value, the resource allocation ratio of the virtual disk 6 and the virtual disk 7 is obtained.
[0097] According to an embodiment of the present application, an embodiment of a resource allocation method is provided. It should be noted that the steps shown in the flowchart can be executed in the computing node, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0098] In this embodiment, a resource allocation method is provided, which can be used in a computing node, Figure 3 is a flowchart of a resource allocation method according to an embodiment of the present application, as Figure 3 shown, the flow includes the following steps:
[0099] Step S301, in the case of receiving the performance value acquisition instruction sent by the node management cluster, the performance value of the second preset number of virtual disks is obtained, wherein the second preset number of virtual disks includes the target virtual disk.
[0100] Specifically, after the node management cluster data aggregates and temporarily stores the information of the target virtual disk and the resource guarantee value of the target virtual disk, the node management cluster sends a function start notification to the first preset number of computing nodes as a performance value acquisition instruction.
[0101] Two timers are provided in the computing node. The period of timer 1 is, for example, 1 second, which is used to monitor the performance value of each virtual disk on each node. The performance value is, for example, the IOPS (Input / Output Operations Per Second) of the virtual disk, the bandwidth, and the like. The period of timer 2 is, for example, 5 seconds, which is used to report the performance value of the virtual disk monitored on each node to the node management cluster. The purpose of setting timer 2 is to control the reporting frequency of the performance value, so as to avoid affecting the overall event processing of the node management cluster. In addition, timer 2 can be used to control the reporting time of the computing node to the node management cluster. The reporting time is, for example, when the minimum performance guarantee function is initially set, when the performance changes, when there is a special event, and the like.
[0102] The computing node starts a timer 1 after receiving the notification as the performance value acquisition instruction, and performs performance statistics and time monitoring to obtain performance values of the second preset number of virtual disks.
[0103] In step S302, the performance values are sent to the node management cluster, so that the node management cluster performs resource allocation on the second preset number of virtual disks according to the resource allocation values, wherein the resource allocation values are obtained according to the resource allocation ratio and the resource guarantee value, the resource allocation ratio is determined according to the performance values, the resource guarantee value and the target virtual disk are determined according to the resource guarantee instruction, and the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value.
[0104] Specifically, the computing node starts a timer 2, and sends the performance values of the virtual disks to the node management cluster when the timer 2 reaches the set time (for example, 5 seconds). The above process is as shown in FIG. 2B. Figure 2 As shown in FIG. 2B, the computing node starts a 1-second timer after receiving the notification, performs performance statistics and event monitoring, performs performance and event monitoring according to the timer 1, performs performance monitoring on the virtual disks by monitoring the IO flow of the virtual disks, and reports the current performance values and events to the node management cluster based on the timer 2.
[0105] After the node management cluster receives the performance values, the resource allocation ratio is determined according to the performance values, for example, the performance values of each virtual disk are divided, the divided results are taken as the resource allocation ratio, and the resource allocation ratio is saved in the node management cluster. When performing resource allocation, the resources of the target virtual disk need to be preferentially guaranteed. First, the resource allocation value of the target virtual disk is set to a value greater than or equal to the resource guarantee value. Then, the resource allocation values of all virtual disks are calculated according to the resource allocation ratio and the resource allocation value of the target virtual disk. The virtual disks are allocated resources corresponding to the resource allocation values. If the resources of the multi-control storage system are limited when performing resource allocation, the resources of the target virtual disk are preferentially guaranteed.
[0106] The resource allocation method provided in this embodiment is that the computing node obtains the performance values of the virtual disks and sends the performance values to the node management cluster. The node management cluster determines the resource allocation ratio according to the performance values of the virtual disks, and determines the resource allocation values of the virtual disks according to the resource guarantee value and the resource allocation ratio, so as to ensure that the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value. It is ensured that the key business corresponding to the target virtual disk can be allocated sufficient resources, so that the key business can be protected by resources, the business operation stability and product adaptability are improved, and the scenarios that can be coped with by the storage system are expanded. The problem that it is difficult to ensure that the key business in the multi-control storage system is allocated sufficient resources, so that the business processing is abnormal, is solved.
[0107] In some optional embodiments, the method further comprises:
[0108] In a case where the identification information, the resource guarantee value and the resource allocation value of the target virtual disk sent by the node management cluster are received, the identification information, the resource guarantee value and the resource allocation value are saved, wherein the identification information is used to determine the target virtual disk;
[0109] A first current resource allocation value of the target virtual disk is obtained, and the target virtual disk with the first current resource allocation value smaller than the resource guarantee value is taken as a virtual disk to be analyzed;
[0110] Resource allocation exception information containing the virtual disk to be analyzed and the first current resource allocation value of the virtual disk to be analyzed is generated;
[0111] In a case where a preset timer reaches a preset time, the resource allocation exception information is sent to the node management cluster, wherein the node management cluster is used to determine whether to send a resource reallocation instruction to the computing node according to the resource allocation exception information, and the resource reallocation instruction is used to perform resource reallocation on the virtual disk;
[0112] In a case where the resource reallocation instruction is received, a second current resource allocation value of other virtual disks is obtained, and according to the second current resource allocation value and the resource allocation value, resources of the other virtual disks are released, and the released resources are allocated to the virtual disk to be analyzed, wherein the other virtual disks are virtual disks other than the target virtual disk in the second preset number of virtual disks.
[0113] Specifically, after the resource allocation is performed for the virtual disk, the node management cluster sends the identification information, the resource guarantee value and the resource allocation value used to determine the target virtual disk to the corresponding computing node, and the computing node saves the identification information, the resource guarantee value and the resource allocation value. Moreover, the computing node determines which virtual disks are the target virtual disk according to the identification information. As shown in Figure 2 After the computing node receives the identification information, the resource guarantee value and the resource allocation value, the data record is saved, the event monitoring is performed, and the resources of each virtual disk are monitored. In a case where the resources of the virtual disk are abnormal, the event is reported to the node management cluster based on the timer 2.
[0114] The second function of the timer 1 in the computing node is to monitor all target virtual disks with the minimum performance guarantee function enabled, obtain a first current resource allocation value of the target virtual disk, and compare the first current resource allocation value with the resource guarantee value received from the node management cluster. If it is detected that the first current resource allocation value is less than the resource guarantee value, the target virtual disk is taken as a virtual disk to be analyzed, and resource allocation exception information containing the virtual disk to be analyzed and the first current resource allocation value is generated. A preset timer is also set in the computing node, which can be the above-mentioned timer 2 or other timers. The preset time of the preset timer is, for example, 5 seconds. When the preset timer reaches the preset time, the computing node reports the resource allocation exception information to the node management cluster. The node management cluster determines whether to send a resource reallocation instruction to the computing node according to the resource allocation exception information.
[0115] When the computing node receives the resource reallocation instruction, the timer 1 is used to re-obtain the second current resource allocation value of the other virtual disks, the other virtual disks are evaluated and analyzed, and it is determined whether the current resource of the other virtual disks exceeds the corresponding resource allocation value by comparing the second current resource allocation value with the resource allocation value received from the node management cluster. The other virtual disks are virtual disks that are not set with the minimum performance guarantee function, that is, virtual disks other than the target virtual disks in the second preset number of virtual disks.
[0116] According to the analysis result, the resource of the other virtual disks is released, and the released resource is allocated to the virtual disk to be analyzed, for example, the virtual disk occupying less resource no longer occupies the resource, the virtual disk occupying more resource releases part of the resource, and the released resource is allocated to the virtual disk to be analyzed, so as to guarantee the running of the key business, thereby realizing the performance monitoring of all virtual disks and the reasonable allocation of resources. As shown in FIG. 6, after the computing node receives the resource reallocation instruction sent by the node management cluster, all virtual disks with business are evaluated and analyzed, and the virtual disk needing to release resource is inhibited according to the evaluation result, and the flow limiter is used to realize the inhibition action. Figure 2
[0117] In addition, it should be noted that the resource reallocation may not be completed in one step, and the step of "releasing the resource of the other virtual disks and allocating the released resource to the virtual disk to be analyzed according to the second current resource allocation value and the resource allocation value" will be repeatedly executed until the current resource allocation value of the virtual disk to be analyzed is greater than or equal to the corresponding resource guarantee value. If the current resource allocation value of the virtual disk to be analyzed cannot be greater than or equal to the corresponding resource guarantee value, it means that the multi-control storage system has no surplus resource to coordinate or exceeds the adjustment range, and the current resource allocation value of the virtual disk to be analyzed is increased as much as possible.
[0118] In the embodiment, the computing node monitors whether the target virtual disk of the key service meets the resource guarantee value, and when the target virtual disk is insufficient in resources, the other virtual disks are evaluated in resources, the virtual disk occupying more resources releases part of the resources, and the released resources are allocated to the virtual disk to be analyzed, so as to guarantee the normal operation of the key service corresponding to the virtual disk to be analyzed, and realize the performance monitoring of all virtual disks and the reasonable allocation of resources.
[0119] In some optional embodiments, according to the second current resource allocation value and the resource allocation value, the resources of the other virtual disks are released, and the released resources are allocated to the virtual disk to be analyzed, comprising:
[0120] determining a ratio of the second current resource allocation value of the other virtual disk to the corresponding resource allocation value;
[0121] the other virtual disk with the ratio greater than the second preset threshold value and less than the third preset threshold value is taken as the first virtual disk to be processed, and the second current resource allocation value of the first virtual disk to be processed is set as the resource upper limit of the first virtual disk to be processed;
[0122] the other virtual disk with the ratio greater than the third preset threshold value is taken as the second virtual disk to be processed, and a first difference between the first current resource allocation value of the virtual disk to be analyzed and the resource guarantee value is determined;
[0123] a second difference between the second current resource allocation value of the second virtual disk to be processed and the first difference is determined, and the second virtual disk to be processed is controlled to release the released resources, wherein the size of the released resources is the first difference;
[0124] the second difference is set as the resource upper limit of the second virtual disk to be processed;
[0125] the second virtual disk to be processed releasing the released resources is recorded, and the corresponding relationship between the second virtual disk to be processed releasing the released resources and the virtual disk to be analyzed obtaining the released resources is recorded.
[0126] Specifically, after the computing node receives the resource reallocation instruction, the second current resource allocation value of the other virtual disk is reacquired by using the timer 1, and the other virtual disk is evaluated and analyzed. The computing node determines the ratio of the second current resource allocation value of the other virtual disk to the corresponding resource allocation value, for example, the second current resource allocation value is the disk space size, the second current resource allocation value is 110 GB, the corresponding resource allocation value is 100 GB, and the ratio is 110%.
[0127] The second preset threshold value is, for example, a preset a%, and the value of a can be customized according to actual needs, and a is less than or equal to 100. The third preset threshold value is, for example, a preset b%, and the value of b can be customized according to actual needs, and b is greater than a and less than 120.
[0128] If the ratio of the other virtual disk is less than the second preset threshold, it is not adjusted.
[0129] If the ratio of the other virtual disk is greater than the second preset threshold and less than the third preset threshold, it is regarded as the first to-be-processed virtual disk, and a performance upper limit is set for the first to-be-processed virtual disk to prevent it from occupying more resources, for example, the second current resource allocation value of the first to-be-processed virtual disk is set to the resource upper limit of the first to-be-processed virtual disk, and the resource value of the first to-be-processed virtual disk cannot be higher than the resource upper limit, so that it cannot occupy more resources.
[0130] If the ratio of the other virtual disk is greater than the third preset threshold, it is regarded as the second to-be-processed virtual disk. A first difference between the first current resource allocation value and the resource guarantee value of the to-be-analyzed virtual disk is determined, which can be calculated by the computing node itself or obtained from the node management cluster, and the first difference represents the size of the insufficient resources of the to-be-analyzed virtual disk.
[0131] The computing node first determines a second difference between the second current resource allocation value of the second to-be-processed virtual disk and the first difference, and sets the second difference as the resource upper limit of the second to-be-processed virtual disk, so that the second to-be-processed virtual disk releases the released resources, and the size of the released resources is the first difference. The released resources are subsequently allocated to the to-be-analyzed virtual disk to guarantee the normal operation of the key service corresponding to the to-be-analyzed virtual disk. The second difference represents the size of the remaining resources of the second to-be-processed virtual disk after the released resources required by the to-be-analyzed virtual disk are released. By setting the second difference as the resource upper limit of the second to-be-processed virtual disk, it is ensured that the second to-be-processed virtual disk does not occupy more resources after releasing the resources, and it is ensured that the to-be-analyzed virtual disk obtains the required size of resources.
[0132] The second to-be-processed virtual disk that releases the released resources is recorded, and the first to-be-processed virtual disk that is set with the resource upper limit can also be recorded. At the same time, the correspondence between the second to-be-processed virtual disk that releases the released resources and the to-be-analyzed virtual disk that obtains the released resources is recorded. Through the correspondence, it can be determined which virtual disk with the minimum performance guarantee is released by the second to-be-processed virtual disk, and if there are multiple second to-be-processed virtual disks releasing resources to the same to-be-analyzed virtual disk, only the second to-be-processed virtual disk that releases the most resources needs to be recorded.
[0133] In the embodiment, the computing node performs resource evaluation on the virtual disks, determines a first to-be-processed virtual disk with less resource occupation, sets a resource upper limit for the first to-be-processed virtual disk, so that the first to-be-processed virtual disk no longer occupies more resources. A second to-be-processed virtual disk with more resource occupation is determined, and the second to-be-processed virtual disk is caused to release a first difference value of released resources and re-allocate the released resources to the to-be-analyzed virtual disk, so as to guarantee normal operation of the key service corresponding to the to-be-analyzed virtual disk, and realize reasonable allocation of resources.
[0134] In some optional embodiments, the method further includes:
[0135] In a case where the resource guarantee deletion instruction sent by the node management cluster is received, the identification information and the resource guarantee value of the target virtual disk are deleted;
[0136] The resource upper limit of the first to-be-processed virtual disk and the resource upper limit of the second to-be-processed virtual disk are deleted.
[0137] Specifically, after the minimum performance guarantee function is set, the minimum performance guarantee function can be deleted or modified by an instruction. When the minimum performance guarantee function needs to be deleted, a user can input a resource guarantee deletion instruction through a command line. After the node management cluster receives the resource guarantee deletion instruction, the identification and the resource guarantee value of the target virtual disk saved by the node management cluster are deleted, and the resource guarantee deletion instruction is forwarded to the computing node.
[0138] In a case where the resource guarantee deletion instruction sent by the node management cluster is received, the identification information and the resource guarantee value of the target virtual disk are deleted;
[0139] When the minimum performance guarantee function needs to be modified, the user can instruct the node management cluster to modify or add a target virtual disk, and the resource guarantee value of the target virtual disk can be modified. Then, the node management cluster re-determines new resource allocation values of the virtual disks according to the saved resource allocation ratio, and re-performs resource allocation on the second preset number of virtual disks. The node management cluster sends the new resource allocation values, the identification of the new target virtual disk, and the new resource guarantee value to the computing node. The computing node monitors the virtual disks according to the newly received information.
[0140] In some optional embodiments, the resource can be a capacity allocated to the virtual disk, and the computing node obtains current resource allocation values of the target virtual disk and other virtual disks, that is, obtains disk capacities of the virtual disks. The specific process can include steps A1 to A6.
[0141] Step A1, obtaining the initial capacity of the virtual disk.
[0142] Specifically, the computing node reads the current used capacity of the disk device corresponding to the virtual disk, and takes the current used capacity as the initial capacity of the virtual disk.
[0143] Step A2, the computing node monitors the IO of the virtual machine disk driver and obtains the IO information.
[0144] Specifically, the computing node monitors the IO for the virtual disk, and if there is IO, obtains the corresponding IO information, analyzes the IO composition and obtains the operation type of each IO and the data capacity value of the processed data. If the operation type is marked as add, the operation type is an operation of adding data to the virtual disk, and if the operation type is marked as remove, the operation type is an operation of deleting data from the virtual disk.
[0145] Step A3, obtaining the target capacity according to the IO information of the first IO and the initial capacity.
[0146] Specifically, the computing node determines the operation type of the first IO according to the IO information of the first IO. If the operation type is an operation of adding data to the virtual disk, the computing node adds the data capacity value to the initial capacity to obtain the target capacity, and if the operation type is an operation of deleting data from the virtual disk, the computing node subtracts the data capacity value from the initial capacity to obtain the target capacity. The target capacity represents the capacity of the virtual disk after executing the first IO.
[0147] Step A4, updating the target capacity according to the IO information of the subsequent IO.
[0148] Specifically, the computing node determines the operation type of the subsequent IO according to the IO information of the subsequent IO. If the operation type is an operation of adding data to the virtual disk, the data capacity value is added to the target capacity to obtain a new target capacity, and if the operation type is an operation of deleting data from the virtual disk, the target capacity is subtracted by the data capacity value.
[0149] Step A6, the computing node verifies the target capacity according to the verification condition.
[0150] Specifically, when the IO throughput of the multi-control storage system is higher than a configuration threshold, the computing node counts the number of IO occurrences of the virtual disk in a current time period (such as the last 1 hour) and compares the number of IO occurrences with a set IO processing threshold, which is the minimum number of IOs of the virtual disk in a time period, for example: 100, 11, … and other values that meet actual needs. If the number of IO occurrences is lower than the IO processing threshold, it means that there is a situation of missing IO statistics, and the computing node checks and corrects the target capacity. The checking and correcting process includes: the computing node reads the occupied capacity of the current virtual disk and replaces the current target capacity with the occupied capacity of the current virtual disk. According to the target capacity, the current resource allocation value of the virtual disk can be determined.
[0151] In the embodiment, the computing node determines the current resource allocation value of the virtual disk by obtaining the capacity of the virtual disk, and realizes performance monitoring and reasonable allocation of resources for all virtual disks.
[0152] The embodiment also provides a resource allocation system for implementing the above-mentioned embodiments and preferred embodiments, which has been described and will not be repeated. The system includes a node management cluster and a computing node, and a resource allocation device is deployed in the node management cluster and the computing node respectively. The node management cluster executes the resource allocation method applied to the node management cluster through the resource allocation device therein, and the computing node executes the resource allocation method applied to the computing node through the resource allocation device therein.
[0153] As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.
[0154] The embodiment provides a resource allocation device, which is deployed in a node management cluster, as shown in Figure 4 The device includes:
[0155] The virtual disk determination module 401 is configured to determine a target virtual disk and a resource guarantee value of the target virtual disk according to a resource guarantee instruction when the resource guarantee instruction is received, where the target virtual disk is a virtual disk that is preferentially guaranteed in resource allocation.
[0156] The instruction sending module 402 is configured to send a performance value obtaining instruction to a first preset number of computing nodes, where the performance value obtaining instruction is used to obtain performance values of a second preset number of virtual disks, the virtual disks are from the computing nodes, and the target virtual disk is included in the second preset number of virtual disks.
[0157] The allocation value determination module 403 is configured to determine a resource allocation ratio according to the performance values, and obtain resource allocation values of the second preset number of virtual disks according to the resource allocation ratio and the resource guarantee value, wherein the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value.
[0158] The resource allocation module 404 is configured to perform resource allocation on the second preset number of virtual disks according to the resource allocation values.
[0159] In some optional embodiments, the apparatus further includes:
[0160] The first sending module is configured to send the identification information of the target virtual disk, the resource guarantee value, and the resource allocation value to the corresponding computing node, wherein the identification information is used to determine the target virtual disk.
[0161] The determination module is configured to, in a case where the resource allocation exception information sent by the computing node is received, determine a to-be-analyzed virtual disk and a first current resource allocation value of the to-be-analyzed virtual disk in the target virtual disk according to the resource allocation exception information.
[0162] The second sending module is configured to, if the first current resource allocation value is less than the resource guarantee value of the to-be-analyzed virtual disk, send a resource reallocation instruction to the computing node, wherein the resource reallocation instruction is used to perform resource reallocation on the virtual disk.
[0163] In some optional embodiments, the allocation value determination module 403 includes:
[0164] The judgment unit is configured to judge whether the performance values of the second preset number of virtual disks have a common divisor.
[0165] The first loop unit is configured to, in a case where the common divisor exists, repeatedly divide the performance values by the common divisor until a performance value that cannot be divided by the common divisor exists, then stop, and obtain the resource allocation ratio according to the current performance value.
[0166] The second loop unit is configured to, in a case where the common divisor does not exist, repeatedly divide the performance values by a preset numerical value until the performance value is less than a first preset threshold, then stop, and obtain the resource allocation ratio according to the current performance value.
[0167] The embodiment provides a resource allocation apparatus, which is deployed in a computing node, as shown in the figure, and includes: Figure 5
[0168] The performance value acquisition module 501 is configured to, in a case where a performance value acquisition instruction sent by a node management cluster is received, acquire performance values of a second preset number of virtual disks, wherein the second preset number of virtual disks includes a target virtual disk.
[0169] The performance value sending module 502 is configured to send the performance value to the node management cluster, so that the node management cluster performs resource allocation on the second preset number of virtual disks according to the resource allocation value, wherein the resource allocation value is obtained according to the resource allocation ratio and the resource guarantee value, the resource allocation ratio is determined according to the performance value, and the resource guarantee value and the target virtual disk are determined according to the resource guarantee instruction, and the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value.
[0170] In some optional embodiments, the apparatus further comprises:
[0171] The saving module is configured to save the identification information, the resource guarantee value and the resource allocation value in a case where the identification information, the resource guarantee value and the resource allocation value of the target virtual disk sent by the node management cluster are received, wherein the identification information is used to determine the target virtual disk.
[0172] The obtaining module is configured to obtain a first current resource allocation value of the target virtual disk, and take the target virtual disk with the first current resource allocation value smaller than the resource guarantee value as the virtual disk to be analyzed.
[0173] The generating module is configured to generate resource allocation exception information containing the virtual disk to be analyzed and the first current resource allocation value of the virtual disk to be analyzed.
[0174] The third sending module is configured to send the resource allocation exception information to the node management cluster in a case where a preset timer reaches a preset time, wherein the node management cluster is used to determine whether to send a resource reallocation instruction to the computing node according to the resource allocation exception information, and the resource reallocation instruction is used to perform resource reallocation on the virtual disk.
[0175] The releasing module is configured to obtain a second current resource allocation value of the other virtual disk in a case where the resource reallocation instruction is received, release the resource of the other virtual disk according to the second current resource allocation value and the resource allocation value, and allocate the released resource to the virtual disk to be analyzed, wherein the other virtual disk is a virtual disk other than the target virtual disk in the second preset number of virtual disks.
[0176] In some optional embodiments, the releasing module comprises:
[0177] The first determining unit is configured to determine a ratio of the second current resource allocation value of the other virtual disk to the corresponding resource allocation value.
[0178] The first setting unit is configured to take the other virtual disk with the ratio greater than a second preset threshold value and smaller than a third preset threshold value as a first virtual disk to be processed, and set the second current resource allocation value of the first virtual disk to be processed as a resource upper limit of the first virtual disk to be processed.
[0179] The second determining unit is configured to determine other virtual disks with a ratio greater than a third preset threshold as second to-be-processed virtual disks, and determine a first difference between the first current resource allocation value and the resource guarantee value of the to-be-analyzed virtual disk;
[0180] The releasing unit is configured to determine a second difference between the second current resource allocation value of the second to-be-processed virtual disk and the first difference, and control the second to-be-processed virtual disk to release the released resource, wherein the size of the released resource is the first difference;
[0181] The second setting unit is configured to set the second difference as the resource upper limit of the second to-be-processed virtual disk;
[0182] The recording unit is configured to record the second to-be-processed virtual disk that releases the released resource, and record the corresponding relationship between the second to-be-processed virtual disk that releases the released resource and the to-be-analyzed virtual disk that obtains the released resource.
[0183] In some optional embodiments, the releasing module further comprises:
[0184] The first deleting unit is configured to delete the identification information and the resource guarantee value of the target virtual disk in a case where a resource guarantee deletion instruction sent by the node management cluster is received;
[0185] The second deleting unit is configured to delete the resource upper limit of the first to-be-processed virtual disk and the resource upper limit of the second to-be-processed virtual disk.
[0186] Further function descriptions of the above various modules and units are the same as those of the above corresponding embodiments, and will not be described here.
[0187] The resource allocation apparatus in the embodiment is presented in the form of a functional unit. The unit herein refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory executing one or more software or fixed programs, and / or other devices that can provide the above functions.
[0188] The embodiment of the present application further provides a computer device with the resource allocation apparatus shown in the above Figure 4 or Figure 5 .
[0189] Please refer to Figure 6 , Figure 6 is a structural schematic diagram of a computer device provided by an optional embodiment of the present application, as shown in Figure 6As shown, the computer device includes one or more processors 10, memory 20, and interfaces 30 for external devices such as a display, a keyboard or a pointing device. One or more buses 10 can be used for communication within the computer device. The various buses can be implemented using various types of bus structures, including a memory bus and a peripheral bus. The memory 20 can include read-only memory (ROM) and random access memory (RAM) (including flash memory, etc.). The RAM can store, among other things, computer program instructions. As will be understood, the computer device can include multiple processors 10 and multiple buses 10. Both the multiple buses 10 and the multiple processors 10 can be employed between the various components of the computer device. For example, the bus connecting the central processing unit (CPU) to the ROM can be implemented as a high speed bus, and the bus connecting the CPU to the RAM can be implemented as a wide, fast bus. The bus connecting the CPU to the peripherals can be implemented as an "isolated" bus, shown as a high-speed memory bus with the CPU and the peripherals being examples of devices coupled to the isolated bus. The high-speed bus can be configured to carry only memory- related commands, such as load and store instructions. Similarly, the wide, fast bus can be configured to carry instructions that are not memory-related commands. The isolated bus can be implemented, for example, using an advanced microcontroller bus architecture (AMBA) bus. The peripherals can include the display, keyboard, or pointing device, among other peripherals. Figure 6 The processor 10 is used as an example in the following description.
[0190] The processor 10 can be a central processing unit, a network processor, or a combination thereof. The processor 10 can further include an integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic device, a programmable logic array, a general array logic, or a combination thereof.
[0191] The memory 20 stores instructions that can be executed by the at least one processor 10, to cause the at least one processor 10 to perform the methods illustrated by the above embodiments.
[0192] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs, and the like for the computer device. The data storage area can store application data that can be created when the computer device is in operation. The memory 20 can include a high speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some alternative embodiments, the memory 20 can optionally include a remote memory storage device that is located remotely from the processor 10, and can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, or a combination thereof.
[0193] The memory 20 can include a volatile memory, such as a random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. The memory 20 can include a combination of the above-mentioned types of storage devices.
[0194] The computer device also includes a communication interface 30 that can be used to communicate with other devices or computer devices or a communication network.
[0195] The embodiments of the present application further provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0196] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, the operation of the computer can call or provide the method and / or technical solutions according to the present application. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file, etc. Correspondingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.
[0197] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the present application.
Claims
1. A resource allocation method characterized by, The method is applied to a node management cluster, and the method comprises: In a case where a resource guarantee instruction is received, a target virtual disk and a resource guarantee value of the target virtual disk are determined according to the resource guarantee instruction, wherein the target virtual disk is a virtual disk that is preferentially guaranteed in resource allocation; A performance value acquisition instruction is sent to a first preset number of computing nodes, wherein the performance value acquisition instruction is used to acquire performance values of a second preset number of virtual disks, the virtual disks are from the computing nodes, and the target virtual disk is included in the second preset number of virtual disks; A resource allocation proportion is determined according to the performance values, and a resource allocation value of the second preset number of virtual disks is obtained according to the resource allocation proportion and the resource guarantee value, wherein the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value; Resource allocation is performed on the second preset number of virtual disks according to the resource allocation value.
2. The method of claim 1, wherein, After the resource allocation is performed on the second preset number of virtual disks, the method further comprises: Identification information of the target virtual disk, the resource guarantee value and the resource allocation value are sent to a corresponding computing node, wherein the identification information is used to determine the target virtual disk; In a case where resource allocation exception information sent by the computing node is received, a virtual disk to be analyzed in the target virtual disk and a first current resource allocation value of the virtual disk to be analyzed are determined according to the resource allocation exception information; If the first current resource allocation value is less than the resource guarantee value of the virtual disk to be analyzed, a resource reallocation instruction is sent to the computing node, wherein the resource reallocation instruction is used to perform resource reallocation on the virtual disk.
3. The method of claim 1, wherein, The determination of the resource allocation proportion according to the performance values comprises: It is judged whether there is a common divisor of the performance values of the second preset number of virtual disks; In a case where the common divisor exists, the performance values are repeatedly divided by the common divisor until there is a performance value that cannot be divided by the common divisor, then the process is stopped, and the resource allocation proportion is obtained according to the current performance value; In a case where the common divisor does not exist, the performance values are repeatedly divided by a preset numerical value until the performance value is less than a first preset threshold, then the process is stopped, and the resource allocation proportion is obtained according to the current performance value.
4. A resource allocation method characterized by, The method is applied to a computing node, and the method comprises: In a case where a performance value acquisition instruction sent by a node management cluster is received, performance values of a second preset number of virtual disks are acquired, wherein the second preset number of virtual disks include a target virtual disk; The performance values are sent to the node management cluster, so that the node management cluster performs resource allocation on the second preset number of virtual disks according to a resource allocation value, wherein the resource allocation value is obtained according to a resource allocation proportion and a resource guarantee value, the resource allocation proportion is determined according to the performance values, the resource guarantee value and the target virtual disk are determined according to a resource guarantee instruction, and the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value.
5. The method of claim 4, wherein, The method further comprises: In a case where the identification information of the target virtual disk, the resource guarantee value and the resource allocation value sent by the node management cluster are received, the identification information, the resource guarantee value and the resource allocation value are saved, wherein the identification information is used to determine the target virtual disk; A first current resource allocation value of the target virtual disk is obtained, and a target virtual disk with a first current resource allocation value smaller than the resource guarantee value is regarded as a virtual disk to be analyzed; Resource allocation exception information containing the virtual disk to be analyzed and the first current resource allocation value of the virtual disk to be analyzed is generated; In a case where a preset timer reaches a preset time, the resource allocation exception information is sent to the node management cluster, wherein the node management cluster is used to determine whether to send a resource reallocation instruction to the computing node according to the resource allocation exception information, and the resource reallocation instruction is used to perform resource reallocation on the virtual disk; In a case where the resource reallocation instruction is received, a second current resource allocation value of other virtual disks is obtained, resources of the other virtual disks are released according to the second current resource allocation value and the resource allocation value, and the released resources are allocated to the virtual disk to be analyzed, wherein the other virtual disks are virtual disks other than the target virtual disk in the second preset number of virtual disks.
6. The method of claim 5, wherein, The releasing of the resources of the other virtual disks according to the second current resource allocation value and the resource allocation value and the allocation of the released resources to the virtual disk to be analyzed comprises: A ratio of the second current resource allocation value of the other virtual disk to the corresponding resource allocation value is determined; The other virtual disk with a ratio greater than a second preset threshold and smaller than a third preset threshold is regarded as a first virtual disk to be processed, and the second current resource allocation value of the first virtual disk to be processed is set as an upper limit of resources of the first virtual disk to be processed; The other virtual disk with a ratio greater than the third preset threshold is regarded as a second virtual disk to be processed, a first difference between the first current resource allocation value of the virtual disk to be analyzed and the resource guarantee value is determined; A second difference between the second current resource allocation value of the second virtual disk to be processed and the first difference is determined, and the second virtual disk to be processed is controlled to release the released resources, wherein the size of the released resources is the first difference; The second difference is set as an upper limit of resources of the second virtual disk to be processed; The second virtual disk to be processed releasing the released resources is recorded, and a corresponding relationship between the second virtual disk to be processed releasing the released resources and the virtual disk to be analyzed obtaining the released resources is recorded.
7. The method of claim 6, wherein, The method further comprises: In a case where a resource guarantee deletion instruction sent by the node management cluster is received, the identification information of the target virtual disk and the resource guarantee value are deleted; The upper limit of resources of the first virtual disk to be processed and the upper limit of resources of the second virtual disk to be processed are deleted.
8. A resource allocation system characterized by, The system comprises a node management cluster and a computing node; The node management cluster is configured to, in response to receiving a resource guarantee instruction, determine a target virtual disk and a resource guarantee value of the target virtual disk according to the resource guarantee instruction, wherein the target virtual disk is a virtual disk that is preferentially guaranteed in resource allocation; The node management cluster is configured to send a performance value acquisition instruction to a first preset number of the computing nodes, wherein the performance value acquisition instruction is used to acquire performance values of a second preset number of virtual disks, the virtual disks being from the computing nodes, and the target virtual disk being included in the second preset number of virtual disks; The computing nodes are configured to, in response to receiving the performance value acquisition instruction sent by the node management cluster, acquire performance values of a second preset number of virtual disks; The computing nodes are configured to send the performance values to the node management cluster; The node management cluster is configured to determine a resource allocation ratio according to the performance values, and obtain resource allocation values of the second preset number of virtual disks according to the resource allocation ratio and the resource guarantee value, wherein the resource allocation value of the target virtual disk is greater than or equal to the resource guarantee value; The node management cluster is configured to perform resource allocation on the second preset number of virtual disks according to the resource allocation values.
9. A computer device, comprising: Comprise: A memory and a processor, which are in communication connection with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the resource allocation method in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the resource allocation method in any one of claims 1 to 7.
Citation Information
Patent Citations
Application program configuration method and device, equipment and storage medium
CN117472471A
Virtual machine disk performance adjusting method, device and equipment based on SPDK and memory
CN117519604A