Resource scheduling method and device of virtual machine
By using the resource prediction model to adjust virtual machine resource allocation in the cloud platform, the problem in the existing technology that virtual machine resource scheduling cannot be dynamically adjusted is solved, improving operating efficiency and reducing costs.
Patent Information
- Application Number
- CN202410365031.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-10-18
AI Technical Summary
Existing virtual machine resource scheduling methods cannot perform dynamic scheduling based on the actual resource requirements of the virtual machine and the resource consumption of physical nodes, resulting in low operating efficiency.
By inputting the resource usage data of each virtual machine instance in the cloud platform into the resource prediction model, the resource requirements are predicted, and resource allocation is adjusted based on the prediction results and the resource usage data of the computing nodes to achieve dynamic resource scheduling to ensure that resource usage requirements are met and achieved. Maximum excess ratio allocation.
It improves the operating efficiency of the cloud platform system, reduces resource usage costs, and achieves the overall maximum over-ratio allocation of computing cluster resources.
Smart Images

Figure CN118796380A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a resource scheduling method and device for a virtual machine. Background Art
[0002] Resource scheduling of virtual machines is based on integrating the computing resources of data centers to provide users with the infrastructure (CPU, memory, storage, network, heterogeneous computing power, etc.) required for computing tasks. By allocating computing resources to users, on-demand computing services are realized.
[0003] The existing resource scheduling method for virtual machines generally schedules and deploys virtual machines according to various predefined policies based on the specification requirements of the virtual machines and the resource reservation on the physical nodes. However, this is a scheduling method based on templates and fixed policies. It cannot schedule according to the actual resource requirements of the virtual machines and the actual resource consumption of the physical nodes. It does not implement the dynamic resource scheduling process, resulting in low operating efficiency. Summary of the invention
[0004] The present invention provides a virtual machine resource scheduling method and device, which are used to realize the dynamic scheduling process of virtual machine resources and improve the operation efficiency of the cloud platform system.
[0005] The present invention provides a resource scheduling method for a virtual machine, comprising:
[0006] Inputting the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model respectively, and obtaining a resource demand prediction result of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance;
[0007] Based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, the resource allocation of each computing node is adjusted so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of the resources of the cloud platform.
[0008] According to a virtual machine resource scheduling method provided by the present invention, the resource allocation of each computing node is adjusted based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, including:
[0009] Based on the resource demand prediction results of the virtual machine instances, determining a changed virtual machine instance having a resource demand change among the virtual machine instances;
[0010] Based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform, a target node matching the changed virtual machine instance is determined from the multiple computing nodes of the cloud platform, so that after the changed virtual machine instance is allocated to the target node, the target node can meet the resource usage demand of the changed virtual machine instance, and the resources of each computing node in the cloud platform reach the maximum over-resolution allocation.
[0011] According to a virtual machine resource scheduling method provided by the present invention, based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of the multiple computing nodes of the cloud platform, a target node matching the changed virtual machine instance is determined from the multiple computing nodes of the cloud platform, including:
[0012] Determine the matching degree between each virtual machine instance and each computing node based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform;
[0013] Based on the matching degree, a target node matching the changed virtual machine instance is determined from multiple computing nodes of the cloud platform.
[0014] According to a virtual machine resource scheduling method provided by the present invention, after adjusting the resource allocation of each computing node, the method further includes:
[0015] Obtaining changed resource usage data of each virtual machine instance after resource adjustment, and inputting the changed resource usage data into the resource prediction model to obtain a changed resource demand prediction result of each virtual machine instance output by the resource prediction model;
[0016] Determine a virtual machine instance to be created in the cloud platform, wherein the virtual machine instance to be created is a cloud desktop instance;
[0017] Based on the configuration parameters of the virtual machine instance to be created and the change resource demand prediction result, determine the deployment node for deploying the virtual machine instance to be created from multiple computing nodes of the cloud platform, so that after the virtual machine to be created is deployed to the deployment node, the deployment node can meet the resource usage requirements of the virtual machine to be created, and the cloud platform resources reach the maximum over-resolution allocation;
[0018] Deploy the virtual machine to be created to the deployment node.
[0019] According to a virtual machine resource scheduling method provided by the present invention, the resource prediction model is a time series analysis SARIMA model.
[0020] According to a virtual machine resource scheduling method provided by the present invention, after adjusting the resource allocation of each computing node, the method further includes:
[0021] Based on a preset time period, an updated SARIMA model is obtained, and based on the updated SARIMA model, resource requirements of each virtual machine instance in the cloud platform are predicted to obtain dynamic resource requirement prediction results of each virtual machine instance, wherein the updated SARIMA model is trained based on updated historical resource data of each virtual machine instance;
[0022] Based on the dynamic resource demand prediction results and the resource usage data of the multiple computing nodes of the cloud platform, the resource allocation of the multiple computing nodes of the cloud platform is adjusted so that each computing node can meet the resource usage requirements of the corresponding virtual machine instance and the resources of each computing node in the cloud platform reach the maximum over-resolution allocation.
[0023] The present invention also provides a resource scheduling device for a virtual machine, comprising:
[0024] A resource prediction module, used to input the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model, and obtain the resource demand prediction results of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance;
[0025] A resource scheduling module is used to adjust the resource allocation of each computing node based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of resources of the cloud platform.
[0026] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a resource scheduling method for a virtual machine as described above is implemented.
[0027] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the resource scheduling method for a virtual machine as described in any one of the above is implemented.
[0028] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned resource scheduling methods for a virtual machine.
[0029] The resource scheduling method and device for virtual machines provided by the present invention predict the resource requirements of each virtual machine instance in the future through the historical resource data of each virtual machine instance in the cloud platform. Based on the resource demand prediction results of each virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform, the resource allocation of multiple computing nodes of the cloud platform is adjusted to realize the dynamic resource scheduling process of each computing node in the cloud platform. In addition, when the resource demand of the virtual machine instance changes dynamically, the overall maximum over-resolution ratio allocation of the computing cluster resources is realized while meeting the resource demand, thereby reducing the resource usage cost and improving the operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 It is a flow chart of the resource scheduling method of a virtual machine provided by the present invention;
[0032] Figure 2 It is a schematic diagram of the cloud platform deployment structure provided by the present invention;
[0033] Figure 3 It is a schematic diagram of the SARIMA model prediction process provided by the present invention;
[0034] Figure 4 It is a schematic diagram of the process of changing the resource scheduling of a virtual machine instance provided by the present invention;
[0035] Figure 5 It is a schematic diagram of the scheduling process of a newly created virtual machine instance provided by the present invention;
[0036] Figure 6 It is a schematic diagram of the structure of a device applying the resource scheduling method of a virtual machine provided by the present invention;
[0037] Figure 7 It is a structural schematic diagram of a resource scheduling device for a virtual machine provided by the present invention;
[0038] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Cloud computing refers to the provision of various computing services through the Internet. These services include computing, storage, database, software, network and analysis, which is IaaS (Infrastructure as a Service).
[0041] IaaS services mainly integrate the computing resources of data centers to provide users with the infrastructure (CPU, memory, storage, network, heterogeneous computing power, etc.) required for computing tasks, and realize on-demand computing services by allocating computing resources to users.
[0042] Cloud desktop, also known as desktop virtualization or cloud computer, is a virtual desktop running in a virtual machine instance on a cloud computing platform, replacing a traditional computer. After adopting cloud desktop, the corresponding CPU, memory, disk, network and other resources are all virtual resources and can be scalable at any time. Users use software clients or thin terminal hardware to connect to the virtual desktop in the cloud through the network, providing a user experience similar to that of a local PC.
[0043] Cloud desktops are currently widely used in home, office, medical, and educational scenarios. Common scenarios are as follows:
[0044] Remote work: Connect to a remote computer through the Internet to work remotely. You can use the same cloud desktop on different devices and in different locations to keep the working environment synchronized.
[0045] Education and training: Cloud desktops can facilitate distance education and training. Teachers and students can conduct remote learning and teaching through cloud connections.
[0046] Games and entertainment: Users connect to cloud computers through the Internet to play games and engage in entertainment.
[0047] Online design: Users use the GPU resources provided by the cloud desktop instance to perform design modeling, video rendering, film and television editing, etc.
[0048] Different types of cloud desktops, such as design, entertainment, office, and gaming, require different quantities and types of resources, including CPU resources, memory resources, network bandwidth, and heterogeneous hardware resources (vGPU, etc.). In the cloud platform, the resources on the computing node (physical machine) are shared by the virtual machines deployed on it. If the resources allocated to the virtual machine are insufficient or there is resource competition between different virtual machines, the experience of cloud desktop users will be reduced. How to schedule virtual machines in the computing cluster and reasonably allocate the resources of the computing cluster to each virtual machine is the core issue of the cloud platform in the cloud desktop scenario.
[0049] One of the related methods, cloud platform resource scheduling, is implemented based on the OpenStack platform. Specifically:
[0050] OpenStack is an open source software platform for building and managing private or public clouds. OpenStack is based on a modular architecture and provides a set of open application programming interfaces (APIs) to help users create and manage resources such as virtual machines, storage, networks, containers, load balancers, elastic computing, etc.
[0051] Openstack includes the following core modules to manage the underlying resources of the data center: Nova computing service module, Keystone authentication module, Glance image service, Cinder block storage service and Neutron network service.
[0052] The nova-scheduler submodule of the Nova service is responsible for scheduling virtual machines and allocating resources in the cloud environment. It selects the most suitable host to deploy the newly created virtual machine instance through predefined policies and rules, which can meet the requirements of fairness priority, throughput priority, and utilization priority. It is divided into the following processes:
[0053] Filter selector: Openstack supports multiple filters to filter and evaluate computing nodes. For example, you can check the CPU and memory usage of the host, check the storage space, etc. The filter can limit the range of computing nodes that can be selected.
[0054] Weighers: Weighers evaluate factors such as the load of computing nodes, available resources, and network topology based on predefined strategies and weights, thereby providing an evaluation score for each host.
[0055] Selection Process: Select a compute node to deploy a virtual machine instance based on the host's score and selection policy.
[0056] One of the defects of the related methods is that Openstack's nova-scheduler schedules and deploys virtual machines according to various predefined policies based on the specification requirements of the virtual machines and the resource reservation on the physical nodes. However, this is a scheduling method based on templates and fixed policies, and cannot perform dynamic scheduling based on the actual resource requirements of the virtual machines and the actual resource consumption of the physical nodes.
[0057] The second related method is a virtual machine scheduling method based on combinatorial optimization. Specifically, it makes real-time decisions on the virtual machine startup locations based on the current resource usage of the cluster, minimizing the number of occupied physical hosts, thereby improving resource utilization and reducing energy consumption.
[0058] The defect of the second related method is that the solution makes real-time decisions based on the usage of various resources in the cluster to meet the requirement of occupying the minimum number of physical machines. However, in the cloud desktop scenario, the resource usage of virtual machines changes dynamically and even has certain rules. In this case, the solution cannot meet the resource requirements of virtual machines while achieving the purpose of reducing costs.
[0059] The third related method is a system and method for achieving dynamic balance based on Openstack cloud desktop. According to the actual load of the physical machine, the virtual machines running on it are dynamically adjusted to reduce the host load and ensure that the system is always in an efficient state.
[0060] The defect of the third related method is that: this solution can alleviate the resource conflict between virtual machines to a certain extent, but it does not take into account the time characteristics of the virtual machine resources occupied in the cloud desktop scenario, nor does it take into account the different requirements of different types of cloud desktops for resource types. Therefore, it does not achieve optimization.
[0061] The fourth related method is a virtual machine deployment method based on a dynamic prediction model in a cloud environment. It predicts the memory consumption forecast value at a certain moment based on the historical memory consumption value on the physical node, so as to deploy the virtual machine to a reasonable physical node.
[0062] The defect of the fourth related method is that this solution mainly predicts the future memory resources of the virtual machine in the physical server, so as to ensure that the virtual machine to be deployed meets the resource requirements and reduces the number of physical services. In this solution, only the memory resources are judged without considering other resources such as CPU, so the optimization of resources cannot be guaranteed. In addition, the resource requirements of the virtual machine will change dynamically based on the type and time of the business, and this solution does not meet the dynamic resource change requirements of the virtual machine to be deployed.
[0063] In view of the defects in the related methods, the present invention provides a resource scheduling method for a virtual machine. Figure 1 A schematic diagram of a flow chart of a resource scheduling method for a virtual machine provided by the present invention. Figure 1 The resource scheduling method of a virtual machine provided by the present invention may include:
[0064] Step 110, inputting the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model respectively, and obtaining a resource demand prediction result of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance;
[0065] Step 120, based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, adjust the resource allocation of each computing node so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of resources of the cloud platform.
[0066] The execution subject of the resource scheduling method of the virtual machine provided by the present invention can be an electronic device, a component in the electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS) or a personal computer (PC), etc., which is not specifically limited by the present invention.
[0067] The following takes a computer executing the resource scheduling method for a virtual machine provided by the present invention as an example to describe the technical solution of the present invention in detail.
[0068] In step 110, the resource usage data of each virtual machine instance in the cloud platform is respectively input into a resource prediction model to obtain a resource demand prediction result of each virtual machine instance output by the resource prediction model. The resource prediction model is trained based on the historical resource data of each virtual machine instance.
[0069] like Figure 2As shown in the schematic diagram of the cloud platform deployment structure provided by the present invention, the cloud platform includes control nodes, computing nodes and storage nodes, which are interconnected through network connections. Each node is deployed in a cluster manner to meet requirements such as reliability and scalability.
[0070] This article takes the Openstack platform in the cloud platform as an example to introduce how to deploy services and resources of each node.
[0071] On the control node, the management services of the cloud management platform are mainly deployed, including core components such as nova (computing), neutron (network), cinder (block storage), glance (image), etc., to complete the management of corresponding resources on the computing node.
[0072] On the computing nodes, the cloud management platform's proxy services, such as nova-compute and neutron-agent, will be deployed to connect to the corresponding services of the control nodes and implement computing node resource management. At the same time, all virtual machine instances will be deployed on them, and virtual resources will be managed through virtualization technology.
[0073] Several storage nodes form a storage cluster, which supports different storage technologies such as Ceph and Network File System (NFS).
[0074] A cloud desktop instance is actually a virtual machine instance running on the cloud platform, which allocates corresponding virtual machine CPU, memory, network, disk and other resources for user use.
[0075] A resource prediction model is pre-trained, wherein the resource prediction model may be a SARIMA (Seasonal Autoregressive Integrated Moving Average) model.
[0076] The SARIMA model is a time series analysis model used to model and forecast data with seasonal changes and trends. The SARIMA model combines the autoregressive integrated moving average (ARIMA) model with seasonal factors and can effectively handle seasonal changes in time series data.
[0077] The SARIMA model usually consists of the following parts: Seasonal Component: Consider the seasonal changes in the data, usually by introducing seasonal differences to deal with the seasonal characteristics of the data. Autoregressive Component: Consider the autocorrelation of the data in time, that is, the relationship between the current observation and the past observation. Difference Component: Consider the non-stationarity of the data, and convert the non-stationary data into stationary data through the difference operation. Moving Average Component: Consider the correlation between the random error terms of the data, that is, the impact of past errors on the current observation. The parameters of the SARIMA model are usually represented by SARIMA (p, d, q) (P, D, Q) s, where p, d, q represent the order of the autoregressive part, the number of differences, and the order of the moving average part respectively; P, D, Q represent the order of the seasonal autoregressive part, the number of seasonal differences, and the order of the seasonal moving average part respectively; s represents the length of the seasonal cycle.
[0078] SARIMA model parameter selection can be helped by libraries such as auto_arima and sarimax.auto_arima. These libraries can use network search and information criteria to automatically select the best model. However, in the actual parameter selection process, further manual adjustments are required based on the characteristics of the data to obtain the optimal parameter selection.
[0079] Once the model is clear, the SARIMA model can be trained based on the historical resource data of each virtual machine instance.
[0080] Specifically, the prediction process of the SARIMA model can be as follows Figure 3 The SARIMA model prediction process diagram provided by the present invention is shown in FIG.
[0081] Based on the resource information collection module, the historical resource usage data used in the training process is collected. Based on the data aggregation and processing module, the acquired historical resource usage data is aggregated and time-series processed.
[0082] The training process of the SARIMA model is implemented based on the prediction model training module. Specifically, the SARIMA model is trained using various historical resource usage data (CPU usage, memory usage, bandwidth, vGPU computing power usage, etc.) for each virtual machine instance in the cloud platform computing cluster.
[0083] After the SARIMA model is trained, the prediction accuracy can be evaluated through cross-validation model evaluation technology. The data set is divided into multiple training sets and validation sets, and the SARIMA model is fitted and predicted through the training set and validation set respectively, so as to continuously optimize the parameter combination.
[0084] Optionally, based on a preset prediction strategy, resource usage prediction can be performed for each virtual machine instance in the computing cluster to predict the resource demand value of the virtual machine instance in the next day, week, etc.
[0085] In step 120, based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, the resource allocation of each computing node is adjusted so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of the resources of the cloud platform.
[0086] After predicting the resource demand prediction results of each virtual machine instance based on the resource prediction model, the resource allocation of multiple computing nodes of the cloud platform is adjusted based on the resource demand prediction results of each virtual machine instance.
[0087] The resource allocation of multiple computing nodes of the cloud platform can be adjusted based on the optimal resource allocation algorithm of dynamic super-resolution. The goal of the optimal resource allocation algorithm of dynamic super-resolution is that each computing node can meet the resource usage requirements of the corresponding virtual machine instance, and the resources of each computing node in the cloud platform reach the maximum super-resolution ratio allocation.
[0088] Specifically, the constraints corresponding to the optimal resource allocation algorithm of dynamic super-resolution are:
[0089] From the perspective of the computing cluster, reduce the scheduling of virtual machine instances as much as possible;
[0090] The over-allocation ratio of various resources on each computing node is dynamic, not fixed;
[0091] Considering the actual usage of virtual machine instances such as cloud desktop instances, if the virtual machine instance has no resource requirements (i.e., the user does not use it) or has very little resource requirements (i.e., the user occasionally uses it), the computing nodes can be allocated with a larger resource over-allocation ratio;
[0092] If a VM instance has a large demand for a certain type of resource (i.e., cloud desktop users frequently use VM instances), then after the VM instance is deployed, the over-resolution ratio of this type of resource on the corresponding computing node should be kept as small as possible to avoid resource competition that may cause a degradation in user experience.
[0093] Ensure that the average value of resource over-allocation ratio of all computing nodes in the entire cluster is as large as possible to minimize costs.
[0094] Optionally, in order to evaluate the resource requirements of the virtual machine instance and the matching degree of the computing node, define the resource optimization target value M(i,j):
[0095] M(i,j)=a*sat_CPU+b*sat_Mem+c*sat_Net+d*sat_Vgpu;
[0096] Where M(i,j) represents the resource optimization target value of virtual machine instance i and computing node j;
[0097] sat_* represents the matching degree between the resources* of virtual machine instance i and settlement node j, and is defined as:
[0098] sat_*=max(1-(oversub_*-1) / k,0);
[0099] Where oversub_* represents the oversubscription ratio of resources* after virtual machine instance i is deployed to computing node j;
[0100] k is a constant and is adjusted according to specific scenarios and requirements. The smaller k is, the more sensitive it is to changes in the super-resolution ratio.
[0101] sat_CPU indicates the CPU resource optimization target value, sat_Mem indicates the memory resource optimization target value, sat_Net indicates the network bandwidth optimization target value, and sat_vGPU indicates the GPU resource optimization target value. a, b, c, and d are the weights of various types of resources, and can take different values according to the resource expectations of different types of virtual machine instances. For example, for a design-class cloud desktop instance, vGPU computing power resource matching is given the highest priority, followed by memory and CPU resource matching, and network resource matching has a lower priority. Therefore, a can be set to 1 / 5, b to 1 / 5, c to 1 / 10, and d to 1 / 2.
[0102] The specific steps to adjust the resource allocation of multiple computing nodes on the cloud platform based on the optimal resource allocation algorithm of dynamic super-resolution are as follows:
[0103] 1. Sort the virtual machine instances from large to small according to their resource demand change values, and record the resource usage of each computing node in the computing cluster.
[0104] a. In the scenario of creating a new VM instance, the resource requirement change value of the VM instance is the CPU, memory, network bandwidth, and vGPU specifications of the VM instance;
[0105] b. In the dynamic resource scheduling scenario, the resource demand of a virtual machine instance = the latest predicted value of each resource of the virtual machine instance - the predicted value calculated last time, and the absolute value is calculated.
[0106] 2. Classify virtual machine instances into two categories: A and B. Class A virtual machine instances represent virtual machines with large resource requirements, and Class B virtual machine instances represent virtual machines with small resource requirements. Note: The resource requirements described here are the actual resource requirements of virtual machine instances. According to the actual scenario, a threshold K can be defined. If any resource requirement of a virtual machine instance is greater than K, the virtual machine instance is considered to have a large resource requirement. Otherwise, its resource requirement is small.
[0107] 3. Virtual machine scheduling,For class A virtual machine instances, follow the following steps in the order of resource demand changes from large to small:,assuming that virtual machine instance i is currently deployed on computing node k, traverse each computing node and select the computing node that meets the following conditions:,the resource optimization target value M(i, j) is the largest;
[0108] Note: The over-resolution ratio <= 1 or as close to 1 as possible can be used as an auxiliary judgment condition.
[0109] Assume that M(i, j) is the maximum value in the computing cluster, that is, computing node j and virtual machine instance i are the best match. If the computing node k where virtual machine instance i originally resides can meet the resource requirements of the virtual machine instance, and compared with computing node j, (M(i, j)-M(i, k)) / M(i, j)<=Q, computing node k is still preferred, where Q is a threshold that can be configured according to actual conditions, such as 5%. (Note: If a new virtual machine instance is created, this step is ignored).
[0110] Schedule virtual machine instance i from compute node k to compute node j.
[0111] For class B virtual machine instances, they need to be deployed on certain computing nodes with a larger over-resolution ratio. The corresponding steps are as follows:
[0112] Traverse the computing nodes in descending order of super-resolution ratio, if:
[0113] Compute node j can satisfy the resource requirements of virtual machine instance i;
[0114] Calculate the over-resolution ratio of virtual machine instance i after it is deployed to computing node j to be less than or equal to R. R is the threshold, which is configured according to the actual usage of the virtual machine instance. For example, R is 10.
[0115] Assuming that computing node j is the first computing node that meets the requirements of the above traversal process, virtual machine instance i is scheduled to computing node j.
[0116] If j is not found, virtual machine instance i is temporarily retained at the original node and traversal continues to the next virtual machine instance.
[0117] It can be understood that through the optimal resource allocation algorithm of dynamic over-resolution, scheduling and allocation can be carried out on each computing node according to the dynamic over-resolution ratio based on the actual resource requirements of the virtual machine instance, thus achieving a balance between maximizing the overall resource utilization of the computing cluster and maximizing the resource allocation of a single virtual machine instance.
[0118] Fully consider the different requirements of different types of virtual machine instances for different types of resources, define the resource optimization target value, so that the allocation and scheduling of virtual machine instances can fully utilize the different resource surpluses of computing nodes to achieve the goal of cost reduction.
[0119] Through historical resource data, we can determine the seasonal patterns in the use of virtual machine instances, predict the resource usage of virtual machine instances, and more accurately guide the scheduling of virtual machine instances.
[0120] The resource scheduling method for virtual machines provided in the embodiment of the present invention predicts the resource requirements of each virtual machine instance in the future through the historical resource data of each virtual machine instance in the cloud platform. Based on the resource demand prediction results of each virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform, the resource allocation of multiple computing nodes of the cloud platform is adjusted to realize the dynamic resource scheduling process of each computing node in the cloud platform. Moreover, in the case of dynamic changes in the resource demand of the virtual machine instance, while meeting the resource demand, the overall maximum over-resolution ratio allocation of the computing cluster resources is realized, which reduces the resource use cost and improves the operation efficiency.
[0121] In one embodiment, based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, the resource allocation of each computing node is adjusted, including: based on the resource demand prediction results of each virtual machine instance, determining the changed virtual machine instance with resource demand changes among the virtual machine instances; based on the resource demand prediction results of the changed virtual machine instance and the resource usage data of multiple computing nodes in the cloud platform, determining a target node matching the changed virtual machine instance from multiple computing nodes in the cloud platform, so that after the changed virtual machine instance is allocated to the target node, the target node can meet the resource usage demand of the changed virtual machine instance, and the resources of each computing node in the cloud platform reach the maximum over-resolution allocation.
[0122] For multiple virtual machine instances in the cloud platform, there are situations where the resource requirements of the virtual machine instances change or remain unchanged for a long time. Based on the resource requirement prediction results of each virtual machine instance in the cloud platform, a changed virtual machine instance with a changed resource requirement is determined among the virtual machine instances.
[0123] After determining the changed virtual machine instances with changed resource requirements, it is only necessary to adjust the computing node resource usage corresponding to these virtual machine instances to adjust the resources in the cloud platform.
[0124] Optionally, the specific adjustment process can be as follows Figure 4 The schematic diagram of the process of changing the resource scheduling of a virtual machine instance provided by the present invention is shown.
[0125] First, it is determined whether each computing node in the cloud platform needs to be adjusted. If it is determined that adjustment is needed, based on the resource demand prediction results of each virtual machine instance, the virtual machine instance with a change in resource demand is determined.
[0126] Traverse the changed virtual machine instances with changing requirements to implement the scheduling process.
[0127] Based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform, a target node matching the changed virtual machine instance is determined from the multiple computing nodes of the cloud platform.
[0128] Assign the changed virtual machine instance to the target node to implement the scheduling migration of the virtual machine instance.
[0129] In one embodiment, based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of the multiple computing nodes of the cloud platform, a target node matching the changed virtual machine instance is determined from the multiple computing nodes of the cloud platform, including: based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of the multiple computing nodes of the cloud platform, determining the matching degree of each virtual machine instance and each computing node; based on the matching degree, determining the target node matching the changed virtual machine instance from the multiple computing nodes of the cloud platform.
[0130] Based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform, the matching degree of each virtual machine instance and each computing node is determined.
[0131] Optionally, in order to evaluate the resource requirements of the virtual machine and the matching degree of the computing node, define the resource optimization target value M(i,j):
[0132] M(i,j)=a*sat_CPU+b*sat_Mem+c*sat_Net+d*sat_Vgpu;
[0133] Where M(i,j) represents the resource optimization target value of virtual machine instance i and computing node j;
[0134] sat_* represents the matching degree between the resources* of virtual machine instance i and settlement node j, and is defined as:
[0135] sat_*=max(1-(oversub_*-1) / k,0);
[0136] Where oversub_* represents the oversubscription ratio of resources* after virtual machine instance i is deployed to computing node j;
[0137] k is a constant and is adjusted according to specific scenarios and requirements. The smaller k is, the more sensitive it is to changes in the super-resolution ratio.
[0138] sat_CPU indicates the CPU resource optimization target value, sat_Mem indicates the memory resource optimization target value, sat_Net indicates the network bandwidth optimization target value, and sat_vGPU indicates the GPU resource optimization target value. a, b, c, and d are the weights of various types of resources, and can take different values according to the resource expectations of different types of virtual machine instances. For example, for a design-class cloud desktop instance, vGPU computing power resource matching is given the highest priority, followed by memory and CPU resource matching, and network resource matching has a lower priority. Therefore, a can be set to 1 / 5, b to 1 / 5, c to 1 / 10, and d to 1 / 2.
[0139] In one embodiment, after adjusting the resource allocation of each computing node, it also includes: obtaining the changed resource usage data of each virtual machine instance after the resource adjustment, and inputting the changed resource usage data into the resource prediction model to obtain the changed resource demand prediction result of each virtual machine instance output by the resource prediction model; determining the virtual machine instance to be created in the cloud platform, the virtual machine instance to be created is a cloud desktop instance; based on the configuration parameters of the virtual machine instance to be created and the changed resource demand prediction result, determining the deployment node for deploying the virtual machine instance to be created from the multiple computing nodes of the cloud platform, so that after the virtual machine to be created is deployed to the deployment node, the deployment node can meet the resource usage demand of the virtual machine to be created, and the cloud platform resources reach the maximum over-allocation ratio; deploying the virtual machine to be created to the deployment node.
[0140] It is understandable that during the operation of a cloud platform, there is often a need to create new virtual machine instances.
[0141] After creating a new virtual machine, you need to consider which computing node of the cloud platform to deploy the virtual machine to ensure that the cloud platform resources are allocated to the maximum over-resolution ratio.
[0142] The specific deployment node can be determined based on the configuration parameters of the virtual machine instance to be created and the change resource demand prediction result determined by the resource prediction model. Based on the configuration parameters of the virtual machine instance to be created and the change resource demand prediction result, the deployment node for deploying the virtual machine instance to be created is determined from multiple computing nodes of the cloud platform.
[0143] Optional: For virtual machine instances in cloud desktop scenarios, when creating new virtual machine instances, Openstack's original filters and weight calculations are not used to select computing nodes. Instead, the dynamic super-resolution resource optimal allocation algorithm is used directly to allocate matching computing nodes, such as Figure 5 The scheduling process of creating a new virtual machine instance provided by the present invention is shown in the schematic diagram.
[0144] Since newly created virtual machine instances lack historical resource usage data and cannot predict resource demand, when scheduling virtual machines based on the dynamic super-resolution resource optimal allocation algorithm, the configuration parameters of the virtual machine instance and the deployment node determined by the change resource demand prediction result are used. After the deployment node is determined, the virtual machine to be created is deployed in the corresponding deployment node.
[0145] In one embodiment, after adjusting the resource allocation of each computing node, it also includes: based on a preset time period, obtaining an updated SARIMA model, and based on the updated SARIMA model, predicting the resource requirements of each virtual machine instance in the cloud platform to obtain a dynamic resource demand prediction result of each virtual machine instance, wherein the updated SARIMA model is trained based on the updated historical resource data of each virtual machine instance; based on the dynamic resource demand prediction result and the resource usage data of multiple computing nodes of the cloud platform, adjusting the resource allocation of multiple computing nodes of the cloud platform so that each computing node can meet the resource usage requirements of the corresponding virtual machine instance, and the resources of each computing node in the cloud platform reach the maximum over-resolution ratio allocation.
[0146] In the related methods, the resource scheduling process is implemented based on the Scheduler module in the cloud platform. Specifically, the Scheduler module is responsible for the scheduling and allocation of newly created virtual machine instances on various computing nodes. In the Openstack open source cloud platform, the scheduler is the nova-scheduler subservice of the computing service component nova. It uses a series of filters to filter out qualified computing nodes. These filters contain different policies and rules, such as the status of the host, available resources, affinity rules, etc. Then use weigher to calculate the weights of the filtered computing nodes. Common weight factors include computing node load, available resources, affinity rules, etc. Finally, according to the weight results, the optimal computing node is selected to schedule the virtual machine.
[0147] In the resource scheduling process of the related methods, when users use virtual machine instances for a long time, their demand for various resources will change over time, which may cause the resource reservation of the computing node to fail to meet the resource demand of the cloud desktop instance on it.
[0148] During the long-term use of virtual machine instances by users, their demand for various resources will change over time, which may cause the resource reservation of the computing node to fail to meet the resource requirements of the virtual machine instances on it. Therefore, in the process of resource scheduling on the cloud platform, it is necessary to implement the dynamic calling process of each computing node in the cloud platform.
[0149] Based on a preset time period, an updated SARIMA model is periodically obtained.
[0150] It is understandable that as the business runs, the historical resource data of each virtual machine instance is continuously updated, and the SARIMA model parameters can be periodically and dynamically updated based on the updated historical resource data of each virtual machine instance.
[0151] Periodically obtain the latest SARIMA model and the predicted resource requirements of each virtual machine instance in the computing cluster. Based on the dynamic resource demand prediction results and the resource usage data of multiple computing nodes of the cloud platform, adjust the resource allocation of multiple computing nodes of the cloud platform, reallocate computing nodes for virtual machine instances, and perform hot migration of virtual machines.
[0152] The following is an example of a schematic diagram of a device structure of a resource scheduling method for a virtual machine provided by the present invention to illustrate the technical solution provided by the present invention:
[0153] like Figure 6As shown in the figure, the device is based on the Openstack cloud management platform and proposes a virtual machine scheduling framework based on virtual machine resource demand prediction for cloud desktop scenarios. Through this system, the cloud platform can adapt to the dynamic changes in virtual machine resource demand, optimize the allocation of various resources in the computing cluster, and achieve the optimal allocation and deployment of overall resources while meeting the resource requirements of virtual machine instances.
[0154] Based on the Openstack cloud platform, the following modules are added to the control node: data aggregation & processing module; prediction model training module; resource prediction module; dynamic resource scheduling module; and a resource optimization scheduling module is added to the nova-scheduler module.
[0155] The following is a detailed description of the functions of the key components involved in the cloud desktop scheduling process:
[0156] The virtual machine management module is the proxy service of the corresponding service of the Openstack management platform on the computing node, which mainly completes the life cycle management of virtual machine instances, networks, storage and other resources. Openstack services may include: nova-compute, neutron-agent, cinder-volume, ceilometer-agent, etc. The services of other cloud platforms may be different.
[0157] The resource information collection module obtains information about various resources, such as network bandwidth, CPU usage, memory usage, etc., by monitoring the resource information of virtual machine instances and host machines in real time.
[0158] In the Openstack environment, you can use components such as Ceilometer and prometheus to collect resource information. Other cloud platforms also have similar components that can complete the corresponding functions.
[0159] The data aggregation and processing module connects to each computing node to aggregate the collected information on all computing nodes in the computing cluster. Here, interfaces such as AMQP advanced message queue protocol or Restful API can be used to complete the connection.
[0160] Process the aggregated data, including classification, data formatting, abnormal data processing, etc. Data can be classified and sorted according to time series and different resource types. For example, CPU resources can be sorted in the format of timestamp + CPU usage.
[0161] The prediction model training module mainly completes the following functions:
[0162] (1) Collecting data
[0163] Obtain time series resource usage data of various types of resources from the data aggregation and processing module, mainly including: CPU usage, memory usage, network usage, and vGPU computing resource usage.
[0164] (2) Estimation and selection of SARIMA model parameters
[0165] Considering that virtual machine instances are cloud desktop scenarios, users' use of cloud desktop instances has certain seasonal patterns. For example, office users use them much more frequently during the day than at night; office users use them very rarely during weekends, holidays, and other holidays; game users use them much more frequently at specific times at night than at other time periods; the seasonal ARIMA (SARIMA) model is used to predict the resource demand of cloud desktop instances.
[0166] Parameter estimation and selection of the SARIMA model mainly includes the following tasks:
[0167] (1) Check the completeness and accuracy of time series data;
[0168] (2) Data preprocessing
[0169] The ADF test method is used to detect the stationarity of the data. If the data is non-stationary, the time series data is processed through difference operations or seasonal difference methods to ensure that the data reaches a stable state.
[0170] (3) SARIMA model parameter selection
[0171] You can use libraries such as auto_arima and sarimax.auto_arima to help select the parameters of the SARIMA model. These libraries can use network search and information criteria to automatically select the best model. However, in the actual parameter selection process, further manual adjustments are required based on the characteristics of the data to obtain the optimal parameter selection.
[0172] Once the model is clear, the SARIMA model can be used to predict the future resource requirements of the cloud desktop instance based on historical data.
[0173] (4) Evaluate prediction accuracy using cross-validation model evaluation techniques
[0174] The data set is divided into multiple training sets and validation sets, and the SARIMA model is fitted and predicted using the training sets and validation sets respectively, so as to continuously optimize the parameter combination.
[0175] The main function of the resource prediction module is to use various historical resource usage data (CPU usage, memory usage, bandwidth, vGPU computing power usage, etc.) of each virtual machine instance in the computing cluster based on the latest output model of the prediction model training module to predict resource demand.
[0176] Based on the preset prediction strategy, this module can predict the resource usage of each virtual machine instance in the computing cluster and predict the resource demand value of the virtual machine instance in the next day, week, etc.
[0177] The Scheduler module is responsible for the scheduling and allocation of newly created virtual machine instances on various computing nodes. In the Openstack open source cloud platform, the scheduler is the nova-scheduler subservice of the computing service component nova. It uses a series of filters to filter out qualified computing nodes. These filters contain different policies and rules, such as the host status, available resources, affinity rules, etc. Then use weigher to calculate the weights of the filtered computing nodes. Common weight factors include computing node load, available resources, affinity rules, etc. Finally, according to the weight results, the optimal computing node is selected to schedule the virtual machine instance.
[0178] The above describes the open source implementation of the nova-scheduler module of Openstack. In this proposal, a resource optimization scheduling submodule is added, which will replace the filters and weigh submodules. This submodule allocates appropriate computing nodes to virtual machine instances through the dynamic super-resolution resource optimal allocation algorithm. When a virtual machine instance is created, the optimal computing node is obtained and deployed through this scheduling strategy.
[0179] Dynamic resource scheduling module During the long-term use of cloud desktops by users, their demand for various resources will change over time, which may cause the resource reservation of the computing node to fail to meet the resource requirements of the cloud desktop instance on it.
[0180] The dynamic resource scheduling module periodically obtains the latest SARIMA model and the predicted resource requirements of each virtual machine instance in the computing cluster. It then reallocates computing nodes for each virtual machine instance through the dynamic super-resolution resource optimal allocation algorithm and performs hot migration of virtual machine instances.
[0181] The triggering of the dynamic resource scheduling module is determined by predefined policies:
[0182] 1. Time-triggered strategy
[0183] Directly configure the trigger time point. According to the usage habits of users in specific scenarios, the dynamic resource scheduling process is triggered at a time point with low user frequency, for example, 1:00 a.m. every day.
[0184] 2. Resource triggering strategy
[0185] Dynamic resource scheduling is triggered based on whether the resources of each computing node can meet the predicted resource requirements of the virtual machine instances running on it. For example, if the total predicted resource requirements of the virtual machine instances on a computing node have reached or exceeded the computing node resource threshold (e.g., 90%), the dynamic resource scheduling process is triggered.
[0186] 3. Manual trigger
[0187] The dynamic resource scheduling process is manually triggered by the operation and maintenance personnel based on the actual usage of the computing cluster.
[0188] Note: Multiple policies can work together, for example, combining a time-triggered policy + a resource-triggered policy.
[0189] Description of the optimal resource allocation algorithm for dynamic super-resolution:
[0190] Based on the resource usage characteristics of cloud desktop instances in cloud desktop scenarios, such as seasonal changes and different types of instances requiring different types of resources, this proposal proposes a dynamic super-resolution resource optimal allocation algorithm.
[0191] The goal of the optimal resource allocation algorithm of dynamic over-resolution is that after the virtual machine instance to be allocated is deployed to a computing node, the computing node can meet its resource usage requirements and the over-resolution ratio of the overall computing cluster is maximized.
[0192] Based on the above resource allocation goals and actual operation requirements, several constraints of the algorithm can be given:
[0193] (1) From the perspective of the computing cluster, reduce the scheduling of virtual machine instances as much as possible;
[0194] (2) The over-allocation ratio of various resources on each computing node is dynamic rather than fixed;
[0195] (3) Considering the actual usage of the cloud desktop instance, if the virtual machine instance has no resource demand (i.e., the user does not use it) or has very little resource demand (i.e., the user occasionally uses it), the computing node can be allocated with a larger resource over-allocation ratio;
[0196] (4) If a VM instance has a large demand for a certain type of resource (i.e., a cloud desktop user will frequently use the VM instance), then after the VM instance is deployed, the over-resolution ratio of this type of resource on the corresponding computing node should be kept as small as possible to avoid resource competition that may lead to a degraded experience.
[0197] (5) After the virtual machine instances are deployed, the average value of the resource over-allocation ratio of all computing nodes in the entire cluster is as large as possible to minimize the cost.
[0198] Figure 7 Schematic diagram of the structure of the resource scheduling device of the virtual machine provided by the present invention, such as Figure 7 The device comprises:
[0199] The resource prediction module 710 is used to input the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model to obtain the resource demand prediction results of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance;
[0200] The resource scheduling module 720 is used to adjust the resource allocation of each computing node based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of the resource usage of the cloud platform and the rated value of the resources of the cloud platform.
[0201] The resource scheduling device for virtual machines provided in the embodiment of the present invention predicts the resource requirements of each virtual machine instance in the future through the historical resource data of each virtual machine instance in the cloud platform. Based on the resource demand prediction results of each virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform, the resource allocation of multiple computing nodes of the cloud platform is adjusted to realize the dynamic resource scheduling process of each computing node in the cloud platform. Moreover, in the case of dynamic changes in the resource demand of the virtual machine instance, while meeting the resource demand, the overall maximum over-ratio allocation of the computing cluster resources is realized, which reduces the resource use cost and improves the operation efficiency.
[0202] In one embodiment, the resource scheduling module 720 is specifically used to:
[0203] Based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, adjusting the resource allocation of each computing node includes:
[0204] Based on the resource demand prediction results of the virtual machine instances, determining a changed virtual machine instance having a resource demand change among the virtual machine instances;
[0205] Based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform, a target node matching the changed virtual machine instance is determined from the multiple computing nodes of the cloud platform, so that after the changed virtual machine instance is allocated to the target node, the target node can meet the resource usage demand of the changed virtual machine instance, and the resources of each computing node in the cloud platform reach the maximum over-resolution allocation.
[0206] In one embodiment, the resource scheduling module 720 is further specifically configured to:
[0207] Based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of the multiple computing nodes of the cloud platform, determining a target node matching the changed virtual machine instance from the multiple computing nodes of the cloud platform, including:
[0208] Determine the matching degree between each virtual machine instance and each computing node based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform;
[0209] Based on the matching degree, a target node matching the changed virtual machine instance is determined from multiple computing nodes of the cloud platform.
[0210] In one embodiment, the resource scheduling module 720 is further specifically configured to:
[0211] After adjusting the resource allocation of multiple computing nodes of the cloud platform, the method further includes:
[0212] Obtaining changed resource usage data of each virtual machine instance after resource adjustment, and inputting the changed resource usage data into the resource prediction model to obtain a changed resource demand prediction result of each virtual machine instance output by the resource prediction model;
[0213] Determine a virtual machine instance to be created in the cloud platform, wherein the virtual machine instance to be created is a cloud desktop instance;
[0214] Based on the configuration parameters of the virtual machine instance to be created and the change resource demand prediction result, determine the deployment node for deploying the virtual machine instance to be created from multiple computing nodes of the cloud platform, so that after the virtual machine to be created is deployed to the deployment node, the deployment node can meet the resource usage requirements of the virtual machine to be created, and the cloud platform resources reach the maximum over-resolution allocation;
[0215] Deploy the virtual machine to be created to the deployment node.
[0216] In one embodiment, the resource prediction module 710 is specifically used to:
[0217] The resource prediction model is determined to be the time series analysis SARIMA model.
[0218] In one embodiment, the resource scheduling module 720 is further specifically configured to:
[0219] After adjusting the resource allocation of each computing node, based on a preset time period, an updated SARIMA model is obtained, and based on the updated SARIMA model, the resource demand of each virtual machine instance in the cloud platform is predicted to obtain a dynamic resource demand prediction result of each virtual machine instance, wherein the updated SARIMA model is trained based on the updated historical resource data of each virtual machine instance;
[0220] Based on the dynamic resource demand prediction results and the resource usage data of the multiple computing nodes of the cloud platform, the resource allocation of the multiple computing nodes of the cloud platform is adjusted so that each computing node can meet the resource usage requirements of the corresponding virtual machine instance and the resources of each computing node in the cloud platform reach the maximum over-resolution allocation.
[0221] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the resource scheduling method of the virtual machine, and the method includes:
[0222] Inputting the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model respectively, and obtaining a resource demand prediction result of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance;
[0223] Based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, the resource allocation of each computing node is adjusted so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of the resources of the cloud platform.
[0224] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0225] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the resource scheduling method of the virtual machine provided by the above methods, the method comprising:
[0226] Inputting the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model respectively, and obtaining a resource demand prediction result of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance;
[0227] Based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, the resource allocation of each computing node is adjusted so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of the resources of the cloud platform.
[0228] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the resource scheduling method of the virtual machine provided above, the method comprising:
[0229] Inputting the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model respectively, and obtaining a resource demand prediction result of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance;
[0230] Based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, the resource allocation of each computing node is adjusted so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of the resources of the cloud platform.
[0231] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0232] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0233] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for resource scheduling of a virtual machine, characterized in that: The method comprises: Inputting the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model respectively, and obtaining a resource demand prediction result of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance; Based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, the resource allocation of each computing node is adjusted so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of the resources of the cloud platform.
2. The method for scheduling virtual machine resources according to claim 1, characterized in that: The adjusting the resource allocation of each computing node based on the resource demand prediction result of each virtual machine instance and the resource usage data of each computing node in the cloud platform includes: Based on the resource demand prediction results of the virtual machine instances, determining a changed virtual machine instance having a resource demand change among the virtual machine instances; Based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform, a target node matching the changed virtual machine instance is determined from the multiple computing nodes of the cloud platform, so that after the changed virtual machine instance is allocated to the target node, the target node can meet the resource usage demand of the changed virtual machine instance, and the resources of each computing node in the cloud platform reach the maximum over-resolution allocation.
3. The method for resource scheduling of a virtual machine according to claim 2, characterized in that: The step of determining a target node matching the changed virtual machine instance from the multiple computing nodes of the cloud platform based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of the multiple computing nodes of the cloud platform includes: Determine the matching degree of each virtual machine instance and each computing node based on the resource demand prediction result of the changed virtual machine instance and the resource usage data of multiple computing nodes of the cloud platform; Based on the matching degree, a target node matching the changed virtual machine instance is determined from multiple computing nodes of the cloud platform.
4. The method for resource scheduling of a virtual machine according to claim 1, characterized in that: After the resource allocation of each computing node is adjusted, the method further includes: Obtaining changed resource usage data of each virtual machine instance after resource adjustment, and inputting the changed resource usage data into the resource prediction model to obtain a changed resource demand prediction result of each virtual machine instance output by the resource prediction model; Determine a virtual machine instance to be created in the cloud platform, wherein the virtual machine instance to be created is a cloud desktop instance; Based on the configuration parameters of the virtual machine instance to be created and the change resource demand prediction result, determine the deployment node for deploying the virtual machine instance to be created from multiple computing nodes of the cloud platform, so that after the virtual machine to be created is deployed to the deployment node, the deployment node can meet the resource usage requirements of the virtual machine to be created, and the cloud platform resources reach the maximum over-resolution allocation; Deploy the virtual machine to be created to the deployment node.
5. The method for scheduling virtual machine resources according to any one of claims 1 to 5, characterized in that: The resource prediction model is a time series analysis SARIMA model.
6. The method for scheduling virtual machine resources according to claim 5, characterized in that: After the resource allocation of each computing node is adjusted, the method further includes: Based on a preset time period, an updated SARIMA model is obtained, and based on the updated SARIMA model, resource requirements of each virtual machine instance in the cloud platform are predicted to obtain dynamic resource requirement prediction results of each virtual machine instance, wherein the updated SARIMA model is trained based on updated historical resource data of each virtual machine instance; Based on the dynamic resource demand prediction results and the resource usage data of the multiple computing nodes of the cloud platform, the resource allocation of the multiple computing nodes of the cloud platform is adjusted so that each computing node can meet the resource usage requirements of the corresponding virtual machine instance and the resources of each computing node in the cloud platform reach the maximum over-resolution allocation.
7. A resource scheduling device for a virtual machine, characterized in that: include: A resource prediction module, used to input the resource usage data of each virtual machine instance in the cloud platform into a resource prediction model, and obtain the resource demand prediction results of each virtual machine instance output by the resource prediction model, wherein the resource prediction model is trained based on the historical resource data of each virtual machine instance; A resource scheduling module is used to adjust the resource allocation of each computing node based on the resource demand prediction results of each virtual machine instance and the resource usage data of each computing node in the cloud platform, so that the resource usage demand of each virtual machine instance can be met and the resources of each computing node in the cloud platform reach the maximum over-allocation ratio, where the over-allocation ratio is the percentage difference between the actual value of resource usage of the cloud platform and the rated value of resources of the cloud platform.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the resource scheduling method for the virtual machine according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the resource scheduling method for a virtual machine as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the resource scheduling method for a virtual machine as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Intelligent central control system based on 5G cloud computing technology
CN119356189A
Intelligent scheduling management system for private cloud resources based on hyper-converged architecture
CN120011088A
Intelligent Scheduling and Management System for Private Cloud Resources Based on Hyper-Converged Architecture
CN120011088B
Virtual machine resource scheduling method and device, equipment and storage medium
CN120803616A
Resource allocation method and device, equipment, storage medium and program product
CN122691838A
