Virtual machine scheduling method, electronic equipment, computer storage medium and computer program product

By identifying the tenant business characteristics and demand levels of virtual machines, efficient scheduling of virtual machines in the cloud service system is achieved, solving the problems of resource competition and low sales rate, and improving resource utilization efficiency and tenant business performance.

CN120653412APending Publication Date: 2025-09-16HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410292020.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Cloud service providers face the contradiction between tenant business performance stability and host resource sales rate in virtual machine scheduling, resulting in resource contention and low sales rate.

Method used

By determining the tenant business characteristics of the virtual machine, identifying its demand for multiple host resources, and scheduling the virtual machine to the host, the demand for virtual machines in the same host is in a complementary state, reducing resource competition, and optimizing host resource allocation and rescheduling priority.

Benefits of technology

It improves the sales rate of host resources, reduces resource competition between virtual machines, ensures the performance stability of tenant services, and reduces the operating costs of cloud service providers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653412A_ABST
    Figure CN120653412A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual machine scheduling method, electronic equipment, a computer storage medium and a computer program product. The virtual machine scheduling method comprises the following steps: determining tenant business characteristics of each virtual machine in a plurality of virtual machines to be scheduled; based on the tenant business characteristics of each virtual machine, determining the demand degree of the virtual machine for various host machine resources; the plurality of virtual machines to be scheduled are scheduled to at least one host machine, so that the demand degrees of any two virtual machines in the same host machine for each kind of host machine resources are in a demand complementary state, and the difference of the demand degrees of the two virtual machines in the demand complementary state exceeds a preset threshold value. According to the scheme of the embodiment of the invention, the performance stability of the business of the tenant can be ensured, the resource selling rate of the host machine can be ensured, and the operation cost of a cloud service provider is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a virtual machine scheduling method, electronic device, computer storage medium, and computer program product. Background Art

[0002] Cloud service providers such as public clouds, private clouds, and hybrid clouds can provide service resources to a large number of tenants, allowing tenants to focus on the configuration, management, and maintenance of business data without having to build the hardware required for service resources.

[0003] Generally speaking, cloud service providers provide service resources to tenants in the form of virtual machines. By scheduling virtual machines to host machines (for example, usually servers) in the cloud service system, virtual machines can use the underlying resources from the host machine to run the tenant's business data. For example, the host machine's resources may include the host machine's computing resources, memory bandwidth resources, storage resources, and power consumption resources.

[0004] As the number of tenants increases, more host resources are sold to them via virtual machines. The higher the sell-through rate, the less flexibility the host resources provide for virtual machine business changes. On the one hand, concurrent business from different tenants leads to competition for host resources. On the other hand, reserving sufficient host resources in advance for different tenant businesses will result in a lower resource sell-through rate.

[0005] Therefore, a virtual machine scheduling solution is needed that can not only ensure the performance stability of tenant services, but also ensure the resource sales rate of the host machine and reduce the operating costs of cloud service providers. Summary of the Invention

[0006] In view of this, embodiments of the present invention provide a virtual machine scheduling method, an electronic device, a computer storage medium, and a computer program product to solve the above problems.

[0007] According to a first aspect of an embodiment of the present invention, a virtual machine scheduling method, electronic device, computer storage medium, and computer program product are provided. The virtual machine scheduling method comprises: determining tenant service characteristics of each virtual machine among a plurality of virtual machines to be scheduled; determining the virtual machine's demand for multiple host machine resources based on the tenant service characteristics of each virtual machine; and scheduling the plurality of virtual machines to be scheduled to at least one host machine such that any two virtual machines in the same host machine have a demand-complementary state for each host machine resource, wherein the difference in demand between the two virtual machines in the demand-complementary state exceeds a preset threshold.

[0008] In another implementation of the present invention, the tenant business characteristics of each virtual machine among multiple virtual machines to be scheduled are determined, including: monitoring the resource usage data of at least one scheduled virtual machine of the tenant business of each virtual machine on each host hardware that provides the multiple host resources; and determining the tenant business characteristics of the virtual machine to be scheduled based on the resource usage data of each host hardware.

[0009] In another implementation of the present invention, based on the tenant business characteristics of each virtual machine, the degree of demand of the virtual machine for multiple host resources is determined, including: identifying the tenant business characteristics of each virtual machine to obtain the business scenario and business risk of the virtual machine; based on the correlation between the business scenario and business risk of the virtual machine and the multiple host resources, determining the degree of demand of the virtual machine for the multiple host resources.

[0010] In another implementation of the present invention, the method further includes: determining the total amount of allocatable resources of multiple host machines for the multiple host machine resources; sorting the total amount of allocatable resources of the multiple host machines to determine the resource priority of the multiple host machines; selecting at least one host machine from the multiple host machines so that the resource priority of the at least one host machine is greater than a first preset priority threshold.

[0011] In another implementation of the present invention, selecting the at least one host machine from the multiple host machines includes: performing averaging processing on the resource selling rates of each of the multiple host machines to obtain the average resource selling rate of the multiple host machines; and determining the first preset priority threshold so that the resource selling rate of the at least one host machine is less than the average resource selling rate.

