Virtual machine allocation method and system, computer equipment and storage medium

By obtaining and analyzing the operating parameters of the host, and automatically determining and migrating the virtual machine, the load imbalance caused by uneven distribution of virtual machines is solved, and the automatic allocation and load balancing of virtual machines is realized, which saves human resources and improves real-time monitoring capabilities.

CN119645559APending Publication Date: 2025-03-18BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311204851.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, uneven distribution of virtual machines on different hosts leads to load imbalance, requiring human monitoring and migration of virtual machines, consuming a lot of human resources and real-time monitoring cannot be achieved.

Method used

By obtaining the operating parameters of each supervisory host, hitting the preset allocation conditions based on the target operating parameters, determining the migration host and the virtual machine to be migrated, and migrating them to the destination host that meets the load requirements, realizing automatic migration of the virtual machine.

Benefits of technology

It realizes automatic migration of virtual machines, saves human resources, can monitor and balance the virtual machine load of the host in real time, and improves resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645559A_ABST
    Figure CN119645559A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual machine allocation method and system, computer equipment and a storage medium. The method comprises the following steps: acquiring operation parameters of each supervision host machine; when a target operation parameter hits a preset distribution condition, a migration host machine is determined based on a supervision host machine corresponding to the target operation parameter, and the target operation parameter comprises at least any one operation parameter; determining a to-be-migrated virtual machine in a plurality of virtual machines in the migration host machine based on a preset allocation condition hit by the target operation parameter; other host machines meeting the load requirements of the virtual machine to be migrated are determined as target host machines, and the other host machines are supervision host machines except the migration host machine; and migrating the virtual machine to be migrated to the target host machine. Therefore, automatic migration of the virtual machines in different host machines is realized, the virtual machines do not need to be manually migrated and allocated, and the labor cost can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a virtual machine allocation method, system, computer device and storage medium. Background Art

[0002] With the development of the Internet, more and more users request resources by accessing resource storage hosts, but the number of hosts is limited. In order to meet more user requests, multiple virtual machines are used to provide resource request services for users. However, when multiple virtual machines are unevenly distributed on different hosts, it will lead to unbalanced loads on different hosts, and it is easy to have hosts with high loads and low loads, which makes the request response speed of the host with high loads slower, and wastes the resource service capabilities of the host with low loads.

[0003] In order to balance the virtual machines on different hosts, the existing method is to manually monitor the distribution of virtual machines on each host and manually migrate virtual machines to balance the virtual machine resources on each host. However, the manual migration method consumes a lot of human resources and cannot achieve real-time monitoring. Summary of the invention

[0004] The present application provides a virtual machine allocation method, system, computer device and storage medium to solve the problem that the existing manual migration of virtual machines to balance host machine resources consumes a lot of human resources and cannot achieve real-time monitoring.

[0005] In a first aspect, the present application provides a method for obtaining operating parameters of each supervisory host;

[0006] When the target operating parameter hits the preset allocation condition, determining the migration host based on the supervision host corresponding to the target operating parameter, wherein the target operating parameter includes at least any one of the operating parameters;

[0007] Determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter;

[0008] Determine the remaining host machines that meet the load requirement of the virtual machine to be migrated as the destination host machines, wherein the remaining host machines are monitoring host machines other than the migration host machine;

[0009] Migrate the virtual machine to be migrated to the destination host machine.

[0010] In a second aspect, the present application provides a data acquisition module for obtaining operating parameters of each supervisory host;

[0011] A resource processing module, configured to determine a migration host machine based on a supervision host machine corresponding to the target operation parameter when the target operation parameter hits a preset allocation condition, wherein the target operation parameter includes at least any one of the operation parameters; and determine a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on the preset allocation condition hit by the target operation parameter;

[0012] The scheduling platform is used to determine the remaining host machines that meet the load requirements of the virtual machine to be migrated as the destination host machines, wherein the remaining host machines are monitoring host machines other than the migration host machine; and migrate the virtual machine to be migrated to the destination host machine.

[0013] In a third aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned virtual machine allocation method when executing the computer program.

[0014] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the above-mentioned virtual machine allocation method.

