CN114138400A - Resource scheduling system and method - Google Patents

Resource scheduling system and method Download PDF

Info

Publication number
CN114138400A
CN114138400A CN202010924142.2A CN202010924142A CN114138400A CN 114138400 A CN114138400 A CN 114138400A CN 202010924142 A CN202010924142 A CN 202010924142A CN 114138400 A CN114138400 A CN 114138400A
Authority
CN
China
Prior art keywords
resource
host
cloud
scheduling node
instance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010924142.2A
Other languages
Chinese (zh)
Inventor
朱磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to CN202010924142.2A priority Critical patent/CN114138400A/en
Publication of CN114138400A publication Critical patent/CN114138400A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Abstract

The application discloses a resource scheduling system and method, and belongs to the technical field of cloud services. The resource scheduling system comprises an offline scheduling node and an online scheduling node, wherein the offline scheduling node is used for confirming first cloud resources needing to be reallocated to a first host of a first instance and requesting the online scheduling node for the use right of the first cloud resources on the first host, and the first instance is a created instance; the online scheduling node is used for receiving an online scheduling request requesting to allocate cloud resources to the second instance, confirming second cloud resources to be allocated to the first host of the second instance according to the online scheduling request, and refusing to provide the offline scheduling node with the use right of the first cloud resources on the first host under the condition that resource conflict exists between the first cloud resources and the second cloud resources on the first host, wherein the second instance is an instance to be created. According to the method and the device, the resource scheduling system can be guaranteed to effectively schedule the cloud resources on the host.

Description