[0012] In another implementation of the present invention, determining the total amount of resources that can be allocated to the multiple host resources by multiple host machines includes: determining the amount of resources that can be allocated to each host resource by each host machine among the multiple host machines; and weighting the multiple amounts of resources that can be allocated to the multiple host resources by each host machine using the respective weight coefficients of the multiple host resources to determine the total amount of resources that can be allocated to the host machine.

[0013] In another implementation of the present invention, the method further includes: rescheduling a target scheduled virtual machine among the scheduled virtual machines so that the resource priority of the host machine where the target scheduled virtual machine is located before rescheduling is greater than the resource priority of the host machine where the target scheduled virtual machine is located after rescheduling.

[0014] In another implementation of the present invention, the method further includes: determining the target scheduled virtual machine by a scheduled virtual machine whose rescheduling priority among each scheduled virtual machine is higher than a second preset priority threshold, wherein the smaller the current resource occupancy ratio of the scheduled virtual machine to the multiple host machine resources, the higher the rescheduling priority of the scheduled virtual machine.

[0015] In another implementation of the present invention, the method further includes: for each host machine resource, monitoring the rated resource amount of the processing unit of the host machine where the scheduled virtual machine is located, and the resource occupancy of at least one processing core allocated to the scheduled virtual machine by the processing unit; determining the ratio between the resource occupancy of the at least one processing core and the rated resource amount of the processing unit as the current resource occupancy ratio of the scheduled virtual machine for the host machine resource.

[0016] According to a second aspect of an embodiment of the present invention, a virtual machine scheduling device is provided, comprising: a first determination module, which determines the tenant business characteristics of each virtual machine among a plurality of virtual machines to be scheduled; a second determination module, which determines the degree of demand of the virtual machine for a plurality of host machine resources based on the tenant business characteristics of each virtual machine; and a scheduling module, which schedules the plurality of virtual machines to be scheduled to at least one host machine, so that the degree of demand of any two virtual machines in the same host machine for each host machine resource is in a demand complementary state, wherein the difference in the degree of demand of the two virtual machines in the demand complementary state exceeds a preset threshold.

[0017] According to a third aspect of an embodiment of the present invention, an electronic device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.

[0018] According to a fourth aspect of an embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method according to the first aspect is implemented.

[0019] According to a fifth aspect of an embodiment of the present invention, a computer program product is provided, comprising a computer program / instruction, which implements the method described in the first aspect when executed by a processor.

[0020] In the solution of the embodiment of the present invention, the tenant business characteristics of the virtual machine reliably reflect the degree of demand of the virtual machine for various host machine resources. When scheduling multiple virtual machines to be scheduled to at least one host machine, the resource sales rate can be guaranteed as much as possible. In addition, after the scheduling of multiple virtual machines to be scheduled, since the difference in demand levels of two virtual machines in a demand complementary state exceeds a preset threshold, the resource competition among different virtual machines to be scheduled in the same host machine is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0022] Figure 1 Schematic block diagram of some example cloud service systems.

[0023] Figure 2 The present invention is a flowchart of the steps of a virtual machine scheduling method according to some embodiments of the present invention.

[0024] Figure 3A for Figure 2 A schematic diagram of a process for calculating resource requirements of a tenant service in an example embodiment.

[0025] Figure 3B for Figure 2 A schematic diagram of a scheduling principle of an example of an embodiment.

[0026] Figure 4 This is a flowchart of the steps of a virtual machine scheduling method according to some other embodiments of the present invention.

[0027] Figure 5 for Figure 4 Schematic diagram of the process of selecting a host machine based on resource priority in an embodiment.

[0028] Figure 6 is a structural block diagram of a virtual machine scheduling device according to some other embodiments of the present invention.

[0029] Figure 7 Schematic diagram of the structure of electronic devices according to other embodiments of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.

[0031] The specific implementation of the embodiment of the present invention is further described below with reference to the accompanying drawings of the embodiment of the present invention.

[0032] Figure 1 Schematic block diagram of some example cloud service systems. Figure 1 As shown, the cloud service system includes a scheduling management node 110 and various computing nodes 120. Figure 1 The M computing nodes 120 shown include computing node #1, computing node #2, computing node #M, etc. The scheduling management node 110 and each computing node 120 are interconnected via a network connection 130. The scheduling management node 110 can be a cloud service management node such as a cloud management system (CMS), or a node different from the cloud service management node. The network connection 130 can be a communication connection between a built-in network card or an independent network card mounted to the computing node 120, used to implement distributed computing between the computing nodes 120. Each computing node 120 can be served by one or more physical machines, and each physical machine can serve as a host for one or more virtual machines.

[0033] In the computing node 120 serving as a host, each virtual machine 121 can be managed by a virtual machine management module 122, such as a hypervisor. This virtual machine management module 122 acts as a local agent for the scheduling management node 110, which then performs the coordinated scheduling of each virtual machine in the cloud service system. Specifically, the resources of the host computing power 123 can be sold to tenants using virtual machines as the basic sales unit. For example, virtual machines #1, #2, and #N require various host resources of the host computing power 123. Virtual machines 121 include, but are not limited to, Java virtual machines and container objects such as PODs.

[0034] Configuration nodes such as network controllers perform communication between virtual machines through the virtual machine management module 122. The control node can manage virtual machines by creating, operating or orchestrating virtual machines to achieve elastic computing or flexible deployment of applications.