[0015] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application obtains the operating parameters of each supervisory host; when the target operating parameter hits the preset allocation condition, it indicates that the virtual machines in each host need to be reallocated at this time, and the migration host is determined based on the supervisory host corresponding to the target operating parameter, and the target operating parameter includes at least any one of the operating parameters; based on the preset allocation condition hit by the target operating parameter, the virtual machine to be migrated is determined among the multiple virtual machines in the migration host; the remaining host machines that meet the load requirements of the virtual machine to be migrated are determined as the destination host, and the remaining host machines are supervisory host machines other than the migration host; the virtual machine to be migrated is migrated to the destination host. Thus, the automatic migration of virtual machines in different host machines is realized, and there is no need to manually migrate and allocate virtual machines, which can save labor costs and can realize real-time monitoring of the distribution of virtual machines in different host machines for automatic allocation of virtual machines. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0019] Figure 1 A structural block diagram of a virtual machine allocation system provided in an embodiment of the present application;

[0020] Figure 2 A structural block diagram of a virtual machine allocation system provided in an embodiment of the present application;

[0021] Figure 3 A flowchart of a virtual machine allocation method provided in an embodiment of the present application;

[0022] Figure 4 A flowchart of a virtual machine allocation method provided in an embodiment of the present application;

[0023] Figure 5 A flowchart of a virtual machine allocation method provided in an embodiment of the present application;

[0024] Figure 6 A flowchart of a virtual machine allocation method provided in an embodiment of the present application;

[0025] Figure 7 A flowchart of a virtual machine allocation method provided in an embodiment of the present application;

[0026] Figure 8 A flowchart of a virtual machine allocation method provided in an embodiment of the present application;

[0027] Fig. 9 A flowchart of a virtual machine allocation method provided in an embodiment of the present application;

[0028] Fig.10 A flowchart of a virtual machine allocation method provided in an embodiment of the present application;

[0029] Fig.11 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0031] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0032] Figure 1 This is a structural block diagram of a virtual machine allocation system provided in an embodiment of the present application. Figure 1 , the virtual machine allocation method is applied to a virtual machine allocation system. The virtual machine allocation system includes a scheduling platform 110 (Nova), a monitoring platform 120 (Eagles) and a virtual machine evacuation system 130 (DRS). The virtual machine evacuation system 130 obtains the operating parameters of each host machine from the monitoring platform 120. The virtual machine evacuation system 130 determines whether it is necessary to reallocate the virtual machines in each host machine according to the operating parameters of multiple host machines, and when it is necessary to reallocate the virtual machines in the host machine, determines the migration host machine and the virtual machine to be migrated that need to be migrated, and reports them to the scheduling platform 110. The scheduling platform 110 determines the destination host machine to receive the virtual machine to be migrated, and migrates the virtual machine to be migrated in the migration host machine to the destination host machine, so as to complete the reallocation of the virtual machines and balance the load of the virtual machines in each host machine.

[0033] like Figure 2As shown, the virtual machine evacuation system 130 includes a system external interface 131 (API), a resource processing module, a data collection module 135 (Collector) and a notification alarm module 136 (Notifiter). The resource processing module includes a resource monitoring submodule 133 (Monitor) and a resource management submodule 132 (Sweeper). The system external interface 131 provides functions such as cluster registration, configuration management, tenant protection, and system execution information. The resource monitoring submodule 133 provides two major functions: fault evacuation and preemptive evacuation. The resource management submodule 132 provides two major functions: resource integration and elastic resource pool. The CPU consumption service is divided into aggregates for data calculation. The data collection module 135 is responsible for synchronizing cluster information with the scheduling platform 110, monitoring data collection and cleaning modules, providing basic data for the resource monitoring submodule 133 and the resource management submodule 132, and is responsible for notifying the resource monitoring submodule 133 and the resource processing module to perform data analysis. The CPU consumption service is divided into aggregates for data collection and cleaning. The notification alarm module 136 is responsible for notifying the background staff of the resource integration strategy and / or alarm downtime information when the resource processing module determines that the virtual machines in the host machine need to be reallocated, and supports multiple alarm channels, such as email, text message, phone or third-party instant messaging applications.

[0034] In one embodiment, Figure 3 A flowchart of a virtual machine allocation method in an embodiment is shown in FIG. Figure 3 , provides a virtual machine allocation method. This embodiment mainly applies this method to the above Figure 1 Taking the virtual machine allocation system in the example of FIG. 1 as an example, the virtual machine allocation method specifically includes the following steps:

[0035] Step S210, obtaining the operating parameters of each monitoring host machine.

[0036] Specifically, the data acquisition module 135 in the virtual machine allocation system obtains the operating parameters of each supervised host from the monitoring platform 120. The supervised host refers to a host that is successfully registered in the virtual machine allocation system and supervised by the virtual machine allocation system. The operating parameters include the operating status of the host, resource occupancy (CPU occupancy), available storage space, video memory parameters (GPU parameters), and peripheral parameters, etc., wherein the resource occupancy can be an instantaneous value detected in real time, or a detection average value corresponding to a preset time.

