Resource scheduling method and device, computer equipment and storage medium
By performing pre-deduction operations in the inventory view of computing nodes, the problem of low resource scheduling efficiency under high concurrency is solved, resource availability is ensured, and system performance and resource utilization are improved.
Patent Information
- Application Number
- CN202410924054.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-10-22
AI Technical Summary
During the virtual machine creation process, the resource scheduling efficiency of computing nodes is low under high concurrency conditions, which may result in resource provisioning failure and the inability to respond to the next resource scheduling request.
By performing a pre-deduction operation in the inventory view of the target computing node, pre-occupying idle resources, and performing resource activation after the pre-deduction operation, it is ensured that the idle resources read by the scheduler are truly available resources, thereby avoiding resource shortages. The response failed.
It improves the efficiency of resource scheduling, ensures the reliability and accuracy of resource scheduling under high concurrency conditions, and improves the overall performance and resource utilization of the system.
Smart Images

Figure CN118819849A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a resource scheduling method, apparatus, computer equipment and storage medium. Background Art
[0002] Resource scheduling is involved in the creation of a virtual machine. However, the current scheduling process has the following problems, especially in high concurrency situations. The following situations are more likely to occur:
[0003] For example, computing node A is executing resource provisioning operation 1 corresponding to scheduling request 1. At the same time, based on the resource view of computing node A at the current moment (the resource view is used to display the available resources of computing node A), the scheduler determines computing node A as the target computing node for responding to scheduling request 2. However, since the available resources in the current resource view are the resources before executing resource provisioning operation 1, when computing node A executes resource provisioning operation 2 corresponding to scheduling request 2, it is likely that the resource provisioning will fail due to insufficient available resources of computing node A, so that scheduling request 2 cannot be responded to in a short time, thereby reducing the efficiency of resource scheduling. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a resource scheduling method, apparatus, computer equipment and storage medium.
[0005] In a first aspect, the present invention provides a resource scheduling method, comprising:
[0006] A target computing node is selected from a plurality of computing nodes according to a pre-received resource scheduling request; a pre-deduction operation is performed on an inventory view of the target computing node according to the resource scheduling request; and the target computing node is controlled to perform a resource activation operation to complete resource scheduling.
[0007] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0008] The resource scheduling method provided in this embodiment, after selecting the target computing node according to the resource scheduling request, directly performs a pre-deduction operation on the idle resources of the target computing node in the inventory view, and performs resource activation and other operations after the pre-deduction operation; the pre-deduction operation on the idle resources in the above embodiment is equivalent to pre-occupation of resources, and the idle resources in the inventory view after the pre-deduction operation are deducted from the actual used resources and the resources to be used (i.e., the pre-deduction resources), which are the actual available resources that are not affected by this resource scheduling request; such a setting can ensure that even in a high concurrency situation, the idle resources read by the scheduler are truly available resources, thereby avoiding the situation in the current technology that the next resource scheduling request cannot be responded to due to insufficient resources caused by the previous resource scheduling request, thereby improving the efficiency of resource scheduling.
[0009] In an optional implementation, after controlling the target computing node to perform a resource provisioning operation to complete resource scheduling, the method further includes:
[0010] When the resource provisioning operation is successfully executed, the resource view of the target computing node is updated, and the resource view is used to record the actual resource information of the target computing node.
[0011] In an optional embodiment, the method further comprises:
[0012] When the resource activation operation fails, the inventory view after the pre-deduction operation is rolled back.
[0013] In an optional implementation, selecting a target computing node from a plurality of computing nodes according to a pre-received resource scheduling request includes:
[0014] Obtain the idle resource amount of the current computing node for scheduling services; read the resource demand amount from the resource scheduling request; when the idle resource amount is greater than or equal to the resource demand amount, determine the current computing node as the target computing node.
[0015] In an optional implementation manner, obtaining the amount of idle resources of the current computing node for scheduling services includes:
[0016] Obtain an inventory view and a resource view of the current computing node; read a first idle resource amount from the inventory view, and read a second idle resource amount for resource scheduling from the resource view; select a minimum value from the first idle resource amount and the second idle resource amount, and determine the minimum value as the idle resource amount of the current computing node for scheduling services.
[0017] In the resource scheduling method provided by the present invention, the idle resource amount of the current computing node for scheduling services is determined according to the inventory view and the resource view, and then whether the current computing node is the target computing node is determined according to the idle resource amount and the resource demand amount; in this embodiment, according to the characteristic that the faulty resource is not displayed in the inventory view but displayed in the resource view, the first idle resource amount of the inventory view and the second idle resource amount of the resource view are compared, and the minimum value of the two is determined as the idle resource amount of the current computing node for scheduling services, so that the obtained idle resource amount is consistent with the actual situation, avoiding the misuse of invalid or faulty resources, and also avoiding the problem of reduced scheduling efficiency due to insufficient actual idle resources of the target computing node, thereby making the use of resources more accurate and efficient, and improving the overall performance and resource utilization of the system.
[0018] In an optional embodiment, the method further comprises:
[0019] When the inventory view and resource view fail to be obtained, the inventory view and resource view corresponding to the current computing node are initialized, and the initialized inventory view and resource view are stored.
[0020] In an optional implementation, after performing a pre-deduction operation on the inventory view of the target computing node according to the resource scheduling request, the method further includes:
[0021] Create a virtual machine based on resource scheduling requests.
[0022] In a second aspect, the present invention provides a resource scheduling device, comprising:
[0023] The selection module is used to select a target computing node from multiple computing nodes according to a pre-received resource scheduling request; the pre-deduction module is used to perform a pre-deduction operation on the inventory view of the target computing node according to the resource scheduling request; and the control module is used to control the target computing node to perform a resource activation operation to complete resource scheduling.
[0024] In a third aspect, the present invention provides a computer device, comprising:
[0025] The memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the resource scheduling method of the first aspect and any of its implementation modes by executing the computer instructions.
[0026] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the resource scheduling method of the first aspect and any of its embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0029] Figure 1 is a flowchart of a resource scheduling method provided according to an embodiment of the present disclosure;
[0030] Figure 2 is a schematic diagram of a process of selecting a target computing node according to another embodiment of the present disclosure;
[0031] Figure 3 is a structural diagram of a resource scheduling device provided according to an embodiment of the present disclosure;
[0032] Figure 4 It is a structural diagram of a computer device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0034] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0035] According to an embodiment of the present invention, a resource scheduling method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, 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.
[0036] In this embodiment, a resource scheduling method is provided, which can be used for a scheduler. Figure 1 is a flow chart of a resource scheduling method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0037] Step S101 : selecting a target computing node from a plurality of computing nodes according to a pre-received resource scheduling request.
[0038] Specifically, after receiving the resource scheduling request, the scheduler parses the resource scheduling request to obtain the resource demand corresponding to this scheduling, and selects a target computing node that can meet the resource demand from multiple computing nodes in the resource pool. The resource demand includes the demand for various resources in this scheduling. For example, the resource demand includes but is not limited to the demand for CPU resources, the demand for memory resources, the demand for hard disk resources, and the demand for network resources.
[0039] Exemplarily, the resource scheduling request may be generated during the process of creating a virtual machine or during other processes, and the scenario of generating the resource scheduling request is not limited here. The resource scheduling request may include resource demand, configuration information, network information, version information, etc.
[0040] Step S102: performing a pre-deduction operation on the inventory view of the target computing node according to the resource scheduling request.
[0041] Specifically, each computing node (including the target computing node) corresponds to two views, namely, the resource view and the inventory view. Among them, the resource view is oriented to the underlying reporting service and is used to record all resource information corresponding to the computing node, while the inventory view is oriented to the scheduling service and is only used to record the resource information corresponding to the scheduling service in the computing node. When the computing node allocates all resources to the scheduling service, the resource information in the resource view is consistent with the resource information in the inventory view; when the computing node only allocates part of the resources to the scheduling service, the resource information in the resource view includes not only the resource information in the inventory view, but also the resource information allocated to other services. By setting two views for the computing node, the business logic is decoupled. The resource view does not participate in the scheduling service and is only used to display and manage the underlying resources, while the inventory view only focuses on the pre-deduction of resources. This design not only reduces the complexity and maintenance cost of the system, but also enables different business lines to perform customized calculations based on their own needs based on the resource information displayed in the inventory view without affecting the data display of the resource view, thereby improving the flexibility and customizability of the system.
[0042] Specifically, the inventory view is only for the resource scheduling service and is the object for performing pre-deduction operations.
[0043] Specifically, after selecting the target computing node, the pre-deduction operation is performed on the inventory view of the target computing node according to the resource demand in the resource scheduling request. That is, the pre-deduction operation is performed on the idle resources recorded in the inventory view according to the demand for each resource in this scheduling. It should be noted that the inventory view includes the used resource amount and the idle resource amount, wherein the used resource amount includes the actual used resource amount and the pre-deduction resource amount.
[0044] Exemplarily, this embodiment takes memory resources as an example to schematically illustrate the pre-deduction operation of idle resources in the inventory view. For example, the resource demand is obtained by parsing the resource scheduling request, and the resource demand includes the demand for memory resources of 50G for this scheduling. Before performing the pre-deduction operation, the inventory view of the target computing node includes 200G of used memory resources and 100G of idle memory resources, wherein the used memory resources of 200G include the actual used memory resources of 200G and the pre-deduction memory resources of 0G. After performing the pre-deduction operation on the inventory view according to the resource scheduling request, the used memory resources become 250G, and the idle memory resources become 50G. In the used memory resources, the actual used memory resources are still 200G, and the pre-deduction memory resources become 50G.
[0045] Exemplarily, after the pre-deduction operation is performed, a virtual machine is created according to the resource scheduling request, that is, the virtual machine is created according to the configuration information, network information and version information in the resource scheduling request.
[0046] Step S103, controlling the target computing node to execute a resource activation operation to complete resource scheduling.
[0047] Specifically, after executing step S102, the resource provisioning service in the target computing node is called to control the target computing node to perform a resource provisioning operation according to the resource scheduling request to complete the current resource scheduling operation.
[0048] Specifically, when the target computing node is controlled to perform a resource activation operation, there are two results: successful execution of the resource activation operation and failed execution of the resource activation operation. When the resource activation operation corresponding to the resource scheduling request is successfully executed in the target computing node, in the inventory view, the pre-deducted resources are added to the original actual used resource amount as the actual used resources to complete the update of the used resource amount. When the resource activation operation corresponding to the resource scheduling request fails to execute, the inventory view after the pre-deducted operation is rolled back. Rolling back means that in the inventory view, the pre-deducted resources are added to the idle resource amount as unused resources to restore the inventory view to the view before the most recent pre-deducted operation.
[0049] Exemplarily, still taking the implementation in step S102 as an example, after executing step S102, the used memory resource amount in the inventory view is 250G, the free memory resource amount is 50G, and in the used memory resource amount, the actual used memory resource amount is 200G, and the pre-deducted memory resource amount is 50G.
[0050] After the resource activation operation is performed on the target computing node, if the resource activation is successful, indicating that the pre-deducted memory resources are used, the pre-deducted memory resources of 50G are added to the actual used memory resources as the used memory resources. At this time, the inventory view includes 250G of used memory resources and 50G of free memory resources. Of the used memory resources of 250G, the actual used memory resources are 250G (200G+50G), and the pre-deducted resources are 0G.
[0051] After the target computing node executes the resource activation operation, if the resource activation fails, it means that the pre-deducted memory resources are not used, then the pre-deducted memory resources of 50G are added to the free memory resources as unused memory resources. At this time, the inventory view includes the used memory resources of 200G and the free memory resources of 100G (50G+50G). The used memory resources of 200G include the actual used memory resources of 200G and the pre-deducted memory resources of 0G.
[0052] The resource scheduling method provided in this embodiment, after selecting the target computing node according to the resource scheduling request, directly performs a pre-deduction operation on the idle resources of the target computing node in the inventory view, and performs resource activation and other operations after the pre-deduction operation; the pre-deduction operation on the idle resources in the above embodiment is equivalent to pre-occupation of resources, and the idle resources in the inventory view after the pre-deduction operation are deducted from the actual used resources and the resources to be used (i.e., the pre-deduction resources), which are the actual available resources that are not affected by this resource scheduling request; such a setting can ensure that even in a high concurrency situation, the idle resources read by the scheduler are truly available resources, thereby avoiding the situation in the current technology that the next resource scheduling request cannot be responded to due to insufficient resources caused by the previous resource scheduling request, thereby improving the efficiency of resource scheduling.
[0053] In the resource scheduling process, sometimes there will be resource failures. Since the inventory view is only for scheduling services, when a computing node has a resource failure, the failed resource exists in the free resources of the inventory view as an available resource, causing the inventory view to be inconsistent with the actual situation. In this case, if the scheduler still selects the target computing node based on the inventory view, the resource provisioning will fail due to insufficient actual resources of the computing node, thereby increasing the complexity of scheduling and reducing the efficiency of resource provisioning.
[0054] To avoid the above situation, in an optional embodiment, a method for selecting a target computing node from multiple computing nodes according to a pre-received resource scheduling request is as follows: Figure 2 As shown, including:
[0055] Step S201, obtaining the amount of idle resources of the current computing node for scheduling services.
[0056] Specifically, after receiving the resource scheduling request, the scheduler needs to select a target computing node that can meet the resource demand from all computing nodes corresponding to at least one cluster. Exemplarily, the computing nodes in each cluster can be read in sequence according to the cluster order, or the computing nodes can be read in sequence from the cluster with a high priority according to the cluster priority. The computing node read is the current computing node, and the computing node is a virtual server.
[0057] Specifically, the above step S201 includes:
[0058] Step S2011, obtaining the inventory view and resource view of the current computing node.
[0059] Specifically, the inventory view and resource view corresponding to the current computing node are read from the memory of the scheduler. The resource view includes the actual used resources, the actual idle resources and the faulty resources. From the resource view, the used resource amount for the scheduling service, the idle resource amount for the scheduling service and the resource amount that fails after being allocated to the scheduling service can also be obtained. For a detailed description of the inventory view, please refer to the relevant description of step S102, which will not be repeated here.
[0060] Specifically, when a resource failure occurs in a computing node, the resource view forms a faulty resource based on the reported faulty resource information, and determines the faulty resource as an unavailable resource. The faulty resource information includes but is not limited to the faulty resource type, the faulty resource size, etc. It is precisely because the faulty resource is displayed in the resource view but not in the inventory resource, therefore, this embodiment determines the amount of idle resources used by the current computing node for scheduling services based on the resource view and the inventory view.
[0061] For example, still taking memory resources as an example, in the inventory view of the current computing node, the amount of used memory resources is 200G, and the amount of free memory resources is 300G. In the resource view of the current computing node (the following resource information is the information read from the resource view of the current computing node for resource scheduling, and the resource information corresponding to other services is not described in detail here), the amount of used memory resources is 200G, the amount of free memory resources is 200G, and the amount of faulty resources is 100G.
[0062] Step S2012: read the first idle resource amount from the inventory view, and read the second idle resource amount used for resource scheduling from the resource view.
[0063] Specifically, since the faulty resources are displayed as unavailable resources in the resource view and as available resources in the inventory view, if the current computing node has not experienced resource failure before, then the first idle resource amount is equal to the second idle resource amount; if the current computing node has experienced resource failure before, then the first idle resource amount must be greater than the second idle resource amount, and the difference between the first idle resource amount and the second idle resource amount is the faulty resource amount.
[0064] Exemplarily, in the embodiment corresponding to step S2011, the first idle resource amount is 300G, and the second idle resource amount is 200G.
[0065] Step S2013: Select a minimum value from the first idle resource amount and the second idle resource amount, and determine the minimum value as the idle resource amount used by the current computing node for scheduling services.
[0066] Specifically, the idle resource amount is the sum of the idle resource amounts corresponding to each resource.
[0067] Specifically, when the current computing node has no resource failure, the first idle resource amount and the second idle resource amount are equal, and both are the actual idle resource amounts that the current computing node can use for scheduling services. Therefore, the minimum value is the first idle resource amount (or the second idle resource amount). When the current computing node has a resource failure, since the first idle resource amount includes the amount of faulty resources, which is inconsistent with the actual situation, and the second idle resource amount is the actual amount of resources that the current computing node can use for scheduling services after deducting the faulty resources, the minimum value of the first idle resource amount and the second idle resource amount, that is, the second idle resource amount, is used as the idle resource amount of the current computing node for scheduling services.
[0068] Exemplarily, in the embodiment corresponding to step S2012, the minimum value of the first idle resource amount 300G and the second idle resource amount 200G is the second idle resource amount, and therefore, the idle resource amount available for scheduling services in the current computing node is 200G.
[0069] Step S202: Read resource requirements from the resource scheduling request.
[0070] Specifically, resource demand is the total demand for various resources in this scheduling.
[0071] Exemplarily, the resource demand includes, but is not limited to, the demand for CPU resources, the demand for memory resources, the demand for hard disk resources, and the demand for network resources.
[0072] Step S203: when the amount of idle resources is greater than or equal to the amount of required resources, the current computing node is determined as the target computing node.
[0073] Specifically, the idle amount of each resource is compared with the resource demand of the corresponding resource. When the idle amount of all resources is greater than or equal to the resource demand of the corresponding resource (that is, when the idle amount is greater than or equal to the resource demand), it means that the resources of the current computing node are sufficient and can fully meet the resource demand of this scheduling. At this time, the current computing node can be determined as the target computing node. Conversely, as long as there is at least one resource whose idle amount is less than the demand of the corresponding resource, it means that the current computing node is insufficient in resources. Then, continue to follow Figure 2 The steps in the flowchart select a target compute node from the remaining compute nodes.
[0074] Exemplarily, corresponding to the resource demand, the idle resource includes but is not limited to idle CPU resources, idle memory resources, idle hard disk resources, and idle network resources. When judging whether the idle resource is greater than or equal to the resource demand, it is necessary to compare the idle CPU resources with the CPU resource demand of this scheduling, the idle memory resources with the memory resource demand of this scheduling, the idle hard disk resources with the hard disk resource demand of this scheduling, and the idle network resources with the network resource demand of this scheduling; when the comparison result of each item is that the former is greater than or equal to the latter, the current computing node can be determined as the target computing node. If at least one of the comparison results of the above four items is that the former is less than the latter, it is necessary to select the target computing node from other computing nodes.
[0075] In the resource scheduling method provided by the present invention, the idle resource amount of the current computing node for scheduling services is determined according to the inventory view and the resource view, and then whether the current computing node is the target computing node is determined according to the idle resource amount and the resource demand amount; in this embodiment, according to the characteristic that the faulty resource is not displayed in the inventory view but displayed in the resource view, the first idle resource amount of the inventory view and the second idle resource amount of the resource view are compared, and the minimum value of the two is determined as the idle resource amount of the current computing node for scheduling services, so that the obtained idle resource amount is consistent with the actual situation, avoiding the misuse of invalid or faulty resources, and also avoiding the problem of reduced scheduling efficiency due to insufficient actual idle resources of the target computing node, thereby making the use of resources more accurate and efficient, and improving the overall performance and resource utilization of the system.
[0076] In an optional embodiment, the method further comprises:
[0077] When the inventory view and resource view fail to be obtained, the inventory view and resource view corresponding to the current computing node are initialized, and the initialized inventory view and resource view are stored.
[0078] Specifically, the inventory view and resource view of the computing node are stored in the scheduler's memory after successfully accessing the current computing node and completing the initialization of the inventory view and resource view. Therefore, when the inventory view and resource view fail to be obtained, it means that the scheduler has not successfully accessed the current computing node. At this time, the scheduler needs to re-access the current computing node and initialize the inventory view and resource view of the current computing node. Initialization is to generate a resource view based on the actual resource information of the current computing node, and generate an inventory view based on the resource information allocated by the current computing node for the scheduling service. After the initialization is completed, the inventory view and resource view are stored in the scheduler's memory. In the subsequent resource scheduling process, the inventory view and resource view are updated through operations such as opening and deducting various resources.
[0079] In an optional embodiment, after step S103, the method further includes: when the resource provisioning operation is successfully executed, updating the resource view of the target computing node.
[0080] Specifically, the resource view is used to record the actual resource information of the target computing node.
[0081] Specifically, when the resource opening operation is successfully executed, it means that the resource scheduling request is successfully responded to. At this time, the used resource information is reported to the resource view, and the resource view is deducted (i.e. updated), so that the deduction operation in the inventory view and the resource view for this resource scheduling request is consistent.
[0082] Exemplarily, still taking memory resources as an example, this embodiment determines computing node A as the target computing node, and the memory requirement is 100G. The following is an exemplary description of the change process of the inventory view and the resource view during the resource scheduling process.
[0083] Before the pre-deduction operation is performed, the inventory view of the target computing node A includes: total memory resources 500G, used memory resources 200G (actual used memory resources 200G, pre-deduction resources 0G), free memory resources 300G. The resource view of the target computing node A includes: total memory resources 1000G, memory resources used for scheduling services 500G (used memory resources 200G, free memory resources 200G, fault resources 100G).
[0084] After the pre-deduction operation is performed, the inventory view of the target computing node A includes: total memory resources 500G, used memory resources 300G (actually used memory resources 200G, pre-deduction resources 100G), free memory resources 200G. The resource view of the target computing node A remains unchanged.
[0085] After the resource activation operation is successfully executed, the inventory view of the target computing node A includes: total memory resources 500G, used memory resources 300G (actually used memory resources 300G, pre-deducted resources 0G), free memory resources 200G. The resource view of the target computing node A includes: total memory resources 1000G, memory resources for scheduling services 500G (used memory resources 300G, free memory resources 100G, faulty resources 100G).
[0086] After the resource provisioning operation fails, the inventory view and resource view of the target computing node A remain consistent with those before the pre-deduction operation is performed.
[0087] In this embodiment, a resource scheduling device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0088] This embodiment provides a resource scheduling device, such as Figure 3 As shown, including:
[0089] The selection module 301 is used to select a target computing node from multiple computing nodes according to a pre-received resource scheduling request.
[0090] The pre-deduction module 302 is used to perform a pre-deduction operation on the inventory view of the target computing node according to the resource scheduling request.
[0091] The control module 303 is used to control the target computing node to perform resource provisioning operations to complete resource scheduling.
[0092] In some optional implementations, after the control module 303, the device further includes:
[0093] The update module is used to update the resource view of the target computing node when the resource provisioning operation is successfully executed. The resource view is used to record the actual resource information of the target computing node.
[0094] In some optional embodiments, the device further comprises:
[0095] The rollback module is used to roll back the inventory view after the pre-deduction operation when the resource activation operation fails.
[0096] In some optional implementations, the selection module 301 includes:
[0097] The acquisition submodule is used to obtain the amount of idle resources used by the current computing node for scheduling services; the reading submodule is used to read the resource demand from the resource scheduling request; the determination submodule is used to determine the current computing node as the target computing node when the amount of idle resources is greater than or equal to the resource demand.
[0098] In some optional implementations, the acquisition submodule includes:
[0099] An acquisition unit is used to acquire an inventory view and a resource view of a current computing node; a reading unit is used to read a first idle resource amount from the inventory view and a second idle resource amount for resource scheduling from the resource view; a determination unit is used to select a minimum value from the first idle resource amount and the second idle resource amount, and determine the minimum value as the idle resource amount of the current computing node for scheduling services.
[0100] In some optional implementations, the acquisition submodule further includes:
[0101] The initialization unit is used to initialize the inventory view and resource view corresponding to the current computing node when the inventory view and resource view acquisition fails, and store the initialized inventory view and resource view.
[0102] In some optional embodiments, after the pre-deduction module 302, the apparatus further includes:
[0103] The creation module is used to create a virtual machine according to a resource scheduling request.
[0104] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0105] The resource scheduling device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0106] The embodiment of the present invention also provides a computer device having the above Figure 3 The resource scheduling device shown.
[0107] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0108] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0109] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0110] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0111] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0112] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0113] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or 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 a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0114] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0115] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A resource scheduling method, It is characterized in that include: Selecting a target computing node from a plurality of computing nodes according to a pre-received resource scheduling request; According to the resource scheduling request, pre-deduction operation is performed on the inventory view of the target computing node; The target computing node is controlled to execute a resource provisioning operation to complete resource scheduling.
2. The method according to claim 1, It is characterized in that After controlling the target computing node to perform a resource provisioning operation to complete resource scheduling, the method further includes: When the resource provisioning operation is successfully executed, the resource view of the target computing node is updated, and the resource view is used to record the actual resource information of the target computing node.
3. The method according to claim 1 or 2, It is characterized in that The method further comprises: When the resource activation operation fails to be executed, the inventory view after the pre-deduction operation is rolled back.
4. The method according to claim 1 or 2, It is characterized in that The selecting a target computing node from a plurality of computing nodes according to the pre-received resource scheduling request includes: Get the amount of idle resources of the current computing node for scheduling services; Reading resource demand from the resource scheduling request; When the amount of idle resources is greater than or equal to the required amount of resources, the current computing node is determined as the target computing node.
5. The method according to claim 4, It is characterized in that The obtaining of the idle resource amount of the current computing node for scheduling services includes: Obtaining an inventory view and a resource view of the current computing node; Reading a first idle resource amount from the inventory view, and reading a second idle resource amount for resource scheduling from the resource view; A minimum value is selected from the first idle resource amount and the second idle resource amount, and the minimum value is determined as the idle resource amount of the current computing node for scheduling services.
6. The method according to claim 5, It is characterized in that The method further comprises: When the inventory view and the resource view fail to be acquired, the inventory view and the resource view corresponding to the current computing node are initialized, and the initialized inventory view and resource view are stored.
7. The method according to claim 1, It is characterized in that After performing a pre-deduction operation on the inventory view of the target computing node according to the resource scheduling request, the method further includes: A virtual machine is created according to the resource scheduling request.
8. A resource scheduling device, It is characterized in that include: A selection module, used for selecting a target computing node from a plurality of computing nodes according to a pre-received resource scheduling request; A pre-deduction module, used for performing a pre-deduction operation on the inventory view of the target computing node according to the resource scheduling request; The control module is used to control the target computing node to perform resource provisioning operations to complete resource scheduling.
9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the resource scheduling method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the resource scheduling method according to any one of claims 1 to 7.