[0035] As the number of virtual machine tenants continues to increase, more host machine 121 resources will be sold to tenants through virtual machines. The higher the sales rate, the less flexibility the host machine computing power 123 leaves for business changes in virtual machines. On the one hand, when the business volumes from different tenants are concurrent, it will lead to competition for host machine resources. On the other hand, if sufficient host machine resources are reserved in advance for different tenant businesses, it will lead to a low resource sales rate. To this end, the various embodiments of the present invention provide a series of solutions that can not only ensure the performance stability of tenant businesses, but also ensure the resource sales rate of the host machine, thereby reducing the operating costs of cloud service providers.

[0036] The following will be combined Figure 2 The virtual machine scheduling methods according to some embodiments of the present invention are described in detail. Figure 2 The virtual machine scheduling method can be Figure 1 The scheduling management node is executed, and the virtual machine scheduling method includes:

[0037] S210: Determine tenant service characteristics of each virtual machine among the multiple virtual machines to be scheduled.

[0038] It should be understood that virtual machines of different tenants can run the same business or different businesses. In other words, the businesses of different tenants belong to different tenant businesses, and different businesses of the same tenant also belong to different tenant businesses. Tenant business characteristics include data indicating characteristic indicators of tenant businesses, and the characteristic indicators of tenant businesses may include at least business scenario dimensions and business risk dimensions. The data in the business scenario dimension indicates the business scenarios of tenant businesses, including but not limited to: web page access scenarios, game scenarios, AI reasoning scenarios, AI training scenarios, big data analysis scenarios, streaming media scenarios, data processing scenarios, etc.; the data in the business risk dimension indicates the business risks of tenant businesses, including but not limited to: data flow jitter risk, data flow interruption risk, data congestion risk, business failure risk, etc.

[0039] S220: Determine the degree of demand of each virtual machine for multiple host machine resources based on the tenant service characteristics of the virtual machine.

[0040] It should be understood that various host machine resources are related to the host machine hardware, including but not limited to the host machine's computing resources, memory bandwidth resources, storage resources, and power consumption resources.

[0041] Specifically, a host's computing resources refer to the capabilities available to perform various computing tasks and process workloads. These typically include characteristics such as the number of processing cores, clock speed, processing power, and parallelism of a processing unit (e.g., CPU). The strength of the computing resources determines the host's computing performance and processing capabilities. Stronger computing resources allow the host to run more complex applications, process larger amounts of data, and perform more parallel computing tasks. The host's memory bandwidth represents the data transfer rate between system memory and the processing unit, impacting program and operating system access to memory, data read and write speeds, and application performance. Higher memory bandwidth provides faster data transfer speeds, enabling the host to more efficiently process large data streams and perform memory-intensive operations. The host's storage resources refer to the capacity and performance available for storing and managing data, including but not limited to storage devices such as hard drives or solid-state drives (SSDs). Storage resources influence the host's data storage and retrieval speeds, as well as the available storage capacity. High-performance and large-capacity storage resources support faster data read and write operations and larger storage requirements. The power consumption resources of the host machine refer to the electrical resources used to power and support the operation of the host machine. Saving the power consumption resources of the host machine can improve energy efficiency and operating cost management. In addition, the multiple host machine resources can be at least two of the various resources mentioned above. Specifically, the host machine hardware related to the computing resources of the host machine includes processing units, processing cores, caches, memories, hard disks, etc.; the host machine hardware related to the memory bandwidth resources of the host machine includes caches, memory buses, etc.; the host machine hardware related to the storage resources of the host machine includes memory, hard disks, etc.; the host machine hardware related to the power consumption resources of the host machine includes memory, processing units, etc.

[0042] It should also be understood that some tenant businesses have a high demand for certain host resources, which can be considered as these tenant businesses being sensitive to the demand for the host resources, for example, computing resource-sensitive businesses, memory bandwidth resource-sensitive businesses, storage resource-sensitive businesses, or power consumption resource-sensitive businesses.

[0043] S230: Schedule multiple virtual machines to be scheduled to at least one host machine, so that the demand levels of any two virtual machines in the same host machine for each host machine resource are in a demand complementary state, wherein the difference in demand levels of the two virtual machines in the demand complementary state exceeds a preset threshold.

[0044] It should be understood that, generally speaking, a specific business scenario has a specific degree of demand for each host resource. For example, the demand for computing resources and memory bandwidth resources in the AI ​​reasoning scenario is usually less than the demand for computing resources and memory bandwidth resources in the AI ​​training scenario. In other words, when the AI ​​reasoning scenario and the AI ​​training scenario are concurrent, since the demand for computing resources and memory bandwidth resources in the AI ​​reasoning scenario and the AI ​​training scenario is quite different (that is, the two are in a state of complementary demand), the degree of resource contention for computing resources and memory bandwidth resources is small, or even no resource contention will occur. In general, the degree of demand for each host resource reflects the degree of resource contention for that host resource.

[0045] It should also be understood that the opposite state to a complementary demand state is a resource conflict state. In this resource conflict state, two virtual machines have similar demands for host resources, for example, the difference in demand does not exceed a preset threshold. Furthermore, in the case of multiple host resources, two virtual machines on the same host may have complementary demands for some host resources but conflicting demands for others. In the scheduling of individual virtual machines in this embodiment, it is necessary to ensure that any two virtual machines on the same host have complementary demands for each host resource. In some examples, two virtual machines in a conflicting demand state are scheduled to different hosts.