[0037] Step S220, when the target operating parameter hits the preset allocation condition, determining the migration host based on the monitoring host corresponding to the target operating parameter, wherein the target operating parameter includes at least any one of the operating parameters.

[0038] Specifically, the resource processing module in the virtual machine allocation system determines whether virtual machine reallocation is needed based on the operating parameters of each supervised host machine. When the target operating parameters hit the preset allocation conditions, it means that the virtual machine reallocation conditions are met. At this time, the virtual machine loads between multiple supervised host machines are out of balance and virtual machines need to be reallocated. The migration host machine that needs to migrate the virtual machine is determined based on the supervised host machine corresponding to the target operating parameters.

[0039] Step S230: determining a virtual machine to be migrated from among the multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter.

[0040] Specifically, the resource processing module screens the virtual machines to be migrated in the migration host machine according to the preset allocation conditions hit by the target operating parameters. The virtual machines to be migrated may include all or part of the virtual machines in the migration host machine.

[0041] Step S240: determining the remaining host machines that meet the load requirement of the virtual machine to be migrated as the destination host machines, wherein the remaining host machines are monitoring host machines except the migration host machine.

[0042] Specifically, the scheduling platform 110 screens the destination host machine for receiving the virtual machine to be migrated from the remaining host machines based on the load requirements of the virtual machine to be migrated, and the load requirements include at least resource occupancy requirements and storage space requirements. The remaining host machines that meet the resource occupancy requirements and storage space requirements of the virtual machine to be migrated are used as destination host machines.

[0043] Step S250: Migrate the virtual machine to be migrated to the destination host machine.

[0044] Specifically, after determining the destination host machine that can accept the virtual machine to be migrated, the scheduling platform 110 migrates the virtual machine to the destination host machine, modifies the use status of the virtual machine to be migrated in the migration host machine to unavailable, so as to reduce the virtual machine load of the migration host machine, and then obtains the resource information of the virtual machine to be migrated by accessing the database 134, creates the virtual machine to be migrated in the destination host machine based on the resource information of the virtual machine to be migrated, and completes the migration and reallocation process of the virtual machine to be migrated. Based on the above process, the automatic migration and migration of virtual machines in different hosts can be realized, without the need for manual migration and allocation of virtual machines, which can save labor costs and can realize real-time monitoring of the distribution of virtual machines in different hosts for automatic allocation of virtual machines.

[0045] In one embodiment, Figure 4 As shown, when the target operating parameter hits the preset allocation condition, determining the migration host based on the supervision host corresponding to the target operating parameter includes:

[0046] Step S2201, when the target operating parameters indicate a fault and downtime, or the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate, or the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate and there is a specific virtual machine in the supervision host corresponding to the target operating parameters, the supervision host corresponding to the target operating parameters is used as the migration host, wherein the preset allocation conditions include the supervision host failure and downtime, the resource occupancy rate of the supervision host is greater than the first preset occupancy rate, and the resource occupancy rate of the supervision host is greater than the first preset occupancy rate and there is a specific virtual machine, and the specific virtual machine is a virtual machine with a protection mark.

[0047] Specifically, if the operating status in the target operating parameter is failure downtime, it means that the supervision host corresponding to the target operating parameter has a fault and the virtual machines in the supervision host need to be evacuated. The supervision host corresponding to the target operating parameter can be directly determined as the migration host where the virtual machines need to be migrated.

[0048] The first preset occupancy rate is used to limit the resource load of the supervision host machine from being too high. The first preset occupancy rate can be a pre-configured resource occupancy rate, or it can be the average of the resource occupancy rates of multiple current supervision hosts, and is used to determine whether there is a supervision host machine with a higher resource occupancy rate. If the resource occupancy rate in the target operating parameter is greater than the first preset occupancy rate, it means that the resource occupancy rate of the supervision host machine corresponding to the target operating parameter is higher than the resource occupancy rate of other supervision hosts. It can be understood that the virtual machine load of the supervision host machine corresponding to the target operating parameter is higher. At this time, the virtual machine loads of various supervision hosts are unbalanced, and it is necessary to migrate and reallocate the virtual machines for the supervision hosts with higher virtual machine loads. In this case, the supervision host machine corresponding to the target operating parameter is determined as the migration host machine that needs to migrate the virtual machine.

