Resource Scheduling System and Method
By uniformly managing the cloud resource usage rights of the cloud resource pool on the online scheduling node, the resource conflict problem between the online scheduling node and the offline scheduling node is solved, the resource scheduling efficiency and user experience of the cloud platform are improved, and additional overhead is reduced.
Patent Information
- Application Number
- CN202010924142.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-04
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2040-09-04
AI Technical Summary
When online scheduling nodes and offline scheduling nodes schedule virtual machine resources on the cloud platform, resource conflicts are prone to occur, affecting the creation efficiency and user experience of the instances to be created.
By uniformly managing the cloud resource usage rights in the cloud resource pool, offline scheduling nodes need to request permission from the online scheduling node when they need to use cloud resources on the host, and they cannot use the resources on the host when they refuse permission to avoid resource conflicts.
It effectively avoids resource scheduling conflicts, improves the creation efficiency of instances to be created, improves the user experience of the cloud platform, and reduces the additional overhead caused by the introduction of third-party components.
Smart Images

Figure CN114138400B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of cloud services, and particularly to a resource scheduling system and method. Background Art
[0002] In recent years, the virtual machine consolidation technology has received great attention from major cloud service providers. The virtual machine consolidation technology can achieve the purpose of resource configuration optimization such as eliminating hot spots, sorting out resource fragments, and controlling the power consumption of physical machines (PMs) by rescheduling the allocated virtual machine resources. The virtual machine resources refer to the cloud resources on the host used to create virtual machines.
[0003] Generally, an online scheduling node and an offline scheduling node are deployed in a cloud platform. The online scheduling node is used to receive an instance creation request and schedule virtual machine resources for the instance to be created according to the instance creation request, that is, allocate cloud resources on the host for the instance to be created. The offline scheduling node is used to reschedule virtual machine resources for the created instance when it is determined that the virtual machine resources of the created instance need to be reallocated.
[0004] However, since both the online scheduling node and the offline scheduling node need to schedule virtual machine resources, there will be a problem of scheduling conflicts. Summary of the Invention
[0005] This application provides a resource scheduling system and method, which can solve the problem of scheduling conflicts that occur when both the online scheduling node and the offline scheduling node need to schedule virtual machine resources.
[0006] In a first aspect, this application provides a resource scheduling system, including an offline scheduling node and an online scheduling node. The offline scheduling node is used to confirm the first cloud resources on the first host to be allocated to the first instance, and request the right to use the first cloud resources on the first host from the online scheduling node, where the first instance is a created instance; the online scheduling node is used to receive an online scheduling request for allocating cloud resources to a second instance, confirm the second cloud resources on the first host to be allocated to the second instance according to the online scheduling request, and refuse to provide the right to use the first cloud resources on the first host to the offline scheduling node when it is confirmed that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, where the second instance is an instance to be created.
[0007] In the resource scheduling system provided by this application, the online scheduling node uniformly manages the right to use the cloud resources in the cloud resource pool managed by the resource scheduling system. When the offline scheduling node needs to use the cloud resources on a host, it needs to first request the right to use the cloud resources on this host from the online scheduling node. And when the online scheduling node refuses to provide the offline scheduling node with the right to use the cloud resources on this host, the offline scheduling node cannot use the cloud resources on this host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host between the online scheduling node and the offline scheduling node, ensure the effective scheduling of cloud resources on the host by the resource scheduling system, ensure the creation efficiency of the instance to be created, and effectively improve the user experience of the cloud platform. Moreover, by the online scheduling node managing the right to use the cloud resources in the cloud resource pool of the resource scheduling system, there is no need to introduce an additional third-party component in this resource scheduling system, which can reduce the additional overhead caused by introducing this third-party component.
[0008] Optionally, the offline scheduling node is further configured to, after the right to use is refused, re-confirm the third cloud resources on the second host to be allocated to the first instance, and request the right to use the third cloud resources on the second host from the online scheduling node, so as to obtain the right to use the cloud resources to be re-allocated to the first instance, and achieve the optimal resource configuration of the first instance.
[0009] Optionally, the online scheduling node is further configured to, when it is confirmed that there is no resource conflict between the first cloud resources and the second cloud resources on the first host, provide the offline scheduling node with the right to use the first cloud resources on the first host. In this way, the offline scheduling node can obtain the right to use the first cloud resources on the first host, and can allocate the first cloud resources on the first host to the first instance, so as to relocate the first instance to the first cloud resources on the first host, and achieve the optimal resource configuration of the created instance.
[0010] In one implementable manner, the online scheduling node can manage the usage rights of cloud resources in the cloud resource pool managed by the resource scheduling system through a resource information table. The online scheduling node records the resource information table of the cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resources. Among them, when the occupancy status indicated by the resource information table of the cloud resources to be allocated is occupied, it means that there is a resource conflict for the cloud resources. Correspondingly, the implementation manner for the online scheduling node to manage the usage rights of cloud resources according to the resource information table can be: when the online scheduling node receives a request from the offline scheduling node for the usage rights of the first cloud resource on the first host, the online scheduling node queries the occupancy status of the first cloud resource on the first host in the resource information table, and when the occupancy status of the first cloud resource on the first host is occupied, it is determined that there is a resource conflict for the first cloud resource on the first host, or when the occupancy status of the first cloud resource on the first host is unoccupied, it is determined that there is no resource conflict for the first cloud resource on the first host. And, this implementation manner further includes: after the online scheduling node receives an online scheduling request to allocate cloud resources to a second instance, it determines the cloud resources on the host to which the second instance needs to be allocated among the cloud resources on all hosts whose occupancy status recorded in the resource information table is unoccupied.
[0011] Moreover, the resource information table can be maintained by the online scheduling node. In one implementable manner, the online scheduling node can update the occupancy status of the cloud resources in the cloud resource pool in the resource information table when the occupancy status of the cloud resources changes. For example, the online scheduling node is further configured to, after providing the usage rights of the first cloud resource on the first host to the offline scheduling node, mark the occupancy status of the first cloud resource on the first host as occupied in the resource information table.
[0012] Since the cloud resources in the cloud resource pool managed by the resource scheduling system are uniformly scheduled by the online scheduling node, the offline scheduling node cannot understand the occupancy status of all cloud resources in the cloud resource pool based on the scheduling situation of the cloud resources on the host by the offline scheduling node. Therefore, the online scheduling node is further configured to send the resource information table to the offline scheduling node.
[0013] In addition, after the offline scheduling node determines the cloud resources to be scheduled to the first instance, when the offline scheduling node needs to determine the cloud resources to be scheduled to other instances, the occupancy status of the cloud resources scheduled to the first instance may not have been updated in time in the resource information table recorded by the offline scheduling node. At this time, in order to avoid conflicts between the cloud resources scheduled by the offline scheduling node to other instances and the cloud resources scheduled to the first instance, the offline scheduling node is further configured to, after the online scheduling node provides the right to use the first cloud resource on the first host to the offline scheduling node, allocate the first cloud resource on the first host to the first instance, and mark the occupancy status of the first cloud resource on the first host as occupied in the resource information table recorded by the offline scheduling node. The resource information table at least indicates the occupancy status of the cloud resources. In this way, it is possible to avoid resource conflicts between the cloud resources scheduled by the offline scheduling node to different created instances, thereby ensuring the scheduling efficiency of the offline scheduling.
[0014] In a second aspect, the present application provides a resource scheduling system, including an online scheduling node and an offline scheduling node. The online scheduling node is configured to receive an online scheduling request for requesting to allocate cloud resources to a second instance, confirm the second cloud resource on the first host to be allocated to the second instance according to the online scheduling request, and request the right to use the second cloud resource on the first host from the offline scheduling node, where the second instance is an instance to be created; the offline scheduling node is configured to confirm the first cloud resource on the first host to be reallocated to the first instance, and reject providing the right to use the second cloud resource on the first host to the online scheduling node when it is confirmed that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, where the first instance is a created instance.
[0015] In the resource scheduling system provided by the present application, the offline scheduling node uniformly manages the right to use the cloud resources in the cloud resource pool managed by the resource scheduling system. When the online scheduling node needs to use the cloud resources on a host, it needs to first request the right to use the cloud resources on the host from the offline scheduling node. And when the offline scheduling node refuses to provide the right to use the cloud resources on the host to the online scheduling node, the online scheduling node cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of the cloud resources on the host between the online scheduling node and the offline scheduling node, and ensure the effective scheduling of the cloud resources on the host by the resource scheduling system. Moreover, by using the offline scheduling node to manage the right to use the cloud resources in the cloud resource pool of the resource scheduling system, there is no need to introduce an additional third-party component in the resource scheduling system, which can reduce the additional overhead caused by introducing the third-party component.
[0016] Optionally, the online scheduling node is further configured to, after the right to use is refused, reconfirm the third cloud resource on the second host to be allocated to the second instance, and request the right to use the third cloud resource on the second host from the offline scheduling node.
[0017] Optionally, the offline scheduling node is further configured to provide the online scheduling node with the right to use the second cloud resource on the first host when it is confirmed that there is no resource conflict between the first cloud resource and the second cloud resource on the first host.
[0018] Optionally, the offline scheduling node records a resource information table of the cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resources;
[0019] Optionally, after providing the online scheduling node with the right to use the second cloud resource on the first host, the offline scheduling node marks the occupancy status of the second cloud resource on the first host as occupied in the resource information table.
[0020] Optionally, the offline scheduling node is further configured to send the resource information table to the online scheduling node.
[0021] Optionally, after the offline scheduling node provides the online scheduling node with the right to use the second cloud resource on the first host, the online scheduling node allocates the second cloud resource on the first host to the second instance, and in the resource information table recorded by the online scheduling node, marks the occupancy status of the second cloud resource on the first host as occupied, and the resource information table at least indicates the occupancy status of the cloud resources.
[0022] In a third aspect, the present application provides a resource scheduling method, which is applied to the resource scheduling system provided in the first aspect. The resource scheduling system includes: an offline scheduling node and an online scheduling node. The method includes: the offline scheduling node confirms the first cloud resource on the first host that needs to be reallocated to the first instance, and requests the online scheduling node for the right to use the first cloud resource on the first host, where the first instance is a created instance; the online scheduling node receives an online scheduling request for allocating cloud resources to the second instance, confirms the second cloud resource on the first host that needs to be allocated to the second instance according to the online scheduling request, and refuses to provide the online scheduling node with the right to use the first cloud resource on the first host when it is confirmed that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, and the second instance is a to-be-created instance.
[0023] Optionally, the resource scheduling method further includes: after the right to use is refused, the offline scheduling node reconfirms the third cloud resource on the second host that needs to be allocated to the first instance, and requests the online scheduling node for the right to use the third cloud resource on the second host.
[0024] Optionally, the resource scheduling method further includes: when it is confirmed that there is no resource conflict between the first cloud resource and the second cloud resource on the first host, the online scheduling node provides the offline scheduling node with the right to use the first cloud resource on the first host.
[0025] Optionally, the online scheduling node records a resource information table of cloud resources in the cloud resource pool managed by the resource scheduling method, and the resource information table indicates at least the occupancy status of the cloud resources. Correspondingly, the resource scheduling method further includes: after the online scheduling node provides the usage right of the first cloud resource on the first host to the offline scheduling node, marking the occupancy status of the first cloud resource on the first host as occupied in the resource information table.
[0026] Optionally, the resource scheduling method further includes: the online scheduling node sending the resource information table to the offline scheduling node.
[0027] Optionally, the resource scheduling method further includes: after the online scheduling node provides the usage right of the first cloud resource on the first host to the offline scheduling node, the offline scheduling node allocates the first cloud resource on the first host to the first instance, and in the resource information table recorded by the offline scheduling node, marking the occupancy status of the first cloud resource on the first host as occupied, and the resource information table indicates at least the occupancy status of the cloud resources.
[0028] In a fourth aspect, the present application provides a resource scheduling method, which is applied to the resource scheduling system provided in the second aspect. The resource scheduling system includes: an online scheduling node and an offline scheduling node. The method includes: the online scheduling node receives an online scheduling request for allocating cloud resources to a second instance, confirms the second cloud resource on the first host to be allocated to the second instance according to the online scheduling request, and requests the usage right of the second cloud resource on the first host from the offline scheduling node, where the second instance is an instance to be created; the offline scheduling node confirms the first cloud resource on the first host to be reallocated to the first instance, and in the case of confirming that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, refuses to provide the usage right of the second cloud resource on the first host to the online scheduling node, where the first instance is an already created instance.
[0029] Optionally, the resource scheduling method further includes: after the usage right is refused, the online scheduling node reconfirms the third cloud resource on the second host to be allocated to the second instance, and requests the usage right of the third cloud resource on the second host from the offline scheduling node.
[0030] Optionally, the resource scheduling method further includes: in the case of confirming that there is no resource conflict between the first cloud resource and the second cloud resource on the first host, the offline scheduling node provides the usage right of the second cloud resource on the first host to the online scheduling node.
[0031] Optionally, the offline scheduling node records a resource information table of cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resources. Correspondingly, the resource scheduling method further includes: after the offline scheduling node provides the right to use the second cloud resource on the first host to the online scheduling node, marking the occupancy status of the second cloud resource on the first host as occupied in the resource information table.
[0032] Optionally, the resource scheduling method further includes: the offline scheduling node sending the resource information table to the online scheduling node.
[0033] Optionally, the resource scheduling method further includes: after the offline scheduling node provides the right to use the second cloud resource on the first host to the online scheduling node, the online scheduling node allocates the second cloud resource on the first host to the second instance, and in the resource information table recorded by the online scheduling node, marking the occupancy status of the second cloud resource on the first host as occupied, and the resource information table at least indicates the occupancy status of the cloud resources.
[0034] In a fifth aspect, the present application further provides an online scheduling node. The online scheduling node is used to receive an online scheduling request for requesting to allocate cloud resources to a second instance, confirm the second cloud resource on the first host that needs to be allocated to the second instance according to the online scheduling request, and reject providing the right to use the first cloud resource on the first host to the offline scheduling node when it is confirmed that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, and the second instance is an instance to be created.
[0035] Optionally, the online scheduling node is further used to provide the right to use the first cloud resource on the first host to the offline scheduling node when it is confirmed that there is no resource conflict between the first cloud resource and the second cloud resource on the first host.
[0036] Optionally, the online scheduling node records a resource information table of cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resources. Correspondingly, the online scheduling node is further used to, after providing the right to use the first cloud resource on the first host to the offline scheduling node, mark the occupancy status of the first cloud resource on the first host as occupied in the resource information table.
[0037] And, the online scheduling node is further used to send the resource information table to the offline scheduling node.
[0038] In a sixth aspect, the present application further provides an offline scheduling node. The offline scheduling node is used to confirm the first cloud resource on the first host that needs to be reallocated to the first instance, and request the right to use the first cloud resource on the first host from the online scheduling node, and the first instance is an already created instance.
[0039] Optionally, the offline scheduling node is further configured to, after the right of use is rejected, re-confirm the third cloud resource on the second host to be allocated to the first instance, and request the right of use of the third cloud resource on the second host from the online scheduling node.
[0040] Optionally, the offline scheduling node is further configured to, after the online scheduling node provides the right of use of the first cloud resource on the first host to the offline scheduling node, allocate the first cloud resource on the first host to the first instance, and mark the occupancy status of the first cloud resource on the first host as occupied in the resource information table recorded by the offline scheduling node. The resource information table at least indicates the occupancy status of the cloud resource.
[0041] In a seventh aspect, the present application further provides an online scheduling node. The online scheduling node is configured to receive an online scheduling request for requesting to allocate cloud resources to a second instance, confirm the second cloud resource on the first host to be allocated to the second instance according to the online scheduling request, and request the right of use of the second cloud resource on the first host from the offline scheduling node, where the second instance is an instance to be created;
[0042] Optionally, the online scheduling node is further configured to, after the right of use is rejected, re-confirm the third cloud resource on the second host to be allocated to the second instance, and request the right of use of the third cloud resource on the second host from the offline scheduling node.
[0043] Optionally, the online scheduling node is further configured to, after the offline scheduling node provides the right of use of the second cloud resource on the first host to the online scheduling node, allocate the second cloud resource on the first host to the second instance, and mark the occupancy status of the second cloud resource on the first host as occupied in the resource information table recorded by the online scheduling node. The resource information table at least indicates the occupancy status of the cloud resource.
[0044] In an eighth aspect, the present application further provides an offline scheduling node. The offline scheduling node is configured to confirm the first cloud resource on the first host to be re-allocated to the first instance, and reject providing the right of use of the second cloud resource on the first host to the online scheduling node when it is confirmed that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, where the first instance is an already created instance.
[0045] Optionally, the offline scheduling node is further configured to provide the right of use of the second cloud resource on the first host to the online scheduling node when it is confirmed that there is no resource conflict between the first cloud resource and the second cloud resource on the first host.
[0046] Optionally, the offline scheduling node records a resource information table of the cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resource;
[0047] Optionally, the offline scheduling node is further configured to mark the occupancy status of the second cloud resource on the first host as occupied in the resource information table after providing the right to use the second cloud resource on the first host to the online scheduling node.
[0048] Optionally, the offline scheduling node is further configured to send the resource information table to the online scheduling node.
[0049] In a ninth aspect, the present application provides a computer device, including: a processor and a memory, where a computer program is stored in the memory, and when the processor executes the computer program, the computer device implements the functions of the online scheduling node provided in the fifth aspect.
[0050] In a tenth aspect, the present application provides a computer device, including: a processor and a memory, where a computer program is stored in the memory, and when the processor executes the computer program, the computer device implements the functions of the offline scheduling node provided in the sixth aspect.
[0051] In an eleventh aspect, the present application provides a computer device, including: a processor and a memory, where a computer program is stored in the memory, and when the processor executes the computer program, the computer device implements the functions of the online scheduling node provided in the seventh aspect.
[0052] In a twelfth aspect, the present application provides a computer device, including: a processor and a memory, where a computer program is stored in the memory, and when the processor executes the computer program, the computer device implements the functions of the offline scheduling node provided in the eighth aspect.
[0053] In a thirteenth aspect, a storage medium is provided, and when the instructions in the storage medium are executed by a processor, the functions of the online scheduling node provided in the fifth aspect are implemented.
[0054] In a fourteenth aspect, a storage medium is provided, and when the instructions in the storage medium are executed by a processor, the functions of the offline scheduling node provided in the sixth aspect are implemented.
[0055] In a fifteenth aspect, a storage medium is provided, and when the instructions in the storage medium are executed by a processor, the functions of the online scheduling node provided in the seventh aspect are implemented.
[0056] In a sixteenth aspect, a storage medium is provided, and when the instructions in the storage medium are executed by a processor, the functions of the offline scheduling node provided in the eighth aspect are implemented. Description of the Drawings
[0057] Figure 1 It is a schematic structural diagram of a resource scheduling system provided by an embodiment of the present application;
[0058] Figure 2It is a flowchart of a resource scheduling method provided by an embodiment of the present application;
[0059] Figure 3 It is a schematic diagram of a method for an online scheduling node to uniformly manage resources in a cloud resource pool provided by an embodiment of the present application;
[0060] Figure 4 It is a flowchart of another resource scheduling method provided by an embodiment of the present application;
[0061] Figure 5 It is a schematic structural diagram of a computer device provided by an embodiment of the present application;
[0062] Figure 6 It is a schematic structural diagram of another computer device provided by an embodiment of the present application;
[0063] Figure 7 It is a schematic structural diagram of yet another computer device provided by an embodiment of the present application;
[0064] Figure 8 It is a schematic structural diagram of still another computer device provided by an embodiment of the present application. Detailed implementation manners
[0065] To make the objectives, technical solutions and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0066] For ease of understanding, the following first explains the nouns involved in the embodiments of the present application.
[0067] Virtual machine (VM): Refers to a complete computer system that is realized through software simulation, has the functions of a complete hardware system, and runs in a completely isolated environment.
[0068] Host (also known as a physical machine): The physical resource used to carry virtualization technology. Generally, the host used to deploy virtual machines is usually a physical server.
[0069] Online scheduling: Used to respond to resource requests in a user's instance creation request, select a host (also known as a physical machine) for the instance created for the instance creation request, allocate resources according to the selected host, and achieve real-time scheduling of resources, so as to be able to create an instance according to the scheduled resources.
[0070] Offline scheduling: It is used to reselect a host for a created instance, reallocate resources according to the reselected host, relocate the instance with the reallocated resources, so as to adjust the allocation status of resources in the resource pool and achieve the purpose of optimizing resource configuration. For example, when the resources allocated to an instance have performance hotspots, a high resource fragmentation rate, high energy consumption, or low resource health, it can be considered to reschedule resources to this instance, that is, perform offline scheduling on the resources of this instance.
[0071] In the first aspect of the embodiments of the present application, the embodiments of the present application provide a resource scheduling system. As Figure 1 shown, the resource scheduling system includes an offline scheduling node 01 and an online scheduling node 02. The offline scheduling node 01 and the online scheduling node 02 are communicatively connected. The offline scheduling node 01 is used to confirm the first cloud resources on the first host that need to be reallocated to the first instance, and request the right to use the first cloud resources on the first host from the online scheduling node 02. The online scheduling node 02 is used to receive an online scheduling request for allocating cloud resources to a second instance, confirm the second cloud resources on the first host that need to be allocated to the second instance according to the online scheduling request, and refuse to provide the right to use the first cloud resources on the first host to the offline scheduling node 01 when it is confirmed that there is a resource conflict between the first cloud resources and the second cloud resources on the first host.
[0072] Among them, the first instance is a created instance, and the second instance is a to-be-created instance. Therefore, the offline scheduling node 01 is for a created instance with allocated cloud resources, and confirms the cloud resources on the host that need to be reallocated to this created instance, that is, the offline scheduling node 01 is used to reallocate the cloud resources on the host to the created instance, and perform offline scheduling on the cloud resources on the host used by the created instance. And the online scheduling node 02 is for a to-be-created instance, and confirms the cloud resources on the host that need to be allocated to the to-be-created instance according to the online scheduling request, that is, the online scheduling node 02 performs online scheduling on the cloud resources on the host that the to-be-created instance needs to use during the process of creating the instance, so as to create the to-be-created instance according to the cloud resources on the host of the online scheduling.
[0073] Since the offline scheduling node 01 determines the cloud resources on the host that need to be reallocated to the first instance from the cloud resources on the host where the created instances have not yet occupied, that is, the first cloud resources on the first host determined by the offline scheduling node 01 are cloud resources not occupied by the created instances. However, it is possible that the cloud resources not occupied by the created instances are the cloud resources that the online scheduling node 02 needs to allocate to the to-be-created instances. Moreover, when there is a resource conflict in the use of cloud resources on the host between the online scheduling node 02 and the offline scheduling node 01, if the cloud resources allocated by the offline scheduling node 01 to the created instances preempt the cloud resources that the online scheduling node 02 allocates to the to-be-created instances, it will cause the cloud resource rescheduling or the failure of creating the to-be-created instances, affecting the creation efficiency of the to-be-created instances and resulting in a poor user experience of the cloud platform.
[0074] Therefore, in the embodiment of the present application, to avoid the resource offline scheduling of the created instances from affecting the creation process of the to-be-created instances, when the offline scheduling node 01 determines the first cloud resources on the first host that need to be reallocated to the first instance, it is necessary to determine whether there is a conflict between the first cloud resources on the first host and the cloud resources that the online scheduling node 02 needs to allocate to the to-be-created instances.
[0075] Moreover, in the resource scheduling system provided in the embodiment of the present application, the online scheduling node 02 uniformly manages the right to use the cloud resources in the cloud resource pool managed by the resource scheduling system. When the offline scheduling node 01 needs to use the cloud resources on the host, it needs to first request the right to use the cloud resources on the host from the online scheduling node 02. And when the online scheduling node 02 refuses to provide the offline scheduling node 01 with the right to use the cloud resources on the host, the offline scheduling node 01 cannot use the cloud resources on the host. In this way, it can avoid the situation of resource conflict in the use of cloud resources on the host between the online scheduling node 02 and the offline scheduling node 01, ensure the effective scheduling of the cloud resources on the host by the resource scheduling system, ensure the creation efficiency of the to-be-created instances, and effectively improve the user experience of the cloud platform.
[0076] Among them, the resource scheduling system can be deployed on a cloud infrastructure service platform with online scheduling capabilities and offline scheduling capabilities. The cloud infrastructure service platform can achieve the effective scheduling of the cloud resources in the cloud infrastructure service platform through the resource scheduling system, can reduce the probability of resource rescheduling caused by resource scheduling conflicts in the cloud infrastructure service platform, shorten the duration consumed by instance creation and instance relocation, and improve the success probability of instance creation and instance relocation.
[0077] Optionally, both the online scheduling node 02 and the offline scheduling node 01 can be implemented using virtual machines, containers, physical servers, etc. For example, both the online scheduling node 02 and the offline scheduling node 01 can be implemented by a single server or a server cluster composed of multiple servers. Additionally, for example, both the online scheduling unit and the offline scheduling unit can be software running on a virtual machine.
[0078] In one implementable manner, the online scheduling node 02 is further configured to provide the offline scheduling node 01 with the right to use the first cloud resource on the first host when it is confirmed that there is no resource conflict between the first cloud resource and the second cloud resource on the first host. The fact that there is no resource conflict between the first cloud resource and the second cloud resource on the first host indicates that the instance to be created does not need to use the first cloud resource on the first host. At this time, the offline scheduling node can allocate the first cloud resource on the first host to the first instance, so as to relocate the first instance to the first cloud resource on the first host, thereby realizing the optimization of the resource configuration of the created instance.
[0079] Optionally, the offline scheduling node 01 is further configured to re-confirm the third cloud resource on the second host to be allocated to the first instance after the right to use the first cloud resource on the first host is rejected, and request the online scheduling node 02 for the right to use the third cloud resource on the second host. That is, each time the offline scheduling node 01 applies for the right to use the cloud resource on the host from the online scheduling node 02, if the online scheduling node 02 refuses to provide the offline scheduling node 01 with the right to use the cloud resource on the host requested by the offline scheduling node 01, the offline scheduling node 01 can re-determine the cloud resource on the host to be allocated to the first instance and request the online scheduling node 02 again for the right to use the cloud resource on the host until the application stop condition is reached. Optionally, the application stop condition can be determined according to application requirements, and the embodiments of the present application do not make specific limitations thereto. For example, the application stop condition can indicate that after the offline scheduling node 01 fails to apply for the cloud resource on the host for the same instance a preset number of times, it stops applying to the online scheduling node 02 for the cloud resource on the host allocated to the instance. Alternatively, the application stop condition can be that the offline scheduling node 01 obtains the right to use the cloud resource on the host requested by the offline scheduling node 01.
[0080] In one implementable manner, the online scheduling node 02 can manage the usage rights of cloud resources in the cloud resource pool managed by the resource scheduling system through a resource information table. The resource information table records at least the occupancy status of the cloud resources in the cloud resource pool. Among them, when the occupancy status indicated by the resource information table of the cloud resources to be allocated is occupied, it means that there is a resource conflict for the cloud resources. Correspondingly, the implementation manner for the online scheduling node 02 to manage the usage rights of cloud resources according to the resource information table can be: when the online scheduling node 02 receives a request from the offline scheduling node 01 for the usage rights of the first cloud resource on the first host, the online scheduling node 02 queries the occupancy status of the first cloud resource on the first host in the resource information table, and when the occupancy status of the first cloud resource on the first host is occupied, it is determined that there is a resource conflict for the first cloud resource on the first host, or when the occupancy status of the first cloud resource on the first host is unoccupied, it is determined that there is no resource conflict for the first cloud resource on the first host. And, this implementation manner further includes: after the online scheduling node 02 receives an online scheduling request to allocate cloud resources to the second instance, it determines the cloud resources on the host to which the second instance needs to be allocated among the cloud resources on all hosts whose occupancy status recorded in the resource information table is unoccupied.
[0081] Moreover, the resource information table can be maintained by the online scheduling node 02. In one implementable manner, the online scheduling node 02 can update the occupancy status of the cloud resources in the resource information table when the occupancy status of the cloud resources in the cloud resource pool changes. For example, after the online scheduling node 02 determines the cloud resources on the host to be allocated to the instance to be created, it can mark the occupancy status of the cloud resources on the host as occupied, and, after the online scheduling node 02 provides the usage rights of the cloud resources on the host to the offline scheduling node 01, it marks the occupancy status of the cloud resources on the host as occupied in the resource information table.
[0082] Furthermore, since the cloud resources in the cloud resource pool managed by the resource scheduling system are uniformly scheduled by the online scheduling node 02, the offline scheduling node 01 cannot understand the occupancy status of all the cloud resources in the cloud resource pool based on the scheduling situation of the cloud resources on the host by the offline scheduling node 01. Therefore, the online scheduling node 02 can also send the resource information table to the offline scheduling node 01 so that the offline scheduling node 01 can understand the occupancy status of all the cloud resources in the cloud resource pool managed by the resource scheduling system according to the resource information table.
[0083] Among them, the implementation manner in which the online scheduling node 02 sends the resource information table to the offline scheduling node 01 can be determined according to application requirements, and the embodiments of the present application do not make specific limitations thereon. For example, the online scheduling node 02 can send the full amount of information of the resource information table to the offline scheduling node 01 each time. Alternatively, the online scheduling node 02 can also send the full amount of information of the resource information table to the offline scheduling node 01 for the first time, and send the incremental information of the resource information table relative to the previous sending process to the offline scheduling node 01 in each subsequent sending process. Moreover, the timing at which the online scheduling node 02 sends the resource information table to the offline scheduling node 01 can also be determined according to application requirements, and the embodiments of the present application do not make specific limitations thereon. For example, the online scheduling node 02 can send the resource information table to the offline scheduling node 01 each time the information in the resource information table changes. Alternatively, the online scheduling node 02 can send the resource information table to the offline scheduling node 01 periodically. Alternatively, the online scheduling node 02 can send the resource information table to the offline scheduling node 01 when receiving a resource information table acquisition request sent by the offline scheduling node 01.
[0084] Optionally, since the offline scheduling node 01 determines the cloud resources on the host to which the created instance needs to be allocated from the cloud resources on the unoccupied host, the resource information table recorded in the offline scheduling node 01 can also only include the cloud resources on all unoccupied hosts. Correspondingly, the online scheduling node 02 can only send the cloud resources on the unoccupied host to the offline scheduling node 01 to facilitate the offline scheduling node 01 to update the cloud resources on the unoccupied host it records.
[0085] In addition, after the offline scheduling node 01 determines the cloud resources to be scheduled to the first instance, when the offline scheduling node 01 needs to determine the cloud resources to be scheduled to other instances, the occupancy status of the cloud resources scheduled to the first instance may not have been updated in time in the resource information table recorded by the offline scheduling node 01. At this time, in order to avoid conflicts between the cloud resources scheduled by the offline scheduling node 01 to other instances and the cloud resources scheduled to the first instance, the offline scheduling node 01 can also update the occupancy status of the cloud resources scheduled to the first instance to occupied in the resource information table recorded by the offline scheduling node 01 after determining the cloud resources scheduled to the first instance. For example, after the online scheduling node 02 provides the right to use the cloud resources scheduled to the first instance to the offline scheduling node 01, if the offline scheduling node 01 allocates the cloud resources to the first instance, the offline scheduling node 01 can mark the occupancy status of the cloud resources allocated to the first instance as occupied in the resource information table recorded by the offline scheduling node 01. In this way, it is possible to avoid resource conflicts between the cloud resources scheduled by the offline scheduling node 01 to different created instances, thereby ensuring the scheduling efficiency of offline scheduling.
[0086] It should be noted that since the resource information table records the occupancy status of cloud resources on the host, that is, it records the correspondence between the cloud resources on the host and the occupancy status of the cloud resources, it is referred to as the resource information table in the embodiments of the present application. However, this name does not limit the data representation form of this correspondence to a table form, as long as the data representation form of this correspondence can represent the correspondence recorded in the resource information table.
[0087] In summary, in the resource scheduling system provided in the embodiments of the present application, the online scheduling node uniformly manages the usage rights of the cloud resources in the cloud resource pool managed by the resource scheduling system. When the offline scheduling node needs to use the cloud resources on the host, it needs to first request the usage rights of the cloud resources on the host from the online scheduling node. And when the online scheduling node refuses to provide the usage rights of the cloud resources on the host to the offline scheduling node, the offline scheduling node cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host by the online scheduling node and the offline scheduling node, ensure the effective scheduling of the cloud resources on the host by the resource scheduling system, ensure the creation efficiency of the instance to be created, and effectively improve the user experience of the cloud platform. Moreover, by managing the usage rights of the cloud resources in the cloud resource pool managed by the online scheduling node resource scheduling system, there is no need to introduce an additional third-party component in this resource scheduling system, which can reduce the additional overhead caused by introducing this third-party component.
[0088] In the second aspect of the embodiments of the present application, the embodiments of the present application also provide a resource scheduling method. The resource scheduling system provided in the first aspect of the embodiments of the present application can use this resource scheduling method to manage the cloud resources in the cloud resource pool managed by this resource scheduling system. The implementation process of this resource scheduling method will be described below. Figure 2 It is a flowchart of a resource scheduling method provided for this embodiment. As Figure 2 shown, this resource scheduling method may include the following steps:
[0089] Step 201, the offline scheduling node confirms the first cloud resource on the first host that needs to be reallocated to the first instance.
[0090] The offline scheduling node can determine whether the cloud resources that need to be reallocated to the first instance according to the allocation situation of the cloud resources in the cloud resource pool managed by the resource scheduling system. When determining that the cloud resources that need to be reallocated to the first instance, determine the first cloud resource on the first host that needs to be reallocated to the first instance. Optionally, the offline scheduling node can obtain information such as the performance hotspots, resource fragmentation rate, energy consumption, and resource health of the cloud resources in the cloud resource pool managed by the resource scheduling system, and when the information indicating the resource configuration needs to be improved, determine the cloud resources that need to be reallocated to the first instance.
[0091] After determining that resources need to be reallocated to the first instance, the offline scheduling node can calculate the relocation benefit of relocating the first instance to one or more unoccupied cloud resources in the resource allocation system, and determine the resources that need to be reallocated to the host of the first instance according to the relocation benefit. For example, after determining that resources need to be reallocated to the first instance, the offline scheduling node calculates the relocation benefit of relocating the first instance to an unoccupied cloud resource. When the relocation benefit is greater than the benefit threshold, it can be determined that the resource to be reallocated to the first instance is the unoccupied cloud resource. The relocation benefit is used to reflect the magnitude of the beneficial effect obtained by the relocation.
[0092] It should be noted that when the offline scheduling node performs offline scheduling on the created instances, it usually performs batch scheduling on multiple created instances. Therefore, after determining that multiple created instances need to be offline scheduled, a preset resource allocation algorithm (such as a heuristic algorithm) can be used to allocate resources to the multiple created instances. Moreover, during the process of allocating resources to the multiple created instances, an instance relocation sequence can be generated, and the relocation benefit of relocating each created instance can be calculated according to the information indicated by the instance relocation sequence. When the relocation benefit of any created instance is greater than the relocation threshold, it is determined that the created instance can be relocated according to the indication of the instance relocation sequence. The instance relocation sequence indicates the relocation order of the multiple created instances and the resources allocated to each created instance before and after the relocation.
[0093] Optionally, the implementation method of calculating the relocation benefit of relocating each created instance may include: respectively obtaining the allocation balance degree of the cloud resources in the resource pool managed by the resource allocation system before and after the relocation, and determining the relocation benefit according to the allocation balance degree of the cloud resources on the host after the relocation and the allocation balance degree of the cloud resources on the host before the relocation. In one implementable manner, the relocation benefit G may be equal to the difference between the allocation balance degree θ1 of the cloud resources on the host after the relocation and the allocation balance degree θ2 of the cloud resources on the host before the relocation, that is, G = θ1 - θ2.
[0094] In one implementable manner, the allocation balance degree of the cloud resources in the resource pool managed by the resource allocation system at a certain moment can be calculated according to the resource allocation situation of the cloud resources in the resource pool managed by the resource allocation system at that moment. The calculation process includes: obtaining an allocated proportion vector representing the allocated proportion of various types of cloud resources in the resource pool at that moment, obtaining a all-ones vector with the same dimension as the allocated proportion vector and the modulus of each vector dimension being 1, and then using the cosine formula to calculate the cosine angle between the allocated proportion vector and the all-ones vector. This cosine angle is the allocation balance degree of the cloud resources in the resource pool at that moment.
[0095] Among them, the implementation process of obtaining an allocated ratio vector representing the allocated ratios of various types of cloud resources in the cloud resources in the resource pool at this moment includes: obtaining the allocated ratios of various types of cloud resources in the cloud resources in the resource pool at this moment, and then using the allocated ratios of various types of cloud resources at this moment as the modulus of the vector dimension in the allocated ratio vector for representing the corresponding type of cloud resources, so as to obtain the allocated ratio vector. Optionally, the allocated ratio of any type of cloud resources at this moment can be calculated in the following manner: first calculate the ratio of the total amount that can be allocated of this type of cloud resources at this moment to the total amount of resources of this type of cloud resources, and then determine the difference between 1 and this ratio as the allocated ratio of this type of cloud resources at this moment.
[0096] Step 202, the offline scheduling node requests the right to use the first cloud resources on the first host from the online scheduling node.
[0097] Among them, the first instance is an instance that has been created.
[0098] After the offline scheduling node confirms the first cloud resources on the first host that need to be reallocated to the first instance, it can apply to the online scheduling node for the right to use the first cloud resources on the first host, so as to obtain the right to use the first cloud resources on the first host and allocate the first cloud resources on the first host to the first instance.
[0099] It should be noted that if an instance relocation sequence is generated during the process of resource allocation for the multiple created instances, since the instance relocation sequence indicates the relocation order of the multiple created instances, when applying to the online scheduling node for the right to use the first cloud resources on the first host, the offline scheduling node can apply to the online scheduling node for the cloud resources on the host corresponding to the instance to be allocated to the corresponding instance in sequence according to the order specified in the instance relocation instance. Alternatively, the offline scheduling node can also apply to the online scheduling node for the cloud resources on the host corresponding to the instance to be allocated to the corresponding instance in sequence according to the order from the largest to the smallest relocation benefits of the multiple instances in the instance relocation sequence, so as to preferentially relocate the instances with larger relocation benefits under limited resource conditions to maximize the optimization of resource allocation.
[0100] Step 203, the online scheduling node receives an online scheduling request for allocating cloud resources to the second instance.
[0101] Among them, the second instance is an instance to be created.
[0102] When a user needs to create a second instance in the cloud platform, the user will send an instance creation request to the cloud platform to request the creation of a second instance in the cloud platform. Since an instance needs to be created depending on cloud resources, the instance creation request will also request to allocate cloud resources to the second instance so that the second instance can be created based on the allocated cloud resources. After the cloud platform receives the instance creation request, it will send an online scheduling request to an online scheduling node to request the online scheduling node to schedule cloud resources for the second instance.
[0103] Step 204: The online scheduling node confirms the second cloud resources on the first host that need to be allocated to the second instance according to the online scheduling request.
[0104] The instance creation request carries the performance parameters of the to-be-created second instance to indicate the performance that the to-be-created second instance needs to meet. According to the performance parameters, the specification of the cloud resources required to create the second instance can be determined. When the cloud platform sends an online scheduling request to the online scheduling node, it will send this specification to the online scheduling node. The online scheduling node can select cloud resources that meet this specification from the cloud resources in the cloud resource pool managed by the resource scheduling system to obtain the cloud resources to be allocated to the to-be-created second instance, that is, to obtain the second cloud resources on the first host to be allocated to the second instance.
[0105] In an implementable manner, the management of the usage rights of cloud resources on a host by the online scheduling node can be achieved through a resource information table. The resource information table records at least the occupancy status of the cloud resources on the host. Among them, when the occupancy status indicated by the resource information table of the cloud resources to be allocated is occupied, it means that there is a resource conflict for this cloud resource. Correspondingly, the implementation method for the online scheduling node to manage the usage rights of cloud resources on the host according to the resource information table can be: when the online scheduling node receives a request from an offline scheduling node for the usage rights of the first cloud resources on the first host, the online scheduling node queries the occupancy status of the first cloud resources on the first host in the resource information table, and when the occupancy status of the first cloud resources on the first host is occupied, it determines that there is a resource conflict for the first cloud resources on the first host, or when the occupancy status of the first cloud resources on the first host is unoccupied, it determines that there is no resource conflict for the first cloud resources on the first host. And this implementation method also includes: after the online scheduling node receives an online scheduling request for allocating cloud resources to the second instance, it determines the cloud resources on the host to be allocated to the second instance among all the cloud resources on the hosts whose occupancy status recorded in the resource information table is unoccupied.
[0106] Moreover, the resource information table can be maintained by the online scheduling node. In one implementable manner, when the occupancy status of the cloud resources on its management host changes, the online scheduling node can update the occupancy status of the cloud resources on this host in the resource information table. Therefore, after determining the second cloud resource on the first host to be allocated to the second instance, the online scheduling node can mark the occupancy status of the second cloud resource on the first host as occupied, so as to ensure the accuracy of the information recorded in the resource information table and ensure the effective scheduling of cloud resources.
[0107] Furthermore, since the cloud resources in the cloud resource pool managed by the resource scheduling system are uniformly scheduled by the online scheduling node, the offline scheduling node cannot understand the occupancy status of all the cloud resources in the cloud resource pool managed by the resource scheduling system based on the scheduling situation of the cloud resources on the host by this offline scheduling node. Therefore, the online scheduling node can also send the resource information table to the offline scheduling node, so that the offline scheduling node can understand the occupancy status of all the cloud resources in the cloud resource pool managed by the resource scheduling system according to this resource information table.
[0108] Among them, the implementation manner of the online scheduling node sending the resource information table to the offline scheduling node can be determined according to application requirements, and the embodiments of the present application do not make specific limitations on it. For example, the online scheduling node can send the full amount of information of the resource information table to the offline scheduling node each time. Or, the online scheduling node can also send the full amount of information of the resource information table to the offline scheduling node for the first time, and send the incremental information of the resource information table relative to the previous sending process to the offline scheduling node in each subsequent sending process. Moreover, the timing of the online scheduling node sending the resource information table to the offline scheduling node can also be determined according to application requirements, and the embodiments of the present application do not make specific limitations on it. For example, the online scheduling node can send the resource information table to the offline scheduling node each time the information in the resource information table changes. Or, the online scheduling node can send the resource information table to the offline scheduling node periodically. Or, the online scheduling node can send the resource information table to the offline scheduling node when receiving a resource information table acquisition request sent by the offline scheduling node.
[0109] Optionally, since the offline scheduling node determines the cloud resources on the host that need to be allocated to the created instance among the cloud resources on the unoccupied hosts, the resource information table recorded in the offline scheduling node can also only include the cloud resources on all unoccupied hosts. Correspondingly, the online scheduling node can only send the cloud resources on the unoccupied hosts to the offline scheduling node, so that the offline scheduling node can update the cloud resources on the unoccupied hosts recorded by it.
[0110] It should be noted that since the resource information table records the occupancy status of cloud resources on the host, that is, it records the correspondence between the cloud resources on the host and the occupancy status of the cloud resources, it is called the resource information table in the embodiments of the present application. However, this name does not limit the data representation form of this correspondence to a table form, as long as the data representation form of this correspondence can represent the correspondence recorded in the resource information table.
[0111] Step 205: The online scheduling node confirms whether there is a resource conflict between the first cloud resource and the second cloud resource on the first host.
[0112] After the online scheduling node receives a request from the offline scheduling node for the right to use the first cloud resource on the first host, it can determine whether there is a conflict between the first cloud resource on the first host and the second cloud resource on the first host that the online scheduling node needs to allocate to the second instance, and decide whether to provide the offline scheduling node with the right to use the first cloud resource on the first host based on whether there is a conflict, so as to be able to successfully allocate the second cloud resource on the first host to the second instance. Among them, when there is a conflict between the first cloud resource on the first host and the second cloud resource on the first host, step 206 is executed. When there is no conflict between the first cloud resource on the first host and the second cloud resource on the first host, step 208 is executed.
[0113] The online scheduling node records a resource information table, which at least indicates the occupancy status of cloud resources in the cloud resource pool managed by the resource scheduling system. When the online scheduling node determines that the second cloud resource on the first host needs to be allocated to the second instance, it will modify the occupancy status of the second cloud resource on the first host to occupied. And if there is a resource conflict between the first cloud resource on the first host and the second cloud resource on the first host, when modifying the occupancy status of the second cloud resource on the first host to occupied, the first cloud resource on the first host will also be marked as occupied. Therefore, the online scheduling node can query the occupancy status of the first cloud resource on the first host in the resource information table to determine whether there is a resource conflict between the first cloud resource on the first host and the second cloud resource on the first host. And when the occupancy status of the first cloud resource on the first host is occupied, it is determined that there is a resource conflict between the first cloud resource on the first host and the second cloud resource on the first host. When the occupancy status of the first cloud resource on the first host is unoccupied, it is determined that there is no resource conflict between the first cloud resource on the first host and the second cloud resource on the first host.
[0114] Step 206: When the online scheduling node confirms that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, it refuses to provide the offline scheduling node with the right to use the first cloud resource on the first host.
[0115] When there is a resource conflict between the first cloud resource and the second cloud resource on the first host, if the right to use the first cloud resource is provided to the offline scheduling node, there will be a situation where the offline scheduling node and the online scheduling node compete for the cloud resource. Moreover, if the offline scheduling node wins the competition for the cloud resource, it will cause the online scheduling node to fail in scheduling, which will affect the creation process of the second instance. Therefore, to ensure the creation efficiency of the second instance, when the online scheduling node confirms that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, it can refuse to provide the offline scheduling node with the right to use the first cloud resource on the first host, so as to give priority to the use of this cloud resource by the second instance.
[0116] Step 207: After the right to use is refused, the offline scheduling node reconfirms the third cloud resource on the second host that needs to be allocated to the first instance, and requests the right to use the third cloud resource on the second host from the online scheduling node.
[0117] After the offline scheduling node applies for the right to use the cloud resource on the host from the online scheduling node each time, if the online scheduling node refuses to provide the offline scheduling node with the cloud resource on the host requested by the offline scheduling node, the offline scheduling node can re-determine the cloud resource on the host that needs to be allocated to the first instance, and request the right to use the cloud resource on this host from the online scheduling node again until the application stop condition is reached. Optionally, the application stop condition can be determined according to application requirements, and the embodiments of the present application do not make specific limitations on it. For example, the application stop condition can indicate that after the offline scheduling node repeats the failure to apply for the cloud resource on the host for the same instance a preset number of times, it stops applying to the online scheduling node for the cloud resource on the host allocated to this instance. Or, the application stop condition can be that the offline scheduling node obtains the right to use the cloud resource on the host requested by the offline scheduling node. Among them, for the implementation process of step 207, please refer to the implementation process of step 201 accordingly, and details are not described here again.
[0118] Step 208: When the online scheduling node confirms that there is no resource conflict between the first cloud resource and the second cloud resource on the first host, it provides the offline scheduling node with the right to use the first cloud resource on the first host.
[0119] When there is no resource conflict between the first cloud resource and the second cloud resource on the first host, it means that the second instance does not need to use the first cloud resource on the first host, and the use of the first cloud resource by the offline scheduling node will not affect the creation of the second instance. Then the online scheduling node can provide the offline scheduling node with the right to use the first cloud resource on the first host.
[0120] Exemplarily, as Figure 3 shown, the cloud resources in the cloud resource pool managed by the resource scheduling system include the cloud resources on hosts PM1 to PM4, and the Figure 3The black filling indicates that the cloud resources are occupied, and the white filling indicates that the cloud resources are not occupied. After receiving an online scheduling request to create a second instance, the online scheduling node confirms that the cloud resources to be allocated to the second instance are the cloud resources on the host PM1 according to the online scheduling request. When the offline scheduling node has a defragmentation requirement, it confirms that the cloud resources to be allocated to the first instance are the cloud resources on the host PM2, and after determining the cloud resources, the offline scheduling node requests the right to use the cloud resources on the host PM2 from the online scheduling node. After receiving the request from the offline scheduling node, if the online scheduling node determines that there is no resource conflict between the cloud resources on the host PM2 and the cloud resources on the host PM1, it allocates the right to use the cloud resources on the host PM2 to the offline scheduling node.
[0121] Moreover, to ensure the accuracy of the information recorded in the resource information table, after the online scheduling node provides the offline scheduling node with the right to use the first cloud resources on the first host, it can mark the occupancy status of the first cloud resources on the first host as occupied in the resource information table.
[0122] Step 209: The offline scheduling node allocates the first cloud resources on the first host to the first instance.
[0123] After obtaining the right to use the first cloud resources on the first host, the offline scheduling node can allocate the first cloud resources on the first host to the first instance, so as to relocate the first instance to the first cloud resources on the first host.
[0124] Moreover, after the offline scheduling node determines the cloud resources to be scheduled to the first instance, when the offline scheduling node needs to determine the cloud resources to be scheduled to other instances, the occupancy status of the cloud resources scheduled to the first instance may not have been updated in time in the resource information table recorded by the offline scheduling node. At this time, to avoid conflicts between the cloud resources scheduled to other instances and the cloud resources scheduled to the first instance by the offline scheduling node, the offline scheduling node can also update the occupancy status of the cloud resources scheduled to the first instance to occupied in the resource information table recorded by the offline scheduling node after determining the cloud resources to be scheduled to the first instance. For example, after the online scheduling node provides the offline scheduling node with the right to use the cloud resources scheduled to the first instance, if the offline scheduling node allocates the cloud resources to the first instance, the offline scheduling node can mark the occupancy status of the cloud resources allocated to the first instance as occupied in the resource information table recorded by the offline scheduling node. In this way, it is possible to avoid resource conflicts between the cloud resources scheduled to different created instances by the offline scheduling node, thereby ensuring the scheduling efficiency of the offline scheduling.
[0125] Optionally, to ensure the orderly progress of resource scheduling, the online scheduling node can set the effective duration of the cloud resource usage right. If the cloud resource is not used within this effective duration, the online scheduling node can reallocate the cloud resource. This effective duration can be set according to application requirements. For example, the effective duration can be 10 minutes.
[0126] If an instance relocation sequence is generated during the process of allocating resources to the multiple created instances, since the instance relocation sequence indicates the relocation order of the multiple created instances, the multiple to-be-relocated instances involved in the relocation sequence can be relocated in the order indicated by the relocation sequence, or in the order of the decreasing relocation benefits of the multiple instances in the instance relocation sequence. And if there is a resource conflict between the cloud resources that the offline scheduling node needs to allocate to a to-be-relocated instance and the cloud resources that the online scheduling node needs to allocate to a to-be-created instance, when relocating the multiple to-be-relocated instances in order, the relocation of the to-be-relocated instance with the resource conflict will be abandoned.
[0127] Moreover, the relocation operation for the to-be-relocated instance can be executed according to the state of the to-be-relocated instance. Among them, after the offline scheduling node generates the relocation sequence, it can modify the state of each to-be-relocated instance involved in the relocation sequence to the PREPARE state. When obtaining the usage right of the cloud resources that need to be allocated to the to-be-relocated instance, it modifies the state of the to-be-relocated instance to the STANDBY state. When the online scheduling node refuses to provide the usage right of the cloud resources that need to be allocated to the to-be-relocated instance to the offline scheduling node, it modifies the state of the to-be-relocated instance to the SKIP state. When performing the relocation operation on the to-be-relocated instance, the to-be-relocated instance with the complete state can be relocated, and the relocation of the to-be-relocated instance with the SKIP state will be abandoned. And during the relocation process, the identification number of the instance relocated to the reallocated resources can be reset. For example, the identification number of the to-be-relocated instance is modified to the sum of the identification number of the to-be-relocated instance and a random number. After the relocation is completed, the instance before the relocation is deleted, and then the identification number of the instance after the relocation is modified to the identification number of the instance before the relocation to complete the update of the instance in the system.
[0128] In summary, in the resource management method provided in the embodiments of the present application, the online scheduling node uniformly manages the right to use cloud resources in the cloud resource pool managed by the resource scheduling system. When the offline scheduling node needs to use the cloud resources on a host, it needs to first request the right to use the cloud resources on the host from the online scheduling node. And when the online scheduling node refuses to provide the offline scheduling node with the right to use the cloud resources on the host, the offline scheduling node cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host between the online scheduling node and the offline scheduling node, ensure the effective scheduling of cloud resources on the host by the resource scheduling system, ensure the creation efficiency of the instance to be created, and effectively improve the user experience of the cloud platform. Moreover, by means of the online scheduling node's management of the right to use cloud resources in the cloud resource pool managed by the resource scheduling system, there is no need to introduce an additional third-party component in the resource scheduling system, which can reduce the additional overhead caused by the introduction of this third-party component.
[0129] It should be noted that the resource management method provided in the present application is not limited to being used in the resource scheduling scenario of instances, and can also be used in other hybrid scheduling systems that require the use of a unified scheduling unit as a resource decision-making module. The embodiments of the present application do not make specific limitations on this.
[0130] It should also be noted that the sequence of steps of the resource scheduling method provided in the embodiments of the present application can be appropriately adjusted, and the steps can also be increased or decreased accordingly according to the situation. Any person skilled in the art in the technical field disclosed in the present application can easily think of a changed method within the technical scope disclosed in the present application, and it should be covered within the protection scope of the present application. Therefore, it will not be elaborated here.
[0131] In the third aspect of the embodiments of the present application, the embodiments of the present application also provide an online scheduling node. This online scheduling node is used to receive an online scheduling request for requesting to allocate cloud resources to a second instance, confirm the second cloud resources on the first host that need to be allocated to the second instance according to the online scheduling request, and when it is confirmed that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, refuse to provide the offline scheduling node with the right to use the first cloud resources on the first host, where the second instance is the instance to be created.
[0132] Optionally, the online scheduling node is further used to, when it is confirmed that there is no resource conflict between the first cloud resources and the second cloud resources on the first host, provide the offline scheduling node with the right to use the first cloud resources on the first host.
[0133] Optionally, the online scheduling node records a resource information table of cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resources. Correspondingly, the online scheduling node is further configured to, after providing the usage right of the first cloud resource on the first host to the offline scheduling node, mark the occupancy status of the first cloud resource on the first host as occupied in the resource information table.
[0134] Moreover, the online scheduling node is further configured to send the resource information table to the offline scheduling node.
[0135] In summary, the online scheduling node provided in the embodiment of the present application can uniformly manage the usage rights of cloud resources in the cloud resource pool managed by the resource scheduling system. When the offline scheduling node needs to use the cloud resources on a host, it needs to first request the usage right of the cloud resources on the host from the online scheduling node. And when the online scheduling node refuses to provide the usage right of the cloud resources on the host to the offline scheduling node, the offline scheduling node cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host between the online scheduling node and the offline scheduling node, and it is possible to ensure the effective scheduling of cloud resources on the host by the resource scheduling system.
[0136] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the online scheduling node described above can refer to the working process of the online scheduling node in the resource scheduling system provided in the foregoing first aspect and the resource scheduling method provided in the foregoing second aspect accordingly, and will not be elaborated here.
[0137] In the fourth aspect of the embodiment of the present application, the embodiment of the present application further provides an offline scheduling node. The offline scheduling node is configured to confirm the first cloud resource on the first host that needs to be reallocated to the first instance, and request the usage right of the first cloud resource on the first host from the online scheduling node, where the first instance is a created instance.
[0138] Optionally, the offline scheduling node is further configured to, after the usage right is refused, reconfirm the third cloud resource on the second host that needs to be allocated to the first instance, and request the usage right of the third cloud resource on the second host from the online scheduling node.
[0139] Optionally, the offline scheduling node is further configured to, after the online scheduling node provides the usage right of the first cloud resource on the first host to the offline scheduling node, allocate the first cloud resource on the first host to the first instance, and mark the occupancy status of the first cloud resource on the first host as occupied in the resource information table recorded by the offline scheduling node. Wherein, the resource information table at least indicates the occupancy status of the cloud resources.
[0140] In summary, for the offline scheduling node provided in the embodiments of the present application, when the offline scheduling node needs to use the cloud resources on the host, it needs to first request the right to use the cloud resources on the host from the online scheduling node. Moreover, when the online scheduling node refuses to provide the offline scheduling node with the right to use the cloud resources on the host, the offline scheduling node cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host between the online scheduling node and the offline scheduling node, and ensure the effective scheduling of cloud resources on the host by the resource scheduling system.
[0141] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the offline scheduling node described above can refer to the working process of the offline scheduling node in the resource scheduling system provided in the foregoing first aspect and the resource scheduling method provided in the foregoing second aspect accordingly, and will not be elaborated here.
[0142] In the fifth aspect of the embodiments of the present application, the embodiments of the present application further provide a resource scheduling system. As Figure 1 shown, the resource scheduling system includes: an online scheduling node 02 and an offline scheduling node 01. A communication connection is established between the offline scheduling node 01 and the online scheduling node 02. The online scheduling node 02 is configured to receive an online scheduling request for requesting to allocate cloud resources to a second instance, confirm the second cloud resources on a first host to be allocated to the second instance according to the online scheduling request, and request the right to use the second cloud resources on the first host from the offline scheduling node 01, where the second instance is an instance to be created. The offline scheduling node 01 is configured to confirm the first cloud resources on the first host to be reallocated to a first instance, and refuse to provide the online scheduling node 02 with the right to use the second cloud resources on the first host when it is confirmed that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, where the first instance is an already created instance.
[0143] In the resource scheduling system provided by the present application, the offline scheduling node 01 uniformly manages the right to use the cloud resources in the cloud resource pool managed by the resource scheduling system. When the online scheduling node 02 needs to use the cloud resources on the host, it needs to first request the right to use the cloud resources on the host from the offline scheduling node 01. And when the offline scheduling node 01 refuses to provide the online scheduling node 02 with the right to use the cloud resources on the host, the online scheduling node 02 cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host between the online scheduling node 02 and the offline scheduling node 01, and ensure the effective scheduling of cloud resources on the host by the resource scheduling system. Moreover, by using the offline scheduling node 01 to manage the right to use the cloud resources in the cloud resource pool of the resource scheduling system, there is no need to introduce an additional third-party component in the resource scheduling system, which can reduce the additional overhead caused by introducing the third-party component.
[0144] Optionally, the online scheduling node 02 is further configured to, after the usage right is rejected, re-confirm the third cloud resource on the second host to be allocated to the second instance, and request the usage right of the third cloud resource on the second host from the offline scheduling node 01.
[0145] Optionally, the offline scheduling node 01 is further configured to, when confirming that there is no resource conflict between the first cloud resource and the second cloud resource on the first host, provide the usage right of the second cloud resource on the first host to the online scheduling node 02.
[0146] Optionally, the offline scheduling node 01 records a resource information table of the cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resources.
[0147] Optionally, the offline scheduling node 01 is further configured to, after providing the usage right of the second cloud resource on the first host to the online scheduling node 02, mark the occupancy status of the second cloud resource on the first host as occupied in the resource information table.
[0148] Optionally, the offline scheduling node 01 is further configured to send the resource information table to the online scheduling node 02.
[0149] Optionally, the online scheduling node 02 is further configured to, after the offline scheduling node 01 provides the usage right of the second cloud resource on the first host to the online scheduling node 02, allocate the second cloud resource on the first host to the second instance, and mark the occupancy status of the second cloud resource on the first host as occupied in the resource information table recorded by the online scheduling node 02, and the resource information table at least indicates the occupancy status of the cloud resources.
[0150] As can be seen from the above, in the resource scheduling system provided in this fifth aspect, the offline scheduling node uniformly manages the scheduling of the cloud resources in the cloud resource pool managed by the resource scheduling system. Moreover, the principle of the offline scheduling node to achieve unified management in this resource scheduling system is basically the same as the principle of the online scheduling node to achieve unified management in the resource scheduling system provided in the foregoing first aspect and the resource scheduling method provided in the foregoing second aspect, and the principle of the online scheduling node to be managed in this resource scheduling system is basically the same as the principle of the offline scheduling node to be managed in the resource scheduling system provided in the foregoing first aspect and the resource scheduling method provided in the foregoing second aspect. Then, in the resource scheduling system provided in this fifth aspect, the specific working process of the offline scheduling node can refer to the working process of the online scheduling node in the resource scheduling system provided in the foregoing first aspect and the resource scheduling method provided in the foregoing second aspect accordingly, and the specific working process of the online scheduling node can refer to the working process of the offline scheduling node in the resource scheduling system provided in the foregoing first aspect and the resource scheduling method provided in the foregoing second aspect accordingly, which will not be elaborated here.
[0151] In the sixth aspect of the embodiments of the present application, the embodiments of the present application further provide a resource scheduling method. The resource scheduling system provided in the fifth aspect of the embodiments of the present application can use this resource scheduling method to manage the cloud resources in the cloud resource pool managed by the resource scheduling system. The implementation process of this resource scheduling method will be described below. Figure 4 It is a flowchart of a resource scheduling method provided for this embodiment. As Figure 4 shown, this resource scheduling method may include the following steps:
[0152] Step 401, the online scheduling node receives an online scheduling request for allocating cloud resources to a second instance.
[0153] Among them, the second instance is an instance to be created. For the implementation process of this step 401, please refer to the implementation process of step 203 accordingly, which will not be elaborated here.
[0154] Step 402, the online scheduling node confirms the second cloud resources on the first host that need to be allocated to the second instance according to the online scheduling request.
[0155] For the implementation process of this step 402, please refer to the implementation process of step 204 accordingly, which will not be elaborated here.
[0156] Step 403, the online scheduling node requests the right to use the second cloud resources on the first host from the offline scheduling node.
[0157] For the implementation process of this step 403, please refer to the implementation process of step 202 accordingly, which will not be elaborated here.
[0158] Step 404, the offline scheduling node confirms the first cloud resources on the first host that need to be reallocated to the first instance.
[0159] Among them, the first instance is an already created instance. For the implementation process of this step 404, please refer to the implementation process of step 201 accordingly, which will not be elaborated here.
[0160] Step 405, the offline scheduling node confirms whether there is a resource conflict between the first cloud resources and the second cloud resources on the first host.
[0161] Among them, when there is a conflict between the first cloud resources on the first host and the second cloud resources on the first host, step 406 is executed. When there is no conflict between the first cloud resources on the first host and the second cloud resources on the first host, step 408 is executed. For the implementation process of this step 405, please refer to the implementation process of step 205 accordingly, which will not be elaborated here.
[0162] In one implementable manner, the management of the right to use cloud resources on a host by an offline scheduling node can be achieved through a resource information table. The resource information table records at least the occupancy status of cloud resources on the host. The specific implementation manner of the resource information table and the implementation manner in which the offline scheduling node manages cloud resources according to the resource information table can correspond to the corresponding descriptions in the resource scheduling system provided in the foregoing first aspect and the resource scheduling method provided in the second aspect, and will not be elaborated here.
[0163] Moreover, since the cloud resources in the cloud resource pool managed by the resource scheduling system are uniformly scheduled by the offline scheduling node, the online scheduling node cannot understand the occupancy status of all cloud resources in the cloud resource pool managed by the resource scheduling system based on the scheduling situation of cloud resources on the host by the online scheduling node. Therefore, the resource scheduling method further includes: the offline scheduling node sends the resource information table to the online scheduling node. Moreover, the implementation manner in which the offline scheduling node sends the resource information table to the online scheduling node can be correspondingly referred to the corresponding description in the resource scheduling method provided in the foregoing second aspect, and will not be elaborated here.
[0164] Step 406: When the offline scheduling node confirms that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, it refuses to provide the online scheduling node with the right to use the second cloud resource on the first host.
[0165] For the implementation process of this step 406, please correspondingly refer to the implementation process of step 206, and will not be elaborated here.
[0166] Step 407: After the right to use is refused, the online scheduling node reconfirms the third cloud resource on the second host to be allocated to the second instance, and requests the offline scheduling node for the right to use the third cloud resource on the second host.
[0167] For the implementation process of this step 407, please correspondingly refer to the implementation process of step 207, and will not be elaborated here.
[0168] Step 408: When the offline scheduling node confirms that there is no resource conflict between the first cloud resource and the second cloud resource on the first host, it provides the online scheduling node with the right to use the second cloud resource on the first host.
[0169] For the implementation process of this step 408, please correspondingly refer to the implementation process of step 208, and will not be elaborated here.
[0170] Optionally, the offline scheduling node records a resource information table of cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table indicates at least the occupancy status of the cloud resources. Correspondingly, the resource scheduling method further includes: after the offline scheduling node provides the right to use the second cloud resource on the first host to the online scheduling node, marking the occupancy status of the second cloud resource on the first host as occupied in the resource information table.
[0171] Step 409: The online scheduling node allocates the second cloud resource on the first host to the second instance.
[0172] After obtaining the right to use the second cloud resource on the first host, the online scheduling node can allocate the second cloud resource on the first host to the second instance, so as to create the second instance on the second cloud resource on the first host.
[0173] Optionally, after the online scheduling node allocates the second cloud resource on the first host to the second instance, it can mark the occupancy status of the second cloud resource on the first host as occupied in the resource information table recorded by the online scheduling node, and the resource information table indicates at least the occupancy status of the cloud resources.
[0174] In summary, in the resource scheduling method provided in this application, the offline scheduling node uniformly manages the right to use the cloud resources in the cloud resource pool managed by the resource scheduling system. When the online scheduling node needs to use the cloud resources on a host, it needs to first request the right to use the cloud resources on the host from the offline scheduling node. And when the offline scheduling node refuses to provide the right to use the cloud resources on the host to the online scheduling node, the online scheduling node cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host between the online scheduling node and the offline scheduling node, and it is possible to ensure the effective scheduling of cloud resources on the host by the resource scheduling system. Moreover, by using the offline scheduling node to manage the right to use the cloud resources in the cloud resource pool of the resource scheduling system, there is no need to introduce an additional third-party component in the resource scheduling system, which can reduce the additional overhead caused by introducing the third-party component.
[0175] It should be noted that the order of the steps of the resource scheduling method provided in the embodiments of this application can be appropriately adjusted, and the steps can also be increased or decreased accordingly according to the situation. Any method of change that can be easily thought of by any person skilled in the art within the technical scope disclosed in this application should be covered within the protection scope of this application, so it will not be elaborated here.
[0176] In the seventh aspect of the embodiments of the present application, the embodiments of the present application further provide an online scheduling node. The online scheduling node is used to receive an online scheduling request for allocating cloud resources to a second instance, confirm the second cloud resources on the first host to be allocated to the second instance according to the online scheduling request, and request the right to use the second cloud resources on the first host from the offline scheduling node, where the second instance is an instance to be created.
[0177] Optionally, the online scheduling node is further used to, after the right to use is rejected, re-confirm the third cloud resources on the second host to be allocated to the second instance, and request the right to use the third cloud resources on the second host from the offline scheduling node.
[0178] Optionally, the online scheduling node is further used to, after the offline scheduling node provides the right to use the second cloud resources on the first host to the online scheduling node, allocate the second cloud resources on the first host to the first instance, and mark the occupancy status of the second cloud resources on the first host as occupied in the resource information table recorded by the online scheduling node, where the resource information table at least indicates the occupancy status of the cloud resources.
[0179] In summary, for the online scheduling node provided by the embodiments of the present application, when the online scheduling node needs to use the cloud resources on a host, it needs to first request the right to use the cloud resources on the host from the offline scheduling node. Moreover, when the offline scheduling node refuses to provide the right to use the cloud resources on the host to the online scheduling node, the online scheduling node cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host between the online scheduling node and the offline scheduling node, and it is possible to ensure the effective scheduling of the cloud resources on the host by the resource scheduling system.
[0180] As can be seen from the above, the principle of the online scheduling node provided in the seventh aspect being managed in the resource scheduling system is basically the same as the principle of the offline scheduling node being managed in the resource scheduling system provided in the first aspect and the resource scheduling method provided in the second aspect. Those skilled in the art can clearly understand that for the sake of convenience and brevity of description, the specific working process of the online scheduling node provided in the seventh aspect can refer to the working process of the offline scheduling node in the resource scheduling system provided in the first aspect and the resource scheduling method provided in the second aspect accordingly, and will not be elaborated here.
[0181] In the eighth aspect of the embodiments of the present application, the embodiments of the present application further provide an offline scheduling node. The offline scheduling node is used to confirm the first cloud resources on the first host to be re-allocated to the first instance, and reject providing the right to use the second cloud resources on the first host to the online scheduling node when it is confirmed that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, where the first instance is an already created instance.
[0182] Optionally, the offline scheduling node is further configured to provide the online scheduling node with the right to use the second cloud resource on the first host when it is confirmed that there is no resource conflict between the first cloud resource and the second cloud resource on the first host.
[0183] Optionally, the offline scheduling node records a resource information table of the cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resources.
[0184] Optionally, after providing the online scheduling node with the right to use the second cloud resource on the first host, the offline scheduling node marks the occupancy status of the second cloud resource on the first host as occupied in the resource information table.
[0185] Optionally, the offline scheduling node is further configured to send the resource information table to the online scheduling node.
[0186] In summary, the offline scheduling node provided by the embodiments of the present application can uniformly manage the right to use the cloud resources in the cloud resource pool managed by the resource scheduling system. When the online scheduling node needs to use the cloud resources on a host, it needs to first request the right to use the cloud resources on the host from the offline scheduling node. And when the offline scheduling node refuses to provide the online scheduling node with the right to use the cloud resources on the host, the online scheduling node cannot use the cloud resources on the host. In this way, it is possible to avoid resource conflicts in the use of cloud resources on the host by the online scheduling node and the offline scheduling node, and it is possible to ensure the effective scheduling of the cloud resources on the host by the resource scheduling system.
[0187] As can be seen from the above, the principle of the offline scheduling node provided by the eighth aspect for unified management in the resource scheduling system is basically the same as the principle of the online scheduling node for unified management in the resource scheduling system provided by the first aspect and the resource scheduling method provided by the second aspect. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the offline scheduling node provided by the eighth aspect can refer to the working process of the online scheduling node in the resource scheduling system provided by the first aspect and the resource scheduling method provided by the second aspect accordingly, and will not be elaborated here.
[0188] In the ninth aspect of the embodiments of the present application, the embodiments of the present application further provide a computer device. The online scheduling node provided by the third aspect of the embodiments of the present application can be deployed on this computer device. Figure 5 An exemplary possible architecture diagram of the computer device is provided. As Figure 5 shown, the computer device 50 may include a processor 501, a memory 502, a communication interface 503, and a bus 504. In this computer device, the number of processors 501 may be one or more,Figure 5 Only one of the processors 501 is schematically shown. Optionally, the processor 501 may be a Central Processing Unit (CPU). If the computer device has multiple processors 501, the types of the multiple processors 501 may be different or the same. Optionally, the multiple processors of the computer device may also be integrated into a multi-core processor.
[0189] The memory 502 stores computer instructions and data. The memory 502 may store the computer instructions and data required to implement the functions of the online scheduling node provided in the third aspect of the embodiments of the present application. The memory 502 may be any one or any combination of the following storage media: non-volatile memory (such as Read-Only Memory (ROM), Solid State Disk (SSD), Hard Disk Drive (HDD), optical disc, etc.), volatile memory.
[0190] The communication interface 503 may be any one or any combination of the following devices: network interfaces (such as Ethernet interfaces), wireless network cards, and other devices with network access functions.
[0191] The communication interface 503 is used for the computer device to perform data communication with other nodes or other computer devices.
[0192] Figure 5 The bus 504 is also exemplarily drawn. The bus 504 can connect the processor 501 to the memory 502 and the communication interface 503. In this way, through the bus 504, the processor 501 can access the memory 502 and can also perform data interaction with other nodes or other computer devices by using the communication interface 503.
[0193] In the present application, when the computer device executes the computer instructions in the memory 502, it can implement the online scheduling node provided in the third aspect of the embodiments of the present application. For example, when the computer device executes the computer instructions in the memory 502, it can perform the following steps: the online scheduling node receives an online scheduling request for requesting to allocate cloud resources to a second instance, confirms the second cloud resources on the first host that need to be allocated to the second instance according to the online scheduling request, and when it is confirmed that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, refuses to provide the right to use the first cloud resources on the first host to the offline scheduling node. Moreover, when the computer device executes the computer instructions in the memory 502, the implementation process of executing this step can be correspondingly referred to the corresponding description in the above embodiments.
[0194] In a tenth aspect of the embodiments of the present application, the embodiments of the present application further provide a computer device. The offline scheduling node provided in the fourth aspect of the embodiments of the present application can be deployed on the computer device. Figure 6 A possible architecture diagram of a computer device is provided as an example. Figure 6 As shown, the computer device 60 may include a processor 601, a memory 602, a communication interface 603 and a bus 604. In the computer device, the number of the processor 601 may be one or more. Figure 6 Only one of the processors 601 is shown. Optionally, the processor 601 may be a central processing unit (CPU). If the computer device has multiple processors 601, the types of the multiple processors 601 may be different or the same. Optionally, the multiple processors of the computer device may also be integrated into a multi-core processor.
[0195] The memory 602 stores computer instructions and data. The memory 602 may store computer instructions and data required to implement the functions of the offline scheduling node provided in the fourth aspect of the embodiment of the present application. The memory 602 may be any one or any combination of the following storage media: non-volatile memory (such as read-only memory (ROM), solid state disk (SSD), hard disk (HDD), optical disk, etc.), volatile memory.
[0196] The communication interface 603 may be any one or any combination of the following devices: a network interface (such as an Ethernet interface), a wireless network card, or other devices with a network access function.
[0197] The communication interface 603 is used for the computer device to perform data communication with other nodes or other computer devices.
[0198] Figure 6 A bus 604 is also exemplarily drawn. The bus 604 can connect the processor 601 with the memory 602 and the communication interface 603. Thus, through the bus 604, the processor 601 can access the memory 602, and can also use the communication interface 603 to exchange data with other nodes or other computer devices.
[0199] In this application, when the computer device executes the computer instructions in the memory 602, it can implement the offline scheduling node provided in the fourth aspect of the embodiments of this application. For example, when the computer device executes the computer instructions in the memory 602, it can perform the following steps: The offline scheduling node confirms the first cloud resources on the first host that need to be reallocated to the first instance, and requests the right to use the first cloud resources on the first host from the online scheduling node. Moreover, when the computer device executes the computer instructions in the memory 602, the implementation process of performing this step can refer to the corresponding description in the above embodiments accordingly.
[0200] In the eleventh aspect of the embodiments of this application, the embodiments of this application further provide a computer device. The online scheduling node provided in the seventh aspect of the embodiments of this application can be deployed on this computer device. Figure 7 An exemplary possible architecture diagram of the computer device is provided. As Figure 7 shown, the computer device 70 may include a processor 701, a memory 702, a communication interface 703, and a bus 704. In this computer device, the number of processors 701 may be one or more, Figure 7 and only one processor 701 is schematically shown. Optionally, the processor 701 may be a Central Processing Unit (CPU). If the computer device has multiple processors 701, the types of the multiple processors 701 may be different or the same. Optionally, the multiple processors of the computer device may also be integrated into a multi-core processor.
[0201] The memory 702 stores computer instructions and data. The memory 702 may store the computer instructions and data required to implement the functions of the online scheduling node provided in the seventh aspect of the embodiments of this application. The memory 702 may be any one or any combination of the following storage media: non-volatile memory (such as Read-Only Memory (ROM), Solid State Disk (SSD), Hard Disk Drive (HDD), optical disc, etc.), volatile memory.
[0202] The communication interface 703 may be any one or any combination of the following devices: network interfaces (such as Ethernet interfaces), wireless network cards, and other devices with network access functions.
[0203] The communication interface 703 is used for the computer device to communicate data with other nodes or other computer devices.
[0204] Figure 7A bus 704 is also exemplarily drawn. The bus 704 can connect the processor 701 with the memory 702 and the communication interface 703. Thus, through the bus 704, the processor 701 can access the memory 702, and can also use the communication interface 703 to exchange data with other nodes or other computer devices.
[0205] In the present application, the computer device executes the computer instructions in the memory 702 to implement the online scheduling node provided in the seventh aspect of the embodiment of the present application. For example, the computer device executes the computer instructions in the memory 702 to perform the following steps: the online scheduling node receives an online scheduling request requesting to allocate cloud resources to the second instance, confirms the second cloud resources on the first host to be allocated to the second instance according to the online scheduling request, and requests the use right of the second cloud resources on the first host from the offline scheduling node. In addition, the computer device executes the computer instructions in the memory 702, and the implementation process of executing this step can refer to the corresponding description in the above embodiment.
[0206] In a twelfth aspect of the embodiments of the present application, the embodiments of the present application further provide a computer device. The offline scheduling node provided in the eighth aspect of the embodiments of the present application can be deployed on the computer device. Figure 8 A possible architecture diagram of a computer device is provided as an example. Figure 8 As shown, the computer device 80 may include a processor 801, a memory 802, a communication interface 803 and a bus 804. In the computer device, the number of the processor 801 may be one or more. Figure 8 Only one of the processors 801 is shown. Optionally, the processor 801 may be a central processing unit (CPU). If the computer device has multiple processors 801, the types of the multiple processors 801 may be different or the same. Optionally, the multiple processors of the computer device may also be integrated into a multi-core processor.
[0207] The memory 802 stores computer instructions and data. The memory 802 may store computer instructions and data required to implement the functions of the offline scheduling node provided in the eighth aspect of the embodiment of the present application. The memory 802 may be any one or any combination of the following storage media: non-volatile memory (such as read-only memory (ROM), solid state disk (SSD), hard disk (HDD), optical disk, etc.), volatile memory.
[0208] The communication interface 803 can be any one or any combination of the following devices: network interfaces (such as Ethernet interfaces), wireless network cards, and other devices with network access functions.
[0209] The communication interface 803 is used for data communication between the computer device and other nodes or other computer devices.
[0210] Figure 8 The bus 804 is also exemplarily drawn. The bus 804 can connect the processor 801 to the memory 802 and the communication interface 803. In this way, through the bus 804, the processor 801 can access the memory 802 and can also perform data interaction with other nodes or other computer devices by using the communication interface 803.
[0211] In this application, when the computer device executes the computer instructions in the memory 802, it can implement the offline scheduling node provided in the eighth aspect of the embodiments of this application. For example, when the computer device executes the computer instructions in the memory 802, it can perform the following steps: The offline scheduling node confirms the first cloud resources on the first host that need to be reallocated to the first instance. In the case of confirming that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, it refuses to provide the right to use the second cloud resources on the first host to the online scheduling node. And the implementation process of the computer device performing this step by executing the computer instructions in the memory 802 can refer to the corresponding description in the above embodiments.
[0212] In the thirteenth aspect of the embodiments of this application, the embodiments of this application also provide a storage medium, which is a non-volatile computer-readable storage medium. When the instructions in the storage medium are executed by a processor, the functions of the online scheduling node provided in the fifth aspect of the embodiments of this application are implemented.
[0213] In the fourteenth aspect of the embodiments of this application, the embodiments of this application also provide a storage medium, which is a non-volatile computer-readable storage medium. When the instructions in the storage medium are executed by a processor, the functions of the offline scheduling node provided in the sixth aspect of the embodiments of this application are implemented.
[0214] In the fifteenth aspect of the embodiments of this application, the embodiments of this application also provide a storage medium, which is a non-volatile computer-readable storage medium. When the instructions in the storage medium are executed by a processor, the functions of the online scheduling node provided in the seventh aspect of the embodiments of this application are implemented.
[0215] In the sixteenth aspect of the embodiments of this application, the embodiments of this application also provide a storage medium, which is a non-volatile computer-readable storage medium. When the instructions in the storage medium are executed by a processor, the functions of the offline scheduling node provided in the eighth aspect of the embodiments of this application are implemented.
[0216] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk, an optical disc, or the like.
[0217] In the embodiments of the present application, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. The term "at least one" means one or more, and the term "a plurality" means two or more, unless otherwise clearly defined.
[0218] The term "and / or" in the present application is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0219] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the concept and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A resource scheduling system, characterized in that, It includes an offline scheduling node and an online scheduling node. The online scheduling node is used to respond to resource requests in the instance creation requests of users, select a host for the instance to be created in the instance creation requests, perform resource allocation according to the selected host, and achieve real-time scheduling of resources. The offline scheduling node is used to reselect a host for the created instance and re-perform resource allocation according to the reselected host; The offline scheduling node is further used to confirm the first cloud resources on the first host to be allocated to the first instance, and request the right to use the first cloud resources on the first host from the online scheduling node, where the first instance is a created instance; The online scheduling node is further used to receive an online scheduling request for allocating cloud resources to a second instance, confirm the second cloud resources on the first host to be allocated to the second instance according to the online scheduling request, and refuse to provide the right to use the first cloud resources on the first host to the offline scheduling node when it is confirmed that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, where the second instance is an instance to be created.
2. The system according to claim 1, wherein, The offline scheduling node is further used to, after the right to use is refused, reconfirm the third cloud resources on the second host to be allocated to the first instance, and request the right to use the third cloud resources on the second host from the online scheduling node.
3. The system according to claim 1, wherein, The online scheduling node is further used to, when it is confirmed that there is no resource conflict between the first cloud resources and the second cloud resources on the first host, provide the right to use the first cloud resources on the first host to the offline scheduling node.
4. The system according to claim 3, characterized in that, The online scheduling node records a resource information table of the cloud resources in the cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates the occupancy status of the cloud resources; The online scheduling node is further used to, after providing the right to use the first cloud resources on the first host to the offline scheduling node, mark the occupancy status of the first cloud resources on the first host as occupied in the resource information table.
5. The system according to claim 4, wherein, The online scheduling node is further used to send the resource information table to the offline scheduling node.
6. The system according to any one of claims 3 to 5, wherein, The offline scheduling node is further used to, after the online scheduling node provides the right to use the first cloud resources on the first host to the offline scheduling node, allocate the first cloud resources on the first host to the first instance, and mark the occupancy status of the first cloud resources on the first host as occupied in the resource information table recorded by the offline scheduling node, where the resource information table at least indicates the occupancy status of the cloud resources.
7. A resource scheduling system, characterized in that, It includes an online scheduling node and an offline scheduling node. The online scheduling node is used to respond to the resource requests in the instance creation requests of users, select a host for the instance created for the instance creation request, perform resource allocation according to the selected host, and achieve real-time scheduling of resources. The offline scheduling node is used to reselect a host for the created instance and re-perform resource allocation according to the reselected host; The online scheduling node is further used to receive an online scheduling request for requesting to allocate cloud resources to a second instance, confirm the second cloud resources on the first host to which the second instance needs to be allocated according to the online scheduling request, and request the right to use the second cloud resources on the first host from the offline scheduling node. The second instance is an instance to be created; The offline scheduling node is further used to confirm the first cloud resources on the first host to which the first instance needs to be allocated. In the case of confirming that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, it refuses to provide the online scheduling node with the right to use the second cloud resources on the first host. The first instance is a created instance.
8. A resource scheduling method, characterized in that, The resource scheduling method is applied to a resource scheduling system. The resource scheduling system includes: an offline scheduling node and an online scheduling node. The online scheduling node is used to respond to the resource requests in the instance creation requests of users, select a host for the instance created for the instance creation request, perform resource allocation according to the selected host, and achieve real-time scheduling of resources. The offline scheduling node is used to reselect a host for the created instance and re-perform resource allocation according to the reselected host; The method includes: The offline scheduling node confirms the first cloud resources on the first host to which the first instance needs to be allocated, and requests the right to use the first cloud resources on the first host from the online scheduling node. The first instance is a created instance; The online scheduling node receives an online scheduling request for requesting to allocate cloud resources to a second instance, confirms the second cloud resources on the first host to which the second instance needs to be allocated according to the online scheduling request. In the case of confirming that there is a resource conflict between the first cloud resources and the second cloud resources on the first host, it refuses to provide the offline scheduling node with the right to use the first cloud resources on the first host. The second instance is an instance to be created.
9. The method according to claim 8, wherein The resource scheduling method further includes: After the right to use is refused, the offline scheduling node reconfirms the third cloud resources on the second host to which the first instance needs to be allocated, and requests the right to use the third cloud resources on the second host from the online scheduling node.
10. The method according to claim 8, characterized in that, The resource scheduling method further includes: In the case of confirming that there is no resource conflict between the first cloud resources and the second cloud resources on the first host, the online scheduling node provides the offline scheduling node with the right to use the first cloud resources on the first host.
11. The method according to claim 10, wherein, The online scheduling node records a resource information table of cloud resources in the cloud resource pool managed by the resource scheduling method. The resource information table at least indicates the occupancy status of the cloud resources. The resource scheduling method further includes: After the online scheduling node provides the usage right of the first cloud resource on the first host to the offline scheduling node, it marks the occupancy status of the first cloud resource on the first host as occupied in the resource information table.
12. The method according to claim 11, wherein The resource scheduling method further includes: The online scheduling node sends the resource information table to the offline scheduling node.
13. The method according to any one of claims 10 to 12, characterized in that, The resource scheduling method further includes: After the online scheduling node provides the usage right of the first cloud resource on the first host to the offline scheduling node, the offline scheduling node allocates the first cloud resource on the first host to the first instance, and marks the occupancy status of the first cloud resource on the first host as occupied in the resource information table recorded by the offline scheduling node. The resource information table at least indicates the occupancy status of the cloud resources.
14. A resource scheduling method, characterized in that, The resource scheduling method is applied to a resource scheduling system. The resource scheduling system includes an online scheduling node and an offline scheduling node. The online scheduling node is used to respond to resource requests in an instance creation request of a user, select a host for the instance created for the instance creation request, and perform resource allocation according to the selected host to achieve real-time scheduling of resources. The offline scheduling node is used to reselect a host for the already created instance and re-perform resource allocation according to the reselected host. The method includes: The online scheduling node receives an online scheduling request for allocating cloud resources to a second instance, confirms the second cloud resource on the first host that needs to be allocated to the second instance according to the online scheduling request, and requests the usage right of the second cloud resource on the first host from the offline scheduling node. The second instance is an instance to be created. The offline scheduling node confirms the first cloud resource on the first host that needs to be reallocated to the first instance. In the case of confirming that there is a resource conflict between the first cloud resource and the second cloud resource on the first host, it refuses to provide the usage right of the second cloud resource on the first host to the online scheduling node. The first instance is an already created instance.
Citation Information
Patent Citations
Resource management method of virtual machine system, virtual machine system, and apparatus
CN104011685A
Management method, management center and management system for cloud scheduling
WO2015192556A1