[0046] In the solution of the embodiment of the present invention, the tenant business characteristics of the virtual machine reliably reflect the degree of demand of the virtual machine for various host machine resources. When scheduling multiple virtual machines to be scheduled to at least one host machine, the resource sales rate can be guaranteed as much as possible. In addition, after the scheduling of multiple virtual machines to be scheduled, since the difference in demand levels of two virtual machines in a demand complementary state exceeds a preset threshold, the resource competition among different virtual machines to be scheduled in the same host machine is reduced.

[0047] In some examples, when determining the tenant service characteristics of each virtual machine, the tenant service characteristics of the virtual machine can be determined based on the resource usage data and / or specified demand indicators of the tenant service of the virtual machine. For example, the resource usage of the scheduled virtual machines of the tenant service can be monitored to obtain resource usage data of the scheduled virtual machines for various host resources. Specifically, the resource usage data of the same tenant service can be monitored for each host resource.

[0048] It should be understood that if the real-time resource contention level of each virtual machine within the same host is considered, the resource usage data can be aggregated and counted at the statistical granularity of the resource usage data within a shorter period of time. If the goal is to reduce frequent secondary scheduling of virtual machines, the resource usage data can be aggregated and counted at the statistical granularity of the resource usage data within a longer period of time.

[0049] Specifically, in order to obtain resource usage data for each host resource, usage data of at least one host hardware related to the host resource can be obtained, wherein the host hardware includes but is not limited to the occupancy rate of the processing unit, the occupancy rate of each processing core (virtual processing core or physical processing core) in the processing unit, the occupancy rate of the access bandwidth of the memory bus, the occupancy rate of the cache in the processing unit, the power consumption index of the processing unit, etc.

[0050] Different host resources are associated with different host hardware. For example, host hardware associated with the host's computing resources includes processing units, processing cores, cache, memory, and hard disks. Host hardware associated with the host's memory bandwidth resources includes cache and memory buses. Host hardware associated with the host's storage resources includes memory and hard disks. Host hardware associated with the host's power consumption resources includes memory and processing units.

[0051] Without loss of generality, as an example of determining the tenant service characteristics of each of the multiple virtual machines to be scheduled, resource usage data of at least one scheduled virtual machine of the tenant service of each virtual machine on each host hardware providing multiple host resources can be monitored, and then, based on the resource usage data of each host hardware and / or specified demand indicator data, the tenant service characteristics of the virtual machine can be determined. In some examples, such as Figure 3A As shown, the resource usage data and specified demand indicator data of each host hardware can be summarized, and then the summarized data can be clustered based on the business scenario dimension and the business risk dimension to obtain the tenant business characteristics.

[0052] It should be understood that Figure 3AThe business scenario dimension shown includes multiple business scenarios, and the business risk dimension includes multiple business risks. Further, by combining multiple business scenarios and multiple business risks, multiple combinations can be obtained. For example, X types of business scenarios and Y types of business risks can form X*Y combinations, each combination corresponding to the business characteristics of the tenant business. The demand degree of multiple host resources can be characterized and marked in advance for each combination in the X*Y combinations. For example, further, when comparing whether the demand degree of each tenant business is in a complementary state, the demand characterization value of each tenant business can be normalized. For example, when the virtual machines of five tenant businesses, tenant business A, B, C, D, and E, are scheduled to at least one host, each tenant business can use one or more virtual machines to run, and the host resources include M, N, and O (that is, an example of multiple host resources). The demand characterization values ​​of the virtual machines of tenant business AE for host resource M are 60%, 10%, 10%, 10%, and 10%. That is, the virtual machine of tenant business A requires 60% of the host resource M as a whole; the virtual machine of tenant business B requires 10% of the host resource M as a whole; the virtual machine of tenant business C requires 10% of the host resource M as a whole; the virtual machine of tenant business D requires 10% of the host resource M as a whole; and the virtual machine of tenant business E requires 10% of the host resource M as a whole.

[0053] If the preset threshold for demand complementation between two VMs is set to 40%, the demand difference between the VMs of tenant service A and the VMs of other tenant services is 50% greater than 40%, while the demand difference between the VMs of tenant services BE is 0% less than 40%. In other words, the VMs of tenant service A and the VMs of other tenant services are in demand complementation, while the VMs of other tenant services are not in demand complementation, that is, they are in the aforementioned demand conflict state.

[0054] Without loss of generality, as an example of determining the degree of demand of the virtual machine for multiple host resources, the tenant business characteristics of each virtual machine can be identified to obtain the business scenario and business risk of the virtual machine. Then, based on the correlation between the business scenario and business risk of the virtual machine and multiple host resources, the degree of demand of the virtual machine for multiple host resources can be determined.

[0055] It should be understood that the summary data can be clustered based on the business scenario dimension and business risk dimension through the above-mentioned business scenario dimension and business risk dimension to obtain the business scenario and business risk of the virtual machine. That is, in the above example, the combination of X*Y combinations corresponding to the virtual machine indicates the business scenario and business risk of the virtual machine.

[0056] It should also be understood that the correlation between the business scenarios and business risks of the virtual machine and various host resources can be specified through expert experience or historical statistical results, that is, the correlation between each combination and various host resources can be pre-specified.

[0057] In some cases, after some virtual machines have been scheduled, the status of tenant services and the dynamic changes of host resources will cause these virtual machines to be rescheduled. In other words, some virtual machines to be scheduled can be scheduled once, and these scheduled virtual machines can also be rescheduled. Figure 3B In the coordinate system shown, the horizontal axis represents the time experienced by the virtual machine after one scheduling, and the vertical axis represents the degree of resource contention after the virtual machine is scheduled to the host machine through the first scheduling, that is, the resource conflict degree of the host machine. The higher the resource sales rate of the host machine, the higher the resource conflict degree. Therefore, in order to maximize the sales rate of the host machine, the resource conflict degree of the host machine will increase. When the resource conflict degree does not exceed the resource conflict threshold, the tenant business will not be significantly affected. When the resource conflict degree exceeds the resource conflict threshold, the tenant business will be significantly affected. In this case, the virtual machine that has been scheduled once can be rescheduled to automatically and continuously dynamically reschedule some of the scheduled virtual machines to alleviate the resource conflict degree of the host machine.

[0058] About the scheduling of virtual machines

[0059] Before scheduling multiple virtual machines to be scheduled onto at least one host machine, at least one host machine must be selected from the multiple virtual machines. That is, the current multiple virtual machines to be scheduled will not be scheduled onto the remaining host machines. The selection of at least one host machine from the multiple virtual machines can be performed based on the resource priorities of the multiple host machines. The resource priorities of the host machines represent the resource allocation capabilities of the host machines; the higher the resource priority, the more resources the host machine can allocate. Therefore, by selecting at least one host machine with a higher resource priority from the multiple virtual machines, and then scheduling the multiple virtual machines to be scheduled onto the at least one host machine, the degree of resource contention among the individual virtual machines is reduced.

[0060] As an example of selecting at least one host machine with a higher resource priority from multiple virtual machines, the resource priority of the at least one host machine can be greater than the resource priority of at least some other host machines. Preferably, the resource priority of the at least one host machine is greater than the resource priority of the other host machines.

[0061] For example, the resource priority of at least one host machine is greater than a first preset priority threshold, and at least one host machine is directly selected from multiple virtual machines based on the first preset priority threshold. Alternatively, some host machines can be directly selected from multiple virtual machines based on the first preset priority threshold, and then at least one host machine is further screened out from some host machines.

[0062] Furthermore, resource priorities can be determined for each of the multiple hosts. For example, a comprehensive allocatable resource indicator of multiple host resources, such as the total allocatable resources, can be determined for each host. It should be understood that the allocatable resources herein include resources already allocated to a specific virtual machine or remaining resources beyond the resources reserved for the virtual machine.

[0063] In order to determine the comprehensive allocatable resource index of multiple host resources, the total allocatable resource amount of multiple hosts for the multiple host resources can be determined, and then the total allocatable resource amount of the multiple hosts can be sorted to determine the resource priority of the multiple hosts.

[0064] Furthermore, as an example of determining the total amount of resources that can be allocated to multiple host machines for multiple host machine resources, the amount of resources that can be allocated to each host machine resource for each host machine resource of the multiple host machines can be determined, and then, the multiple amounts of resources that can be allocated to the multiple host machine resources of each host machine can be weighted using the respective weight coefficients of the multiple host machine resources to determine the total amount of resources that can be allocated to the host machine.

[0065] It should be understood that the weight coefficients of various host resources can be pre-set. For example, historical usage data of various host resources can be collected, and then the historical usage data can be fitted with the degree of resource demand or resource contention, and the weight coefficient of each host resource can be determined based on the fitting relationship. In other words, the weight of the host resource with a greater impact on the comprehensive allocatable resource index is greater, and the weight of the host resource with a smaller impact on the comprehensive allocatable resource index is greater. For example, in general, the weight coefficients of the number of processing cores and memory bandwidth in the host are greater than the weight coefficient of the host's power consumption resources.

[0066] It should also be understood that the allocatable resource amount of each host resource of the host machine represents the remaining amount of the host resource of the host machine after deducting the allocated resource amount or the reserved resource amount. The allocatable resource amount can be represented by the allocatable resource ratio of multiple host resources.

[0067] In other examples, to select at least one host from multiple hosts, the resource sales rates of the multiple hosts can be averaged to obtain the average resource sales rate of the multiple hosts. Then, a first preset priority threshold is determined such that the resource sales rate of the at least one host is less than the average resource sales rate. In other words, the resource sales rate of the at least one host is less than the average resource sales rate, thereby ensuring that resources are distributed evenly across the hosts as much as possible. This further avoids resource contention among virtual machines while maintaining the resource sales rate.

[0068] About the Secondary Scheduling of Virtual Machines

[0069] For some virtual machines that have been scheduled, in some cases, some of them can be migrated to a new host machine, that is, rescheduled to a new host machine. For example, although various factors of possible resource demand and resource contention are taken into account in the case of one scheduling, due to the need to ensure a certain sales rate for each host machine, different virtual machines scheduled to the same host machine may also have a high concurrency within a period of time. At this time, it is necessary to alleviate the degree of resource contention in the virtual machine. In some examples, virtual machines that may have resource contention may be rescheduled to different host machines. For example, one of the two virtual machines that have resource contention may be rescheduled to another virtual machine, and it is ensured that after the virtual machine is rescheduled to the other virtual machine, it will not compete with the other virtual machine's own virtual machine for resource demand, thereby reliably solving the problem of resource contention.

[0070] In other examples, since the virtual machines that are experiencing resource contention occupy more host machine resources, migrating such virtual machines will result in higher migration costs and lower migration success rates. In addition, if the migration fails, data will be lost, which will further increase the migration cost. In this case, virtual machines other than the virtual machines that are experiencing resource contention in the host machine can be re-migrated to other virtual machines. Therefore, taking into account factors such as the virtual machine migration cost or the migration success rate, a rescheduling priority is set for the already scheduled virtual machines, and then, based on the rescheduling priority of each scheduled virtual machine, some of the scheduled virtual machines are rescheduled. Preferably, the smaller the current resource occupancy ratio of the scheduled virtual machine to multiple host machine resources, the higher the rescheduling priority of the scheduled virtual machine.

[0071] For example, when rescheduling a target scheduled virtual machine, the resource priority of the host machine where the target scheduled virtual machine is located before rescheduling can be made higher than the resource priority of the host machine where the target scheduled virtual machine is located after rescheduling. In this case, the cost of virtual machine rescheduling (i.e., virtual machine migration) is reduced, and the possibility of increasing the target scheduled virtual machine's competition for resources with other virtual machines after rescheduling is avoided.

[0072] In some examples, a target scheduled virtual machine can be specified from among the scheduled virtual machines, thereby specifically resolving resource contention for the target scheduled virtual machine. Alternatively, a second preset priority threshold can be set to select the target scheduled virtual machine from among the scheduled virtual machines that have been reordered based on the rescheduling priority.

[0073] Alternatively, by setting a second preset priority threshold, some scheduled virtual machines can be automatically and continuously dynamically rescheduled. For example, scheduled virtual machines with a rescheduling priority higher than the second preset priority threshold can be continuously identified as target scheduled virtual machines. Furthermore, the second preset priority threshold can be adjusted based on the average resource sales rate of multiple host machines. The higher the average resource sales rate, the lower the second preset priority threshold can be set, allowing more target scheduled virtual machines to be selected for rescheduling. This provides available resources for virtual machines that have been allocated more resources, thus preventing resource contention among these virtual machines.

[0074] From the above description, we can see that the smaller the current resource usage ratio of a scheduled virtual machine for various host resources, the higher the rescheduling priority of the scheduled virtual machine. In other words, the larger the current resource usage ratio of a scheduled virtual machine for various host resources, the lower the rescheduling priority of the scheduled virtual machine. Therefore, it is necessary to reliably determine the current resource usage ratio of a scheduled virtual machine for each host resource.

[0075] As some examples of determining the current resource occupancy ratio of a scheduled virtual machine for each host machine resource, for each host machine resource, the rated resource amount of the processing unit of the host machine where the scheduled virtual machine is located and the resource occupancy of at least one processing core allocated to the scheduled virtual machine by the processing unit can be monitored. Then, the ratio between the resource occupancy of the at least one processing core and the rated resource amount of the processing unit is determined as the current resource occupancy ratio of the scheduled virtual machine for the host machine resource.

[0076] It should be understood that the processing core can be a physical processing core (core) or a virtual processing core (virtual core), and the processing unit can be a central processing unit (CPU). For example, when the host machine resource is a memory bandwidth resource, the current resource occupancy ratio of the scheduled virtual machine is the ratio between the resource occupancy of each processing core of the scheduled virtual machine and the rated resource amount of the processing unit. The resource occupancy of each processing core (i.e., core granularity) and the rated resource amount of the processing unit (i.e., packet granularity) can be read from registers set in the processing unit, such as a PMU (Performance Monitoring Unit).

[0077] In the case where the scheduled virtual machine is allocated n processing cores, the memory bandwidth BW of the scheduled virtual machine = PMU (core 1) + PMU (core 2) + . . . PMU (core n).

[0078] Similarly, in the case where the scheduled virtual machine is allocated n processing cores, the power consumption P of the scheduled virtual machine = PMU (core 1) + PMU (core 2) + . . . PMU (core n).

[0079] The following will be combined Figure 4 The virtual machine scheduling methods of other embodiments of the present invention are described in detail. Figure 4 The virtual machine scheduling methods include:

[0080] S410: Determine the total amount of resources that can be allocated to multiple host resources by multiple host machines.

[0081] S420: Sort the total amount of allocatable resources of the multiple host machines and determine the resource priorities of the multiple host machines.

[0082] S430: Select at least one host machine from the plurality of host machines, so that the resource priority of the at least one host machine is greater than a first preset priority threshold.

[0083] S440: Schedule the multiple virtual machines to be scheduled to at least one host machine, so that the requirements of any two virtual machines in the same host machine for each host machine resource are in a complementary state.

[0084] It should be understood that, as an example of selecting at least one host from a plurality of host machines, at least one host machine can be directly selected from a plurality of virtual machines according to the first preset priority threshold, or some host machines can be directly selected from a plurality of virtual machines according to the first preset priority threshold, and then at least one host machine can be further selected from the some host machines. Figure 5 As shown, the total allocatable resources of hosts 1-8 are sorted to obtain the resource priorities of hosts 1-8. Some virtual machines are preliminarily screened from hosts 1-8 by using the first preset priority threshold, wherein the resource priorities of host 1, host 3, host 4, host 7 and host 8 are greater than the first preset priority threshold. Then, host 1, host 3 and host 4 can be further screened out from host 1, host 3, host 4, host 7 and host 8 as at least one of the above-mentioned virtual machines. It should be understood that the criterion for further screening can be that host 7 or host 8 needs to reserve more host resources for subsequent large business expenses or as a virtual machine of a designated important tenant, thereby determining the resource priority of host 7 or host 8 to be a lower resource priority.

[0085] It should also be understood that the relevant explanations and descriptions of other steps and schemes can be found above and will not be repeated here.

[0086] The following will be combined Figure 6 Next, a virtual machine scheduling device according to some other embodiments of the present invention will be described. Figure 6 The virtual machine scheduling device corresponds to Figure 2 The virtual machine scheduling method includes:

[0087] A first determining module 610 determines tenant service characteristics of each virtual machine among a plurality of virtual machines to be scheduled;

[0088] The second determination module 620 determines the degree of demand for various host resources of each virtual machine based on the tenant service characteristics of the virtual machine;

[0089] The scheduling module 630 schedules the multiple virtual machines to be scheduled to at least one host machine, so that the demand levels of any two virtual machines in the same host machine for each host machine resource are in a demand complementary state, wherein the difference in demand levels of the two virtual machines in the demand complementary state exceeds a preset threshold.

[0090] In the solution of the embodiment of the present invention, the tenant business characteristics of the virtual machine reliably reflect the degree of demand of the virtual machine for various host machine resources. When scheduling multiple virtual machines to be scheduled to at least one host machine, the resource sales rate can be guaranteed as much as possible. In addition, after the scheduling of multiple virtual machines to be scheduled, since the difference in demand levels of two virtual machines in a demand complementary state exceeds a preset threshold, the resource competition among different virtual machines to be scheduled in the same host machine is reduced.

[0091] In other embodiments, the first determination module is specifically used to: monitor the resource usage data of at least one scheduled virtual machine of the tenant business of each virtual machine on the various host hardware that provides the multiple host resources; and determine the tenant business characteristics of the virtual machine to be scheduled based on the resource usage data of the various host hardware.

[0092] In other embodiments, the first determination module is specifically used to: identify the tenant business characteristics of each virtual machine to obtain the business scenario and business risk of the virtual machine; and determine the degree of demand of the virtual machine for the multiple host resources based on the correlation between the business scenario and business risk of the virtual machine and the multiple host resources.

[0093] In other embodiments, the virtual machine scheduling device also includes: a third determination module, which is used to: determine the total amount of resources that can be allocated to the multiple host machine resources by multiple host machines; sort the total amount of resources that can be allocated to the multiple host machines to determine the resource priority of the multiple host machines; select at least one host machine from the multiple host machines so that the resource priority of the at least one host machine is greater than a first preset priority threshold.

[0094] In other embodiments, the third determination module is specifically used to: perform averaging processing on the resource sales rate of each of the multiple host machines to obtain the average resource sales rate of the multiple host machines; determine the first preset priority threshold so that the resource sales rate of at least one host machine is less than the average resource sales rate.

[0095] In other embodiments, the third determination module is specifically used to: determine the amount of allocatable resources for each host machine resource of each of the multiple host machines; use the respective weight coefficients of the multiple host machine resources to weight the multiple allocatable resource amounts of each host machine for the multiple host machine resources to determine the total amount of allocatable resources of the host machine.

[0096] In other embodiments, the scheduling module is also used to: reschedule the target scheduled virtual machine among the scheduled virtual machines so that the resource priority of the host machine where the target scheduled virtual machine is located before rescheduling is greater than the resource priority of the host machine where the target scheduled virtual machine is located after rescheduling.

[0097] In other embodiments, the scheduling module is also used to: determine the target scheduled virtual machine from among the scheduled virtual machines whose rescheduling priority is higher than a second preset priority threshold, wherein the smaller the current resource occupancy ratio of the scheduled virtual machine to the multiple host machine resources, the higher the rescheduling priority of the scheduled virtual machine.

[0098] In other embodiments, the virtual machine scheduling device also includes: a monitoring module, which is used to: monitor, for each host machine resource, the rated resource amount of the processing unit of the host machine where the scheduled virtual machine is located, and the resource occupancy of at least one processing core allocated to the scheduled virtual machine by the processing unit; and determine the ratio between the resource occupancy of the at least one processing core and the rated resource amount of the processing unit as the current resource occupancy ratio of the scheduled virtual machine for the host machine resource.

[0099] The specific implementation of each module in the virtual machine scheduling device can be found in the corresponding descriptions of the corresponding steps in the above-mentioned method embodiment, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working process of the above-mentioned device and modules can refer to the corresponding process description in the above-mentioned method embodiment, and will not be repeated here.

