Optimal allocation method and device of resource pool virtual machine and electronic equipment
By optimizing virtual machine migration through a multi-objective optimization model, the problem of uneven resource distribution in the cloud resource pool was solved, achieving load balancing and energy efficiency improvement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE GROUP DESIGN INST
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-15
AI Technical Summary
The uneven distribution of virtual machine resources in the cloud resource pool leads to performance degradation of servers with high load rates and low energy efficiency of servers with low load rates, resulting in resource waste and increased energy consumption.
By using a multi-objective optimization model that combines server cluster energy consumption, service default rate, and number of active servers, iterative optimization is performed to determine the destination server for virtual machine migration, thereby achieving global resource optimization and dynamic balance.
Load balancing was achieved, reducing the probability of service failure, improving the computing power efficiency of the server, and reducing energy consumption and resource waste.
Smart Images

Figure CN122044746A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an optimized allocation method, apparatus and electronic device for resource pool virtual machines. Background Technology
[0002] With the large-scale application of cloud computing technology, the demand for cloud services (including computing services, storage services, application hosting services, etc.) has exploded. As the core infrastructure of data centers (DCs) that host cloud services, the cloud resource pool (CRP) directly determines the quality of cloud services through its resource scheduling efficiency and operational stability. In the existing technology system, cloud resource pools generally adopt virtualization technology to build their resource allocation architecture, using virtual machines (VMs) as the core operating platform for cloud services.
[0003] When there is a demand for cloud services, the cloud resource pool creates a virtual machine for each service. The physical resources occupied by the virtual machine change continuously during the service provision process. When the service / demand ends, the created virtual machine is destroyed. A physical server can accommodate several virtual machines simultaneously. The continuous creation and destruction of virtual machines in the server cluster within the cloud resource pool may lead to an uneven distribution of virtual resources among physical hosts: servers with high load rates are prone to SLA defaults, resulting in degraded virtual machine performance; servers with low load rates have low energy efficiency, leading to resource waste and increased energy consumption. Summary of the Invention
[0004] This application aims to at least partially address one of the technical problems in the related art. The technical solution of this application is as follows: The first aspect of this application proposes an optimized allocation method for virtual machines in a resource pool, comprising: In response to the existence of candidate servers in the resource pool that meet the migration conditions, one or more target virtual machines on the candidate servers are identified to be migrated; Under the constraints of a pre-defined set of constraints, the multi-objective optimization model is iteratively optimized and solved based on the server cluster energy consumption, service default rate, and number of active servers in the resource pool to determine the target server corresponding to the target virtual machine. The target server is the destination server to which the target virtual machine is to be migrated.
[0005] A second aspect of this application provides an optimized allocation apparatus for a resource pool virtual machine, comprising: The determination module is used to determine one or more target virtual machines to be migrated on the candidate servers in response to the existence of candidate servers that meet the migration conditions in the resource pool; The iterative optimization solution module is used to iteratively optimize and solve a multi-objective optimization model under the constraints of a preset set of constraints, based on the server cluster energy consumption, service default rate, and number of active servers in the resource pool, to determine the target server corresponding to the target virtual machine. The target server is the destination server to which the target virtual machine is to be migrated.
[0006] A third aspect of this application provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the instructions to implement an optimized allocation method for a resource pool virtual machine as provided in a first aspect of this application.
[0007] A fourth aspect of this application provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the optimized allocation method for a resource pool virtual machine provided in the first aspect of this application.
[0008] In this embodiment, under the constraints of a preset set of constraints, the multi-objective optimization model is iteratively optimized and solved based on the server cluster energy consumption, service default rate, and number of active servers in the resource pool to determine the target server corresponding to the target virtual machine. This application uses a multi-objective optimization model as its core to achieve joint optimization and dynamic balancing of multiple objectives. It performs cluster-level global planning for all virtual machines, rather than local adjustments to individual servers, addressing resource distribution problems at their root, achieving a shift from "local optimum" to "global optimum," eradicating resource imbalance, escaping the trap of local optima, and globally planning the placement of all virtual machines within the cluster to fundamentally improve the uneven distribution of resources.
[0009] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0010] Figure 1 This is a flowchart of an optimized allocation method for resource pool virtual machines according to some embodiments of this application; Figure 2 This is a schematic diagram of an optimized allocation system for resource pool virtual machines according to some embodiments of this application; Figure 3 This is a flowchart of an optimized allocation method for resource pool virtual machines according to some embodiments of this application; Figure 4 This is a schematic diagram of the business process of virtual machine migration scheduling in some embodiments of this application; Figure 5 This is a flowchart of an optimized allocation method for resource pool virtual machines according to some embodiments of this application; Figure 6This is a structural block diagram of an optimized allocation device for a resource pool virtual machine according to some embodiments of this application; Figure 7 This is a schematic diagram of the structure of an electronic device according to some embodiments of this application. Detailed Implementation
[0011] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0012] The acquisition, storage, and application of information and data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0013] The terminology used in this application is explained below.
[0014] A Service Level Agreement (SLA) is a core contract in cloud service terminology used to define the rights and responsibilities between service providers and consumers. Its core functions include setting service performance standards, establishing measurement methods, clarifying remedial measures, and outsourcing procedures. It is widely used in storage services and public cloud outsourcing strategies, primarily to define and regulate service standards, measurement methods, and remedial measures between service providers and consumers.
[0015] Resource pools are a resource management technology in the fields of computing and cloud computing. They achieve efficient sharing and dynamic allocation of hardware resources through centralization. Essentially, they are a collection of computing, storage, and network resources.
[0016] The following description, in conjunction with the accompanying drawings, describes the optimized allocation method, apparatus, and electronic device for resource pool virtual machines according to embodiments of this application.
[0017] Figure 1 This is a flowchart of an optimized allocation method for resource pool virtual machines according to some embodiments of this application, such as... Figure 1 As shown, the method includes the following steps: S101, in response to the existence of candidate servers in the resource pool that meet the migration conditions, determine one or more target virtual machines to be migrated on the candidate servers.
[0018] In this embodiment of the application, the migration conditions can be determined based on the load status of each server in the resource pool. In some implementations, if a server is overloaded or underloaded, then that server is a candidate server that meets the migration conditions.
[0019] In some implementations, when a candidate server is underloaded, all virtual machines on that underloaded server are identified as target virtual machines to be migrated.
[0020] In some implementations, when a candidate server is overloaded, one or more virtual machines on that overloaded server are identified as target virtual machines to be migrated. The higher the load on a virtual machine, the stronger its correlation with the overload status of the physical host; therefore, the virtual machine with a high correlation to the vCPU utilization of other virtual machines is selected as the target virtual machine.
[0021] S102, under the constraints of the preset set of constraints, the multi-objective optimization model is iteratively optimized and solved based on the server cluster energy consumption, service default rate and number of active servers in the resource pool, to determine the target server corresponding to the target virtual machine.
[0022] In some implementations, the constraint set includes at least a first constraint, a second constraint, and a third constraint. The process of constructing the constraint set includes: constructing a first constraint based on the mapping relationship between each virtual machine and the server to which it is deployed; constructing a second constraint based on the sum of the resource requirements of the virtual machines mounted on each server and the size relationship of the resource capacity of each server; and constructing a third constraint based on the active status of each server.
[0023] The following describes the form of virtual machine resource allocation in this application: Let set For server clusters within the cloud resource pool, a collection Let n and m represent the number of virtual machines currently existing in the server cluster, respectively. Each virtual machine can only be placed on one server, represented by binary variables. This indicates the placement relationship between the virtual machine and the server. If the j-th virtual machine is deployed on the i-th server, then the mapping relationship between the virtual machines and the servers is as follows: Equation (1) In the formula, For server A list of virtual machines running on it.
[0024] Therefore, the first constraint is constructed based on the uniqueness of the mapping relationship between each virtual machine and the server to which it is deployed. A single server can host multiple virtual machines, but a virtual machine can only be hosted on one server. Thus, in the subsequent process, the target server corresponding to the target virtual machine is a single server.
[0025] The types of resources that a server can provide include CPU and memory. , This represents the CPU and memory resource capacity provided by the i-th server. , This represents the CPU and memory resource requirements of a candidate virtual machine (which can be the j-th virtual machine, i.e., virtual machine j). The resource requirements of virtual machines deployed on the same server cannot exceed the server's resource capacity. Equation (2) Therefore, the second constraint is based on the principle that the sum of the resource requirements of the virtual machines mounted on each server cannot exceed the resource capacity of each server.
[0026] Define a binary variable This indicates whether server i is powered on. This indicates that one or more virtual machines are deployed on server i; This indicates that no virtual machines have been deployed on server i, and the server can be shut down or put into hibernation. Deploying any virtual machine to server i would cause... Therefore, the third constraint satisfied after virtual machine integration is: Equation (3) The following describes the multi-objective optimization model of this application. The multi-objective optimization model is an objective function model for multi-objective optimization of virtual machine migration, including a server energy consumption model (used to obtain the energy consumption of the server cluster in the resource pool), a server resource utilization objective function (used to obtain the number of active servers), and a service quality (QoS) guarantee objective function (used to obtain the service default rate).
[0027] The server energy consumption model of this application is described below.
[0028] Since server energy consumption is positively correlated with its CPU utilization, during virtual machine migration and consolidation, when the server is not running virtual machines and is in an idle state, the server is shut down or switched to hibernation. Therefore, at time t, the energy consumption model of server i is as follows: Equation (4) In the formula, These represent the peak power consumption and idle power consumption of server i, respectively. This represents the CPU utilization of server i.
[0029] Virtual machine migration always aims to keep as many servers as possible running at high energy efficiency after scheduling, thereby improving the overall energy efficiency of the server cluster. This involves defining a method for calculating high energy efficiency points (high computational efficiency) and an efficiency ratio. : Equation (5) This refers to the performance (e.g., computing power) of server i when CPU utilization is u. Let be the energy consumption of server i when CPU utilization is u.
[0030] The objective function for server resource utilization in this application is described below.
[0031] Based on the above description of the third constraint, the total number of servers in the cloud resource pool in this application is as follows: Equation (6) In the formula, Let t be the total number of active (enabled) servers in the cloud resource pool at time t. The value represents the degree of fragmentation of resources within the cloud resource pool. The smaller the value, the higher the utilization rate of resources within the cloud resource pool.
[0032] The objective function for QoS guarantee in this application is described below.
[0033] This application uses the default rate of Service Level Agreements (SLAs) to characterize the level of QoS assurance. The SLA is calculated using an average default percentage, representing the percentage of SLA violations caused by performance degradation due to excessive server load.
[0034] Equation (7) In the formula, This indicates the resources requested by the virtual machine on the current server. This refers to the resources that the current server actually allocates to the virtual machine.
[0035] In this embodiment, candidate neighborhood solutions are generated under the constraints of a preset set of constraints. The candidate neighborhood solutions include the mapping relationship between virtual machines and servers in the resource pool. Based on the mapping relationship, a multi-objective optimization model is invoked to perform multiple rounds of iterative optimization. In each round of iterative optimization, the multi-objective evaluation function of the resource pool is calculated based on the server energy consumption model, the server resource utilization objective function, and the QoS guarantee objective function. The function value corresponding to the candidate neighborhood solution is obtained. Based on the function value corresponding to the candidate neighborhood solution, the optimal neighborhood solution in the iteration process is determined until the iteration control condition is met. The optimal neighborhood solution is then output, and the target server corresponding to the target virtual machine is obtained.
[0036] In this context, the target server is the destination server for the target virtual machine to be migrated. That is, in some implementations, after determining the target server corresponding to the target virtual machine, the target virtual machine can be migrated from the candidate server to the target server.
[0037] For high-load servers, by migrating virtual machines in high-load servers to target servers, the load balancing of cloud resource pool servers can be achieved, reducing the probability of SLA default and improving the computing power efficiency of server operation; For low-load servers, virtual machine migration and consolidation can reduce the number of active hosts, reduce cloud resource pool energy consumption, and improve server resource utilization.
[0038] In this embodiment, under the constraints of a preset set of constraints, the multi-objective optimization model is iteratively optimized and solved based on the server cluster energy consumption, service default rate, and number of active servers in the resource pool to determine the target server corresponding to the target virtual machine. This application uses a multi-objective optimization model as its core to achieve joint optimization and dynamic balancing of multiple objectives. It performs cluster-level global planning for all virtual machines, rather than local adjustments to individual servers, addressing resource distribution problems at their root, achieving a shift from "local optimum" to "global optimum," eliminating resource imbalance, and escaping the trap of local optima. Global planning of the placement of all virtual machines within the cluster fundamentally improves uneven resource distribution, thereby enhancing virtual machine performance and avoiding resource waste.
[0039] Optionally, the core technology principle of virtual machine resource allocation is virtual machine migration scheduling under multi-objective joint optimization. For example... Figure 2 As shown in the embodiments of this application, the optimized allocation system for virtual machines in the resource pool mainly consists of three parts: a resource monitoring system, a virtual machine resource optimization allocation method, and a virtual machine scheduling system. The virtual machine allocation system calls the resource monitoring system and the virtual machine scheduling system to execute the optimized allocation method for virtual machine resources. First, the user device purchases cloud services and initiates a virtual machine creation request. The resource monitoring system monitors the resource usage of virtual machines and servers in real time and provides relevant information to the virtual machine resource optimization allocation method (algorithm system). The algorithm system is responsible for generating the scheduled "virtual machine-server" mapping relationship and passing the result to the virtual machine scheduling system. Finally, the virtual machine scheduling system completes the migration action, ending one scheduling process.
[0040] The migration and scheduling of virtual machines requires decisions on three issues: (1) Migration timing, i.e., what circumstances will trigger virtual machine migration; (2) Selection of virtual machines to be migrated, i.e., which virtual machines need to be migrated to other servers; (3) Selection of the destination server for migration, i.e., which server the virtual machine to be migrated to needs to be migrated to.
[0041] The following section provides a detailed explanation of virtual machine migration scheduling.
[0042] Figure 3 This is a flowchart of an optimized allocation method for resource pool virtual machines according to some embodiments of this application, such as... Figure 3 As shown, the method includes the following steps: S301, obtain the utilization rate of each server in the resource pool.
[0043] In this embodiment of the application, the resource utilization rate of the i-th server have: , Equation (8) S302 determines the load status of each server based on its utilization rate and preset load thresholds.
[0044] The following section describes how the timing of this application's migration was determined.
[0045] This application categorizes servers within the cloud resource pool into three types based on their CPU utilization: overloaded servers (servers in an overloaded state), underloaded servers (servers in an underloaded state), and servers available for migration.
[0046] Since most servers reach their maximum performance ratio when CPU utilization is between 60% and 90%. ,make Let the CPU utilization of the i-th server be at its maximum efficiency. Within this range, the server can maintain high energy efficiency. Therefore, the server overload trigger threshold can be defined as follows: Equation (9) The values of 10% and 90% are configured based on prior knowledge; in other implementations, they can be other proportional values.
[0047] In this embodiment of the application, the server load status is determined based on the server utilization and preset load thresholds (including at least the upper threshold and the lower threshold).
[0048] S303, in response to the server's load status being overloaded or underloaded, determines the server as a candidate server that meets the migration criteria.
[0049] Figure 4 This is a schematic diagram of the business process of virtual machine migration scheduling in some embodiments of this application, such as... Figure 4 As shown in the embodiments of this application, when the server utilization rate is higher than (Upper Threshold) Determines a server as overloaded when its utilization rate is < (Lower threshold, such as 20%), determines that the server is underloaded. The lower threshold is configured based on prior knowledge, and in other implementations, it can also be other percentage values.
[0050] S304, in response to the candidate server's underload status, select all virtual machines mounted on the candidate server as the target virtual machines to be migrated.
[0051] In this embodiment of the application, when the server utilization rate is < If the lower threshold (e.g., 20%) is set, the server is determined to be underloaded. All virtual machines on the server should be moved out, and the adjusted server should be shut down or put into hibernation.
[0052] S305, in response to the candidate server's overload status, obtain the correlation between the vCPU utilization of each virtual machine mounted on the candidate server and the server's CPU load, and determine one or more target virtual machines to be migrated based on the correlation.
[0053] In this embodiment of the application, when the server utilization rate is higher than If a server is deemed overloaded (based on the upper threshold), it will be added to the overloaded server list. Virtual machines on overloaded servers are identified as virtual machines to be migrated.
[0054] Based on the above classification of load states, when the resource monitoring system detects that the server is in an overloaded or underloaded state, it triggers the virtual machine migration process.
[0055] Furthermore, the system obtains the number of physical CPU cores of the candidate server, the utilization rate of each virtual machine mounted on the candidate server, and the number of virtual CPUs (vCPUs) allocated to each virtual machine mounted on the candidate server. For each candidate virtual machine mounted on the candidate server, the system obtains the CPU utilization rate of the candidate server after removing the candidate virtual machine, based on the number of physical CPU cores, the utilization rate of each virtual machine, and the number of vCPUs allocated to each virtual machine. Based on the CPU utilization rate of the candidate server after removing the candidate virtual machine and the utilization rate of each virtual machine mounted on the candidate server, the system obtains the correlation between the vCPU utilization rate of the candidate virtual machine and the server CPU load.
[0056] The following describes the selection of the virtual machines to be migrated in this application.
[0057] The selection of virtual machines to be migrated is mainly for overloaded servers, while when a server is underloaded, all virtual machines on that underloaded server will be migrated out.
[0058] The selection logic for virtual machines to be migrated on an overloaded server is as follows: This application adopts a maximum correlation strategy to determine which virtual machine should be migrated. Specifically, the higher the load on a virtual machine, the higher its correlation with the overload state of the physical host. Therefore, the virtual machine with a high correlation to the vCPU utilization of other virtual machines is selected for migration until the host is relieved of its overload state. The calculation method is as follows: Let the server be at time t. Chinese Virtual Machine Utilization rate , Indicates server The system records the vCPU utilization of all virtual machines on the server at regular intervals. When the server is overloaded, it calculates the correlation ρ between the vCPU utilization of each virtual machine and the server's CPU load based on the p vCPU utilization data of the virtual machine already recorded in the system. Equation (10) Equation (11) In the formula, Indicates server Remove virtual machines CPU utilization afterward The number of vCPUs allocated to the j-th virtual machine on the i-th server. Let be the number of physical CPU cores of the i-th server.
[0059] This indicates the load correlation between virtual machine j and server i. This indicates the degree of correlation between each virtual machine in server i and the server load. ρ The larger the value, the greater the correlation. Therefore, one or more virtual machines with the largest ρ value should be selected for migration first, until the server is relieved of overload.
[0060] S306. Under the constraints of a preset set of constraints, the multi-objective optimization model is iteratively optimized and solved based on the server cluster energy consumption, service default rate, and number of active servers in the resource pool to determine the target server corresponding to the target virtual machine.
[0061] For a description of step S306, please refer to the relevant content in the above embodiments, which will not be repeated here.
[0062] like Figure 4 As shown, in some implementations, after migrating the target virtual machine from the candidate server to the target server, for candidate servers with an underload status, the candidate server is shut down or switched to a hibernation state.
[0063] like Figure 4 As shown, in some implementations, after migrating the target virtual machine from the candidate server to the target server, for candidate servers whose load status is overloaded, in response to the candidate server not meeting the migration conditions, the overload status of the candidate server is lifted. If the overloaded candidate server is still in an overloaded state, the optimization allocation process of the resource pool virtual machine of this application continues to perform virtual machine migration until the overload status is lifted.
[0064] This application defines server performance ratios and dynamically calculates overload thresholds, triggering migration only when the server exceeds its high-performance range. This balances performance and migration efficiency, shifting from "fixed threshold triggering" to "performance-driven triggering," thus improving migration accuracy. Furthermore, by prioritizing the migration of highly correlated virtual machines, this application significantly reduces migration actions and the impact on virtual machine performance, shifting from "randomly selected virtual machine migration" to "correlation-driven selection," thereby lowering migration costs.
[0065] Figure 5 This is a flowchart of an optimized allocation method for resource pool virtual machines according to some embodiments of this application, such as... Figure 5 As shown, the method includes the following steps: S501, in response to the existence of candidate servers in the resource pool that meet the migration conditions, determines one or more target virtual machines on the candidate servers to be migrated.
[0066] For a description of step S501, please refer to the relevant content in the above embodiments, which will not be repeated here.
[0067] S502, in each iteration, generates candidate neighborhood solutions based on the set of constraints using the simulated annealing algorithm.
[0068] The neighborhood solution includes the mapping relationship between virtual machines and servers within the resource pool.
[0069] The following describes the selection of the destination server and the placement and integration process of the virtual machines in this application.
[0070] Based on the resource monitoring system's monitoring of resource utilization of each server in the cloud resource pool, virtual machines on overloaded and underloaded servers are migrated to the remaining active servers (i.e., the migration destination server).
[0071] Virtual machine consolidation is a multi-objective joint optimization decision-making process that should achieve the following objectives: Equation (12) This indicates the energy consumption of the server cluster in the cloud resource pool. This indicates the service default rate (representing the QOS guarantee rate). This indicates the number of active servers (representing the degree of resource fragmentation).
[0072] The placement and integration of virtual machines then constitutes solving the multi-objective optimization problem described above: Equation (13) Equation (14) Equation (15) The set of constraints is as follows: Equation (16) The virtual machine placement and integration algorithm of this application is described below.
[0073] This application designs a virtual machine placement and integration algorithm based on simulated annealing to obtain a "globally optimal virtual machine placement scheme". This algorithm breaks through the local optima limitation of traditional heuristic algorithms by simulating the random search and temperature decay mechanism of solid annealing process. At the same time, it constructs a multi-objective quantization model to balance energy saving, load balancing and QoS guarantee requirements.
[0074] The core design idea of the simulated annealing algorithm is as follows: (1) By analogy with "the disordered motion of molecules in a solid at high temperature, and the gradual orderly arrangement of molecules to the lowest energy state as the temperature decreases", the algorithm expands the solution space coverage by random search in the initial high temperature stage (allowing poor solutions to be accepted) to avoid getting trapped in local optima; (2) By gradually reducing the probability of random search through temperature decay, the algorithm gradually converges to the global optimal solution; (3) Construct a multi-objective evaluation function that integrates “energy saving, resource utilization rate and QoS guarantee”, and transform the multi-objective optimization requirements of cloud resource pool into single-value quantitative indicators to achieve dynamic balance of multi-objective conflicts.
[0075] The simulated annealing algorithm in this application outputs the globally optimal virtual machine placement scheme through six steps: initialization, neighborhood solution generation, multi-objective evaluation, solution acceptance judgment, temperature decay, and iteration termination. The parameter initialization process of this algorithm is described below.
[0076] (1) Initial temperature Based on the current cloud resource pool load differential setting, the calculation formula is as follows: Equation (17) in The maximum difference in CPU utilization between the current physical servers (e.g., the highest load server has a utilization of 90% and the lowest is 30%). =60%), k is an adjustment coefficient (taken as 5-7), to ensure that the initial temperature is high enough to allow for poorer solutions to be accepted to cover more potential solutions.
[0077] (2) Initial solution (X represents the mapping matrix between virtual machines and servers, satisfying the constraints of the first and third constraints): Based on the current virtual machine-server mapping relationship of the cloud resource pool. As the initial solution (i.e. This avoids starting with an "empty solution" which leads to slow convergence.
[0078] (3) Temperature decay coefficient α: adopt the exponential decay strategy and set the value of α (e.g. 0.92, range of 0.5-0.99) to ensure that the algorithm smoothly transitions from "exploration" to "convergence" as the temperature gradually decreases.
[0079] (4) Number of iterations L: The number of searches L at each temperature is positively correlated with the number of VMs, ensuring that the neighborhood solution is fully searched at each temperature.
[0080] (5) Termination temperature Set one (like When the temperature drops to this value, the algorithm converges to the vicinity of the global optimum and stops iterating.
[0081] Furthermore, domain solutions are generated based on the set of constraints (generating potential new virtual machine placement schemes).
[0082] Based on the method for determining overloaded or underloaded servers, a "candidate set of virtual machines to be migrated" is generated. Then, based on the set of virtual machine migration constraints, the mapping relationships of the virtual machines to be integrated are adjusted to integrate them with the target servers, generating a new virtual machine-server mapping solution for the cloud resource pool. .
[0083] S503: Obtain the target server cluster energy consumption, target service default rate, and target active server number based on candidate neighborhood solutions.
[0084] In this embodiment of the application, referring to the relevant description in step S102, based on the mapping relationship between servers and virtual machines in the candidate neighborhood solutions, the server energy consumption model is called to obtain the server cluster energy consumption of the resource pool, the server resource utilization objective function is called to obtain the number of active servers, and the QoS guarantee objective function is called to obtain the service default rate.
[0085] S504 calculates the multi-objective evaluation function of the resource pool based on the target server cluster energy consumption, target service default rate, and target number of active servers, and obtains the function value corresponding to the candidate neighborhood solution.
[0086] In some implementations, the rated total energy consumption of the server cluster in the resource pool and the total number of servers in the resource pool are obtained. Based on the energy consumption of the target server cluster and the rated total energy consumption of the server cluster, the energy consumption ratio is determined. Based on the number of target active servers and the total number of servers, the active server ratio is determined. Based on the sum of the energy consumption ratio, the active server ratio and the target service default rate, the function value corresponding to the candidate neighborhood solution is determined.
[0087] The calculation of the multi-objective evaluation function in this application is described below.
[0088] Construct a multi-objective evaluation function E(X) (corresponding to the algorithm's "energy function"), transforming the three objectives of energy saving, resource utilization, and QoS assurance into single-valued indicators. The lower the function value, the better the solution. Equation (18) In the formula, This represents the current energy consumption of the cloud resource pool server cluster. This refers to the rated total energy consumption of the cloud resource pool server cluster. n represents the current number of active servers in the cloud resource pool; n represents the total number of servers in the cloud resource pool. This refers to the SLA default rate.
[0089] S505: Based on the function values corresponding to the candidate neighborhood solutions, determine the optimal neighborhood solution in the iteration process until the iteration control conditions are met, output the optimal neighborhood solution, and obtain the target server corresponding to the target virtual machine.
[0090] Furthermore, based on the Metropolis criterion, it is determined whether to accept the neighborhood solution of the new scheme. : (1) Calculate the energy difference between the current solution and the new solution. ; (2) If (The new plan is better): Direct acceptance Update the current solution = ; (3) If (The new proposal is inferior): Calculate the probability of acceptance. ( (For the current temperature), generate random numbers. :like :accept Update the current solution = ;like :reject ,Keep constant.
[0091] Furthermore, the temperature decay and iterative control process is introduced: after each L neighborhood solution search (1 round of temperature iteration), the temperature decay is controlled according to the formula... = Lower the temperature; repeat steps 4.3-4.5 until the temperature reaches the target value. If the change in the optimal evaluation function value over three consecutive temperature cycles is ≤10⁻⁵ (indicating that the output has converged to a certain extent), the algorithm terminates and outputs the final optimal solution. (i.e., the globally optimal VM placement scheme).
[0092] S506 migrates the target virtual machine from the candidate server to the target server.
[0093] For details regarding step S506, please refer to the relevant descriptions in the above embodiments; they will not be repeated here.
[0094] This application breaks away from the limitations of focusing on a single optimization objective (such as only reducing high load or only reducing active hosts) by constructing a multi-objective joint optimization system, and establishes a three-dimensional collaborative optimization system of "energy saving, resource utilization, and QoS guarantee". By quantitatively defining the core objective functions (cluster energy consumption function F(power), SLA default rate function F(SLAV), and active server quantity function F(active)), and using the multi-objective optimization model as the core, it achieves joint optimization and dynamic balance of multiple objectives.
[0095] This application utilizes simulated annealing algorithm for global optimal scheduling, avoiding the "step-by-step local optima" defects of traditional heuristic algorithms (greedy, first-fit algorithm). This application employs simulated annealing algorithm to design the virtual machine placement and integration process, combining the steps of "initialization → neighborhood solution generation → multi-objective evaluation → solution acceptance judgment → temperature decay → iteration termination" to escape the local optima trap and perform global planning for the placement of all virtual machines in the cluster, thereby fundamentally improving the uneven distribution of resources.
[0096] This application determines migration triggers based on performance and load. Instead of relying on fixed resource thresholds, it uses a quantitative triggering standard designed in conjunction with the server's maximum performance ratio. By defining overload and underload thresholds, servers are categorized into overloaded, underloaded, and migration-ready states. Migration is triggered only when the resource monitoring system detects that a server is in an overloaded / underloaded state, thus avoiding ineffective migrations that consume resources.
[0097] This application implements virtual machine migration selection logic based on correlation analysis. To address the issue of virtual machine migration order on overloaded servers, this application proposes a "maximum correlation strategy" to determine the migration order of virtual machines on overloaded servers, ensuring that overload is alleviated with the fewest migration actions and reducing the impact on system performance.
[0098] This application employs a simulated annealing algorithm. In the initial high-temperature phase, it uses random search (allowing for poor solutions) to cover the extensive solution space, gradually converging to the global optimum as the temperature decays. The algorithm performs cluster-level global planning for all virtual machines, rather than local adjustments on individual servers, addressing resource distribution issues at their root and achieving a shift from "local optimum" to "global optimum," thus eliminating resource imbalance. This application integrates normalized cluster energy consumption, active server ratio, and SLA default rate into a single-value indicator through a multi-objective evaluation function E(X), achieving a dynamic balance among the three and moving from "single objective" to "multi-objective joint optimization," avoiding the loss of one objective for another.
[0099] Figure 6 This is a structural block diagram of the resource pool virtual machine optimization allocation device according to some embodiments of this application, such as... Figure 6 As shown, the resource pool virtual machine optimization allocation device 600 includes: The determination module 610 is used to determine one or more target virtual machines to be migrated on the candidate servers in response to the existence of candidate servers that meet the migration conditions in the resource pool; The iterative optimization solution module 620 is used to iteratively optimize and solve the multi-objective optimization model under the constraints of a preset set of constraints, based on the server cluster energy consumption, service default rate, and number of active servers in the resource pool, to determine the target server corresponding to the target virtual machine. The target server is the destination server to which the target virtual machine is to be migrated.
[0100] In some implementations, the determining module 610 is further configured to: Obtain the utilization rate of each server in the resource pool; For each server, the load status of the server is determined based on the server utilization and a preset load threshold. In response to the server's load status being overloaded or underloaded, the server is determined to be a candidate server that meets the migration conditions.
[0101] In some implementations, the determining module 610 is further configured to: In response to the candidate server being underloaded, all virtual machines mounted on the candidate server are designated as the target virtual machines to be migrated; or, In response to the candidate server being overloaded, the correlation between the CPU utilization of each virtual machine mounted on the candidate server and the server CPU load is obtained, and one or more target virtual machines to be migrated are determined based on the correlation.
[0102] In some implementations, the resource pool virtual machine optimization allocation device 600 further includes a migration module 630, used for: Migrate the target virtual machine from the candidate server to the target server; For a candidate server that is underloaded, shut down the candidate server or switch the candidate server to a dormant state; or, for a candidate server that is overloaded, in response to the candidate server not meeting the migration conditions, remove the overload status of the candidate server.
[0103] In some implementations, the determining module 610 is further configured to: Obtain the number of physical CPU cores of the candidate server, the utilization rate of each virtual machine mounted on the candidate server, and the number of virtual central processing units (vCPUs) allocated to each virtual machine mounted on the candidate server; For each candidate virtual machine mounted on the candidate server, the CPU utilization of the candidate server after removing the candidate virtual machine is obtained based on the number of physical CPU cores, the utilization rate of each virtual machine, and the number of vCPUs allocated to each virtual machine. Based on the CPU utilization of the candidate servers after removing the candidate virtual machines and the utilization of each virtual machine mounted on the candidate servers, the correlation between the vCPU utilization of the candidate virtual machines and the server CPU load is obtained.
[0104] In some implementations, the set of constraints includes at least a first constraint, a second constraint, and a third constraint. The determining module 610 is further configured to: The first constraint is constructed based on the mapping relationship between each virtual machine and the server to which it is deployed; The second constraint is constructed based on the sum of the resource requirements of the virtual machines mounted on each of the servers and the relationship between the resource capacity of each of the servers. The third constraint is constructed based on the active status of each of the servers.
[0105] In some implementations, the iterative optimization solution module 620 is also used for: In each iteration, based on the simulated annealing algorithm, candidate neighborhood solutions are generated according to the set of constraints, wherein the neighborhood solutions include the mapping relationship between the virtual machines and the servers in the resource pool; Based on the candidate neighborhood solutions, obtain the target server cluster energy consumption, target service default rate, and target number of active servers; Based on the target server cluster energy consumption, the target service default rate, and the target number of active servers, a multi-objective evaluation function for the resource pool is calculated to obtain the function value corresponding to the candidate neighborhood solution. Based on the function value corresponding to the candidate neighborhood solution, the optimal neighborhood solution is determined in the iteration process until the iteration control condition is met, and the optimal neighborhood solution is output to obtain the target server corresponding to the target virtual machine.
[0106] In some implementations, the iterative optimization solution module 620 is also used for: Obtain the rated total energy consumption of the server cluster in the resource pool and the total number of servers in the resource pool; The energy consumption ratio is determined based on the energy consumption of the target server cluster and the rated total energy consumption of the server cluster. The active server ratio is determined based on the target number of active servers and the total number of servers. The function value corresponding to the candidate neighborhood solution is determined based on the sum of the energy consumption ratio, the active server ratio, and the target service default rate.
[0107] In this embodiment, under the constraints of a preset set of constraints, the multi-objective optimization model is iteratively optimized and solved based on the server cluster energy consumption, service default rate, and number of active servers in the resource pool to determine the target server corresponding to the target virtual machine. This application uses a multi-objective optimization model as its core to achieve joint optimization and dynamic balancing of multiple objectives. It performs cluster-level global planning for all virtual machines, rather than local adjustments to individual servers, addressing resource distribution problems at their root, achieving a shift from "local optimum" to "global optimum," eradicating resource imbalance, escaping the trap of local optima, and globally planning the placement of all virtual machines within the cluster to fundamentally improve the uneven distribution of resources.
[0108] Figure 7 This is a schematic diagram of the structure of an electronic device according to some embodiments of this application.
[0109] like Figure 7 As shown, the electronic device 700 includes: The system includes a memory 701 and a processor 702, and a bus 703 connecting different components (including the memory 701 and the processor 702). The memory 701 stores a computer program, and when the processor 702 executes the program, it implements the resource pool virtual machine optimization allocation method of this application embodiment.
[0110] Bus 703 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0111] Electronic device 700 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by electronic device 700, including volatile and non-volatile media, removable and non-removable media.
[0112] Memory 701 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 704 and / or cache memory 705. Electronic device 700 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 706 can be used to read and write non-removable, non-volatile magnetic media (… Figure 7 Not shown; usually referred to as a "hard drive"). Although Figure 7 As not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 703 via one or more data media interfaces. Memory 701 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.
[0113] A program / utility 708 having a set (at least one) of program modules 707 may be stored, for example, in memory 701. Such program modules 707 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 707 typically perform the functions and / or methods described in the embodiments of this application.
[0114] Electronic device 700 can also communicate with one or more external devices 709 (e.g., keyboard, pointing device, display 711, etc.), and with one or more devices that enable a user to interact with the electronic device 700, and / or with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 712. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 713. Figure 7As shown, network adapter 713 communicates with other modules of electronic device 700 via bus 703. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0115] The processor 702 executes various functional applications and data processing by running programs stored in the memory 701.
[0116] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the optimized allocation method of the resource pool virtual machine in the embodiment of this application, and will not be repeated here.
[0117] To implement the above embodiments, this application also proposes a computer-readable storage medium.
[0118] When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to execute the optimized allocation method of the resource pool virtual machine as described above. Optionally, the computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0119] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0120] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for optimizing the allocation of virtual machines in a resource pool, characterized in that, include: In response to the existence of candidate servers in the resource pool that meet the migration conditions, one or more target virtual machines to be migrated on the candidate servers are determined; Under the constraints of a preset set of constraints, the multi-objective optimization model is iteratively optimized and solved based on the server cluster energy consumption, service default rate, and number of active servers of the resource pool to determine the target server corresponding to the target virtual machine. The target server is the destination server to which the target virtual machine is to be migrated.
2. The method according to claim 1, characterized in that, The process for determining whether a candidate server in the resource pool meets the migration criteria includes: Obtain the utilization rate of each server in the resource pool; For each server, the load status of the server is determined based on the server utilization and a preset load threshold. In response to the server's load status being overloaded or underloaded, the server is determined to be a candidate server that meets the migration conditions.
3. The method according to claim 2, characterized in that, The step of determining one or more target virtual machines to be migrated on the candidate server includes: In response to the candidate server being underloaded, all virtual machines mounted on the candidate server are designated as the target virtual machines to be migrated; or, In response to the candidate server being overloaded, the correlation between the virtual CPU utilization of each virtual machine mounted on the candidate server and the server CPU load is obtained, and one or more target virtual machines to be migrated are determined based on the correlation.
4. The method according to claim 2 or 3, characterized in that, After determining the target server corresponding to the target virtual machine, the process further includes: Migrate the target virtual machine from the candidate server to the target server; For candidate servers that are underloaded, shut down the candidate server or switch the candidate server to a dormant state; or, For a candidate server whose load status is overloaded, in response to the candidate server not meeting the migration conditions, the overload status of the candidate server is lifted.
5. The method according to claim 3, characterized in that, The process of obtaining the correlation between the virtual CPU utilization of each virtual machine mounted on the candidate server and the server CPU load includes: Obtain the number of physical CPU cores of the candidate server, the utilization rate of each virtual machine mounted on the candidate server, and the number of vCPUs allocated to each virtual machine mounted on the candidate server; For each candidate virtual machine mounted on the candidate server, the CPU utilization of the candidate server after removing the candidate virtual machine is obtained based on the number of physical CPU cores, the utilization rate of each virtual machine, and the number of vCPUs allocated to each virtual machine. Based on the CPU utilization of the candidate servers after removing the candidate virtual machines and the utilization of each virtual machine mounted on the candidate servers, the correlation between the vCPU utilization of the candidate virtual machines and the server CPU load is obtained.
6. The method according to any one of claims 1-3, or claim 5, characterized in that, The constraint set includes at least a first constraint, a second constraint, and a third constraint. The process of constructing the constraint set includes: The first constraint is constructed based on the mapping relationship between each virtual machine and the server to which it is deployed; The second constraint is constructed based on the sum of the resource requirements of the virtual machines mounted on each of the servers and the relationship between the resource capacity of each of the servers. The third constraint is constructed based on the active status of each of the servers.
7. The method according to any one of claims 1-3, or claim 5, characterized in that, Under the constraints of a preset set of constraints, the multi-objective optimization model is iteratively optimized and solved based on the server cluster energy consumption, service default rate, and number of active servers in the resource pool to determine the target server corresponding to the target virtual machine, including: In each iteration, based on the simulated annealing algorithm, candidate neighborhood solutions are generated according to the set of constraints, wherein the neighborhood solutions include the mapping relationship between the virtual machines and the servers in the resource pool; Based on the candidate neighborhood solutions, obtain the target server cluster energy consumption, target service default rate, and target number of active servers; Based on the target server cluster energy consumption, the target service default rate, and the target number of active servers, a multi-objective evaluation function for the resource pool is calculated to obtain the function value corresponding to the candidate neighborhood solution. Based on the function value corresponding to the candidate neighborhood solution, the optimal neighborhood solution is determined in the iteration process until the iteration control condition is met, and the optimal neighborhood solution is output to obtain the target server corresponding to the target virtual machine.
8. The method according to claim 7, characterized in that, The step of calculating a multi-objective evaluation function for the resource pool based on the energy consumption of the target server cluster, the default rate of the target service, and the number of target active servers, and obtaining the function value corresponding to the candidate neighborhood solution, includes: Obtain the rated total energy consumption of the server cluster in the resource pool and the total number of servers in the resource pool; The energy consumption ratio is determined based on the energy consumption of the target server cluster and the rated total energy consumption of the server cluster. The active server ratio is determined based on the target number of active servers and the total number of servers. The function value corresponding to the candidate neighborhood solution is determined based on the sum of the energy consumption ratio, the active server ratio, and the target service default rate.
9. An optimized allocation device for a resource pool virtual machine, characterized in that, include: The determination module is used to determine one or more target virtual machines to be migrated on the candidate servers in response to the existence of candidate servers in the resource pool that meet the migration conditions; The iterative optimization solution module is used to perform iterative optimization of the multi-objective optimization model under the constraints of a preset set of constraints, based on the server cluster energy consumption, service default rate, and number of active servers of the resource pool, to determine the target server corresponding to the target virtual machine, wherein the target server is the destination server to which the target virtual machine is to be migrated.
10. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the instructions to implement the method as described in any one of claims 1-8.