[0049] A specific virtual machine refers to a virtual machine with a protection identifier, and the protection identifier is used to indicate a protected tenant, so the specific virtual machine is the virtual machine corresponding to the protected tenant. If the resource occupancy rate in the target operating parameter is greater than the first preset occupancy rate and there is a specific virtual machine in the supervision host corresponding to the target operating parameter, it means that the virtual machine load of the supervision host corresponding to the target operating parameter is high and there is a specific virtual machine corresponding to the protected tenant on it. At this time, in order to realize the protection function of the specific virtual machine, it is necessary to migrate and reallocate the virtual machines of the supervision host corresponding to the target operating parameter to reduce the virtual machine load of the supervision host, and then the supervision host corresponding to the target operating parameter is determined as the migration host.

[0050] In one embodiment, Figure 4As shown, the step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on the preset allocation condition hit by the target operating parameter includes:

[0051] Step S2311, when the target operating parameter indicates a fault downtime, controlling the migration host to shut down through an out-of-band channel;

[0052] Step S2312: According to the tenant levels of the virtual machines with automatic migration flags in the migration host machine, the virtual machines with automatic migration flags in the migration host machine are sequentially determined as virtual machines to be migrated.

[0053] Specifically, when the resource processing module determines that the monitoring host machine has a fault and is down, the corresponding alarm information is sent out by notifying the alarm module 136, and the monitoring host machine is shut down through the out-of-band channel to avoid the expansion of the fault scope. A virtual machine with an automatic migration mark means that the tenant corresponding to the virtual machine allows the system to automatically evacuate the virtual machine. The virtual machines with automatic migration marks are sorted in order as virtual machines to be migrated according to the tenant level corresponding to each virtual machine to determine the migration order of each virtual machine with an automatic migration mark, that is, when the monitoring host machine fails and is down, only the virtual machines allowed to be migrated by the tenant are migrated, and the virtual machines with higher tenant levels are evacuated first, so as to migrate the virtual machines with higher tenant levels to the destination host machine as soon as possible, thereby shortening the evacuation time of the virtual machines and avoiding the virtual machines being unavailable during the evacuation process and affecting the tenant's access experience.

[0054] In one embodiment, Figure 5 As shown, the step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on the preset allocation condition hit by the target operating parameter includes:

[0055] Step S2321, when the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate, the virtual machine in the migration host machine with an automatic migration flag and a required resource occupancy rate sum equal to the resource occupancy rate difference is determined as the virtual machine to be migrated, wherein the resource occupancy rate difference is the difference between the first preset occupancy rate and the resource occupancy rate in the target operating parameters.

[0056] Specifically, when the resource occupancy rate in the target operating parameter is greater than the first preset occupancy rate, it indicates that the CPU occupancy rate of the monitoring host corresponding to the target operating parameter is high, then the virtual machines to be migrated are screened from the virtual machines with automatic migration flags in the monitoring host corresponding to the target operating parameter, and multiple virtual machines with automatic migration flags are determined as virtual machines to be migrated based on the resource occupancy rate difference between the resource occupancy rate in the target operating parameter and the first preset occupancy rate. For example, if the resource occupancy rate difference is 20%, the required resource occupancy rate of the first virtual machine with the automatic migration flag is 10%, the required resource occupancy rate of the second virtual machine with the automatic migration flag is 10%, and the sum of the required resource occupancy rates of the first virtual machine and the second virtual machine is 20%, which is equal to the resource occupancy rate difference, then the first virtual machine and the second virtual machine are selected as virtual machines to be migrated. The sum of required resource occupancy rates is used to indicate the sum of the resource occupancy requirements of multiple virtual machines.

[0057] A virtual machine with an automatic migration flag means that the tenant of the virtual machine allows the system to automatically migrate the virtual machine. Only the virtual machines in the host machine to be migrated that the tenant allows to be migrated will be treated as virtual machines to be migrated. For virtual machines that the tenant does not allow automatic migration and evacuation, they will not be automatically migrated as virtual machines to be migrated, thereby meeting the migration needs of tenants corresponding to different virtual machines. For virtual machines without an automatic migration flag, they can be manually migrated by background staff.

[0058] In one embodiment, Figure 6 As shown, the step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on the preset allocation condition hit by the target operating parameter includes:

[0059] Step S2331, when the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate and there is a specific virtual machine in the supervision host corresponding to the target operating parameters, a non-specific virtual machine with an automatic migration flag in the migration host and a required total resource occupancy rate equal to the resource occupancy rate difference is determined as the virtual machine to be migrated, wherein the resource occupancy rate difference is the difference between the first preset occupancy rate and the resource occupancy rate in the target operating parameters.

