A resource scheduling method and device based on a cloud service platform
By obtaining the virtual machine portrait information of the cloud service platform for resource scheduling, avoiding the scheduling of virtual machines on the same host with high resource requirements, solving the problems of resource competition and performance decline in IaaS environment, and achieving improved resource utilization and cost reduction.
Patent Information
- Application Number
- CN202411179676.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2044-08-26
AI Technical Summary
In an infrastructure as a service (IaaS) environment, high load stacking leads to resource competition and performance degradation, and prior art is difficult to effectively improve resource scheduling to improve resource utilization and reduce resource overhead costs.
By obtaining the deployment attribute information of the virtual machine to be scheduled on the cloud service platform, matching the target virtual machine portrait from the virtual machine portrait, scheduling based on resource consumption information, avoiding scheduling of high-resource-demand virtual machines on the same host, and optimizing resource allocation.
It improves resource utilization, reduces resource overhead costs, and reduces multi-tenant resource competition, realizing load peak scheduling and balanced global resource load.
Smart Images

Figure CN119065848B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtualization technology, and in particular, to a resource scheduling method and apparatus based on a cloud service platform. Background Art
[0002] Infrastructure as a Service (IaaS) is a cloud computing service model. In this model, a cloud service provider provides infrastructure services such as servers, storage, and networks to users. Users can rent these resources as needed without having to purchase and maintain hardware devices, which greatly saves costs and significantly improves flexibility.
[0003] In an IaaS environment, high-load stacking usually refers to multiple tenants or application programs with high resource requirements running on the same physical resource (such as a server) intensively, resulting in resource contention and performance degradation. Therefore, how to improve resource scheduling to increase resource utilization and reduce resource overhead costs to reduce multi-tenant resource contention while meeting the resource requirements of multiple tenants. Summary of the Invention
[0004] In view of this, embodiments of the present application provide a resource scheduling method and apparatus based on a cloud service platform, which are used to improve resource scheduling to increase resource utilization and reduce resource overhead costs to reduce multi-tenant resource contention while meeting the resource requirements of multiple tenants.
[0005] To achieve the above object, the embodiments of the present application provide the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a resource scheduling method based on a cloud service platform, including:
[0007] Obtaining deployment attribute information of a to-be-scheduled virtual machine applied for deployment by a tenant on the cloud service platform;
[0008] Obtaining a target virtual machine image that matches the deployment attribute information of the to-be-scheduled virtual machine from a virtual machine image set of the cloud service platform; the virtual machine image set includes multiple virtual machine images generated by analyzing historical operation data of virtual machines on the cloud service platform; the virtual machine image is used to describe the deployment attribute information and resource consumption information corresponding to the virtual machine, where the resource consumption information is used to describe the expected consumption amount of at least one resource of the virtual machine that matches the deployment attribute information of the virtual machine;
[0009] Scheduling the to-be-scheduled virtual machine according to the resource consumption information in the target virtual machine image.
[0010] As an optional implementation manner of an embodiment of the present application, scheduling the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile includes:
[0011] According to the resource consumption information in the target virtual machine profile, obtaining the expected resource consumption of the virtual machine to be scheduled;
[0012] Obtaining the resource surplus of each host in the host cluster of the cloud service platform, where the resource surplus includes the amount of the at least one idle resource on the host;
[0013] Scheduling the virtual machine to be scheduled to a target host in the host cluster where the resource surplus is greater than or equal to the expected resource consumption.
[0014] As an optional implementation manner of an embodiment of the present application, after scheduling the virtual machine to be scheduled to a target host in the host cluster where the resource surplus is greater than or equal to the expected resource consumption, the method further includes:
[0015] Updating the resource surplus of the target host according to the expected resource consumption.
[0016] As an optional implementation manner of an embodiment of the present application, the at least one resource includes: a virtual processor; the method further includes:
[0017] Obtaining the usage information of the virtual processor of the target virtual machine from the historical operation data; the target virtual machine is a virtual machine that matches the deployment attribute information of the virtual machine to be scheduled, and the usage information includes at least one metric for describing the utilization rate of the virtual processor;
[0018] According to the usage information of the virtual processor of the target virtual machine, obtaining the expected utilization rate of the virtual processor of a virtual machine that matches the deployment attribute information of the virtual machine;
[0019] Generating the target virtual machine profile according to the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine.
[0020] As an optional implementation manner of an embodiment of the present application, the usage information includes: the average utilization rate, the first utilization rate, and the second utilization rate of the virtual processor, where the first utilization rate and the second utilization rate are respectively the first percentile and the second percentile of the utilization rate of the virtual processor of the target virtual machine; the first percentile is less than the second percentile; obtaining the expected utilization rate of the virtual processor of a virtual machine that matches the deployment attribute information of the virtual machine according to the usage information of the virtual processor of the target virtual machine includes:
[0021] Calculate the difference between the first utilization rate and the average utilization rate to obtain the first load amplitude;
[0022] Calculate the difference between the second utilization rate and the average utilization rate to obtain the second load amplitude;
[0023] According to the first load amplitude and the second load amplitude, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate or the first utilization rate or the second utilization rate.
[0024] As an optional implementation manner of an embodiment of the present application, the step of obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine according to the first load amplitude and the second load amplitude, based on the average utilization rate or the first utilization rate or the second utilization rate, includes:
[0025] When the second load amplitude is less than or equal to a preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate;
[0026] When the second load amplitude is greater than the preset threshold and the first load amplitude is less than or equal to the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the first utilization rate;
[0027] When the first load amplitude is greater than the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the second utilization rate.
[0028] As an optional implementation manner of an embodiment of the present application, the step of obtaining the expected resource consumption of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile includes:
[0029] Obtain the expected virtual processor utilization rate of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile;
[0030] According to the number of virtual processors of the virtual machine to be scheduled and the expected virtual processor utilization rate of the virtual machine to be scheduled, obtain the expected virtual processor consumption of the virtual machine to be scheduled.
[0031] As an optional implementation manner of an embodiment of the present application, the at least one resource includes: a virtual processor; before obtaining the resource margin of each host in the host cluster of the cloud service platform, the method further includes:
[0032] Obtain the number of virtual processors of each host in the host cluster;
[0033] According to the number of virtual processors of each host in the host cluster and a preset virtual processor utilization rate, obtain the total available virtual processors of each host in the host cluster;
[0034] Obtain an initial value of the virtual processor margin of each host in the host cluster according to the total available virtual processors of each host in the host cluster.
[0035] As an optional implementation manner of an embodiment of the present application, the obtaining a target virtual machine image matching the deployment attribute information of the to-be-scheduled virtual machine from the virtual machine image set of the cloud service platform includes:
[0036] According to the deployment attribute information of the to-be-scheduled virtual machine, obtain the hash value of the to-be-scheduled virtual machine;
[0037] According to the deployment attribute information of each virtual machine image in the virtual machine image set, obtain the hash value of each virtual machine image in the virtual machine image set;
[0038] Determine the virtual machine image in the virtual machine image set with the same hash value as the to-be-scheduled virtual machine as the target virtual machine image.
[0039] As an optional implementation manner of an embodiment of the present application, the method further includes: before obtaining the hash value of the to-be-scheduled virtual machine according to the deployment attribute information of the to-be-scheduled virtual machine, performing a fuzzification process on the deployment attribute information of the to-be-scheduled virtual machine;
[0040] Before obtaining the hash value of each virtual machine image in the virtual machine image set according to the deployment attribute information of each virtual machine image in the virtual machine image set, perform a fuzzification process on the deployment attribute information of each virtual machine image in the virtual machine image set.
[0041] In a second aspect, an embodiment of the present application provides a resource scheduling device based on a cloud service platform, including:
[0042] An obtaining unit, configured to obtain the deployment attribute information of a to-be-scheduled virtual machine applied for deployment by a tenant on a cloud service platform;
[0043] A matching unit, configured to obtain a target virtual machine profile that matches the deployment attribute information of the to-be-scheduled virtual machine from the virtual machine profile set of the cloud service platform; the virtual machine profile set includes multiple virtual machine profiles generated based on the historical operation data analysis of the virtual machines on the cloud service platform; the virtual machine profile is used to describe the deployment attribute information and resource consumption information corresponding to the virtual machine, where the resource consumption information is used to describe the expected consumption amount of at least one resource of the virtual machine that matches the deployment attribute information of the virtual machine.
[0044] A scheduling unit, configured to schedule the to-be-scheduled virtual machine according to the resource consumption information in the target virtual machine profile.
[0045] As an optional implementation manner of an embodiment of this application, the scheduling unit is specifically configured to obtain the expected resource consumption amount of the to-be-scheduled virtual machine according to the resource consumption information in the target virtual machine profile; obtain the resource surplus of each host in the host cluster of the cloud service platform, where the resource surplus includes the amount of the at least one resource idle on the host; and schedule the to-be-scheduled virtual machine to a target host in the host cluster where the resource surplus is greater than or equal to the expected resource consumption amount.
[0046] As an optional implementation manner of an embodiment of this application, after scheduling the to-be-scheduled virtual machine to a target host in the host cluster where the resource surplus is greater than or equal to the expected resource consumption amount, the scheduling unit is further configured to update the resource surplus of the target host according to the expected resource consumption amount.
[0047] As an optional implementation manner of an embodiment of this application, the at least one resource includes: a virtual processor; the matching unit is further configured to obtain the usage information of the virtual processor of the target virtual machine from the historical operation data; obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine according to the usage information of the virtual processor of the target virtual machine; and generate the target virtual machine profile according to the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine.
[0048] Wherein, the target virtual machine is a virtual machine that matches the deployment attribute information of the to-be-scheduled virtual machine, and the usage information includes at least one metric for describing the utilization rate of the virtual processor.
[0049] As an optional implementation manner of an embodiment of the present application, the usage information includes the average utilization rate, the first utilization rate, and the second utilization rate of the virtual processor, where the first utilization rate and the second utilization rate are respectively the first percentile and the second percentile of the utilization rate of the virtual processor of the target virtual machine; the first percentile is less than the second percentile;
[0050] The matching unit is specifically configured to calculate the difference between the first utilization rate and the average utilization rate to obtain the first load amplitude; calculate the difference between the second utilization rate and the average utilization rate to obtain the second load amplitude; and based on the first load amplitude and the second load amplitude, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate or the first utilization rate or the second utilization rate.
[0051] As an optional implementation manner of an embodiment of the present application, the matching unit is specifically configured to, when the second load amplitude is less than or equal to a preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate; when the second load amplitude is greater than the preset threshold and the first load amplitude is less than or equal to the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the first utilization rate; and when the first load amplitude is greater than the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the second utilization rate.
[0052] As an optional implementation manner of an embodiment of the present application, the scheduling unit is specifically configured to obtain the expected virtual processor utilization rate of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile; and obtain the expected virtual processor consumption of the virtual machine to be scheduled according to the number of virtual processors of the virtual machine to be scheduled and the expected virtual processor utilization rate of the virtual machine to be scheduled.
[0053] As an optional implementation manner of an embodiment of the present application, the at least one resource includes a virtual processor; the scheduling unit is further configured to obtain the number of virtual processors of each host in the host cluster of the cloud service platform before obtaining the resource margin of each host in the host cluster; obtain the total available virtual processors of each host in the host cluster according to the number of virtual processors of each host in the host cluster and a preset virtual processor utilization rate; and obtain an initial value of the virtual processor margin of each host in the host cluster according to the total available virtual processors of each host in the host cluster.
[0054] As an optional implementation manner of an embodiment of the present application, the matching unit is specifically configured to obtain the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled; obtain the hash values of each virtual machine portrait in the virtual machine portrait set according to the deployment attribute information of each virtual machine portrait in the virtual machine portrait set; and determine the virtual machine portrait in the virtual machine portrait set with the same hash value as that of the virtual machine to be scheduled as the target virtual machine portrait.
[0055] As an optional implementation manner of an embodiment of the present application, the matching unit is further configured to perform fuzzification processing on the deployment attribute information of the virtual machine to be scheduled before obtaining the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled, and perform fuzzification processing on the deployment attribute information of each virtual machine portrait in the virtual machine portrait set before obtaining the hash values of each virtual machine portrait in the virtual machine portrait set according to the deployment attribute information of each virtual machine portrait in the virtual machine portrait set.
[0056] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor, where the memory is used to store a computer program, and the processor is configured to, when executing the computer program, enable the electronic device to implement the resource scheduling method based on a cloud service platform in any of the above implementation manners.
[0057] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which, when the computer program is executed by a computing device, enables the computing device to implement any of the above resource scheduling methods based on a cloud service platform.
[0058] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a computer, enables the computer to implement any of the above resource scheduling methods based on a cloud service platform.
[0059] The resource scheduling method based on a cloud service platform provided by an embodiment of the present application first obtains the deployment attribute information of a virtual machine to be scheduled that a tenant applies to deploy on the cloud service platform, then obtains a target virtual machine profile that matches the deployment attribute information of the virtual machine to be scheduled from the virtual machine profile set of the cloud service platform, and schedules the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile. Since the embodiments of the present application can generate multiple virtual machine profiles based on the historical operation data analysis of virtual machines on the cloud service platform, and the virtual machine profiles are used to describe the deployment attribute information and resource consumption information corresponding to the virtual machines, and the resource consumption information is used to describe the expected consumption amount of at least one resource of the virtual machine that matches the deployment attribute information of the virtual machine, the present application can obtain the expected resource consumption amount of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile, and schedule the virtual machine to be scheduled according to the expected resource consumption amount of the virtual machine to be scheduled. Therefore, the embodiments of the present application can avoid scheduling virtual machines with high resource requirements to the same host, thereby improving resource scheduling, increasing resource utilization rate, and reducing resource overhead costs, so as to reduce multi-tenant resource contention while meeting the resource requirements of multiple tenants. Brief Description of the Drawings
[0060] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required to be referred to in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0062] Figure 1 It is one of the step flowcharts of the resource scheduling method based on a cloud service platform provided by an embodiment of the present application;
[0063] Figure 2 It is a schematic diagram of the virtual machine profile production link provided by an embodiment of the present application;
[0064] Figure 3 It is the second of the step flowcharts of the resource scheduling method based on a cloud service platform provided by an embodiment of the present application;
[0065] Figure 4 It is a schematic diagram of the structure of the resource scheduling device based on a cloud service platform provided by an embodiment of the present application;
[0066] Figure 5 It is a schematic diagram of the hardware structure of the electronic device provided by an embodiment of the present application. Detailed Embodiments
[0067] In order to more clearly understand the above objects, features, and advantages of the present application, the solutions of the present application will be further described below. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
[0068] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application can also be implemented in other ways different from those described herein. Obviously, the embodiments in the specification are only a part of the embodiments of the present application, rather than all of the embodiments.
[0069] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner. In addition, in the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" refers to two or more.
[0070] The embodiments of the present application provide a resource scheduling method based on a cloud service platform. Referring to Figure 1 as shown, the resource scheduling method based on the cloud service platform includes the following steps:
[0071] S11. Obtain the deployment attribute information of the virtual machine to be scheduled.
[0072] In the embodiments of the present application, the deployment attribute information of the virtual machine to be scheduled is information used to define the deployment characteristics of the virtual machine to be scheduled, and may include deployment attribute information in multiple dimensions.
[0073] In some embodiments, the deployment attribute information of the virtual machine to be scheduled may include one or more of the following: the region (Region) of the virtual machine to be scheduled, the availability zone (Availability Zone, AZ) of the virtual machine to be scheduled, the instance identification code (Instance ID) of the virtual machine to be scheduled, the instance type (Instance Type) of the virtual machine to be scheduled, the account identification code (Account ID) of the virtual machine to be scheduled, the specification family of the virtual machine to be scheduled, the specification of the virtual machine to be scheduled, etc.
[0074] S12. Obtain a target virtual machine profile that matches the deployment attribute information of the virtual machine to be scheduled from the virtual machine profile set of the cloud service platform.
[0075] Among them, the virtual machine portrait set includes multiple virtual machine portraits generated based on the analysis of the historical operation data of virtual machines on the cloud service platform; the virtual machine portraits are used to describe the deployment attribute information and resource consumption information corresponding to the virtual machines, where the resource consumption information is used to describe the expected consumption of at least one resource of the virtual machine that matches the deployment attribute information of the virtual machine.
[0076] Exemplarily, a certain virtual machine portrait in the virtual machine portrait set can be as shown in Table 1 below:
[0077] Table 1 Virtual Machine Portrait
[0078]
[0079] According to the content in the classification column in Table 1 above, it can be determined whether the information of the virtual machine portrait belongs to deployment attribute information or resource consumption information. The hierarchical column content is used to give the acquisition method of the information. Among them, the original data refers to the data directly read from the historical operation data of the virtual machine without data processing and aggregation; the real-time data refers to the objective fact result determined by statistically analyzing the historical operation data of the virtual machine; the model data indicates the index obtained through analysis and modeling according to the content concerned in the business scenario; the predicted data refers to the index obtained by inferring and predicting on the basis of the model data, which is an important basis for the virtual machine portrait to divide the description object.
[0080] It should be noted that in the above embodiment, the resource consumption information of the virtual machine portrait is used to describe the expected utilization rate of the CPU, and the expected utilization rate of the CPU is shown in the form of the expected CPU load level as an example, but the embodiments of the present application are not limited thereto. The resource consumption information of the virtual machine portrait can also indicate the expected consumption of resources such as the Graphics Processing Unit (GPU), memory, and network transmission bandwidth, and the expected consumption can also be expressed in other forms. The embodiments of the present application do not limit this.
[0081] In some embodiments, the resource scheduling method based on the cloud service platform provided in the above embodiment further includes: generating the target virtual machine portrait and adding the target virtual machine portrait to the virtual machine portrait set of the cloud service platform.
[0082] In some embodiments, the at least one resource includes: a virtual processor. That is, the resource consumption information is used to describe the usage of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine. Exemplarily, the virtual processor may be a Virtual Central Processing Unit (VCPU), a Virtual Graphics Processing Unit (GPU), etc.
[0083] When the at least one resource includes: a virtual processor, generating the target virtual machine profile includes the following steps a to c:
[0084] Step a, obtain the usage information of the virtual processor of the target virtual machine from the historical operation data.
[0085] Wherein, the target virtual machine is a virtual machine that matches the deployment attribute information of the to-be-scheduled virtual machine, and the usage information includes at least one metric for describing the utilization rate of the virtual processor.
[0086] Exemplarily, the usage information of the virtual processor of the target virtual machine may include: the average usage rate of the virtual processor of the target virtual machine, the P50 (the fiftieth percentile) of the usage rate of the virtual processor of the target virtual machine, the P90 (the ninetieth percentile) of the usage rate of the virtual processor of the target virtual machine, the P99 (the ninety-ninth percentile) of the usage rate of the virtual processor of the target virtual machine, etc., one or more of them.
[0087] Step b, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine according to the usage information of the virtual processor of the target virtual machine.
[0088] In some embodiments, the usage information includes one usage metric, for example: the average usage rate of the virtual processor of the target virtual machine, or the P50 of the usage rate of the virtual processor of the target virtual machine, or the P90 of the usage rate of the virtual processor of the target virtual machine. The obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine according to the usage information of the virtual processor of the target virtual machine includes: determining the metric for describing the utilization rate of the virtual processor in the usage information as the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine.
[0089] In some embodiments, the usage information includes: the average utilization rate of the virtual processor, the first utilization rate, and the second utilization rate.
[0090] Wherein, the first utilization rate and the second utilization rate are respectively the first percentile and the second percentile of the utilization rate of the virtual processor of the target virtual machine; the first percentile is less than the second percentile.
[0091] Percentile is an index used for statistics and description of the data distribution position. Specifically, it sorts a set of data from small to large and determines the value at a specific percentage position. For example, the 25th percentile (P25) means that 25% of the data is less than or equal to this value; the 75th percentile (P75) means that 75% of the data is less than or equal to this value.
[0092] In some embodiments, the first percentile and the second percentile are P90 (the 90th percentile) and P99 (the 99th percentile) respectively.
[0093] When the usage information includes: the average utilization rate, the first utilization rate, and the second utilization rate of the virtual processor, according to the usage information of the virtual processor of the target virtual machine, obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine includes the following steps b1 to b3:
[0094] Step b1, calculate the difference between the first utilization rate and the average utilization rate to obtain the first load amplitude.
[0095] Exemplarily, the first percentile is 80%, the average utilization rate is 43%, then the first load amplitude is 37%.
[0096] Step b2, calculate the difference between the second utilization rate and the average utilization rate to obtain the second load amplitude.
[0097] Exemplarily, the first percentile is 87%, the average utilization rate is 43%, then the second load amplitude is 44%.
[0098] Step b3, according to the first load amplitude and the second load amplitude, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate or the first utilization rate or the second utilization rate.
[0099] In some embodiments, according to the first load amplitude and the second load amplitude, obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate or the first utilization rate or the second utilization rate includes the following steps b31 to step b33:
[0100] Step b31: When the second load amplitude is less than or equal to the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate.
[0101] Step b32: When the second load amplitude is greater than the preset threshold and the first load amplitude is less than or equal to the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the first utilization rate.
[0102] Step b33: When the first load amplitude is greater than the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the second utilization rate.
[0103] Since the first percentile is less than the second percentile, and the first load amplitude and the second amplitude are respectively the differences between the first percentile and the second percentile and the average utilization rate, the second load amplitude is greater than the first load amplitude. If the second load amplitude is less than or equal to the preset threshold, the first load amplitude is less than the preset threshold. If the first load amplitude is greater than the preset threshold, both the first load amplitude and the second load amplitude are greater than the preset threshold.
[0104] When the load fluctuation of the virtual processor conforms to the Gaussian distribution, the load fluctuation of the virtual processor should satisfy a normal distribution with an expected value μ of the average utilization rate and a variance of σ 2 denoted as N(μ, σ 2 ), and the preset threshold can be determined according to the standard deviation σ.
[0105] For example: If the load conditions of the virtual processors of all virtual machines are statistically analyzed, 1 standard deviation is 0.093, and 2 standard deviations are 0.247, the preset threshold can be set to 0.093 or 0.247.
[0106] In some other embodiments, for the convenience of subsequent calculations, the standard deviation σ can also be rounded to a preset number of digits to obtain the preset threshold. For example: 1 standard deviation is 0.093, and 2 standard deviations are 0.247, the preset threshold can be set to 0.1 or 0.25.
[0107] In some embodiments, obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate includes: determining the average utilization rate as the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine; obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the first utilization rate includes: determining the first utilization rate as the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine; obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the second utilization rate includes: determining the second utilization rate as the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine. That is, representing the first load amplitude as Amplitude1, the second load amplitude as Amplitude2, the average utilization rate as Pavg, the first utilization rate as Pm, the average utilization rate as Pn, the preset threshold as σ, and the expected utilization rate as Pexpect, then there are:
[0108]
[0109] In some embodiments, obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate includes: rounding up the average utilization rate to one decimal place to obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine; obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the first utilization rate includes: rounding up the first utilization rate to one decimal place to obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine; obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the second utilization rate includes: rounding up the second utilization rate to one decimal place to obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine.
[0110] For example: if the average utilization rate is 43%, the first utilization rate is 80%, and the second utilization rate is 87%, then when the second load amplitude is less than or equal to the preset threshold, it is determined that the expected utilization rate is 50%; when the second load amplitude is greater than the preset threshold and the first load amplitude is less than or equal to the preset threshold, it is determined that the expected utilization rate is 80%; when the first load amplitude is greater than the preset threshold, it is determined that the expected utilization rate is 90%.
[0111] Referring to Figure 2 as shown Figure 2 in some embodiments, it is a schematic diagram of the production link of virtual machine portraits. As Figure 2 shown, the production link of virtual machine portraits includes: an offline data warehouse 21, a portrait management service 22, an asynchronous work component 23, a control service 24, and an online scheduler 25. Among them, the functions of the offline data warehouse 21 include: 1. Obtain the historical operation data of virtual machines on the cloud service platform, and obtain the corresponding deployment attribute information and resource consumption information of the virtual machines according to the historical operation data, and write the corresponding deployment attribute information and resource consumption information of the virtual machines into the message queue. 2. Perform preprocessing operations such as data cleaning and aggregation on the corresponding deployment attribute information and resource consumption information of the virtual machines saved in the message queue, and write the preprocessed data into the offline data table. 3. Write the corresponding deployment attribute information and resource consumption information of the virtual machines after preprocessing into the accelerated read-only library. The functions of the portrait management service 22 include: 1. Read the portrait data for generating virtual machine portraits from the offline data warehouse 21 through an asynchronous application programming interface (Application Programming Interface, API). 2. Generate virtual machine portraits in units of available zones distributed by the online scheduler, and start the portrait return sub-task with the available zone as the granularity. 3. Persist the virtual machine portraits into the database. The functions of the asynchronous work component 23 include: 1. Obtain the corresponding portrait data from the accelerated read-only library for each portrait return sub-task. 2. Call the operation and maintenance interface (Ops API) of the scheduler to return the latest virtual machine portraits to the cache of the scheduler for the scheduler to use. 3. Statistically summarize and update the virtual machine portraits in the database according to the results of the virtual machine portraits. The functions of the control service 24 include: 1. Call the virtual machine portraits from the asynchronous work component 23 through the operation and maintenance interface for the scheduler to use. 2. Perform data persistence processing on the virtual machine portraits. The main functions of the online scheduler 25 include: 1. Refresh the cached virtual machine portraits and schedule the virtual machines according to the virtual machine portraits. 2. Update the load margin of the host machine.
[0112] S13. Schedule the virtual machine to be scheduled according to the resource consumption information in the target virtual machine portrait.
[0113] In some embodiments, scheduling the virtual machine to be scheduled according to the resource consumption information in the target virtual machine portrait includes the following steps 1 to 3:
[0114] Step 1. Obtain the expected resource consumption of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine portrait.
[0115] That is, the resource consumption information of the target virtual machine image is used as the resource consumption information of the virtual machine to be scheduled, and the expected resource consumption of the virtual machine to be scheduled is calculated according to the resource consumption information of the virtual machine to be scheduled.
[0116] In some embodiments, the at least one resource includes: a virtual processor. Obtaining the expected resource consumption of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine image includes: obtaining the expected virtual processor utilization rate of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine image; and obtaining the expected virtual processor consumption of the virtual machine to be scheduled according to the number of virtual processors of the virtual machine to be scheduled and the expected virtual processor utilization rate of the virtual machine to be scheduled.
[0117] For example: when the number of virtual processors of a virtual machine is 4 and the expected virtual processor utilization rate of the virtual machine to be scheduled obtained according to the resource consumption information in the target virtual machine image is 80%, then the virtual processor consumption of the virtual machine to be scheduled is: 4 * 80% = 3.2.
[0118] Step 2: Obtain the resource surplus of each host in the host cluster of the cloud service platform.
[0119] The resource surplus includes the amount of the at least one resource idle on the host.
[0120] Step 3: Schedule the virtual machine to be scheduled to a target host in the host cluster where the resource surplus is greater than or equal to the expected resource consumption.
[0121] The resource scheduling method based on a cloud service platform provided by an embodiment of this application first obtains the deployment attribute information of a virtual machine to be scheduled that a tenant applies to deploy on the cloud service platform, then obtains a target virtual machine profile that matches the deployment attribute information of the virtual machine to be scheduled from the virtual machine profile set of the cloud service platform, and schedules the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile. Since the embodiments of this application can generate multiple virtual machine profiles based on the historical operation data analysis of virtual machines on the cloud service platform, and the virtual machine profiles are used to describe the deployment attribute information and resource consumption information corresponding to the virtual machines, and the resource consumption information is used to describe the expected consumption amount of at least one resource of the virtual machine that matches the deployment attribute information of the virtual machine, this application can obtain the expected resource consumption amount of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile, and schedule the virtual machine to be scheduled according to the expected resource consumption amount of the virtual machine to be scheduled. Therefore, the embodiments of this application can avoid scheduling virtual machines with high resource requirements to the same host, thereby improving resource scheduling, increasing resource utilization rate, and reducing resource overhead costs, so as to reduce multi-tenant resource contention while meeting the resource requirements of multiple tenants.
[0122] As an extension and refinement of the above embodiment, an embodiment of this application provides another resource scheduling method based on a cloud service platform. Referring to Figure 3 as shown, this resource scheduling method based on a cloud service platform includes the following steps:
[0123] S301. Obtain the deployment attribute information of a virtual machine to be scheduled that a tenant applies to deploy on the cloud service platform.
[0124] Exemplarily, the deployment attribute information of the virtual machine to be scheduled can be as follows:
[0125] "Instance ID": "i-yctes8xkw0cva4f6rm15",
[0126] "Region": "AA-BB",
[0127] "Availability Zone": "AA-BB-CC",
[0128] "Instance Type": "ecs.g1ie.21xlarge",
[0129] "Account ID": "2100325045",
[0130] "Instance Name": "render-84-bj".
[0131] S302. Obtain the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled.
[0132] Assume that the hash value of the virtual machine to be scheduled is CubeHash, then:
[0133] CubeHash = Hash(AA - BB - CC + 2100325045 + ecs.g1ie.21xlarge + render - 84
[0134] -bj)
[0135] In some embodiments, before obtaining the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled, the resource scheduling method based on the cloud service platform further includes: performing fuzzification processing on the deployment attribute information of the virtual machine to be scheduled.
[0136] In some embodiments, performing fuzzification processing on the deployment attribute information of the virtual machine to be scheduled includes: extracting features of the deployment attribute information of the dimension based on the regular expression corresponding to the deployment attribute information of each dimension.
[0137] For example: The features of the instance name can be extracted through the regular expression corresponding to the instance name, so that the feature item corresponding to the instance name is "render - % - bj".
[0138] The above - mentioned embodiments also perform fuzzification processing on the deployment attribute information of the virtual machine to be scheduled before obtaining the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled. Therefore, the above - mentioned embodiments can avoid the situation that virtual machines and virtual machine portraits with very similar deployment attribute information cannot be matched due to minor differences in the deployment attribute information.
[0139] S303. Obtain the hash values of the virtual machine portraits in the virtual machine portrait set according to the deployment attribute information of the virtual machine portraits in the virtual machine portrait set.
[0140] In some embodiments, the hash values of each virtual machine portrait can be calculated in advance according to the deployment attribute information of each virtual machine portrait and saved. When the hash values of each virtual machine portrait need to be obtained, the pre - saved hash values of each virtual machine portrait can be directly read.
[0141] The implementation method of calculating the hash values of each virtual machine portrait according to the deployment attribute information of each virtual machine portrait can refer to the implementation method of obtaining the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled. To avoid repetition, it will not be elaborated here.
[0142] Similarly, before obtaining the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled, the resource scheduling method based on the cloud service platform further includes: performing fuzzification processing on the deployment attribute information of the virtual machine portrait.
[0143] S304. Determine the target virtual machine image as the virtual machine image in the virtual machine image set that has the same hash value as the virtual machine to be scheduled.
[0144] That is, determine whether there is a virtual machine image with the same hash value as the virtual machine to be scheduled. If so, determine the virtual machine image with the same hash value as the virtual machine to be scheduled as the target virtual machine image.
[0145] S305. Obtain the expected resource consumption of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine image.
[0146] In some embodiments, the at least one resource includes: a virtual processor. The obtaining of the expected resource consumption of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine image includes: obtaining the expected virtual processor utilization rate of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine image; and obtaining the expected virtual processor consumption of the virtual machine to be scheduled according to the number of virtual processors of the virtual machine to be scheduled and the expected virtual processor utilization rate of the virtual machine to be scheduled.
[0147] For example: if the expected virtual processor utilization rate of the virtual machine to be scheduled is 50% and the number of virtual processors of the virtual machine to be scheduled is 6, then the expected virtual processor consumption of the virtual machine to be scheduled is 50% * 6 = 3.
[0148] S306. Obtain the resource margins of each host in the host cluster of the cloud service platform.
[0149] Wherein, the resource margin includes the amount of the at least one resource that is idle on the host.
[0150] In some embodiments, when the at least one resource includes: a virtual processor; before obtaining the resource margins of each host in the host cluster of the cloud service platform, the resource scheduling device based on the cloud service platform further includes: obtaining the total available virtual processor load of each host in the host cluster, obtaining the total available virtual processors of each host in the host cluster according to the number of virtual processors of each host in the host cluster and a preset virtual processor utilization rate, and obtaining an initial value of the virtual processor margin of each host in the host cluster according to the total available virtual processors of each host in the host cluster.
[0151] In the scenario of off-peak load calling of virtual processors, if there are two virtual processors on a host and the utilization rate of one virtual processor is n%, it is expected that the utilization rate of the other virtual processor does not exceed 100% - n%, so that the two virtual processors can perform off-peak load calling, avoiding all virtual processors being in a high-load mode, and thus reducing the risk of failure. Therefore, the average utilization rate of the virtual processors on the host can be set not to exceed 55%. Accordingly, in the embodiments of the present application, the preset virtual processor utilization rate can be set to 55%. The calculation formula for the total load of the available virtual processors on the host can be:
[0152]
[0153] where CPU_load host is the total load of the available virtual processors on the host, vcpu_count host is the number of virtual processors on the host, and A is an adjustment coefficient. In actual use, the value of A can be adjusted according to the scenario to adjust the total load of the available virtual processors on the host.
[0154] Exemplarily, taking the number of virtual processors on the host vcpu_count host = 64, the adjustment coefficient A = 1, and there are three virtual machines deployed on the host. The number of virtual processors of the first virtual machine is 32, and the expected virtual processor utilization rate is 80%. The number of virtual processors of the second virtual machine is 16, and the expected virtual processor utilization rate is 30%. The number of virtual processors of the third virtual machine is 8, and the expected virtual processor utilization rate is 20% as an example to illustrate the calculation process of the resource margin of the host.
[0155] First, calculate the total load of the available virtual processors on the host according to the number of virtual processors on the host and the adjustment coefficient.
[0156] Substitute vcpu_count host = 64 and A = 1 into the calculation formula for the total load of the available virtual processors on the host, and we can get CPU_load host = 35.2.
[0157] Secondly, calculate the virtual processor consumption of the three virtual machines respectively according to the number of virtual processors and the expected virtual processor utilization rate of the three virtual machines.
[0158] According to the number of virtual processors 32 and the expected virtual processor utilization rate 80%, the virtual processor consumption of the first virtual machine is 32 * 0.8 = 25.6.
[0159] Based on the number of virtual processors 16 and the expected virtual processor utilization rate of 30%, the virtual processor consumption of the second virtual machine is 16 * 0.3 = 4.8.
[0160] Based on the number of virtual processors 8 and the expected virtual processor utilization rate of 20%, the virtual processor consumption of the third virtual machine is 8 * 0.2 = 1.6.
[0161] Finally, subtract the virtual processor consumption of the virtual machines deployed on the host from the total available virtual processor load of the host to obtain the virtual processor margin of the host.
[0162] The total available virtual processor load of the host is 35.2, and the virtual processor consumptions of the three virtual machines deployed on the host are 25.6, 4.8, and 1.6 respectively. Therefore, the virtual processor margin of the host is 35.2 - 25.6 - 4.8 - 1.6 = 3.2.
[0163] S307. Schedule the to-be-scheduled virtual machine to a target host in the host cluster where the resource margin is greater than or equal to the expected resource consumption.
[0164] In some embodiments, scheduling the to-be-scheduled virtual machine to a target host in the host cluster where the resource margin is greater than or equal to the expected resource consumption includes:
[0165] Schedule the to-be-scheduled virtual machine to a host where the resource margin is greater than or equal to the expected resource consumption and the resource margin is closest to the expected resource consumption of the to-be-scheduled virtual machine.
[0166] In some embodiments, scheduling the to-be-scheduled virtual machine to a target host in the host cluster where the resource margin is greater than or equal to the expected resource consumption includes: scheduling the to-be-scheduled virtual machine to the host with the largest resource margin in the host cluster.
[0167] S308. Update the resource margin of the target host according to the expected resource consumption.
[0168] In some embodiments, updating the resource margin of the target host according to the expected resource consumption includes: updating the resource margin of the target host to the difference between the resource margin of the target host and the expected resource consumption.
[0169] For example: the virtual processor margin of the target host is 16.8, and the expected virtual processor consumption of the to-be-scheduled virtual machine is 4.6. Then update the virtual processor margin of the target host to 16.8 - 4.6 = 12.2.
[0170] After each virtual machine is scheduled to a host, the remaining resources of the target host are updated according to the expected resource consumption of the virtual machine, so that the remaining resources of the host can be directly read when needed, without having to calculate the remaining resources of the host based on the total available resources of the host and the resource consumption of the virtual machines deployed on the host, thereby improving the efficiency of obtaining the remaining resources of the host.
[0171] Based on the same inventive concept, as an implementation of the above method, an embodiment of the present application further provides a resource scheduling device based on a cloud service platform. This embodiment corresponds to the foregoing method embodiment. For the convenience of reading, the details in the foregoing method embodiment will not be repeated one by one in this embodiment. However, it should be clear that the resource scheduling device based on the cloud service platform in this embodiment can correspondingly implement all the contents in the foregoing method embodiment.
[0172] An embodiment of the present application provides a resource scheduling device based on a cloud service platform. Figure 4 As shown in the structural schematic diagram of the resource scheduling device based on the cloud service platform, Figure 4 as shown, the resource scheduling device 400 based on the cloud service platform includes:
[0173] An obtaining unit 41, configured to obtain the deployment attribute information of the virtual machine to be scheduled applied by a tenant on the cloud service platform;
[0174] A matching unit 42, configured to obtain a target virtual machine image matching the deployment attribute information of the virtual machine to be scheduled from the virtual machine image set of the cloud service platform; the virtual machine image set includes multiple virtual machine images generated based on the historical operation data analysis of the virtual machines on the cloud service platform; the virtual machine image is used to describe the deployment attribute information and resource consumption information corresponding to the virtual machine, wherein the resource consumption information is used to describe the expected consumption amount of at least one resource of the virtual machine matching the deployment attribute information of the virtual machine;
[0175] A scheduling unit 43, configured to schedule the virtual machine to be scheduled according to the resource consumption information in the target virtual machine image.
[0176] As an optional implementation manner of an embodiment of the present application, the scheduling unit 43 is specifically configured to obtain the expected resource consumption amount of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine image; obtain the remaining resources of each host in the host cluster of the cloud service platform, where the remaining resources include the amount of the at least one resource idle on the host; and schedule the virtual machine to be scheduled to a target host in the host cluster where the remaining resources are greater than or equal to the expected resource consumption amount.
[0177] As an optional implementation manner of an embodiment of the present application, the scheduling unit 43 is further configured to update the resource margin of the target host according to the expected resource consumption after scheduling the virtual machine to be scheduled to a target host in the host cluster where the resource margin is greater than or equal to the expected resource consumption.
[0178] As an optional implementation manner of an embodiment of the present application, the at least one resource includes: a virtual processor; the matching unit 42 is further configured to obtain the usage information of the virtual processor of the target virtual machine from the historical operation data; obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine according to the usage information of the virtual processor of the target virtual machine; generate the target virtual machine profile according to the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine.
[0179] Wherein, the target virtual machine is a virtual machine that matches the deployment attribute information of the virtual machine to be scheduled, and the usage information includes at least one index for describing the utilization rate of the virtual processor.
[0180] As an optional implementation manner of an embodiment of the present application, the usage information includes: the average utilization rate, the first utilization rate, and the second utilization rate of the virtual processor, where the first utilization rate and the second utilization rate are respectively the first percentile and the second percentile of the utilization rate of the virtual processor of the target virtual machine; the first percentile is less than the second percentile.
[0181] The matching unit 42 is specifically configured to calculate the difference between the first utilization rate and the average utilization rate to obtain the first load amplitude; calculate the difference between the second utilization rate and the average utilization rate to obtain the second load amplitude; obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate, or the first utilization rate, or the second utilization rate according to the first load amplitude and the second load amplitude.
[0182] As an alternative implementation manner of an embodiment of the present application, the matching unit 42 is specifically configured to: when the second load amplitude is less than or equal to a preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate; when the second load amplitude is greater than the preset threshold and the first load amplitude is less than or equal to the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the first utilization rate; when the first load amplitude is greater than the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the second utilization rate.
[0183] As an alternative implementation manner of an embodiment of the present application, the scheduling unit 43 is specifically configured to obtain the expected virtual processor utilization rate of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile; and obtain the expected virtual processor consumption amount of the virtual machine to be scheduled according to the number of virtual processors of the virtual machine to be scheduled and the expected virtual processor utilization rate of the virtual machine to be scheduled.
[0184] As an alternative implementation manner of an embodiment of the present application, the at least one resource includes: a virtual processor; the scheduling unit 43 is further configured to, before obtaining the resource margin of each host in the host cluster of the cloud service platform, obtain the number of virtual processors of each host in the host cluster; obtain the total available virtual processors of each host in the host cluster according to the number of virtual processors of each host in the host cluster and a preset virtual processor utilization rate; and obtain an initial value of the virtual processor margin of each host in the host cluster according to the total available virtual processors of each host in the host cluster.
[0185] As an alternative implementation manner of an embodiment of the present application, the matching unit 42 is specifically configured to obtain the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled; obtain the hash value of each virtual machine profile in the virtual machine profile set according to the deployment attribute information of each virtual machine profile in the virtual machine profile set; and determine the virtual machine profile in the virtual machine profile set that has the same hash value as the virtual machine to be scheduled as the target virtual machine profile.
[0186] As an optional implementation manner of the embodiment of the present application, the matching unit 42 is further configured to perform a fuzzification process on the deployment attribute information of the virtual machine to be scheduled before obtaining the hash value of the virtual machine to be scheduled according to the deployment attribute information of the virtual machine to be scheduled, and perform a fuzzification process on the deployment attribute information of each virtual machine profile in the virtual machine profile set before obtaining the hash value of each virtual machine profile in the virtual machine profile set according to the deployment attribute information of each virtual machine profile in the virtual machine profile set.
[0187] The resource scheduling device based on the cloud service platform provided by the embodiment of the present application can execute the resource scheduling method based on the cloud service platform provided in any of the above embodiments, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0188] Based on the same inventive concept, the embodiment of the present application also provides an electronic device. Figure 5 The structural schematic diagram of the electronic device provided by the embodiment of the present application is shown in Figure 5 As shown, the electronic device provided in this embodiment includes: a memory 501 and a processor 502. The memory 501 is used to store a computer program, and the processor 502 is used to execute any one of the resource scheduling methods based on the cloud service platform provided in the above embodiments when executing the computer program.
[0189] Based on the same inventive concept, the embodiment of the present application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the computing device is enabled to implement any one of the resource scheduling methods based on the cloud service platform provided in the above embodiments.
[0190] Based on the same inventive concept, the embodiment of the present application also provides a computer program product. When the computer program product runs on a computer, the computing device is enabled to implement any one of the resource scheduling methods based on the cloud service platform provided in the above embodiments.
[0191] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0192] The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0193] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory is an example of computer-readable media.
[0194] Computer-readable media include permanent and non-permanent, removable and non-removable storage media. The storage media can implement information storage by any method or technology, and the information can be computer-readable instructions, data structures, program modules, or other data. Examples of the computer's storage media include, but are not limited to, Phase Change Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other memory technologies, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD), or other optical storage, magnetic cassette tapes, disk storage, or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media do not include transitory media, such as modulated data signals and carrier waves.
[0195] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource scheduling method based on a cloud service platform, characterized in that, Including: Obtaining deployment attribute information of a virtual machine to be scheduled that is applied for deployment by a tenant on a cloud service platform; The deployment attribute information of the virtual machine to be scheduled is information used to define the deployment characteristics of the virtual machine to be scheduled, including: the availability zone of the virtual machine to be scheduled, the instance type of the virtual machine to be scheduled, and the account identification code of the virtual machine to be scheduled; Obtaining a target virtual machine profile that matches the deployment attribute information of the virtual machine to be scheduled from a virtual machine profile set of the cloud service platform; the virtual machine profile set includes multiple virtual machine profiles generated based on historical operation data analysis of virtual machines on the cloud service platform; the virtual machine profile is used to describe the deployment attribute information and resource consumption information corresponding to the virtual machine, where the resource consumption information is used to describe the expected consumption amount of at least one resource of the virtual machine that matches the deployment attribute information of the virtual machine; Scheduling the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile; Obtaining usage information of the virtual processor of the target virtual machine from the historical operation data, where the target virtual machine is a virtual machine that matches the deployment attribute information of the virtual machine to be scheduled, and the usage information includes the average utilization rate, the first utilization rate, and the second utilization rate of the virtual processor; the first utilization rate and the second utilization rate are respectively the first percentile and the second percentile of the utilization rate of the virtual processor of the target virtual machine; the first percentile is less than the second percentile; Calculating the difference between the first utilization rate and the average utilization rate to obtain the first load amplitude; Calculating the difference between the second utilization rate and the average utilization rate to obtain the second load amplitude; When the second load amplitude is less than or equal to a preset threshold, obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate; When the second load amplitude is greater than the preset threshold and the first load amplitude is less than or equal to the preset threshold, obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the first utilization rate; When the first load amplitude is greater than the preset threshold, obtaining the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the second utilization rate; Generating the target virtual machine profile according to the expected utilization rate.
2. The method according to claim 1, characterized in that, The scheduling the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile includes: Obtaining the expected resource consumption amount of the virtual machine to be scheduled according to the resource consumption information in the target virtual machine profile; Obtaining the resource surplus of each host in the host cluster of the cloud service platform, where the resource surplus includes the amount of the at least one resource idle on the host; Scheduling the virtual machine to be scheduled to a target host in the host cluster where the resource surplus is greater than or equal to the expected resource consumption amount.
3. The method according to claim 2, characterized in that, After scheduling the to-be-scheduled virtual machine to a target host in the host cluster where the resource margin is greater than or equal to the expected resource consumption, the method further includes: Updating the resource margin of the target host according to the expected resource consumption.
4. The method according to claim 2, characterized in that, The obtaining the expected resource consumption of the to-be-scheduled virtual machine according to the resource consumption information in the target virtual machine profile includes: Obtaining the expected virtual processor utilization rate of the to-be-scheduled virtual machine according to the resource consumption information in the target virtual machine profile; Obtaining the expected virtual processor consumption of the to-be-scheduled virtual machine according to the number of virtual processors of the to-be-scheduled virtual machine and the expected virtual processor utilization rate of the to-be-scheduled virtual machine.
5. The method according to claim 3, wherein The at least one resource includes: virtual processors; before obtaining the resource margin of each host in the host cluster of the cloud service platform, the method further includes: Obtaining the number of virtual processors of each host in the host cluster; Obtaining the total available virtual processors of each host in the host cluster according to the number of virtual processors of each host in the host cluster and a preset virtual processor utilization rate; Obtaining an initial value of the virtual processor margin of each host in the host cluster according to the total available virtual processors of each host in the host cluster.
6. The method according to claim 1, characterized in that, The obtaining a target virtual machine profile that matches the deployment attribute information of the to-be-scheduled virtual machine from the virtual machine profile set of the cloud service platform includes: Obtaining the hash value of the to-be-scheduled virtual machine according to the deployment attribute information of the to-be-scheduled virtual machine; Obtaining the hash value of each virtual machine profile in the virtual machine profile set according to the deployment attribute information of each virtual machine profile in the virtual machine profile set; Determining the virtual machine profile in the virtual machine profile set with the same hash value as that of the to-be-scheduled virtual machine as the target virtual machine profile.
7. The method according to claim 6, wherein The method further includes: before obtaining the hash value of the to-be-scheduled virtual machine according to the deployment attribute information of the to-be-scheduled virtual machine, performing fuzzification processing on the deployment attribute information of the to-be-scheduled virtual machine; Before obtaining the hash value of each virtual machine profile in the virtual machine profile set according to the deployment attribute information of each virtual machine profile in the virtual machine profile set, performing fuzzification processing on the deployment attribute information of each virtual machine profile in the virtual machine profile set.
8. A resource scheduling device based on a cloud service platform, characterized in that, Including: An obtaining unit, configured to obtain the deployment attribute information of a to-be-scheduled virtual machine applied for deployment by a tenant on a cloud service platform; The deployment attribute information of the to-be-scheduled virtual machine is information for defining the deployment characteristics of the to-be-scheduled virtual machine, including: the available zone of the to-be-scheduled virtual machine, the instance type of the to-be-scheduled virtual machine, and the account identification code of the to-be-scheduled virtual machine; A matching unit, configured to obtain a target virtual machine profile that matches the deployment attribute information of the to-be-scheduled virtual machine from the virtual machine profile set of the cloud service platform; the virtual machine profile set includes multiple virtual machine profiles generated based on the historical operation data analysis of the virtual machines on the cloud service platform; the virtual machine profile is used to describe the deployment attribute information and resource consumption information corresponding to the virtual machine, wherein the resource consumption information is used to describe the expected consumption of at least one resource of the virtual machine that matches the deployment attribute information of the virtual machine. A scheduling unit, configured to schedule the to-be-scheduled virtual machine according to the resource consumption information in the target virtual machine profile. The matching unit is further configured to obtain the usage information of the virtual processor of the target virtual machine from the historical operation data, where the target virtual machine is a virtual machine that matches the deployment attribute information of the to-be-scheduled virtual machine, and the usage information includes the average utilization rate, the first utilization rate, and the second utilization rate of the virtual processor; the first utilization rate and the second utilization rate are respectively the first percentile and the second percentile of the utilization rate of the virtual processor of the target virtual machine; the first percentile is less than the second percentile; calculate the difference between the first utilization rate and the average utilization rate to obtain the first load amplitude; calculate the difference between the second utilization rate and the average utilization rate to obtain the second load amplitude; when the second load amplitude is less than or equal to a preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the average utilization rate; when the second load amplitude is greater than the preset threshold and the first load amplitude is less than or equal to the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the first utilization rate; when the first load amplitude is greater than the preset threshold, obtain the expected utilization rate of the virtual processor of the virtual machine that matches the deployment attribute information of the virtual machine based on the second utilization rate; generate the target virtual machine profile according to the expected utilization rate.
9. An electronic device, characterized in that, Including: A memory and a processor, the memory is used to store a computer program, and the processor is used to, when executing the computer program, enable the electronic device to implement the resource scheduling method based on the cloud service platform according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device is enabled to implement the resource scheduling method based on the cloud service platform according to any one of claims 1-7.
11. A computer program product, characterized in that, When the computer program product runs on a computer, the computer is enabled to implement the resource scheduling method based on the cloud service platform according to any one of claims 1-7.
Citation Information
Patent Citations
Virtual machine creation method and device, management equipment and terminal equipment
CN108762885A
Cited By
Resource scheduling method based on a cloud service platform and electronic device
EP4703881A1