[0100] Reference Figure 7 , shows a schematic structural diagram of an electronic device according to another embodiment of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0101] like Figure 7As shown, the electronic device may include: a processor (processor) 702 for executing a program 710 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0102] The processor, the communication interface, and the memory communicate with each other via a communication bus.

[0103] Communication interface, used to communicate with other electronic devices or servers.

[0104] The processor is used to execute the program, and specifically can execute the relevant steps in the above method embodiment.

[0105] Specifically, the program may include program codes including computer operation instructions.

[0106] The processor may be a CPU, an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs, or different types of processors, such as one or more CPUs and one or more ASICs.

[0107] Memory is used to store programs. The memory may include high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk storage.

[0108] The program may include multiple computer instructions. Specifically, the program may enable the processor to execute operations corresponding to each virtual machine scheduling method described in any of the aforementioned multiple method embodiments through the multiple computer instructions.

[0109] The specific implementation of each step in the program can refer to the corresponding description of the corresponding step, module or unit in the above method embodiment, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working process of the above-described device, equipment or module can refer to the corresponding process description in the above method embodiment, and will not be repeated here.

[0110] An embodiment of the present invention further provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the aforementioned method embodiments. The computer storage medium includes, but is not limited to, a compact disc read-only memory (CD-ROM), random access memory (RAM), a floppy disk, a hard disk, or a magneto-optical disk.

[0111] An embodiment of the present invention further provides a computer program product, comprising computer instructions, which instruct a computing device to execute operations corresponding to the above-mentioned virtual machine scheduling method.

[0112] In addition, it should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used to train the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0113] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.

[0114] The method according to the embodiment of the present invention described above can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded via a network and will be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA)). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., random access memory (RAM), read-only memory (ROM), flash memory, etc.) that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown here.

[0115] Those skilled in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.

[0116] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.

Claims

1. A virtual machine scheduling method, comprising: Determining tenant service characteristics of each virtual machine among the plurality of virtual machines to be scheduled; Determine the VM's demand for various host resources based on the tenant's business characteristics. The multiple virtual machines to be scheduled are scheduled to at least one host machine so that the demand levels of any two virtual machines in the same host machine for each host machine resource are in a demand complementary state, wherein the difference in demand levels of the two virtual machines in the demand complementary state exceeds a preset threshold.

2. The method according to claim 1, wherein Determine tenant service characteristics of each of the multiple virtual machines to be scheduled, including: Monitoring resource usage data of at least one scheduled virtual machine of a tenant service of each virtual machine on each host machine hardware providing the plurality of host machine resources; Based on the resource usage data of the hardware of each host machine, tenant service characteristics of the virtual machine to be scheduled are determined.

3. The method according to claim 2, wherein: Based on the tenant business characteristics of each VM, determine the VM's demand for various host resources, including: Identify the tenant business characteristics of each virtual machine and obtain the business scenario and business risk of the virtual machine; Based on the correlation between the business scenario and business risk of the virtual machine and the multiple host machine resources, the degree of demand of the virtual machine for the multiple host machine resources is determined.

4. The method according to claim 1, wherein The method further comprises: determining a total amount of resources that can be allocated by the plurality of host machines to the plurality of host machine resources; Sorting the total amount of allocatable resources of the multiple host machines to determine the resource priorities of the multiple host machines; The at least one host machine is selected from the plurality of host machines, so that a resource priority of the at least one host machine is greater than a first preset priority threshold.

5. The method according to claim 4, wherein Selecting the at least one host machine from the plurality of host machines includes: Performing average processing on the resource selling rates of the multiple host machines to obtain an average resource selling rate of the multiple host machines; The first preset priority threshold is determined so that the resource selling rate of the at least one host machine is less than the average resource selling rate.

6. The method according to claim 4, wherein: Determining the total amount of resources that can be allocated by the plurality of host machines to the plurality of host machine resources includes: determining an allocatable amount of resources for each host resource of each host machine among the plurality of host machines; The weight coefficients of the plurality of host machine resources are respectively used to weight the plurality of allocatable resource amounts of the plurality of host machine resources for each host machine, so as to determine the total allocatable resource amount of the host machine.

7. The method according to claim 4, wherein: The method further comprises: A target scheduled virtual machine among the scheduled virtual machines is rescheduled so that the resource priority of the host machine where the target scheduled virtual machine is located before the rescheduling is greater than the resource priority of the host machine where the target scheduled virtual machine is located after the rescheduling.

8. The method according to claim 7, wherein: The method further comprises: The scheduled virtual machines whose rescheduling priority is higher than the second preset priority threshold among the scheduled virtual machines are determined as the target scheduled virtual machine, wherein the smaller the current resource occupancy ratio of the scheduled virtual machine to the multiple host machine resources is, the higher the rescheduling priority of the scheduled virtual machine is.

9. The method according to claim 8, wherein The method further comprises: For each host resource, monitor the rated resource amount of the processing unit of the host where the scheduled virtual machine is located, and the resource usage of at least one processing core allocated by the processing unit to the scheduled virtual machine; The ratio between the resource occupation amount of the at least one processing core and the rated resource amount of the processing unit is determined as the current resource occupation ratio of the scheduled virtual machine to the host machine resources.

10. An electronic device comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, where the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1 to 9.

11. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

12. A computer program product comprising a computer program / instruction, which implements the method according to any one of claims 1 to 9 when executed by a processor.