[0060] Specifically, a specific virtual machine refers to a virtual machine corresponding to a protected tenant, and a non-specific virtual machine refers to a virtual machine corresponding to an unprotected tenant. When a specific virtual machine exists in the migration host, the virtual machines to be migrated are screened only from the non-specific virtual machines with automatic migration tags. The number of virtual machines to be migrated is determined by the resource occupancy difference between the resource occupancy in the target operating parameters and the first preset occupancy. Multiple non-specific virtual machines with automatic migration tags whose total required resource occupancy is equal to the resource occupancy difference are used as virtual machines to be migrated. This avoids automatically migrating the virtual machines corresponding to the protected tenants and affecting the access experience of such tenants to the virtual machines. In addition, the resource occupancy of the migration host can be reduced to the first preset occupancy, so as to achieve the effect of balancing the virtual machine load of each supervised host.

[0061] In one embodiment, Figure 7 As shown, the remaining host machines that meet the load requirements of the virtual machine to be migrated are determined as the destination host machines, including:

[0062] Step S241, determine the remaining host machines whose supported model parameters include the model parameters of the virtual machine to be migrated, whose available resource occupancy rate is greater than the resource occupancy rate of the virtual machine to be migrated, and whose available storage space is greater than the data volume of the virtual machine to be migrated as the destination host machines.

[0063] Specifically, when determining the destination host machine, the scheduling system mainly bases its determination on the supported model parameters, available resource occupancy rate and available storage space of the remaining host machines. The supported model parameters refer to the model parameters of the virtual machines that the host machine can support. The supported model parameters of the remaining host machines include the model parameters of the virtual machine to be migrated. If the available resource occupancy rate of the remaining host machines is greater than the resource occupancy rate of the virtual machine to be migrated, and the available storage space of the remaining host machines is greater than the data volume of the virtual machine to be migrated, indicating that the remaining host machines support receiving the virtual machine to be migrated, the remaining host machines will be determined as the destination host machines, and the virtual machine to be migrated can be migrated to the destination host machine.

[0064] In one embodiment, Figure 8 As shown, the remaining host machines that meet the load requirements of the virtual machine to be migrated are determined as the destination host machines, including:

[0065] Step S2411, when there are multiple remaining host machines that meet the load requirement of the virtual machine to be migrated, determining the remaining host machines that meet the load requirement of the virtual machine to be migrated as candidate host machines;

[0066] Step S2412, performing weighted summation of the available resource occupancy rate and the available storage space of each candidate host machine to obtain a host score of each candidate host machine;

[0067] Step S2413: determine the candidate host machine corresponding to the host score with the largest value as the destination host machine.

[0068] Specifically, when there are multiple remaining host machines whose available resource occupancy rates and available storage spaces meet the load requirements of the virtual machine to be migrated, the remaining host machines that meet the load requirements of the virtual machine to be migrated are determined as candidate host machines, and the available resource occupancy rate and available storage space of each candidate host machine are weighted and summed according to the weighting coefficients corresponding to each parameter, that is, the available resource occupancy rate corresponds to a corresponding first weighting coefficient, and the available storage space corresponds to a corresponding second weighting coefficient. The product of the available resource occupancy rate and the first weighting coefficient is added to the product of the available storage space and the second weighting coefficient to obtain the host score of the candidate host machine. The higher the host score, the lowest virtual machine load of the candidate host machine. The candidate host machine with the highest host score is selected as the destination host machine, and the virtual machine to be migrated is migrated to the destination host machine with the lowest virtual machine load, so as to achieve the effect of balancing the virtual machine load of each supervised host machine.

[0069] In one embodiment, Fig. 9 As shown, when the target operating parameter hits the preset allocation condition, determining the migration host based on the supervision host corresponding to the target operating parameter includes:

[0070] Step S2202, when the resource occupancy rates in the operating parameters of each of the monitoring host machines are all less than a second preset occupancy rate, the monitoring host machine with the least virtual machine resources is used as a migration host machine, and the migration host machine is controlled to shut down;

[0071] The step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter includes:

[0072] Step S2341, taking all virtual machines in the migration host machine as virtual machines to be migrated.

[0073] Specifically, the second preset occupancy rate is used to indicate a lower resource occupancy rate. When the resource processing module determines that the resource occupancy rate in the operating parameters of each supervised host machine is less than the second preset occupancy rate, it indicates that the virtual machine load of all supervised host machines is relatively low. At this time, the supervised host machine with the least virtual machine resources is determined as the migration host machine, and the host machine shrinkage processing is performed through the resource monitoring sub-module 133, that is, the resource monitoring sub-module 133 controls the supervision host machine with the lowest virtual machine load to shut down, and uses all virtual machines in the migration host machine as virtual machines to be migrated, and migrates all virtual machines in the migration host machine to other remaining host machines, so that the migration host machine can be emptied to shut it down, so as to reduce the number of enabled supervision hosts and save the operating cost of the supervision hosts.

[0074] In one embodiment, Fig.10 As shown, when the target operating parameter hits the preset allocation condition, determining the migration host based on the supervision host corresponding to the target operating parameter includes:

[0075] Step S2203, when the resource occupancy rates in the operating parameters of each of the monitoring host machines are greater than a third preset occupancy rate, each of the monitoring host machines is used as a migration host machine;

[0076] The step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter includes:

[0077] Step S2351, using some virtual machines in the migration host machine as virtual machines to be migrated;

[0078] The determining of the remaining host machines that meet the load requirement of the virtual machine to be migrated as the destination host machines includes:

[0079] Step S2421, enabling a blank host machine, and determining the blank host machine as a destination host machine, wherein the blank host machine is a monitoring host machine that has not been used and meets the load requirement of the virtual machine to be migrated.

[0080] Specifically, the second preset occupancy rate is used to indicate a higher resource occupancy rate. When the resource processing module determines that the resource occupancy rate in the operating parameters of each supervised host machine is greater than the third preset occupancy rate, it indicates that the virtual machine load of all supervised host machines is high and the existing supervised host machines are insufficient. In this case, each supervised host machine is used as a migration host machine, and some of the virtual machines in the migration host machine are used as virtual machines to be migrated. The host machine expansion processing is performed through the resource monitoring sub-module 133. The resource monitoring sub-module 133 enables a brand new blank host machine and uses the blank host machine as the destination host machine to receive the virtual machines to be migrated in each migration host machine, thereby reducing the virtual machine load of each supervised host machine.

[0081] Figure 3-10 FIG. 1 is a flow chart of a virtual machine allocation method in one embodiment. It should be understood that although Figure 3-10 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3-10 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0082] In one embodiment, Figure 2 As shown, a virtual machine allocation system is provided, comprising:

[0083] The data acquisition module 135 is used to obtain the operating parameters of each monitoring host machine;

[0084] A resource processing module, configured to determine a migration host machine based on a supervision host machine corresponding to the target operation parameter when the target operation parameter hits a preset allocation condition, wherein the target operation parameter includes at least any one of the operation parameters; and determine a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on the preset allocation condition hit by the target operation parameter;

[0085] The scheduling platform 110 is used to determine the remaining host machines that meet the load requirements of the virtual machine to be migrated as the destination host machines, wherein the remaining host machines are monitoring host machines other than the migration host machine; and migrate the virtual machine to be migrated to the destination host machine.

[0086] In one embodiment, the resource monitoring submodule 133 in the resource processing module is used to:

[0087] When the target operating parameters indicate a fault and downtime, or the resource occupancy rate in the target operating parameters is greater than a first preset occupancy rate, or the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate and there is a specific virtual machine in the supervision host corresponding to the target operating parameters, the supervision host corresponding to the target operating parameters is used as the migration host, wherein the preset allocation conditions include the supervision host failure and downtime, the resource occupancy rate of the supervision host is greater than the first preset occupancy rate, and the resource occupancy rate of the supervision host is greater than the first preset occupancy rate and there is a specific virtual machine, and the specific virtual machine is a virtual machine with a protection mark.

[0088] In one embodiment, the resource monitoring submodule 133 is further used to:

[0089] When the target operating parameter indicates a fault downtime, controlling the migration host to shut down through an out-of-band channel;

[0090] According to the tenant levels of the virtual machines with automatic migration flags in the migration host machine, the virtual machines with automatic migration flags in the migration host machine are sequentially determined as virtual machines to be migrated.

[0091] In one embodiment, the resource monitoring submodule 133 is further used to:

[0092] When the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate, the virtual machine in the migration host machine with an automatic migration flag and a required resource occupancy rate that is the total resource occupancy rate difference is determined as the virtual machine to be migrated, wherein the resource occupancy rate difference is the difference between the first preset occupancy rate and the resource occupancy rate in the target operating parameters.

[0093] In one embodiment, the resource monitoring submodule 133 is further used to:

[0094] When the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate and there is a specific virtual machine in the supervision host corresponding to the target operating parameters, a non-specific virtual machine in the migration host with an automatic migration flag and a required total resource occupancy rate equal to the resource occupancy rate difference is determined as the virtual machine to be migrated, wherein the resource occupancy rate difference is the difference between the first preset occupancy rate and the resource occupancy rate in the target operating parameters.

[0095] In one embodiment, the scheduling platform 110 is also used for:

[0096] The remaining host machines whose supported model parameters include the model parameters of the virtual machine to be migrated, whose available resource occupancy rate is greater than the resource occupancy rate of the virtual machine to be migrated, and whose available storage space is greater than the data volume of the virtual machine to be migrated are determined as the destination host machines.

[0097] In one embodiment, the scheduling platform 110 is also used for:

[0098] When there are multiple remaining host machines that meet the load requirement of the virtual machine to be migrated, determining the remaining host machines that meet the load requirement of the virtual machine to be migrated as candidate host machines;

[0099] Taking a weighted sum of the available resource occupancy rate and available storage space of each candidate host machine to obtain a host score of each candidate host machine;

[0100] The candidate host machine corresponding to the host score with the largest value is determined as the destination host machine.

[0101] In one embodiment, the resource management submodule 132 in the resource processing module is used to:

[0102] When the resource occupancy rates in the operating parameters of each of the monitoring host machines are all less than a second preset occupancy rate, the monitoring host machine with the least virtual machine resources is used as the migration host machine, and the migration host machine is controlled to shut down;

[0103] All virtual machines in the migration host machine are used as virtual machines to be migrated.

[0104] In one embodiment, the resource management submodule 132 is further used to:

[0105] When the resource occupancy rates in the operating parameters of each of the monitoring host machines are greater than a third preset occupancy rate, each of the monitoring host machines is used as a migration host machine;

[0106] Using some virtual machines in the migration host machine as virtual machines to be migrated;

[0107] The scheduling platform 110 is also used for:

[0108] A blank host machine is enabled, and the blank host machine is determined as a destination host machine, wherein the blank host machine is a monitoring host machine that has not been used and meets the load requirement of the virtual machine to be migrated.

[0109] like Fig.11 As shown, an embodiment of the present application provides a computer device, including a processor 711, a communication interface 712, a memory 713 and a communication bus 714, wherein the processor 711, the communication interface 712, and the memory 713 communicate with each other through the communication bus 714;

[0110] Memory 713, used for storing computer programs;

[0111] In one embodiment of the present application, the processor 711 is used to implement the virtual machine allocation method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 713.

[0112] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0113] In one embodiment, the virtual machine allocation system provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.11 The memory of the computer device may store various program modules constituting the virtual machine allocation system, such as: Figure 2 The data collection module 135, resource processing module and scheduling platform 110 are shown. The computer program composed of various program modules enables the processor to execute the steps of the virtual machine allocation method of each embodiment of the present application described in this specification.

[0114] Fig.11 The computer device shown can be Figure 2 The data acquisition module 135 in the virtual machine allocation system shown executes to obtain the operating parameters of each monitoring host machine. The computer device can determine the migration host machine based on the monitoring host machine corresponding to the target operating parameter through the resource processing module when the target operating parameter hits the preset allocation condition, wherein the target operating parameter includes at least any one of the operating parameters; based on the preset allocation condition hit by the target operating parameter, determine the virtual machine to be migrated from the multiple virtual machines in the migration host machine. The computer device can determine the remaining host machines that meet the load requirements of the virtual machine to be migrated as the destination host machines through the scheduling platform 110, wherein the remaining host machines are monitoring host machines other than the migration host machine; and migrate the virtual machine to be migrated to the destination host machine.

[0115] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the virtual machine allocation method provided in any of the aforementioned method embodiments are implemented.

[0116] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] 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 general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology 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.

[0118] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0119] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A virtual machine allocation method, characterized in that: The method comprises: Obtain the operating parameters of each supervisory host; When the target operating parameter hits the preset allocation condition, determining the migration host based on the supervision host corresponding to the target operating parameter, wherein the target operating parameter includes at least any one of the operating parameters; Determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter; Determine the remaining host machines that meet the load requirement of the virtual machine to be migrated as the destination host machines, wherein the remaining host machines are monitoring host machines other than the migration host machine; Migrate the virtual machine to be migrated to the destination host machine.

2. The method according to claim 1, characterized in that When the target operating parameter hits the preset allocation condition, determining the migration host based on the supervision host corresponding to the target operating parameter includes: When the target operating parameters indicate a fault and downtime, or the resource occupancy rate in the target operating parameters is greater than a first preset occupancy rate, or the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate and there is a specific virtual machine in the supervision host corresponding to the target operating parameters, the supervision host corresponding to the target operating parameters is used as the migration host, wherein the preset allocation conditions include the supervision host failure and downtime, the resource occupancy rate of the supervision host is greater than the first preset occupancy rate, and the resource occupancy rate of the supervision host is greater than the first preset occupancy rate and there is a specific virtual machine, and the specific virtual machine is a virtual machine with a protection mark.

3. The method according to claim 2, characterized in that The step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter includes: When the target operating parameter indicates a fault downtime, controlling the migration host to shut down through an out-of-band channel; According to the tenant levels of the virtual machines with automatic migration flags in the migration host machine, the virtual machines with automatic migration flags in the migration host machine are sequentially determined as virtual machines to be migrated.

4. The method according to claim 2, characterized in that: The step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter includes: When the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate, the virtual machine in the migration host machine with an automatic migration flag and a required resource occupancy rate that is the total resource occupancy rate difference is determined as the virtual machine to be migrated, wherein the resource occupancy rate difference is the difference between the first preset occupancy rate and the resource occupancy rate in the target operating parameters.

5. The method according to claim 2, characterized in that: The step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter includes: When the resource occupancy rate in the target operating parameters is greater than the first preset occupancy rate and there is a specific virtual machine in the supervision host corresponding to the target operating parameters, a non-specific virtual machine in the migration host with an automatic migration flag and a required total resource occupancy rate equal to the resource occupancy rate difference is determined as the virtual machine to be migrated, wherein the resource occupancy rate difference is the difference between the first preset occupancy rate and the resource occupancy rate in the target operating parameters.

6. The method according to claim 1, characterized in that The determining of the remaining host machines that meet the load requirement of the virtual machine to be migrated as the destination host machines includes: The remaining host machines whose supported model parameters include the model parameters of the virtual machine to be migrated, whose available resource occupancy rate is greater than the resource occupancy rate of the virtual machine to be migrated, and whose available storage space is greater than the data volume of the virtual machine to be migrated are determined as the destination host machines.

7. The method according to claim 1, characterized in that The determining of the remaining host machines that meet the load requirement of the virtual machine to be migrated as the destination host machines includes: When there are multiple remaining host machines that meet the load requirement of the virtual machine to be migrated, determining the remaining host machines that meet the load requirement of the virtual machine to be migrated as candidate host machines; Taking a weighted sum of the available resource occupancy rate and available storage space of each candidate host machine to obtain a host score of each candidate host machine; The candidate host machine corresponding to the host score with the largest value is determined as the destination host machine.

8. The method according to claim 1, characterized in that When the target operating parameter hits the preset allocation condition, determining the migration host based on the supervision host corresponding to the target operating parameter includes: When the resource occupancy rates in the operating parameters of each of the monitoring host machines are all less than a second preset occupancy rate, the monitoring host machine with the least virtual machine resources is used as the migration host machine, and the migration host machine is controlled to shut down; The step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter includes: All virtual machines in the migration host machine are used as virtual machines to be migrated.

9. The method according to claim 1, characterized in that: When the target operating parameter hits the preset allocation condition, determining the migration host based on the supervision host corresponding to the target operating parameter includes: When the resource occupancy rates in the operating parameters of each of the monitoring host machines are greater than a third preset occupancy rate, each of the monitoring host machines is used as a migration host machine; The step of determining a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on a preset allocation condition hit by the target operating parameter includes: Using some virtual machines in the migration host machine as virtual machines to be migrated; The determining of the remaining host machines that meet the load requirement of the virtual machine to be migrated as the destination host machines includes: A blank host machine is enabled, and the blank host machine is determined as a destination host machine, wherein the blank host machine is a monitoring host machine that has not been used and meets the load requirement of the virtual machine to be migrated.

10. A virtual machine allocation system, characterized in that: The system comprises: Data collection module, used to obtain the operating parameters of each monitoring host; A resource processing module, configured to determine a migration host machine based on a supervision host machine corresponding to the target operation parameter when the target operation parameter hits a preset allocation condition, wherein the target operation parameter includes at least any one of the operation parameters; and determine a virtual machine to be migrated from among multiple virtual machines in the migration host machine based on the preset allocation condition hit by the target operation parameter; The scheduling platform is used to determine the remaining host machines that meet the load requirements of the virtual machine to be migrated as the destination host machines, wherein the remaining host machines are monitoring host machines other than the migration host machine; and migrate the virtual machine to be migrated to the destination host machine.

11. A computer 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 steps of the method according to any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Cloud platform GPU virtual machine scheduling method and device

    CN120234099A

  • A cloud platform GPU virtual machine scheduling method and device

    CN120234099B