Resource scheduling system and method
Technical Field
The present application relates to the field of cloud service technologies, and in particular, to a resource scheduling system and method.
Background
In recent years, virtual machine resource integration (virtual machine integration) technology has received great attention from various large cloud service providers. The virtual machine resource integration technology can achieve the purposes of resource configuration optimization such as hot spot elimination, resource fragment arrangement, Physical Machine (PM) power consumption control and the like by rescheduling the issued virtual machine resources. Where virtual machine resources refer to cloud resources on the host machine used to create the virtual machine.
Generally, an online scheduling node and an offline scheduling node are deployed in a cloud platform. The online scheduling node is used for receiving the instance creating request, and scheduling the virtual machine resources for the instance to be created according to the instance creating request, that is, allocating the cloud resources on the host for the instance to be created. And the offline scheduling node is used for rescheduling the virtual machine resources for the created instance when the virtual machine resources are determined to need to be reallocated to the created instance.
However, since both online scheduling nodes and offline scheduling nodes need to schedule virtual machine resources, there is a scheduling conflict problem.
Disclosure of Invention
The application provides a resource scheduling system and method, which can solve the problem that scheduling conflict exists because both online scheduling nodes and offline nodes need to schedule virtual machine resources.
In a first aspect, the present application provides a resource scheduling system, which includes an offline scheduling node and an online scheduling node. The offline scheduling node is used for confirming first cloud resources needing to be allocated to the first host of the first instance and requesting the use right of the first cloud resources on the first host to the online scheduling node, wherein the first instance is a created instance; the online scheduling node is used for receiving an online scheduling request requesting to allocate cloud resources to the second instance, confirming second cloud resources to be allocated to the first host of the second instance according to the online scheduling request, and refusing to provide the offline scheduling node with the use right of the first cloud resources on the first host under the condition that resource conflict exists between the first cloud resources and the second cloud resources on the first host, wherein the second instance is an instance to be created.
In the resource scheduling system provided by the application, the online scheduling node uniformly manages the use right of cloud resources in a cloud resource pool managed by the resource scheduling system, when the offline scheduling node needs to use cloud resources on a host, the online scheduling node needs to be requested for the use right of the cloud resources on the host, and when the online scheduling node refuses to provide the use 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. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured, the creation efficiency of the instance to be created is ensured, and the user experience of the cloud platform is effectively improved. In addition, through the use right of the cloud resources in the cloud resource pool managed by the online scheduling node resource scheduling system, an additional third-party component does not need to be introduced into the resource scheduling system, and the additional overhead caused by the introduction of the third-party component can be reduced.
Optionally, the offline scheduling node is further configured to, after the usage right is rejected, re-confirm the third cloud resource that needs to be allocated to the second host of the first instance, and request the usage right of the third cloud resource on the second host to the online scheduling node, so as to obtain the usage right of the cloud resource that needs to be re-allocated to the first instance, and implement resource optimization configuration on the first instance.
Optionally, the online scheduling node is further configured to provide, to the offline scheduling node, a usage right of the first cloud resource on the first host when it is determined that the first cloud resource and the second cloud resource do not have a resource conflict on the first host. In this way, the offline scheduling node can obtain the usage right of the first cloud resource on the first host, and can allocate the first cloud resource on the first host to the first instance, so that the first instance can be moved to the first cloud resource on the first host, and the resource configuration optimization of the created instance is realized.
In one implementation manner, the management of the usage right of the cloud resources in the cloud resource pool managed by the resource scheduling system by the online scheduling node can be realized through a resource information table. The online scheduling node records a resource information table of cloud resources in a cloud resource pool managed by a resource scheduling system, wherein the resource information table at least indicates the occupation state of the cloud resources. When the cloud resource to be allocated is occupied in the occupation state indicated by the resource information table, it indicates that the cloud resource has a resource conflict. Correspondingly, the implementation manner of managing the use right of the cloud resource by the online scheduling node according to the resource information table may be as follows: when the online scheduling node receives a request for requesting the use right of the first cloud resource on the first host from the offline scheduling node, the online scheduling node queries the occupation state of the first cloud resource on the first host in the resource information table, and determines that the first cloud resource on the first host has resource conflict when the occupation state of the first cloud resource on the first host is occupied, or determines that the first cloud resource on the first host has no resource conflict when the occupation state of the first cloud resource on the first host is unoccupied. And, this implementation also includes: after receiving an online scheduling request requesting to allocate cloud resources to a second instance, the online scheduling node determines cloud resources to be allocated to the hosts of the second instance from the cloud resources on all the hosts whose occupation states recorded in the resource information table are unoccupied.
And, the resource information table may be maintained by the online scheduling node. In an implementation manner, when the occupancy state of the cloud resource in the cloud resource pool changes, the online scheduling node may update the occupancy state of the cloud resource in the resource information table. For example, the online scheduling node is further configured to mark the occupancy status of the first cloud resource on the first host as occupied in the resource information table after providing the offline scheduling node with the usage right of the first cloud resource on the first host.
Because 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 know the occupation states of all the cloud resources in the cloud resource pool according to the scheduling condition of the offline scheduling node on the cloud resources on the host. Therefore, the online scheduling node is also used for sending the resource information table to the offline scheduling node.
In addition, after the offline scheduling node determines the cloud resource scheduled to the first instance, when the offline scheduling node needs to determine the cloud resource scheduled to another instance, the resource information table recorded by the offline scheduling node may not be ready to update the occupation state of the cloud resource scheduled to the first instance. At this time, in order to avoid that the cloud resources scheduled by the offline scheduling node to other instances conflict with the cloud resources scheduled to the first instance, the offline scheduling node is further configured to allocate the first cloud resources on the first host to the first instance after the online scheduling node provides the offline scheduling node with the right to use the first cloud resources on the first host, and mark the occupation state of the first cloud resources on the first host as occupied in a resource information table recorded by the offline scheduling node, where the resource information table at least indicates the occupation state of the cloud resources. Therefore, the situation that resource conflict occurs to different cloud resources which are already created and scheduled by the offline scheduling node can be avoided, and the scheduling efficiency of offline scheduling is further ensured.
In a second aspect, the present application provides a resource scheduling system, which includes an online scheduling node and an offline scheduling node. The online scheduling node is used for receiving an online scheduling request for requesting to allocate cloud resources to the second instance, confirming the second cloud resources to be allocated to the first host of the second instance according to the online scheduling request, and requesting the use right of the second cloud resources on the first host to the offline scheduling node, wherein the second instance is an instance to be created; the offline scheduling node is used for confirming that the first cloud resources on the first host of the first instance need to be reallocated, and refusing to provide the online scheduling node with the use right of the second cloud resources on the first host under the condition that the resource conflict between the first cloud resources and the second cloud resources on the first host is confirmed, wherein the first instance is a created instance.
In the resource scheduling system provided by the application, the offline scheduling node uniformly manages the use right of cloud resources in a cloud resource pool managed by the resource scheduling system, when the online scheduling node needs to use cloud resources on a host, the offline scheduling node needs to be requested for the use right of the cloud resources on the host first, and when the offline scheduling node refuses to provide the use right of the cloud resources on the host to the online scheduling node, the online scheduling node cannot use the cloud resources on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, and the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured. In addition, through the use right of the cloud resources in the cloud resource pool managed by the offline scheduling node resource scheduling system, an additional third-party component does not need to be introduced into the resource scheduling system, and the additional overhead caused by the introduction of the third-party component can be reduced.
Optionally, the online scheduling node is further configured to re-confirm the third cloud resource that needs to be allocated to the second host of the second instance after the usage right is rejected, and request the usage right of the third cloud resource on the second host from the offline scheduling node.
Optionally, the offline scheduling node is further configured to provide, to the online scheduling node, a right of use of the second cloud resource on the first host when it is determined that the resource conflict does not exist between the first cloud resource and the second cloud resource on the first host.
Optionally, the offline scheduling node records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, where the resource information table at least indicates an occupation state of the cloud resources;
optionally, the offline scheduling node is further configured to mark an occupied state of the second cloud resource on the first host as occupied in the resource information table after providing the online scheduling node with the right to use the second cloud resource on the first host.
Optionally, the offline scheduling node is further configured to send the resource information table to the online scheduling node.
Optionally, the online scheduling node is further configured to allocate the second cloud resource on the first host to the second instance after the offline scheduling node provides the usage right of the second cloud resource on the first host to the online scheduling node, and mark an occupied state of the second cloud resource on the first host as occupied in a resource information table recorded by the online scheduling node, where the resource information table at least indicates an occupied state of the cloud resource.
In a third aspect, the present application provides a resource scheduling method, where the resource scheduling method is applied to the resource scheduling system provided in the first aspect, and the resource scheduling system includes: an offline scheduling node and an online scheduling node. The method comprises the following steps: the offline scheduling node confirms first cloud resources needing to be reallocated to the first host of the first instance, and requests the online scheduling node for the use right of the first cloud resources on the first host, wherein the first instance is a created instance; the online scheduling node receives an online scheduling request requesting to allocate cloud resources to a second instance, confirms second cloud resources needing to be allocated to a first host of the second instance according to the online scheduling request, and refuses to provide the offline scheduling node with the use right of the first cloud resources on the first host under the condition that resource conflict exists between the first cloud resources and the second cloud resources on the first host, wherein the second instance is an instance to be created.
Optionally, the resource scheduling method further includes: and after the usage right is rejected, the offline scheduling node reconfirms the third cloud resource which needs to be allocated to the second host of the first instance, and requests the online scheduling node for the usage right of the third cloud resource on the second host.
Optionally, the resource scheduling method further includes: and the online scheduling node provides the first cloud resource usage right on the first host to the offline scheduling node under the condition that the first cloud resource and the second cloud resource are not in resource conflict on the first host.
Optionally, the online scheduling node records a resource information table of cloud resources in the cloud resource pool managed by the resource scheduling method, where the resource information table at least indicates an occupation state of the cloud resources. Correspondingly, the resource scheduling method further comprises the following steps: after the online scheduling node provides the offline scheduling node with the right to use the first cloud resource on the first host, the occupation state of the first cloud resource on the first host is marked as occupied in the resource information table.
Optionally, the resource scheduling method further includes: and the online scheduling node sends the resource information table to the offline scheduling node.
Optionally, the resource scheduling method further includes: after the offline scheduling node provides the offline scheduling node with the right to use the first cloud resource on the first host, the offline scheduling node allocates the first cloud resource on the first host to the first instance, and in a resource information table recorded by the offline scheduling node, the occupation state of the first cloud resource on the first host is marked as occupied, and the resource information table at least indicates the occupation state of the cloud resource.
In a fourth aspect, the present application provides a resource scheduling method, where the resource scheduling method is applied to the resource scheduling system provided in the second aspect, and the resource scheduling system includes: an online scheduling node and an offline scheduling node. The method comprises the following steps: the online scheduling node receives an online scheduling request requesting to allocate cloud resources to a second instance, confirms the second cloud resources needing to be allocated to a first host of the second instance according to the online scheduling request, and requests the offline scheduling node for the use right of the second cloud resources on the first host, wherein the second instance is an instance to be created; the offline scheduling node confirms that the first cloud resources on the first host of the first instance need to be reallocated, and refuses to provide the online scheduling node with the use right of the second cloud resources on the first host under the condition that the resource conflict between the first cloud resources and the second cloud resources on the first host is confirmed, wherein the first instance is a created instance.
Optionally, the resource scheduling method further includes: and after the usage right is rejected, 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 usage right of the third cloud resource on the second host.
Optionally, the resource scheduling method further includes: and the offline scheduling node provides the use right of the second cloud resource on the first host to the online scheduling node under the condition that the first cloud resource and the second cloud resource are not in resource conflict on the first host.
Optionally, the offline scheduling node records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, where the resource information table at least indicates an occupation state of the cloud resources. Correspondingly, the resource scheduling method further comprises the following steps: after the offline scheduling node provides the usage right of the second cloud resource on the first host to the online scheduling node, the occupation state of the second cloud resource on the first host is marked as occupation in the resource information table.
Optionally, the resource scheduling method further includes: and the offline scheduling node sends the resource information table to the online scheduling node.
Optionally, the resource scheduling method further includes: after the offline scheduling node provides the usage right of the second cloud resources on the first host to the online scheduling node, the online scheduling node allocates the second cloud resources on the first host to the second instance, and in a resource information table recorded by the online scheduling node, the occupation state of the second cloud resources on the first host is marked as occupied, and the resource information table at least indicates the occupation state of the cloud resources.
In a fifth aspect, the present application further provides an online scheduling node. The online scheduling node is used for receiving an online scheduling request requesting to allocate cloud resources to a second instance, confirming second cloud resources to be allocated to a first host of the second instance according to the online scheduling request, and refusing to provide the offline scheduling node with the use right of the first cloud resources on the first host under the condition that resource conflict exists between the first cloud resources and the second cloud resources on the first host, wherein the second instance is an instance to be created.
Optionally, the online scheduling node is further configured to provide the offline scheduling node with the usage right of the first cloud resource on the first host in a case that it is determined that the first cloud resource and the second cloud resource do not have a resource conflict on the first host.
Optionally, the online scheduling node records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, where the resource information table at least indicates an occupation state of the cloud resources. Correspondingly, the online scheduling node is further configured to mark the occupation state of the first cloud resource on the first host as occupied in the resource information table after the usage right of the first cloud resource on the first host is provided to the offline scheduling node.
And the online scheduling node is also used for sending the resource information table to the offline scheduling node.
In a sixth aspect, the present application further provides an offline scheduling node. The offline scheduling node is used for confirming the first cloud resource needing to be reallocated to the first host of the first instance, and requesting the use right of the first cloud resource on the first host from the online scheduling node, wherein the first instance is a created instance.
Optionally, the offline scheduling node is further configured to, after the usage right is rejected, reconfirm a third cloud resource that needs to be allocated to the second host of the first instance, and request the usage right of the third cloud resource on the second host from the online scheduling node.
Optionally, the offline scheduling node is further configured to, after the online scheduling node provides the offline scheduling node with the right to use the first cloud resource on the first host, allocate the first cloud resource on the first host to the first instance, and mark the occupation state of the first cloud resource on the first host as occupied in a resource information table recorded by the offline scheduling node. Wherein the resource information table indicates at least an occupation state of the cloud resource.
In a seventh aspect, the present application further provides an online scheduling node. The online scheduling node is used for receiving an online scheduling request for requesting to allocate cloud resources to a second instance, confirming second cloud resources to be allocated to a first host of the second instance according to the online scheduling request, and requesting the use right of the second cloud resources on the first host to the offline scheduling node, wherein the second instance is an instance to be created;
optionally, the online scheduling node is further configured to, after the usage right is rejected, reconfirm a 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.
Optionally, the online scheduling node is further configured to allocate the second cloud resource on the first host to the second instance after the offline scheduling node provides the usage right of the second cloud resource on the first host to the online scheduling node, and mark an occupation state of the second cloud resource on the first host as occupied in a resource information table recorded by the online scheduling node, where the resource information table at least indicates an occupation state of the cloud resource.
In an eighth aspect, the present application further provides an offline scheduling node. The offline scheduling node is used for confirming that the first cloud resources on the first host of the first instance need to be reallocated, and refusing to provide the online scheduling node with the use right of the second cloud resources on the first host under the condition that the resource conflict between the first cloud resources and the second cloud resources on the first host is confirmed, wherein the first instance is a created instance.
Optionally, the offline scheduling node is further configured to provide, to the online scheduling node, a right of use of the second cloud resource on the first host when it is determined that the resource conflict does not exist between the first cloud resource and the second cloud resource on the first host.
Optionally, the offline scheduling node records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, where the resource information table at least indicates an occupation state of the cloud resources;
optionally, the offline scheduling node is further configured to mark an occupied state of the second cloud resource on the first host as occupied in the resource information table after providing the online scheduling node with the right to use the second cloud resource on the first host.
Optionally, the offline scheduling node is further configured to send the resource information table to the online scheduling node.
In a ninth aspect, the present application provides a computer device comprising: a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the computer device realizes the function of the online scheduling node provided by the fifth aspect.
In a tenth aspect, the present application provides a computer device comprising: the processor and the memory, where the memory stores a computer program, and when the processor executes the computer program, the computer device implements the function of the offline scheduling node provided in the sixth aspect.
In an eleventh aspect, the present application provides a computer device comprising: a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the computer device realizes the function of the online scheduling node provided by the seventh aspect.
In a twelfth aspect, the present application provides a computer device comprising: the processor and the memory, wherein the memory stores a computer program, and when the processor executes the computer program, the computer device implements the function of the offline scheduling node provided by the eighth aspect.
In a thirteenth aspect, a storage medium is provided, and when executed by a processor, the instructions in the storage medium implement the functions of the online scheduling node provided in the fifth aspect.
In a fourteenth aspect, a storage medium is provided, and instructions in the storage medium, when executed by a processor, implement the functions of the offline scheduling node provided in the sixth aspect.
In a fifteenth aspect, a storage medium is provided, and instructions in the storage medium, when executed by a processor, implement the functions of the online scheduling node provided in the seventh aspect.
In a sixteenth aspect, a storage medium is provided, and when executed by a processor, the instructions in the storage medium implement the functions of the offline scheduling node provided in the eighth aspect.
Drawings
Fig. 1 is a schematic structural diagram of a resource scheduling system according to an embodiment of the present application;
fig. 2 is a flowchart of a resource scheduling method according to an embodiment of the present application;
fig. 3 is a schematic diagram of an online scheduling node uniformly managing resources in a cloud resource pool according to an embodiment of the present application;
fig. 4 is a flowchart of another resource scheduling method provided in an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of another computer device provided in the embodiments of the present application;
FIG. 7 is a schematic structural diagram of another computer device provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of still another computer device provided in an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
For the sake of understanding, the terms referred to in the embodiments of the present application will be explained below.
Virtual Machine (VM): refers to a complete computer system implemented by software simulation, having complete hardware system functionality and operating in a completely isolated environment.
Host (also called physical machine): physical resources for carrying virtualization technologies. Typically, the host used to deploy the virtual machines is typically a physical server.
Online scheduling (online scheduling): the method is used for responding to the resource request in the user instance creation request, selecting a host (also called a physical machine) for the instance created by the instance creation request, and performing resource allocation according to the selected host to realize real-time scheduling of resources so as to create the instance according to the scheduled resources.
Offline scheduling (offline scheduling): the method is used for reselecting the host for the created instance, and performing resource allocation again according to the reselected host, and performing instance relocation on the instance by the reallocated resource, thereby adjusting the allocation state of the resource in the resource pool and achieving the purpose of resource allocation optimization. For example, when a resource already issued to an instance has a performance hot spot, a high resource fragmentation rate, high energy consumption, or low resource health, it may be considered to reschedule the resource to the instance, that is, perform offline scheduling on the resource of the instance.
In a first aspect of an embodiment of the present application, an embodiment of the present application provides a resource scheduling system. As shown in fig. 1, 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 establish communication connection. The offline scheduling node 01 is configured to determine that the first cloud resource on the first host of the first instance needs to be reallocated, and request the online scheduling node 02 for a usage right of the first cloud resource on the first host. The online scheduling node 02 is configured to receive an online scheduling request requesting allocation of cloud resources to a second instance, confirm, according to the online scheduling request, second cloud resources that need to be allocated to a first host of the second instance, and refuse to provide the offline scheduling node 01 with the right of use of the first cloud resources on the first host when it is confirmed that resource conflicts exist between the first cloud resources and the second cloud resources on the first host.
The first instance is an instance already created, and the second instance is an instance to be created. Therefore, the offline scheduling node 01 confirms that the cloud resources on the host of the created instance need to be reallocated to the created instance for the created instance of the allocated cloud resources, that is, the offline scheduling node 01 is used for reallocating the cloud resources on the host to the created instance, and performs offline scheduling on the cloud resources on the host used by the created instance. The online scheduling node 02 determines, for the to-be-created instance, cloud resources that need to be allocated to the host of 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 need to be used by the to-be-created instance in the process of creating the instance, so as to create the to-be-created instance according to the cloud resources on the host that are scheduled online.
Since the offline scheduling node 01 is in the cloud resources on the host that are not occupied by the created instance, it is determined that the cloud resources on the host of the first instance need to be reallocated, that is, the first cloud resources on the first host determined by the offline scheduling node 01 are the cloud resources that are not occupied by the created instance. However, the cloud resource not occupied by the created instance may be a cloud resource that the online scheduling node 02 needs to allocate to the instance to be created. Moreover, when resource conflict exists between the online scheduling node 02 and the offline scheduling node 01 in the use of cloud resources on the host, if cloud resources allocated to the created instance by the offline scheduling node 01 preempt cloud resources allocated to the instance to be created by the online scheduling node 02, cloud resource rescheduling or failure in creating the instance to be created may be caused, which affects the creation efficiency of the instance to be created, and causes poor user experience of the cloud platform.
Therefore, in the embodiment of the present application, in order to avoid that offline scheduling of resources of an instance that has been created affects a creation process of an instance to be created, when the offline scheduling node 01 determines that a first cloud resource on a first host of a first instance needs to be reallocated, it needs to determine whether there is a conflict between the first cloud resource on the first host and a cloud resource that the online scheduling node 02 needs to allocate to the instance to be created.
In addition, in the resource scheduling system provided in this embodiment of the application, the online scheduling node 02 uniformly manages the usage right of cloud resources in the cloud resource pool managed by the resource scheduling system, and when the offline scheduling node 01 needs to use cloud resources on a host, the online scheduling node 02 needs to be requested for the usage right of the cloud resources on the host first, and when the online scheduling node 02 refuses to provide the usage right of the cloud resources on the host to the offline scheduling node 01, the offline scheduling node 01 cannot use the cloud resources on the host. Therefore, the situation that resource conflict exists in the use of cloud resources on the host by the online scheduling node 02 and the offline scheduling node 01 can be avoided, the effective scheduling of the cloud resources on the host by a resource scheduling system can be ensured, the creation efficiency of the instance to be created is ensured, and the user experience of the cloud platform is effectively improved.
The resource scheduling system can be deployed on a cloud infrastructure service platform with online scheduling capability and offline scheduling capability. The cloud infrastructure service platform can realize effective scheduling of cloud resources in the cloud infrastructure service platform through the resource scheduling system, reduce the probability of resource rescheduling caused by resource scheduling conflict in the cloud infrastructure service platform, shorten the time consumed by instance creation and instance relocation, and improve the success probability of instance creation and instance relocation.
Alternatively, both the online scheduling node 02 and the offline scheduling node 01 may be implemented using a virtual machine, a container, a physical server, or the like. For example, the online scheduling node 02 and the offline scheduling node 01 may be implemented by one server or a server cluster composed of a plurality of servers. For another example, the online scheduling unit and the offline scheduling unit may both be software running on a virtual machine.
In one implementation, the online scheduling node 02 is further configured to provide the offline scheduling node 01 with the usage right of the first cloud resource on the first host in a case that it is determined that there is no resource conflict between the first cloud resource and the second cloud resource on the first host. The first cloud resource and the second cloud resource do not have resource conflict on the first host, which indicates that the to-be-created instance does not need to use the first cloud resource on the first host, and at this time, the offline scheduling node may allocate the first cloud resource on the first host to the first instance, so that the first instance is moved to the first cloud resource on the first host, and resource configuration optimization of the created instance is achieved.
Optionally, the offline scheduling node 01 is further configured to, after the usage right of the first cloud resource on the first host is rejected, reconfirm a 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 02. That is, after the offline scheduling node 01 applies for the right to use the cloud resource on the host to the online scheduling node 02 each time, if the online scheduling node 02 rejects to provide the cloud resource on the host requested by the offline scheduling node 01 to the offline scheduling node 01, the offline scheduling node 01 may re-determine the cloud resource that needs to be allocated to the host of the first instance, and request the right to use the cloud resource on the host to the online scheduling node 02 again until the application stop condition is reached. Optionally, the application stop condition may be determined according to an application requirement, and the application stop condition is not specifically limited in this embodiment. For example, the application stop condition may indicate that, after the offline scheduling node 01 repeatedly applies for cloud resources on the host for the same instance for a preset number of times of failure, the application for cloud resources on the host allocated to the instance is stopped for the online scheduling node 02. Alternatively, the application stop condition may be that the offline scheduling node 01 acquires the usage right of the cloud resource on the host requested by the offline scheduling node 01.
In an implementation manner, the online scheduling node 02 may manage the usage right of the cloud resources in the cloud resource pool managed by the resource scheduling system through the resource information table. The resource information table at least records the occupation state of the cloud resources in the cloud resource pool. When the cloud resource to be allocated is occupied in the occupation state indicated by the resource information table, it indicates that the cloud resource has a resource conflict. Correspondingly, the implementation manner of the online scheduling node 02 managing the use right of the cloud resource according to the resource information table may be as follows: when the online scheduling node 02 receives a request for requesting the usage right of the first cloud resource on the first host from the offline scheduling node 01, the online scheduling node 02 queries the occupation state of the first cloud resource on the first host in the resource information table, and determines that the first cloud resource on the first host has a resource conflict when the occupation state of the first cloud resource on the first host is occupied, or determines that the first cloud resource on the first host has no resource conflict when the occupation state of the first cloud resource on the first host is unoccupied. And, this implementation also includes: after the online scheduling node 02 receives the online scheduling request requesting to allocate cloud resources to the second instance, the cloud resources on the hosts that need to be allocated to the second instance are determined from the cloud resources on all the hosts whose occupancy states recorded in the resource information table are unoccupied.
And, the resource information table may be maintained by the online scheduling node 02. In an implementation manner, when the occupancy state of the cloud resource in the cloud resource pool changes, the online scheduling node 02 may update the occupancy state of the cloud resource in the resource information table. For example, after determining the cloud resources on the host allocated to the instance to be created, the online scheduling node 02 may mark the occupancy status of the cloud resources on the host as occupied, and after providing the usage right of the cloud resources on the host to the offline scheduling node 01, the online scheduling node 02 marks the occupancy status of the cloud resources on the host as occupied in the resource information table.
Further, as 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 know the occupation states of all the cloud resources in the cloud resource pool according to the scheduling conditions of the offline scheduling node 01 on the cloud resources on the host. Therefore, the online scheduling node 02 may also send the resource information table to the offline scheduling node 01, so that the offline scheduling node 01 can know the occupation states of all cloud resources in the cloud resource pool managed by the resource scheduling system according to the resource information table.
The implementation manner of sending the resource information table to the offline scheduling node 01 by the online scheduling node 02 may be determined according to application requirements, and the embodiment of the present application is not particularly limited thereto. For example, the online scheduling node 02 may 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 may first send the full amount information of the resource information table to the offline scheduling node 01, and send the incremental information of the resource information table relative to the last sending process to the offline scheduling node 01 in each subsequent sending process. In addition, the time when the online scheduling node 02 sends the resource information table to the offline scheduling node 01 may also be determined according to application requirements, which is not specifically limited in this embodiment of the present application. For example, the online scheduling node 02 may send the resource information table to the offline scheduling node 01 each time information in the resource information table changes. Alternatively, the online scheduling node 02 may periodically transmit the resource information table to the offline scheduling node 01. Alternatively, the online scheduling node 02 may send the resource information table to the offline scheduling node 01 when receiving the resource information table acquisition request sent by the offline scheduling node 01.
Optionally, because the offline scheduling node 01 determines, from the cloud resources on the unoccupied hosts, the cloud resources on the hosts that need to be allocated to the created instance, the resource information table recorded in the offline scheduling node 01 may also only include the cloud resources on all the unoccupied hosts. Accordingly, the online scheduling node 02 may only send the cloud resources on the unoccupied host to the offline scheduling node 01, so that the offline scheduling node 01 updates the cloud resources on the unoccupied host recorded by the offline scheduling node 01.
In addition, after the offline scheduling node 01 determines the cloud resource scheduled to the first instance, when the offline scheduling node 01 needs to determine the cloud resource scheduled to another instance, the resource information table recorded by the offline scheduling node 01 may not be ready to update the occupancy state of the cloud resource scheduled to the first instance. At this time, in order to avoid that the cloud resources scheduled by the offline scheduling node 01 to other instances conflict with the cloud resources scheduled to the first instance, the offline scheduling node 01 may further update the occupancy state of the cloud resources scheduled to the first instance to be 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 offline scheduling node 01 with the right to use the cloud resource scheduled to the first instance, if the offline scheduling node 01 allocates the cloud resource to the first instance, the offline scheduling node 01 may mark the occupancy state of the cloud resource allocated to the first instance as occupied in the resource information table recorded by the offline scheduling node 01. Therefore, the situation that resource conflict occurs to different cloud resources which are already created and scheduled by the offline scheduling node 01 can be avoided, and the scheduling efficiency of offline scheduling is further ensured.
In the present embodiment, the resource information table is referred to as a resource information table because the resource information table describes the occupancy state of the cloud resource on the host, that is, describes the correspondence between the cloud resource on the host and the occupancy state of the cloud resource, but the name is not limited to that the data representation format of the correspondence is a table format, as long as the data representation format of the correspondence can represent the correspondence described in the resource information table.
In summary, in the resource scheduling system provided in the embodiment of the present application, the online scheduling node uniformly manages the usage right of the cloud resource in the cloud resource pool managed by the resource scheduling system, when the offline scheduling node needs to use the cloud resource on the host, the online scheduling node needs to request the usage right of the cloud resource on the host first, and when the online scheduling node refuses to provide the usage right of the cloud resource on the host to the offline scheduling node, the offline scheduling node cannot use the cloud resource on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured, the creation efficiency of the instance to be created is ensured, and the user experience of the cloud platform is effectively improved. In addition, through the use right of the cloud resources in the cloud resource pool managed by the online scheduling node resource scheduling system, an additional third-party component does not need to be introduced into the resource scheduling system, and the additional overhead caused by the introduction of the third-party component can be reduced.
In a second aspect of the embodiments of the present application, an embodiment of the present application further provides a resource scheduling method. The resource scheduling system provided in the first aspect of the embodiment of the present application may use the resource scheduling method to manage cloud resources in a cloud resource pool managed by the resource scheduling system. The following describes the implementation process of the resource scheduling method. Fig. 2 is a flowchart of a resource scheduling method provided in this embodiment. As shown in fig. 2, the resource scheduling method may include the following steps:
step 201, the offline scheduling node confirms that the first cloud resources on the first host of the first instance need to be reallocated.
The offline scheduling node may determine whether to reallocate the cloud resources to the first instance according to the allocation condition of the cloud resources in the cloud resource pool managed by the resource scheduling system. Upon determining that a reallocation of cloud resources to the first instance is required, determining that a reallocation of first cloud resources on a first host of the first instance is required. Optionally, the offline scheduling node may obtain information of a balance resource configuration condition, such as a performance hotspot, a resource fragmentation rate, energy consumption, and a resource health degree of the cloud resource in the cloud resource pool managed by the resource scheduling system, and determine that the cloud resource needs to be reallocated to the first instance when the information of the balance resource configuration condition indicates that the resource configuration needs to be improved.
After determining that resources need to be reallocated to the first instance, the offline scheduling node may calculate relocation revenue for migrating the first instance to one or more unoccupied cloud resources in the resource allocation system, and determine resources need to be reallocated to the host of the first instance according to the relocation revenue. For example, after determining that resources need to be reallocated to the first instance, the offline scheduling node calculates a relocation benefit for relocating the first instance to an unoccupied cloud resource, and when the relocation benefit is greater than a benefit threshold, may determine that the resources need to be reallocated to the first instance are the unoccupied cloud resource. Wherein the relocation profit is used for reflecting the magnitude of the beneficial effect obtained by relocation.
It should be noted that, when the offline scheduling node performs offline scheduling on the created instances, it typically performs batch scheduling on multiple created instances. Therefore, after determining that the created instances need to be scheduled offline, a preset resource allocation algorithm (e.g., a heuristic algorithm) may be used to allocate resources to the created instances. And in the process of allocating resources to the multiple created instances, an instance relocation sequence can be generated, relocation benefit of each created instance is calculated according to information indicated by the instance relocation sequence, and when relocation benefit of any created instance is greater than a relocation threshold value, 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 sequence of the created instances and the resources allocated to the created instances before and after the relocation.
Optionally, the implementation manner of calculating the relocation benefit of migrating each created instance may include: respectively obtaining the distribution balance degree of cloud resources in the resource pool managed by the resource distribution system before and after the relocation, and determining the relocation income according to the cloud resource distribution balance degree on the host after the relocation and the cloud resource distribution balance degree on the host before the relocation. In an implementation manner, the relocation profit G may be equal to a difference between the equilibrium degree θ 1 of cloud resource allocation on the host after relocation and the equilibrium degree θ 2 of cloud resource allocation on the host before relocation, that is, G ═ θ 1- θ 2.
In an implementation manner, the distribution balance degree of cloud resources in a resource pool managed by the resource distribution system at a certain time may be calculated according to the resource distribution condition of the cloud resources in the resource pool managed by the resource distribution system at the certain time. The calculation process comprises the following steps: the method comprises the steps of obtaining a distributed proportion vector which represents the distributed proportion of various types of cloud resources in a resource pool at the moment, obtaining a full 1 vector which has the same dimension as the distributed proportion vector and the modulus of each vector dimension is 1, and calculating a cosine included angle between the distributed proportion vector and the full 1 vector by using a cosine formula, wherein the cosine included angle is the distribution balance degree of the cloud resources in the resource pool at the moment.
The implementation process of obtaining the allocated proportion vector representing the allocated proportion of various types of cloud resources in the resource pool at the moment comprises the following steps: the method comprises the steps of obtaining the allocated proportion of various types of cloud resources in the cloud resources in a resource pool at the moment, and then taking the allocated proportion of various types of cloud resources at the moment as a module of a vector dimension used for representing the corresponding type of cloud resources in an allocated proportion vector to obtain the allocated proportion vector. Alternatively, the allocated proportion of any type of cloud resource at that time may be calculated as follows: the ratio of the total amount of the cloud resources of the type which can be released at the moment to the total amount of the resources of the cloud resources of the type is calculated, and then the difference between 1 and the ratio is determined as the allocated proportion of the cloud resources of the type at the moment.
Step 202, the offline scheduling node requests the online scheduling node for the usage right of the first cloud resource on the first host.
Wherein the first instance is an instance that has been created.
After the offline scheduling node confirms that the first cloud resources on the first host of the first instance need to be reallocated, the offline scheduling node can apply the usage right of the first cloud resources on the first host to the online scheduling node, so as to obtain the usage right of the first cloud resources on the first host, and allocate the first cloud resources on the first host to the first instance.
It should be noted that, if an instance relocation sequence is generated in the process of allocating resources to the multiple created instances, since the instance relocation sequence indicates the relocation sequence of the multiple created instances, when applying for the usage right of the first cloud resource on the first host to the online scheduling node, the offline scheduling node may sequentially apply for the cloud resources, which are to be allocated to the hosts of the corresponding instances, to the online scheduling node according to the sequence specified by the instance relocation instance. Or, the offline scheduling node may also sequentially apply for the cloud resources, which are correspondingly allocated to the hosts of the corresponding instances, to the online scheduling node according to the descending order of the relocation benefits corresponding to the multiple instances in the instance relocation sequence, so that the instances with higher relocation benefits are preferentially migrated under the condition of limited resources, and the optimal configuration of the resources is maximally realized.
And step 203, the online scheduling node receives an online scheduling request for requesting to allocate cloud resources to the second instance.
Wherein the second instance is an instance to be created.
When a user needs to create a second instance in the cloud platform, an instance creation request is sent to the cloud platform to request that the second instance be created in the cloud platform. Since the instance needs to rely on cloud resource creation, the instance creation request also requests allocation of cloud resources to the second instance, so as to create the second instance according to the allocated cloud resources. After receiving the instance creation request, the cloud platform sends an online scheduling request to an online scheduling node to request the online scheduling node to schedule cloud resources for the second instance.
And step 204, the online scheduling node confirms the second cloud resources which need to be distributed to the first host of the second instance according to the online scheduling request.
The instance creation request carries performance parameters of the second instance to be created to indicate performance that the second instance to be created needs to meet, and the specification of cloud resources required for creating the second instance can be determined according to the performance parameters. When the cloud platform sends an online scheduling request to the online scheduling node, the specification is sent to the online scheduling node. The online scheduling node may select, according to the specification, a cloud resource that meets the specification from cloud resources in a cloud resource pool managed by the resource scheduling system, so as to obtain a cloud resource that needs to be allocated to the second instance to be created, that is, obtain a second cloud resource on the first host of the second instance that needs to be allocated.
In one implementation, the management of the cloud resource usage rights on the host by the online scheduling node may be implemented through a resource information table. The resource information table at least records the occupation state of cloud resources on the host. When the cloud resource to be allocated is occupied in the occupation state indicated by the resource information table, it indicates that the cloud resource has a resource conflict. Correspondingly, the implementation manner of the online scheduling node managing the cloud resource usage right on the host according to the resource information table may be as follows: when the online scheduling node receives a request for requesting the use right of the first cloud resource on the first host from the offline scheduling node, the online scheduling node queries the occupation state of the first cloud resource on the first host in the resource information table, and determines that the first cloud resource on the first host has resource conflict when the occupation state of the first cloud resource on the first host is occupied, or determines that the first cloud resource on the first host has no resource conflict when the occupation state of the first cloud resource on the first host is unoccupied. And, this implementation also includes: after receiving an online scheduling request requesting to allocate cloud resources to a second instance, the online scheduling node determines cloud resources to be allocated to the hosts of the second instance from the cloud resources on all the hosts whose occupation states recorded in the resource information table are unoccupied.
And, the resource information table may be maintained by the online scheduling node. In an implementation manner, when the occupancy state of the cloud resource on the management host of the online scheduling node changes, the occupancy state of the cloud resource on the management host may be updated in the resource information table. Therefore, after determining the second cloud resource to be allocated to the first host of the second instance, the online scheduling node may mark the occupation state 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 the cloud resource.
Furthermore, because 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 know the occupation states of all the cloud resources in the cloud resource pool managed by the resource scheduling system according to the scheduling conditions of the offline scheduling node on the cloud resources on the host. Therefore, the online scheduling node may also send the resource information table to the offline scheduling node, so that the offline scheduling node can know the occupation states of all cloud resources in the cloud resource pool managed by the resource scheduling system according to the resource information table.
The implementation manner of sending the resource information table to the offline scheduling node by the online scheduling node may be determined according to application requirements, and the embodiment of the present application is not particularly limited thereto. For example, the online scheduling node may send the full amount of information of the resource information table to the offline scheduling node each time. Or, the online scheduling node may also send the full 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 last sending process to the offline scheduling node in each subsequent sending process. In addition, the time when the online scheduling node sends the resource information table to the offline scheduling node may also be determined according to application requirements, which is not specifically limited in the embodiments of the present application. For example, the online scheduling node may send the resource information table to the offline scheduling node each time information in the resource information table changes. Alternatively, the online scheduling node may periodically transmit the resource information table to the offline scheduling node. Or, the online scheduling node may send the resource information table to the offline scheduling node when receiving the resource information table acquisition request sent by the offline scheduling node.
Optionally, because the offline scheduling node determines, from the cloud resources on the unoccupied hosts, the cloud resources on the hosts that need to be allocated to the created instance, the resource information table recorded in the offline scheduling node may also only include all the cloud resources on the unoccupied hosts. Accordingly, the online scheduling node may only send the cloud resources on the unoccupied host to the offline scheduling node, so that the offline scheduling node updates the cloud resources on the unoccupied host recorded by the offline scheduling node.
In the present embodiment, the resource information table is referred to as a resource information table because the resource information table describes the occupancy state of the cloud resource on the host, that is, describes the correspondence between the cloud resource on the host and the occupancy state of the cloud resource, but the name is not limited to that the data representation format of the correspondence is a table format, as long as the data representation format of the correspondence can represent the correspondence described in the resource information table.
Step 205, the online scheduling node determines whether a resource conflict exists between the first cloud resource and the second cloud resource on the first host.
After the online scheduling node receives a request of requesting, by the offline scheduling node, the usage right of the first cloud resource on the first host, it may be determined whether a conflict exists between the first cloud resource on the first host and a second cloud resource on the first host that the online scheduling node needs to allocate to the second instance, and it is determined whether to provide the usage right of the first cloud resource on the first host to the offline scheduling node according to whether a conflict exists between the first cloud resource on the first host and the second cloud resource on the first host, so that the second cloud resource on the first host can be successfully allocated to the second instance. Wherein step 206 is performed when there is a conflict between a first cloud resource on the first host and a second cloud resource on the first host. Step 208 is performed when there is no conflict between the first cloud resources on the first host and the second cloud resources on the first host.
The online scheduling node records a resource information table, the resource information table at least indicates the occupation state of the cloud resources in the cloud resource pool managed by the resource scheduling system, and when determining that the second cloud resources on the first host need to be allocated to the second instance, the online scheduling node modifies the occupation state of the second cloud resources on the first host into occupation. And if the first cloud resource on the first host and the second cloud resource on the first host have resource conflict, when the occupation state of the second cloud resource on the first host is modified to be occupied, the first cloud resource on the first host is marked to be occupied. Therefore, the online scheduling node may query the resource information table for the occupation state of the first cloud resource on the first host to determine whether a resource conflict exists between the first cloud resource on the first host and the second cloud resource on the first host. And when the occupation state of the first cloud resource on the first host is occupation, determining that the first cloud resource on the first host has resource conflict with the second cloud resource on the first host, and when the occupation state of the first cloud resource on the first host is unoccupied, determining that the first cloud resource on the first host has no resource conflict with the second cloud resource on the first host.
Step 206, the online scheduling node refuses to provide the offline scheduling node with the right of use of the first cloud resource on the first host under the condition that the resource conflict between the first cloud resource and the second cloud resource exists on the first host.
When a resource conflict exists between a first cloud resource and a second cloud resource on a first host, if the right of use of the first cloud resource is provided for an offline scheduling node, a situation that the offline scheduling node and an online scheduling node contend for the cloud resource occurs, and if the offline scheduling node contends for the cloud resource, scheduling of the online scheduling node fails, the creation process of a second instance is affected. Therefore, in order to ensure the creation efficiency of the second instance, the online scheduling node may refuse to provide the offline scheduling node with the usage right of the first cloud resource on the first host to give priority to the cloud resource for the second instance to use in the case that it is determined that the first cloud resource and the second cloud resource have resource conflict on the first host.
Step 207, after the usage right is rejected, the offline scheduling node reconfirms the third cloud resource that needs to be allocated to the second host of the first instance, and requests the usage right of the third cloud resource on the second host from the online scheduling node.
After the offline scheduling node applies for the usage right of the cloud resource on the host to the online scheduling node each time, if the online scheduling node refuses to provide the cloud resource on the host requested by the offline scheduling node to the offline scheduling node, the offline scheduling node may re-determine the cloud resource to be allocated to the host of the first instance, and request the usage right of the cloud resource on the host to the online scheduling node again until the application stop condition is reached. Optionally, the application stop condition may be determined according to an application requirement, and the application stop condition is not specifically limited in this embodiment. For example, the application stop condition may indicate that the application of the cloud resources on the host allocated to the instance to the online scheduling node is stopped after the offline scheduling node repeatedly applies for the cloud resources on the host for the same instance for a preset number of times of failure. Or, the application stop condition may be that the offline scheduling node acquires the usage right of the cloud resource on the host requested by the offline scheduling node. The implementation process of step 207 refers to the implementation process of step 201, and is not described herein again.
And step 208, the online scheduling node provides the offline scheduling node with the right of use of the first cloud resource on the first host under the condition that the first cloud resource and the second cloud resource are not in resource conflict on the first host.
When the resource conflict does not exist between the first cloud resource and the second cloud resource on the first host, it indicates that the second instance does not need to use the first cloud resource on the first host, and the offline scheduling node uses the first cloud resource without affecting the creation of the second instance, so that the online scheduling node may provide the offline scheduling node with the right to use the first cloud resource on the first host.
Illustratively, as shown in fig. 3, the cloud resources in the cloud resource pool managed by the resource scheduling system include cloud resources on hosts PM1 through PM4, where black filled in fig. 3 indicates that the cloud resources are occupied and white filled indicates that the cloud resources are unoccupied. After receiving the online scheduling request requesting to create the 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 need, it determines that the cloud resource to be allocated to the first instance is a cloud resource on the host PM2, and after determining the cloud resource, the offline scheduling node applies for a usage right of the cloud resource on the host PM2 to the online scheduling node. After receiving the request of the offline scheduling node, 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, and then allocates the usage right providing the cloud resources on the host PM2 to the offline scheduling node.
In addition, in order 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 resource on the first host, the occupation state of the first cloud resource on the first host may be marked as occupied in the resource information table.
Step 209, the offline scheduling node allocates a first cloud resource on the first host to the first instance.
After the offline scheduling node obtains the usage right of the first cloud resource on the first host, the offline scheduling node may allocate the first cloud resource on the first host to the first instance, so as to move the first instance to the first cloud resource on the first host.
Moreover, after the offline scheduling node determines the cloud resource scheduled to the first instance, when the offline scheduling node needs to determine the cloud resource scheduled to another instance, the resource information table recorded by the offline scheduling node may not be ready to update the occupation state of the cloud resource scheduled to the first instance. At this time, in order to avoid that the cloud resources scheduled by the offline scheduling node to other instances conflict with the cloud resources scheduled to the first instance, the offline scheduling node may further update the occupancy state of the cloud resources scheduled to the first instance to be occupied in the resource information table recorded by the offline scheduling node after determining the cloud resources scheduled to the first instance. For example, after the online scheduling node provides the offline scheduling node with the right to use the cloud resource scheduled to the first instance, if the offline scheduling node allocates the cloud resource to the first instance, the offline scheduling node may mark, in a resource information table recorded by the offline scheduling node, the occupancy state of the cloud resource allocated to the first instance as occupied. Therefore, the situation that resource conflict occurs to different cloud resources which are already created and scheduled by the offline scheduling node can be avoided, and the scheduling efficiency of offline scheduling is further ensured.
Optionally, to ensure the ordered resource scheduling, the online scheduling node may set an effective duration of the cloud resource usage right, and when the cloud resource is not used in the effective duration, the online scheduling node may reallocate the cloud resource. The effective time period may be set according to application requirements, for example, the effective time period may be 10 minutes.
If an instance relocation sequence is generated in the process of resource allocation for the multiple created instances, because the instance relocation sequence indicates the relocation sequence of the multiple created instances, multiple to-be-relocated instances related to the relocation sequence can be sequentially relocated according to the sequence indicated by the relocation sequence or the sequence of relocation benefits corresponding to the multiple instances in the instance relocation sequence from large to small, and if a resource conflict exists between a cloud resource which needs to be allocated to a certain to-be-relocated instance by the offline scheduling node and a cloud resource which needs to be allocated to the to-be-created instance by the online scheduling node, the to-be-relocated instance with the resource conflict is abandoned when the multiple to-be-relocated instances are relocated according to the sequence.
And the transferring operation of the instance to be transferred can be executed according to the state of the instance to be transferred. After the offline scheduling node generates the relocation sequence, the state of each to-be-relocated instance in the relocation sequence can be modified into a PREPARE (PREPARE) state, when the use right of the cloud resource needing to be allocated to the to-be-relocated instance is obtained, the state of the to-be-relocated instance is modified into a STANDBY (STANDBY) state, and when the online scheduling node refuses to provide the use right of the cloud resource needing to be allocated to the to-be-relocated instance to the offline scheduling node, the state of the to-be-relocated instance is modified into a SKIP (SKIP) state. When the relocation operation is executed on the to-be-relocated example, the to-be-relocated example in the complete state can be relocated, and relocation of the to-be-relocated example in the skip state is abandoned. In addition, in the relocation process, the identification number of the instance relocated to the reallocated resource may be reset, for example, the identification number of the instance to be relocated is modified to be the sum of the identification number of the instance to be relocated and the 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 be the identification number of the instance before the relocation, so as to complete the update of the instance in the system.
In summary, in the resource management method provided in this embodiment of the present application, the online scheduling node uniformly manages the usage right of the cloud resource in the cloud resource pool managed by the resource scheduling system, when the offline scheduling node needs to use the cloud resource on the host, the online scheduling node needs to request the usage right of the cloud resource on the host first, and when the online scheduling node refuses to provide the usage right of the cloud resource on the host to the offline scheduling node, the offline scheduling node cannot use the cloud resource on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured, the creation efficiency of the instance to be created is ensured, and the user experience of the cloud platform is effectively improved. In addition, through the use right of the cloud resources in the cloud resource pool managed by the online scheduling node resource scheduling system, an additional third-party component does not need to be introduced into the resource scheduling system, and the additional overhead caused by the introduction of the third-party component can be reduced.
It should be noted that the resource management method provided by the present application is not limited to be used in a resource scheduling scenario of an example, and may also be used in other hybrid scheduling systems that use a unified scheduling unit as a resource decision module on demand, and the embodiment of the present application does not specifically limit the method.
It should be further noted that, the order of the steps of the resource scheduling method provided in the embodiment of the present application may be appropriately adjusted, and the steps may also be increased or decreased according to the circumstances, and any method that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application shall be included in the protection scope of the present application, and therefore, no further description is given.
In a third aspect of the embodiments of the present application, an embodiment of the present application further provides an online scheduling node. The online scheduling node is used for receiving an online scheduling request requesting to allocate cloud resources to a second instance, confirming second cloud resources to be allocated to a first host of the second instance according to the online scheduling request, and refusing to provide the offline scheduling node with the use right of the first cloud resources on the first host under the condition that resource conflict exists between the first cloud resources and the second cloud resources on the first host, wherein the second instance is an instance to be created.
Optionally, the online scheduling node is further configured to provide the offline scheduling node with the usage right of the first cloud resource on the first host in a case that it is determined that the first cloud resource and the second cloud resource do not have a resource conflict on the first host.
Optionally, the online scheduling node records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, where the resource information table at least indicates an occupation state of the cloud resources. Correspondingly, the online scheduling node is further configured to mark the occupation state of the first cloud resource on the first host as occupied in the resource information table after the usage right of the first cloud resource on the first host is provided to the offline scheduling node.
And the online scheduling node is also used for sending the resource information table to the offline scheduling node.
In summary, the online scheduling node provided in the embodiment of the present application may uniformly manage the usage right of cloud resources in a cloud resource pool managed by a resource scheduling system, and when an offline scheduling node needs to use cloud resources on a host, the offline scheduling node needs to request the online scheduling node for the usage right of cloud resources on the host. And when the online scheduling node refuses to provide the offline scheduling node with the right of use of the cloud resources on the host, the offline scheduling node cannot use the cloud resources on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, and the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the online scheduling node described above may refer to the resource scheduling system provided in the foregoing first aspect and the working process of the online scheduling node in the resource scheduling method provided in the foregoing second aspect, and is not described herein again.
In a fourth aspect of the embodiments of the present application, an offline scheduling node is further provided in the embodiments of the present application. The offline scheduling node is used for confirming the first cloud resource needing to be reallocated to the first host of the first instance, and requesting the use right of the first cloud resource on the first host from the online scheduling node, wherein the first instance is a created instance.
Optionally, the offline scheduling node is further configured to, after the usage right is rejected, reconfirm a third cloud resource that needs to be allocated to the second host of the first instance, and request the usage right of the third cloud resource on the second host from the online scheduling node.
Optionally, the offline scheduling node is further configured to, after the online scheduling node provides the offline scheduling node with the right to use the first cloud resource on the first host, allocate the first cloud resource on the first host to the first instance, and mark the occupation state of the first cloud resource on the first host as occupied in a resource information table recorded by the offline scheduling node. Wherein the resource information table indicates at least an occupation state of the cloud resource.
In summary, the offline scheduling node provided in the embodiment of the present application needs to request the usage right of the cloud resource on the host from the online scheduling node when the offline scheduling node needs to use the cloud resource on the host. And when the online scheduling node refuses to provide the offline scheduling node with the right of use of the cloud resources on the host, the offline scheduling node cannot use the cloud resources on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, and the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the offline scheduling node described above may refer to the resource scheduling system provided in the foregoing first aspect and the working process of the offline scheduling node in the resource scheduling method provided in the foregoing second aspect, and details are not repeated herein.
In a fifth aspect of the embodiments of the present application, an embodiment of the present application further provides a resource scheduling system. As shown in fig. 1, the resource scheduling system includes: online scheduling node 02 and offline scheduling node 01. The offline scheduling node 01 and the online scheduling node 02 establish communication connection. And the online scheduling node 02 is configured to receive an online scheduling request requesting allocation of cloud resources to a second instance, confirm, according to the online scheduling request, second cloud resources to be allocated to a first host of the second instance, and request, to the offline scheduling node 01, a right of use of the second cloud resources on the first host, where the second instance is an instance to be created. The offline scheduling node 01 is configured to determine that a first cloud resource on a first host of the first instance needs to be reallocated, and refuse to provide the online scheduling node 02 with the right to use a second cloud resource on the first host when it is determined that the first cloud resource and the second cloud resource have a resource conflict on the first host, where the first instance is a created instance.
In the resource scheduling system provided by the application, the offline scheduling node 01 uniformly manages the use right of cloud resources in a cloud resource pool managed by the resource scheduling system, when the online scheduling node 02 needs to use cloud resources on a host, the offline scheduling node 01 needs to be requested for the use right of the cloud resources on the host, and when the offline scheduling node 01 refuses to provide the use right of the cloud resources on the host to the online scheduling node 02, the online scheduling node 02 cannot use the cloud resources on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node 02 and the offline scheduling node 01 can be avoided, and the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured. In addition, through the use right of the cloud resources in the cloud resource pool managed by the resource scheduling system of the offline scheduling node 01, an additional third-party component does not need to be introduced into the resource scheduling system, and the additional overhead caused by the introduction of the third-party component can be reduced.
Optionally, the online scheduling node 02 is further configured to, after the usage right is rejected, re-confirm the third cloud resource that needs to be allocated to the second host of the second instance, and request the usage right of the third cloud resource on the second host from the offline scheduling node 01.
Optionally, the offline scheduling node 01 is further configured to provide the usage right of the second cloud resource on the first host to the online scheduling node 02 under the condition that it is determined that the resource conflict does not exist between the first cloud resource and the second cloud resource on the first host.
Optionally, the offline scheduling node 01 records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, where the resource information table at least indicates an occupation state of the cloud resources.
Optionally, the offline scheduling node 01 is further configured to mark the occupation state of the second cloud resource on the first host as occupied in the resource information table after providing the usage right of the second cloud resource on the first host to the online scheduling node 02.
Optionally, the offline scheduling node 01 is further configured to send the resource information table to the online scheduling node 02.
Optionally, the online scheduling node 02 is further configured to, after the offline scheduling node 01 provides the online scheduling node 02 with the right to use the second cloud resource on the first host, allocate the second cloud resource on the first host to the second instance, and mark the occupation state of the second cloud resource on the first host as occupied in a resource information table recorded by the online scheduling node 02, where the resource information table at least indicates the occupation state of the cloud resource.
As can be seen from the above, in the resource scheduling system provided in the 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. The principle of the offline scheduling node implementing unified management in the resource scheduling system is substantially the same as the principle of the online scheduling node implementing unified management in the resource scheduling system provided by the first aspect and the resource scheduling method provided by the second aspect, and the principle of the online scheduling node being managed in the resource scheduling system is substantially the same as the principle of the offline scheduling node being managed in the resource scheduling system provided by the first aspect and the resource scheduling method provided by the second aspect. In the resource scheduling system provided in the fifth aspect, the specific working process of the offline scheduling node may refer to the working process of the online scheduling node in the resource scheduling system provided in the first aspect and the resource scheduling method provided in the second aspect, and the specific working process of the online scheduling node may 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, which is not described herein again.
In a sixth aspect of the embodiments of the present application, an embodiment of the present application further provides a resource scheduling method. The resource scheduling system provided in the fifth aspect of the embodiment of the present application may use the resource scheduling method to manage cloud resources in a cloud resource pool managed by the resource scheduling system. The following describes the implementation process of the resource scheduling method. Fig. 4 is a flowchart of a resource scheduling method provided in this embodiment. As shown in fig. 4, the resource scheduling method may include the following steps:
step 401, the online scheduling node receives an online scheduling request requesting to allocate cloud resources to the second instance.
Wherein the second instance is an instance to be created. The implementation process of step 401 refers to the implementation process of step 203, and is not described herein again.
Step 402, the online scheduling node confirms the second cloud resource to be allocated to the first host of the second instance according to the online scheduling request.
The implementation process of step 402 refers to the implementation process of step 204, and is not described herein again.
Step 403, the online scheduling node requests the offline scheduling node for the usage right of the second cloud resource on the first host.
The implementation process of step 403 please refer to the implementation process of step 202, which is not described herein again.
Step 404, the offline scheduling node confirms that the first cloud resources on the first host of the first instance need to be reallocated.
Wherein the first instance is an instance that has been created. The implementation process of step 404 refers to the implementation process of step 201, and is not described herein again.
Step 405, the offline scheduling node determines whether a resource conflict exists between the first cloud resource and the second cloud resource on the first host.
Wherein step 406 is performed when there is a conflict between a first cloud resource on the first host and a second cloud resource on the first host. Step 408 is performed when there is no conflict between a first cloud resource on the first host and a second cloud resource on the first host. The implementation process of step 405 refers to the implementation process of step 205, and is not described herein again.
In one implementation, the management of the cloud resource usage rights on the host by the offline scheduling node may be implemented by a resource information table. The resource information table at least records the occupation state of cloud resources on the host. The specific implementation manner of the resource information table and the implementation manner of the offline scheduling node managing the cloud resources according to the resource information table may correspond to the corresponding description in the resource scheduling system provided in the first aspect and the resource scheduling method provided in the second aspect, and details are not repeated here.
In addition, as 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 know the occupation states of all the cloud resources in the cloud resource pool managed by the resource scheduling system according to the scheduling condition of the online scheduling node on the cloud resources on the host. Therefore, the resource scheduling method further includes: and the offline scheduling node sends the resource information table to the online scheduling node. Moreover, the implementation manner of the offline scheduling node sending the resource information table to the online scheduling node may refer to the corresponding description in the resource scheduling method provided in the foregoing second aspect, which is not described herein again.
And 406, the offline scheduling node refuses to provide the online scheduling node with the right of use of the second cloud resource on the first host under the condition that the resource conflict between the first cloud resource and the second cloud resource on the first host is confirmed.
The implementation process of step 406 refers to the implementation process of step 206, and is not described herein again.
Step 407, after the usage right is rejected, the online scheduling node reconfirms the third cloud resource that needs to be allocated to the second host of the second instance, and requests the usage right of the third cloud resource on the second host from the offline scheduling node.
The implementation process of step 407 refers to the implementation process of step 207, and is not described herein again.
Step 408, the offline scheduling node provides the online scheduling node with the right of use of the second cloud resource on the first host under the condition that it is determined that the resource conflict does not exist between the first cloud resource and the second cloud resource on the first host.
The implementation process of step 408 please refer to the implementation process of step 208, which is not described herein again.
Optionally, the offline scheduling node records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, where the resource information table at least indicates an occupation state of the cloud resources. Correspondingly, the resource scheduling method further comprises the following steps: after the offline scheduling node provides the usage right of the second cloud resource on the first host to the online scheduling node, the occupation state of the second cloud resource on the first host is marked as occupation in the resource information table.
Step 409, the online scheduling node allocates a second cloud resource on the first host to the second instance.
After the online scheduling node obtains the usage right of the second cloud resource on the first host, the second cloud resource on the first host may be allocated to the second instance, so as to create the second instance on the second cloud resource on the first host.
Optionally, after the online scheduling node allocates the second cloud resource on the first host to the second instance, the resource information table recorded by the online scheduling node may mark the occupation state of the second cloud resource on the first host as occupied, and the resource information table at least indicates the occupation state of the cloud resource.
In summary, in the resource scheduling method provided by the present application, the offline scheduling node uniformly manages the right to use the cloud resource in the cloud resource pool managed by the resource scheduling system, when the online scheduling node needs to use the cloud resource on the host, the offline scheduling node needs to request the right to use the cloud resource on the host first, and when the offline scheduling node refuses to provide the right to use the cloud resource on the host to the online scheduling node, the online scheduling node cannot use the cloud resource on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, and the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured. In addition, through the use right of the cloud resources in the cloud resource pool managed by the offline scheduling node resource scheduling system, an additional third-party component does not need to be introduced into the resource scheduling system, and the additional overhead caused by the introduction of the third-party component can be reduced.
It should be noted that, the order of steps of the resource scheduling method provided in the embodiment of the present application may be appropriately adjusted, and the steps may also be increased or decreased according to the situation. Any method that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application is covered by the protection scope of the present application, and thus the detailed description thereof is omitted.
In a seventh aspect of the embodiments of the present application, an embodiment of the present application further provides an online scheduling node. The online scheduling node is used for receiving an online scheduling request requesting to allocate cloud resources to a second instance, confirming second cloud resources to be allocated to a first host of the second instance according to the online scheduling request, and requesting the offline scheduling node for the use right of the second cloud resources on the first host, wherein the second instance is an instance to be created.
Optionally, the online scheduling node is further configured to, after the usage right is rejected, reconfirm a 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.
Optionally, the online scheduling node is further configured to allocate, to the first instance, the second cloud resource on the first host after the offline scheduling node provides the online scheduling node with the right to use the second cloud resource on the first host, and mark, in a resource information table recorded by the online scheduling node, an occupied state of the second cloud resource on the first host as occupied, where the resource information table at least indicates an occupied state of the cloud resource.
In summary, the online scheduling node provided in the embodiment of the present application needs to request the offline scheduling node for the right to use the cloud resource on the host when the online scheduling node needs to use the cloud resource on the host. And when the offline scheduling node refuses to provide the online scheduling node with the right of use of the cloud resource on the host, the online scheduling node cannot use the cloud resource on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, and the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured.
As can be seen from the above, the principle that the online scheduling node is managed in the resource scheduling system in the seventh aspect is substantially the same as the principle that the offline scheduling node is managed in the resource scheduling system in the first aspect and the resource scheduling method in the second aspect. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the online scheduling node provided in the seventh aspect may refer to the resource scheduling system provided in the foregoing first aspect and the working process of the offline scheduling node in the resource scheduling method provided in the foregoing second aspect, which is not described herein again.
In an eighth aspect of the embodiments of the present application, an offline scheduling node is further provided in the embodiments of the present application. The offline scheduling node is used for confirming that the first cloud resources on the first host of the first instance need to be reallocated, and refusing to provide the online scheduling node with the use right of the second cloud resources on the first host under the condition that the resource conflict between the first cloud resources and the second cloud resources on the first host is confirmed, wherein the first instance is a created instance.
Optionally, the offline scheduling node is further configured to provide, to the online scheduling node, a right of use of the second cloud resource on the first host when it is determined that the resource conflict does not exist between the first cloud resource and the second cloud resource on the first host.
Optionally, the offline scheduling node records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, where the resource information table at least indicates an occupation state of the cloud resources.
Optionally, the offline scheduling node is further configured to mark an occupied state of the second cloud resource on the first host as occupied in the resource information table after providing the online scheduling node with the right to use the second cloud resource on the first host.
Optionally, the offline scheduling node is further configured to send the resource information table to the online scheduling node.
In summary, the offline scheduling node provided in the embodiment of the present application may uniformly manage the usage right of cloud resources in a cloud resource pool managed by a resource scheduling system, and when the online scheduling node needs to use cloud resources on a host, the offline scheduling node needs to request the usage right of cloud resources on the host first. And when the offline scheduling node refuses to provide the online scheduling node with the right of use of the cloud resource on the host, the online scheduling node cannot use the cloud resource on the host. Therefore, the situation that resource conflict exists in the use of the cloud resources on the host by the online scheduling node and the offline scheduling node can be avoided, and the effective scheduling of the cloud resources on the host by the resource scheduling system can be ensured.
As can be seen from the above, the principle that the offline scheduling node implements unified management in the resource scheduling system according to the eighth aspect is substantially the same as the principle that the online scheduling node implements unified management in the resource scheduling system according to the first aspect and the resource scheduling method according to the second aspect. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the offline scheduling node provided in the eighth aspect may 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, and is not described herein again.
In a ninth aspect of the embodiments of the present application, an embodiment of the present application further provides a computer device. The online scheduling node provided by the third aspect of the embodiments of the present application may be deployed on the computer device. Fig. 5 schematically provides a possible architecture diagram of a computer device. As shown in fig. 5, the computer device 50 may include a processor 501, a memory 502, a communication interface 503, and a bus 504. In the computer device, the number of the processors 501 may be one or more, and fig. 5 illustrates only one of the processors 501. Alternatively, 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 may be the same. Optionally, multiple processors of the computer device may also be integrated into a multi-core processor.
The memory 502 stores computer instructions and data, and the memory 502 may store computer instructions and data required to implement the functionality of the online scheduling node provided by 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: nonvolatile Memory (e.g., Read-Only Memory (ROM), Solid State Disk (SSD), Hard Disk Drive (HDD), optical disc, etc., volatile Memory.
The communication interface 503 may be any one or any combination of the following devices: network interface (such as Ethernet interface), wireless network card, etc.
The communication interface 503 is used for data communication of the computer device with other nodes or other computer devices.
Fig. 5 also illustratively depicts a bus 504. The bus 504 may connect the processor 501 with the memory 502 and the communication interface 503. Thus, the processor 501 may access the memory 502 via the bus 504 and may also interact with other nodes or other computer devices using the communication interface 503.
In the present application, the online scheduling node provided in the third aspect of the embodiments of the present application can be implemented by a computer device executing computer instructions in the memory 502. For example, execution of computer instructions in memory 502 by a computer device may 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 to be allocated to the first host of the second instance according to the online scheduling request, and refuses to provide the offline scheduling node with the use right of the first cloud resources on the first host under the condition that the first cloud resources and the second cloud resources are confirmed to have resource conflict on the first host. Moreover, the computer device executes the computer instructions in the memory 502, and accordingly, the implementation process of executing the step may refer to the corresponding description in the above embodiments.
In a tenth aspect of embodiments of the present application, embodiments of the present application further provide a computer device. The offline scheduling node provided in the fourth aspect of the embodiment of the present application may be deployed on the computer device. Fig. 6 schematically provides a possible architecture diagram of a computer device. As shown in fig. 6, 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 processors 601 may be one or more, and fig. 6 only illustrates one of the processors 601. Alternatively, 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 may be the same. Optionally, multiple processors of the computer device may also be integrated into a multi-core processor.
The memory 602 stores computer instructions and data, and the memory 602 may store computer instructions and data required to implement the functions of the offline scheduling node provided by the fourth aspect of the embodiments of the present application. The memory 602 may be any one or any combination of the following storage media: nonvolatile Memory (e.g., Read-Only Memory (ROM), Solid State Disk (SSD), Hard Disk Drive (HDD), optical disc, etc., volatile Memory.
The communication interface 603 may be any one or any combination of the following devices: network interface (such as Ethernet interface), wireless network card, etc.
Communication interface 603 is used for data communication of the computer device with other nodes or other computer devices.
Fig. 6 also illustratively depicts bus 604. The bus 604 may connect the processor 601 with the memory 602 and the communication interface 603. Thus, the processor 601 has access to the memory 602 via the bus 604 and may also interact with other nodes or other computer devices using the communication interface 603.
In the present application, a computer device executing computer instructions in the memory 602 may implement the offline scheduling node provided in the fourth aspect of the embodiment of the present application. For example, execution of computer instructions in memory 602 by a computer device may perform the following steps: the offline scheduling node confirms the first cloud resources needing to be reallocated to the first host of the first instance, and requests the online scheduling node for the use right of the first cloud resources on the first host. Moreover, the computer device executes the computer instructions in the memory 602, and accordingly, the implementation process of executing this step may refer to the corresponding description in the above embodiments.
In an eleventh aspect of embodiments of the present application, embodiments of the present application further provide a computer device. The online scheduling node provided in the seventh aspect of the embodiment of the present application may be deployed on the computer device. Fig. 7 schematically provides a possible architecture diagram of a computer device. As shown in fig. 7, the computer device 70 may include a processor 701, a memory 702, a communication interface 703 and a bus 704. In the computer device, the number of the processors 701 may be one or more, and fig. 7 illustrates only one of the processors 701. Alternatively, 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 may be the same. Optionally, multiple processors of the computer device may also be integrated into a multi-core processor.
The memory 702 stores computer instructions and data, and the memory 702 may store computer instructions and data required for implementing the functions of the online scheduling node provided by the seventh aspect of the embodiments of the present application. Memory 702 can be any one or any combination of the following storage media: nonvolatile Memory (e.g., Read-Only Memory (ROM), Solid State Disk (SSD), Hard Disk Drive (HDD), optical disc, etc., volatile Memory.
The communication interface 703 may be any one or any combination of the following devices: network interface (such as Ethernet interface), wireless network card, etc.
Communication interface 703 is used for data communication between the computer device and other nodes or other computer devices.
Fig. 7 also illustratively depicts bus 704. The bus 704 may connect the processor 701 with the memory 702 and the communication interface 703. Thus, the processor 701 may access the memory 702 via the bus 704 and may also interact with other nodes or other computer devices using the communication interface 703.
In the present application, the online scheduling node provided in the seventh aspect of the embodiments of the present application can be implemented by a computer device executing computer instructions in the memory 702. For example, execution of computer instructions in memory 702 by a computer device may perform the following steps: and the online scheduling node receives an online scheduling request for requesting to allocate the cloud resources to the second instance, confirms the second cloud resources to be allocated to the first host of the second instance according to the online scheduling request, and requests the offline scheduling node for the use right of the second cloud resources on the first host. Moreover, the computer device executes the computer instructions in the memory 702, and accordingly, the implementation process of executing this step may refer to the corresponding description in the above embodiments.
In a twelfth aspect of the embodiments of the present application, an embodiment of the present application further provides a computer device. The offline scheduling node provided by the eighth aspect of the embodiment of the present application may be deployed on the computer device. Fig. 8 schematically provides a possible architecture diagram of a computer device. As shown in fig. 8, 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 processors 801 may be one or more, and fig. 8 illustrates only one of the processors 801. Alternatively, the processor 801 may be a Central Processing Unit (CPU). If the computer device has multiple processors 801, the multiple processors 801 may be of different types or may be the same type. Optionally, multiple processors of the computer device may also be integrated into a multi-core processor.
The memory 802 stores computer instructions and data, and the memory 802 may store computer instructions and data required to implement the functions of the offline scheduling node provided by the eighth aspect of the embodiments of the present application. The memory 802 may be any one or any combination of the following storage media: nonvolatile Memory (e.g., Read-Only Memory (ROM), Solid State Disk (SSD), Hard Disk Drive (HDD), optical disc, etc., volatile Memory.
The communication interface 803 may be any one or any combination of the following devices: network interface (such as Ethernet interface), wireless network card, etc.
Communication interface 803 is used for data communication by computer devices with other nodes or other computer devices.
Fig. 8 also illustratively depicts bus 804. The bus 804 may connect the processor 801 with the memory 802 and the communication interface 803. Thus, the processor 801 may access the memory 802 via the bus 804 and may also interact with other nodes or other computer devices using the communication interface 803.
In this application, a computer device executing computer instructions in the memory 802 may implement the offline scheduling node provided in the eighth aspect of the embodiment of the present application. For example, execution of computer instructions in memory 802 by a computer device may perform the following steps: the offline scheduling node confirms that the first cloud resources on the first host of the first instance need to be reallocated, and refuses to provide the online scheduling node with the use right of the second cloud resources on the first host under the condition that the resource conflict between the first cloud resources and the second cloud resources on the first host is confirmed. Moreover, the computer device executes the computer instructions in the memory 802, and accordingly, the implementation process of executing this step may refer to the corresponding description in the above embodiments.
In a thirteenth aspect of embodiments of the present application, a storage medium, which is a non-volatile computer-readable storage medium, is further provided, and when executed by a processor, the instructions in the storage medium implement the functions of the online scheduling node as provided in the fifth aspect of embodiments of the present application.
In a fourteenth aspect of embodiments of the present application, there is further provided a storage medium, which is a non-volatile computer-readable storage medium, and when executed by a processor, the instructions in the storage medium implement the functions of the offline scheduling node as provided in the sixth aspect of embodiments of the present application.
In a fifteenth aspect of embodiments of the present application, there is also provided a storage medium, which is a non-volatile computer-readable storage medium, and when executed by a processor, the instructions in the storage medium implement the functions of the online scheduling node as provided in the seventh aspect of embodiments of the present application.
In a sixteenth aspect of the embodiments of the present application, there is further provided a storage medium, which is a non-volatile computer-readable storage medium, and when executed by a processor, the instructions in the storage medium implement the functions of the offline scheduling node as provided in the eighth aspect of the embodiments of the present application.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
In the embodiments of the present application, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The term "at least one" means one or more, and the term "plurality" means two or more, unless expressly defined otherwise.
The term "and/or" in this application is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The above description is only exemplary of the present application and is not intended to limit the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (14)

1. A resource scheduling system is characterized by comprising an off-line scheduling node and an on-line scheduling node,
the offline scheduling node is configured to determine a first cloud resource that needs to be allocated to a first host of a first instance, and request, from the online scheduling node, a right of use of the first cloud resource on the first host, where the first instance is a created instance;
the online scheduling node is configured to receive an online scheduling request requesting allocation of cloud resources to a second instance, confirm, according to the online scheduling request, second cloud resources that need to be allocated to a first host of the second instance, and refuse to provide the offline scheduling node with a right to use the first cloud resources on the first host when it is confirmed that resource conflicts exist 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 of claim 1,
the offline scheduling node is further configured to re-confirm the third cloud resource that needs to be allocated to the second host of the first instance after the usage right is rejected, and request the usage right of the third cloud resource on the second host from the online scheduling node.
3. The system according to claim 1 or 2,
the online scheduling node is further configured to provide the offline scheduling node with the right to use the first cloud resource on the first host if it is determined that the first cloud resource and the second cloud resource do not have a resource conflict on the first host.
4. The system according to claim 3, wherein the online scheduling node records a resource information table of cloud resources in a cloud resource pool managed by the resource scheduling system, and the resource information table at least indicates an occupation state of the cloud resources;
the online scheduling node is further configured to mark an occupation state of the first cloud resource on the first host as occupied in the resource information table after providing the offline scheduling node with the right to use the first cloud resource on the first host.
5. The system of claim 4,
and the online scheduling node is also used for sending the resource information table to the offline scheduling node.
6. The system according to any one of claims 3 to 5,
the offline scheduling node is further configured to allocate the first cloud resource on the first host to the first instance after the online scheduling node provides the offline scheduling node with the right to use the first cloud resource on the first host, and mark an occupied state of the first cloud resource on the first host as occupied in a resource information table recorded by the offline scheduling node, where the resource information table at least indicates the occupied state of the cloud resource.
7. A resource scheduling system comprises an online scheduling node and an offline scheduling node,
the online scheduling node is configured to receive an online scheduling request requesting allocation of cloud resources to a second instance, confirm, according to the online scheduling request, second cloud resources to be allocated to a first host of the second instance, and request, to the offline scheduling node, a right of use of the second cloud resources on the first host, where the second instance is an instance to be created;
the offline scheduling node is configured to determine a first cloud resource that needs to be allocated to a first host of a first instance, and refuse to provide the online scheduling node with a right to use a second cloud resource on the first host when it is determined that the first cloud resource and the second cloud resource have a resource conflict on the first host, where the first instance is a created instance.
8. A resource scheduling method is applied to a resource scheduling system, and the resource scheduling system comprises: offline scheduling nodes and online scheduling nodes, the method comprising:
the offline scheduling node confirms first cloud resources needing to be allocated to a first host of a first instance, and requests the online scheduling node for the use right of the first cloud resources on the first host, wherein the first instance is a created instance;
the online scheduling node receives an online scheduling request requesting to allocate cloud resources to a second instance, confirms second cloud resources to be allocated to a first host of the second instance according to the online scheduling request, and refuses to provide the offline scheduling node with the use right of the first cloud resources on the first host under the condition that resource conflict exists between the first cloud resources and the second cloud resources on the first host, wherein the second instance is an instance to be created.
9. The method of claim 8, wherein the resource scheduling method further comprises:
and after the usage right is rejected, the offline scheduling node reconfirms a third cloud resource on a second host to be allocated to the first instance, and requests the online scheduling node for the usage right of the third cloud resource on the second host.
10. The method according to claim 8 or 9, wherein the resource scheduling method further comprises:
the online scheduling node provides the offline scheduling node with the usage right of the first cloud resource on the first host under the condition that the first cloud resource and the second cloud resource are confirmed not to have resource conflict 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 a cloud resource pool managed by the resource scheduling method, the resource information table at least indicates an occupation state of the cloud resources, and the resource scheduling method further includes:
after the online scheduling node provides the offline scheduling node with the right to use the first cloud resource on the first host, the online scheduling node marks the occupation state of the first cloud resource on the first host as occupied in the resource information table.
12. The method of claim 11, wherein the resource scheduling method further comprises:
and the online scheduling node sends the resource information table to the offline scheduling node.
13. The method according to any of claims 10 to 12, wherein the resource scheduling method further comprises:
after the offline scheduling node provides the offline scheduling node with the right to use the first cloud resource on the first host, the offline scheduling node allocates the first cloud resource on the first host to the first instance, and marks the occupation state of the first cloud resource on the first host as occupied in a resource information table recorded by the offline scheduling node, where the resource information table at least indicates the occupation state of the cloud resource.
14. A resource scheduling method is applied to a resource scheduling system, and the resource scheduling system comprises: an online scheduling node and an offline scheduling node, the method comprising:
the online scheduling node receives an online scheduling request for requesting to allocate cloud resources to a second instance, confirms second cloud resources needing to be allocated to a first host of the second instance according to the online scheduling request, and requests the offline scheduling node for the use right of the second cloud resources on the first host, wherein the second instance is an instance to be created;
the offline scheduling node confirms that a first cloud resource on a first host of a first instance needs to be reallocated, and refuses to provide the online scheduling node with the use right of a second cloud resource on the first host under the condition that the first cloud resource and the second cloud resource are confirmed to have resource conflict on the first host, wherein the first instance is a created instance.
CN202010924142.2A 2020-09-04 2020-09-04 Resource scheduling system and method Pending CN114138400A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010924142.2A CN114138400A (en) 2020-09-04 2020-09-04 Resource scheduling system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010924142.2A CN114138400A (en) 2020-09-04 2020-09-04 Resource scheduling system and method

Publications (1)

Publication Number Publication Date
CN114138400A true CN114138400A (en) 2022-03-04

Family

ID=80438488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010924142.2A Pending CN114138400A (en) 2020-09-04 2020-09-04 Resource scheduling system and method

Country Status (1)

Country Link
CN (1) CN114138400A (en)

Similar Documents

Publication Publication Date Title
US11681562B2 (en) Resource manager for managing the sharing of resources among multiple workloads in a distributed computing environment
US9229764B2 (en) Estimating migration costs for migrating logical partitions within a virtualized computing environment based on a migration cost history
US8694996B2 (en) Application initiated negotiations for resources meeting a performance parameter in a virtualized computing environment
CN108701059B (en) Multi-tenant resource allocation method and system
KR101976234B1 (en) Paas hierarchial scheduling and auto-scaling
KR101994506B1 (en) Decoupling paas resources, jobs, and scheduling
US7516294B2 (en) Logical partitioning method for storage system
JP2005534116A (en) A method for dynamically allocating and managing resources in a multi-consumer computer system.
CN103530170A (en) System and method for providing hardware virtualization in a virtual machine environment
CN110597639B (en) CPU distribution control method, device, server and storage medium
US9246986B1 (en) Instance selection ordering policies for network-accessible resources
CN109257399B (en) Cloud platform application program management method, management platform and storage medium
CN112052068A (en) Method and device for binding CPU (central processing unit) of Kubernetes container platform
CN104301257A (en) Resource distribution method, device and equipment
CN111443870A (en) Data processing method, device and storage medium
JP2011118864A (en) Resource control method and resource control system
JP5867238B2 (en) Auto scaling method, auto scaling program and computer node
US20210191751A1 (en) Method and device for allocating resource in virtualized environment
WO2024022142A1 (en) Resource use method and apparatus
US20230155958A1 (en) Method for optimal resource selection based on available gpu resource analysis in large-scale container platform
CN114138400A (en) Resource scheduling system and method
JP2015103094A (en) Virtual resource management device, selection method and selection program
KR102014246B1 (en) Mesos process apparatus for unified management of resource and method for the same
CN116157778A (en) System and method for hybrid centralized and distributed scheduling on shared physical hosts
KR20160063430A (en) Method for managing and assigning available resourse by reservation of virtual machine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination