A virtual machine migration method and related equipment
By using the migration management controller and configuration interface in a cloud computing environment, users enter preset conditions to determine the virtual machine migration sequence, solving the problem of single scheduling targets in the existing technology, and achieving the multi-objective optimization effect after virtual machine migration.
Patent Information
- Application Number
- CN202011126630.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-10-24
- Filing Date
- 2020-10-20
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2040-10-20
AI Technical Summary
In the cloud computing environment, the scheduling goals considered by the existing virtual machine scheduling scheme are relatively single, resulting in the performance indicators that cannot be fully optimized after virtual machine migration.
Provide a virtual machine migration method, through the migration management controller, provides a configuration interface, the user enters preset conditions, and the migration management controller determines the migration sequence based on the preset conditions and virtual machine-related information, and achieves multi-objective optimization.
Dynamic scheduling of virtual machines is achieved while considering multiple scheduling goals, improving resource utilization, and optimizing load balancing and migration overhead.
Smart Images

Figure CN112711461B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing, and in particular to a virtual machine migration method and related equipment. Background Art
[0002] As an emerging industry in recent years, cloud computing has received extensive attention from the scientific research community and the industry. Cloud computing is mainly divided into three types: infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS). In the cloud computing environment of infrastructure as a service, the reasonable placement of virtual machines (VMs) has always been a core issue.
[0003] In addition, in the cloud computing environment of infrastructure as a service, the needs of users for purchasing virtual machines are different, and the load characteristics they exhibit are also different; there are three most common classification methods, namely central processing unit (CPU) intensive, disk input / output (I / O) intensive, and network intensive. If the virtual machines carried on the same physical machine are of the same type, for example, CPU intensive, then each virtual machine will compete for the use of CPU resources, while the utilization of other resources (such as memory, network, etc.) will be low. Since each virtual machine competes for the use of CPU resources, the service quality is reduced. At the same time, the overall resource utilization is not high, resulting in resource waste and unnecessary energy loss. Therefore, in order to avoid this situation, it is necessary to dynamically migrate virtual machines to improve the overall resource utilization and optimize other indicators.
[0004] At present, there are some problems with the dynamic scheduling technology of virtual machines in cloud computing environments, which leads to problems after virtual machine migration and the performance indicators are not fully optimized. The scheduling objectives (i.e., optimization objectives) considered by existing virtual machine scheduling schemes are relatively simple, such as only considering load balancing scheduling, or only considering resource utilization scheduling, or only considering virtual machine affinity (network affinity) scheduling. Summary of the invention
[0005] The embodiment of the present invention discloses a virtual machine migration method and related equipment, which can dynamically schedule virtual machines under consideration of multiple scheduling objectives and realize multi-objective optimization.
[0006] In a first aspect, the present application provides a virtual machine migration method, the method comprising: a migration management controller provides a configuration interface, the configuration interface is used to prompt a user to input preset conditions, the preset conditions are used to constrain the migration method of the virtual machines in the resource pool; the migration management controller obtains the preset conditions from the configuration interface, and determines the virtual machine migration sequence according to the preset conditions and information related to the virtual machines in the resource pool; the migration management controller migrates the virtual machines in the resource pool according to the virtual machine migration sequence.
[0007] In the solution provided in the present application, the user directly inputs preset conditions on the configuration interface provided by the migration management controller, so that the migration management controller determines the virtual machine migration sequence based on the preset conditions input by the user and the virtual machine related information in the resource pool, thereby ensuring that the virtual machine meets the preset conditions and achieves multi-objective optimization during the migration process.
[0008] In combination with the first aspect, in a possible implementation of the first aspect, the preset conditions include the physical machine cluster where the virtual machine to be migrated is located, the weight of the target to be optimized, the virtual machines that cannot be migrated, and the physical machines that are prioritized for migration, and the targets to be optimized include the virtual machine resource utilization, the physical machine load balancing value, and the virtual machine migration overhead.
[0009] In the solution provided in the present application, the user can ensure that the migration management controller migrates the virtual machines in the resource pool as required by setting preset conditions, ensuring that the virtual machines meet business requirements during the migration process and can achieve multi-objective optimization.
[0010] In combination with the first aspect, in a possible implementation of the first aspect, the virtual machine-related information in the resource pool includes current location information and status information of the virtual machine, wherein the current location information is used to indicate the physical machine to which the current virtual machine belongs, and the status information includes the resource demand of the virtual machine, the resource usage of the virtual machine, and the resource limit of the physical machine where the virtual machine is located; the migration management controller generates multiple candidate location information based on the current location information; the migration management controller selects target location information from the multiple candidate location information based on the status information, wherein when the virtual machines in the resource pool are distributed on the physical machines in the resource pool according to the target location information, the comprehensive score of the virtual machine resource utilization, virtual machine migration overhead and physical machine load balancing value of the resource pool is the highest; the migration management controller determines the virtual machine migration sequence based on the target location information.
[0011] In the scheme provided in the present application, the migration management controller obtains multiple candidate location information based on the current location information of the virtual machine, wherein the migration of the virtual machine in the resource pool from the current location to different candidate locations corresponds to multiple different virtual machine migration schemes. The migration management controller scores the multiple different virtual machine migration schemes corresponding to the multiple candidate location information in different virtual machine migration schemes according to the resource demand of the virtual machine, the resource usage of the virtual machine, and the resource limit of the physical machine where the virtual machine is located, and selects the candidate location corresponding to the highest comprehensive score of the virtual machine resource utilization, virtual machine migration overhead, and physical machine load balancing value, thereby determining the target location information from the multiple candidate location information, which can ensure that the target location information finally selected can improve the virtual machine resource utilization, ensure load balancing and reduce migration overhead, thereby achieving multi-objective optimization of virtual machine migration.
[0012] Optionally, the migration management controller randomly obtains a plurality of candidate location information according to the current location information of the virtual machine, wherein the number of the candidate location information is, for example, 1000 or greater.
[0013] In combination with the first aspect, in a possible implementation of the first aspect, the migration management controller inputs multiple candidate location information and status information into a comprehensive scoring function respectively to obtain a comprehensive score; when the comprehensive score meets a threshold condition, the migration management controller uses the candidate location information corresponding to the comprehensive score that meets the threshold condition as the target location information.
[0014] Optionally, the threshold condition can be set as needed, for example, it can be set to 0.85.
[0015] In the solution provided in the present application, the migration management controller uses a comprehensive scoring function to calculate multiple candidate location information, and compares the calculation results with the threshold, and selects the candidate location information that meets the threshold as the target location information. Multiple candidate location information can be quickly screened and the target location information can be found.
[0016] In combination with the first aspect, in a possible implementation of the first aspect, when the comprehensive score does not meet the threshold condition, the migration management controller selects the candidate position information closest to the threshold condition from the candidate position information corresponding to the comprehensive score that does not meet the threshold condition as the parent candidate position information; the migration management controller performs genetic algorithm processing on the parent candidate position information, and inputs the processing result into the comprehensive scoring function until the comprehensive score output by the comprehensive scoring function meets the threshold condition, and uses the candidate position information corresponding to the comprehensive score that meets the threshold condition as the target position information.
[0017] In the solution provided by the present application, when the migration management controller fails to find candidate location information that meets the threshold condition, the candidate location information closest to the threshold condition is used as the parent candidate location information and processed by the genetic algorithm, and the target location information that meets the threshold condition is finally determined through continuous iteration. In this way, it can be ensured that the target location information finally selected can achieve multi-objective optimization.
[0018] In combination with the first aspect, in a possible implementation manner of the first aspect, the comprehensive score includes a virtual machine resource utilization score, a virtual machine migration overhead score, and a physical machine load balancing value score, and the comprehensive scoring function is:
[0019] F(x)=W u ·F u (x)+W b ·F b (x)+W m ·F m (x)
[0020] Among them, the F u (x) is the virtual machine resource utilization scoring function, and W u For the F u (x) corresponding weight; the F b (x) is the physical machine load balancing value scoring function, and W b For the F b (x) corresponding weight; the F m (x) is the virtual machine migration cost scoring function, and W m For the F m (x) The corresponding weight. Optionally, the weight of each sub-scoring function is obtained based on empirical values.
[0021] In the solution provided in this application, the comprehensive scoring function is composed of each sub-scoring function multiplied by their respective weights, so that the target location information determined from multiple dimensions can improve the virtual machine resource utilization, ensure load balancing, reduce migration overhead, and achieve multi-objective optimization.
[0022] In combination with the first aspect, in a possible implementation manner of the first aspect, the resource requirement of the virtual machine includes the processor requirement, memory requirement, and network requirement of the virtual machine, the resource limit of the physical machine includes the processor limit, memory limit, and network limit of the physical machine, and the virtual machine resource utilization scoring function is:
[0023]
[0024] Among them, the is the processor requirement of the virtual machine, is the processor limit of the physical machine where the virtual machine is located; is the memory requirement of the virtual machine, is the memory limit of the physical machine where the virtual machine is located; is the network demand of the virtual machine, is the network limit of the physical machine where the virtual machine is located; and n is the number of physical machines in the resource pool.
[0025] In the solution provided in the present application, resource utilization is reflected by utilizing the square sum of the utilization rates of processor resources, memory resources, and network resources, thereby ensuring that the resource utilization scoring function is comprehensive and credible.
[0026] In combination with the first aspect, in a possible implementation manner of the first aspect, the physical machine load balancing value scoring function is:
[0027]
[0028] Among them, the is the processor utilization of the physical machine, is the average processor utilization of the physical machines in the resource pool; is the memory utilization of the physical machine. is the average memory utilization of the physical machines in the resource pool; is the network utilization of the physical machine. is the average network utilization of the physical machines in the resource pool.
[0029] In the solution provided in the present application, load balancing is reflected by the mean square deviation of the processor utilization, memory utilization and network utilization of each physical machine, ensuring that the calculated load balancing value is more accurate, thereby ensuring that the comprehensive scoring function is more accurate.
[0030] In combination with the first aspect, in a possible implementation manner of the first aspect, the resource requirement of the virtual machine includes a memory requirement of the virtual machine, and the virtual machine migration cost scoring function is:
[0031]
[0032] Among them, the is the memory requirement of the virtual machine, and the t i It is used to indicate whether the virtual machine needs to be migrated from the physical machine where it is located to another physical machine. i The value is 0 or 1, t i When it is 0, it means that the virtual machine does not need to be migrated from the physical machine to another physical machine; iWhen it is 1, it indicates that the virtual machine needs to be migrated from the physical machine where it is located to another physical machine, and M is the number of virtual machines in the resource pool.
[0033] In the solution provided in this application, the migration overhead is reflected by the memory amount of the virtual machine to be migrated. When more virtual machines need to be migrated, the calculated F m The smaller (x) is, the more efficiently and quickly the migration cost value can be obtained by using the virtual machine migration cost scoring function.
[0034] In combination with the first aspect, in a possible implementation manner of the first aspect, the configuration interface is further used to prompt the user to input a virtual machine migration cycle, and the virtual machines in the resource pool are periodically migrated according to the virtual machine migration cycle.
[0035] In the solution provided by the present application, the user can set the virtual machine migration cycle so that the migration management controller periodically performs the virtual machine migration operation, ensuring that the virtual machine distribution can be updated periodically, thereby improving the virtual machine resource utilization and achieving multi-objective optimization. Optionally, the user can also manually trigger the migration management controller to perform the virtual machine migration operation.
[0036] In a second aspect, the present application provides a computing device, including: a display module, used to provide a configuration interface, the configuration interface is used to prompt a user to input preset conditions, and the preset conditions are used to constrain the migration method of virtual machines in a resource pool; a processing module, used to obtain the preset conditions from the configuration interface, and determine the virtual machine migration sequence according to the preset conditions and information related to the virtual machines in the resource pool; a migration module, used to migrate the virtual machines in the resource pool according to the virtual machine migration sequence.
[0037] In combination with the second aspect, in a possible implementation of the second aspect, the preset conditions include the physical machine cluster where the virtual machine to be migrated is located, the weight of the target to be optimized, the virtual machines that cannot be migrated, and the physical machines that are prioritized for migration, and the targets to be optimized include the virtual machine resource utilization, the physical machine load balancing value, and the virtual machine migration overhead.
[0038] In combination with the second aspect, in a possible implementation of the second aspect, the virtual machine-related information in the resource pool includes current location information and status information of the virtual machine, the current location information is used to indicate the physical machine to which the current virtual machine belongs, and the status information includes the resource demand of the virtual machine, the resource usage of the virtual machine, and the resource limit of the physical machine where the virtual machine is located. The processing module is specifically used to: generate multiple candidate location information based on the current location information; select target location information from the multiple candidate location information based on the status information, wherein when the virtual machines in the resource pool are distributed on the physical machines in the resource pool according to the target location information, the comprehensive score of the virtual machine resource utilization, virtual machine migration overhead and physical machine load balancing value of the resource pool is the highest; and determine the virtual machine migration sequence based on the target location information.
[0039] In combination with the second aspect, in a possible implementation method of the second aspect, the processing module is also used to: input the multiple candidate location information and the status information into a comprehensive scoring function respectively to obtain a comprehensive score; when the comprehensive score meets a threshold condition, the candidate location information corresponding to the comprehensive score that meets the threshold condition is used as the target location information.
[0040] In combination with the second aspect, in a possible implementation of the second aspect, the processing module is also used to: when the comprehensive score does not meet the threshold condition, select the candidate position information closest to the threshold condition from the candidate position information corresponding to the comprehensive score that does not meet the threshold condition as the parent candidate position information; perform genetic algorithm processing on the parent candidate position information, and input the processing result into the comprehensive scoring function until the comprehensive score output by the comprehensive scoring function meets the threshold condition, and use the candidate position information corresponding to the comprehensive score that meets the threshold condition as the target position information.
[0041] In conjunction with the second aspect, in a possible implementation manner of the second aspect, the comprehensive score includes a virtual machine resource utilization score, a virtual machine migration overhead score, and a physical machine load balancing value score, and the comprehensive scoring function is:
[0042] F(x)=W u ·F u (x)+W b ·F b (x)+W m ·F m (x)
[0043] Among them, the F u (x) is the virtual machine resource utilization scoring function, and W u For the F u (x) corresponding weight; the F b(x) is the physical machine load balancing value scoring function, and W b For the F b (x) corresponding weight; the F m (x) is the virtual machine migration cost scoring function, and W m For the F m (x) The corresponding weight.
[0044] In combination with the second aspect, in a possible implementation manner of the second aspect, the resource requirement of the virtual machine includes the processor requirement, memory requirement, and network requirement of the virtual machine, the resource limit of the physical machine includes the processor limit, memory limit, and network limit of the physical machine, and the virtual machine resource utilization scoring function is:
[0045]
[0046] Among them, the is the processor requirement of the virtual machine, is the processor limit of the physical machine where the virtual machine is located; is the memory requirement of the virtual machine, is the memory limit of the physical machine where the virtual machine is located; is the network demand of the virtual machine, is the network limit of the physical machine where the virtual machine is located; and n is the number of physical machines in the resource pool.
[0047] In conjunction with the second aspect, in a possible implementation manner of the second aspect, the physical machine load balancing value scoring function is:
[0048]
[0049] Among them, the is the processor utilization of the physical machine, is the average processor utilization of the physical machines in the resource pool; is the memory utilization of the physical machine. is the average memory utilization of the physical machines in the resource pool; is the network utilization of the physical machine. is the average network utilization of the physical machines in the resource pool.
[0050] In conjunction with the second aspect, in a possible implementation manner of the second aspect, the resource requirement of the virtual machine includes a memory requirement of the virtual machine, and the virtual machine migration cost scoring function is:
[0051]
[0052] in, is the memory requirement of the virtual machine, t i It is used to indicate whether the virtual machine needs to be migrated from the physical machine where it is located to another physical machine. i The value is 0 or 1, t i When it is 0, it means that the virtual machine does not need to be migrated from the physical machine to another physical machine; i When it is 1, it indicates that the virtual machine needs to be migrated from the physical machine where it is located to another physical machine, and M is the number of virtual machines in the resource pool.
[0053] In combination with the second aspect, in a possible implementation manner of the second aspect, the configuration interface is further used to prompt the user to input a virtual machine migration cycle, and the virtual machines in the resource pool are periodically migrated according to the virtual machine migration cycle.
[0054] In a third aspect, the present application provides a computing device, comprising a processor and a memory, wherein the memory is used to store program code, and the processor is used to call the program code in the memory to execute the above-mentioned first aspect and a method combined with any one of the implementation methods of the above-mentioned first aspect.
[0055] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it can implement the process of the virtual machine migration method provided in the above-mentioned first aspect and in combination with any one of the implementation methods in the above-mentioned first aspect.
[0056] In a fifth aspect, the present application provides a computer program product, which includes instructions. When the computer program is executed by a computer, the computer can execute the process of the virtual machine migration method provided in the above-mentioned first aspect and in combination with any one of the implementation methods in the above-mentioned first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0058] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0059] Figure 2 It is a schematic diagram of a system architecture provided by an embodiment of the present application;
[0060] Figure 3It is a structural diagram of a physical machine provided in an embodiment of the present application;
[0061] Figure 4 It is a flowchart of a virtual machine migration method provided in an embodiment of the present application;
[0062] Figure 5 is a schematic diagram of a configuration interface provided in an embodiment of the present application;
[0063] Fig. 6A This is a schematic diagram of an interface before task creation provided in an embodiment of the present application;
[0064] Figure 6B This is a schematic diagram of an interface for creating a task provided in an embodiment of the present application;
[0065] Figure 6C This is a schematic diagram of an interface for executing a task provided in an embodiment of the present application;
[0066] Fig.6D This is a schematic diagram of a task query interface provided by an embodiment of the present application;
[0067] Fig. 7A It is a schematic diagram of group encoding of location information provided by an embodiment of the present application;
[0068] Figure 7B is a schematic diagram of vector encoding of position information provided by an embodiment of the present application;
[0069] Figure 7C It is a schematic diagram of another method of vector encoding of position information provided in an embodiment of the present application;
[0070] Fig.7D is a schematic diagram of matrix encoding of position information provided by an embodiment of the present application;
[0071] Figure 8 is a schematic diagram of candidate location information provided in an embodiment of the present application;
[0072] Fig. 9 is a schematic diagram of a hybridization process provided in an embodiment of the present application;
[0073] Fig.10 is a schematic diagram of a virtual machine migration process provided by an embodiment of the present application;
[0074] Fig.11 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0075] Fig.12 It is a structural diagram of another computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0076] The technical solutions in the embodiments of the present application are described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 creative work are within the scope of protection of the present application.
[0077] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0078] First, some of the terms and related technologies involved in this application are explained in conjunction with the accompanying drawings to facilitate understanding by those skilled in the art.
[0079] A resource pool is composed of multiple virtual machines. The virtual machines in the resource pool can belong to different physical machines, and one physical machine can run one or more virtual machines.
[0080] Migration of a virtual machine refers to a change in the physical machine on which the virtual machine runs. For example, if virtual machine A runs on physical machine 1 and now needs to be migrated to physical machine 2, then virtual machine A will run on physical machine 2 and virtual machine A will no longer exist on physical machine 1.
[0081] Genetic algorithm is a kind of randomized search method evolved from the evolutionary law of the biological world. Its main features are that it operates directly on structural objects, does not have the limitation of derivative and function continuity, has inherent implicitness and better global optimization ability; it adopts probabilistic optimization method, can automatically obtain and guide the optimized search space, and adjust the search direction adaptively without the need for definite rules. Genetic algorithm is a general algorithm for solving search problems, which can be used for various general problems. The common features of search algorithms are: first, a group of candidate solutions are formed; the fitness of these candidate solutions is measured according to certain fitness conditions; some candidate solutions are retained according to fitness, and other candidate solutions are abandoned; the retained candidate solutions are operated to generate new candidate solutions. In genetic algorithms, the above features are combined in a special way: parallel search based on chromosome groups, selection operations with guessing nature, exchange operations and mutation operations.
[0082] The present application provides a virtual machine migration method, which is executed by a virtual machine migration system. The virtual machine migration system may specifically include one or more virtual machine monitors, each of which monitors multiple virtual machines. Furthermore, the virtual machine migration system also includes a migration management controller, which provides a configuration interface to allow a user to input preset conditions, and then determines a virtual machine migration sequence and completes the migration of the virtual machine based on the preset conditions input by the user and the virtual machine related information obtained in the resource pool. The migration method can ensure that multi-objective optimization is achieved during the virtual machine migration process.
[0083] like Figure 1 As shown, the resource pool includes four physical machines, namely physical machine 1, physical machine 2, physical machine 3 and physical machine 4. Two virtual machines are deployed on each physical machine. For example, virtual machine 1 (VM1) and virtual machine 2 (VM2) are deployed on physical machine 1. These virtual machines can be migrated between different physical machines. For example, virtual machine 1 is initially deployed on physical machine 1 and can be migrated to physical machine 2. Virtual machine 5 is initially deployed on physical machine 3 and can be migrated to physical machine 4.
[0084] The virtual machine migration system is used to monitor the virtual machines in the resource pool and dynamically migrate the virtual machines based on the monitoring information to achieve multi-objective optimization. Figure 2 As shown, the virtual machine migration system 200 includes a migration management controller 210 and 8 physical machines, namely physical machine A to physical machine H. The 8 physical machines form a resource pool. A virtual machine monitor is deployed in each physical machine to monitor the virtual machines in the physical machine and report the location information and status information of the monitored virtual machines to the migration management controller 210. The migration management controller 210 generates multiple candidate location information based on the location information and status information of the virtual machines in each physical machine reported by each virtual machine monitor. Each candidate location information corresponds to a virtual machine migration plan, and determines a target location information that meets the requirements, so as to optimize multiple goals in the process of migrating virtual machines, such as virtual machine resource utilization, migration overhead, load balancing, etc.
[0085] Furthermore, the structure of each physical machine is similar, except for the number of virtual machines deployed in each physical machine and the amount of various resources that can be provided. The following takes physical machine A as an example for explanation, and other physical machines are similar to physical machine A. Figure 3As shown, physical machine A includes a hardware structure 2210 and a software structure 2220. The hardware structure 2210 includes a processor 2211 (for providing processor resources), a memory 2212 (for providing memory resources), and a network card 2213 (for providing network resources). The software structure 2220 includes an operating system 2221, a virtual machine 2222 (i.e., VM3), and a virtual machine 2223 (i.e., VM4). The operating system 2221 includes a virtual machine monitor 22210 for monitoring the virtual machines 2222 and 2223 and obtaining the location information and status information of the virtual machines 2222 and 2223. The virtual machines 2222 and 2223 include the required virtualized virtual processors, virtual memories, and virtual network cards.
[0086] Based on the above, the virtual machine migration method and related devices provided in the embodiments of the present application are described below. Figure 4 , Figure 4 A flow chart of a virtual machine migration method provided in an embodiment of the present application. Figure 4 As shown, the method includes but is not limited to the following steps:
[0087] S401: The migration management controller provides a configuration interface.
[0088] Specifically, the migration management controller prompts the user to input preset conditions by providing a configuration interface, and the user inputs the preset conditions based on the configuration interface. The preset conditions are used to constrain the migration mode of the virtual machines in the resource pool.
[0089] Optionally, the preset conditions include the physical machine cluster where the virtual machine to be migrated is located, the weight of the target to be optimized, the virtual machines that cannot be migrated and the physical machines that are prioritized for migration. The targets to be optimized include virtual machine resource utilization, physical machine load balancing value and virtual machine migration overhead, etc.
[0090] For example, Figure 5 As shown, Figure 5It is a schematic diagram of a configuration interface provided in an embodiment of the present application. A user creates a virtual machine migration task based on the configuration interface. In the configuration interface, the user can select the pod name where the container is located, and select the physical machine identifier corresponding to the physical machine cluster involved in the virtual machine migration, such as the identifier corresponding to the physical machine from which the virtual machine needs to be migrated and the identifier corresponding to the physical machine to be migrated. The user chooses to set preset parameters, such as physical machines that are prioritized for migration, virtual machines that cannot be migrated, virtual machine resource utilization, physical machine load and virtual machine migration overhead weight, number of migrations, etc. The user can also select the migration algorithm and integration algorithm in the configuration interface to display the integration effect (i.e., the effect after the virtual machine migration) and display the migration step information. After the user completes all selections, by clicking the confirmation button in the interface, the migration management controller can generate a virtual machine migration task and perform virtual machine migration based on the parameters selected and entered by the user.
[0091] S402: The migration management controller obtains the preset condition from the configuration interface.
[0092] Specifically, users can Figure 5 The configuration interface shown is used to input preset conditions, and the migration management controller obtains the preset conditions input by the user from the configuration interface.
[0093] For further information on how the migration management controller creates, executes, and queries virtual machine migration tasks, see Figure 6A-6D . Fig. 6A : is a schematic diagram of an interface before creating a task provided in an embodiment of the present application, wherein the defragmentation option on the left side of the interface corresponds to the virtual machine migration in the present application, and the option includes two sub-options: host group and task. The host group option includes a list of multiple host groups, each of which has a corresponding name, identifier, number of hosts, creation time, metadata, etc., and any host group can be selected to create a defragmentation task, such as Figure 6B As shown, after selecting the host group, the user enters and selects the corresponding parameters based on the selection interface corresponding to the host group, such as integration algorithm, migration algorithm, virtual machine resource utilization weight, virtual machine migration overhead weight, physical machine load balancing value weight, virtual machines that cannot be migrated, and physical machines that are preferentially migrated, and then clicks the OK button to complete the task creation. After the task creation is completed, the migration management controller can run the task, such as Figure 6C As shown in the figure, the task options include multiple task lists. Each task has a corresponding task ID, host group ID, status information (normal or error), the number of initial empty hosts, submission time, and optional operations (such as sorting, querying, pausing, retrying, deleting, etc.). It should be noted that the migration management controller can execute multiple tasks at the same time. In addition, for each task, real-time query can be performed, such as Fig.6DAs shown, for the first task, that is, the task identified as 13e98c72-6fb-465d, click Query to query the relevant information of the first task, such as the integration algorithm, migration algorithm, the number of empty hosts, the number of virtual machines to be migrated, the amount of memory to be migrated, and the number of CPUs to be migrated corresponding to the first task.
[0094] S403: The migration management controller obtains the current location information and status information of the virtual machine reported by the virtual machine monitor.
[0095] In the present application, the virtual machine monitor can be any virtual machine monitor deployed in the cloud resource pool. The cloud resource pool includes multiple physical machines, each of which is deployed with one or more virtual machines. In addition, each physical machine is deployed with a virtual machine monitor for monitoring all virtual machines on the physical machine. The virtual machine monitor can monitor the current location information of the virtual machine and the status information of the virtual machine and the physical machine itself in real time or periodically, and report the monitored current location information and status information to the migration management controller. After the migration management controller receives the current location information and status information reported by all virtual machine monitors in the cloud resource pool, it determines the virtual machine migration strategy and implements the migration of virtual machines between different physical machines to meet the simultaneous optimization of multiple objectives, such as improving resource utilization, achieving load balancing, reducing migration overhead, and meeting the service level agreement (SLA).
[0096] Specifically, the migration management controller can determine the physical machine to which all virtual machines in the cloud resource pool belong through the received current location information, that is, the correspondence between the current virtual machines and physical machines has been determined. The resource demand of each virtual machine, the resource usage of each virtual machine, and the resource limit of each physical machine (that is, the amount of resources that each physical machine can provide) can be determined through the status information.
[0097] Furthermore, the migration management controller may encode the received current location information of the virtual machine. Fig. 7A As shown, the migration management controller performs group encoding on the current location information, that is, virtual machines located on the same physical machine are grouped into one group, for example, virtual machine 3 and virtual machine 4 are grouped into one group, located on physical machine A; virtual machine 2, virtual machine 9 and virtual machine 11 are grouped into one group, located on physical machine D; virtual machine 1 and virtual machine 5 are grouped into one group, located on physical machine E. Optionally, the migration management controller may perform vector encoding on the current location information, such as Figure 7B As shown, the virtual machine identifications (IDs) are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12, and the physical machine identifications are A, B, C, D, E, F, and H. Figure 7B From the vector encoding shown, it can be seen that virtual machines identified as 3 and 4 are located on a physical machine identified as A, virtual machines identified as 12 are located on a physical machine identified as B, virtual machines identified as 8 and 10 are located on a physical machine identified as C, virtual machines identified as 2, 9 and 11 are located on a physical machine identified as D, virtual machines identified as 1 and 5 are located on a physical machine identified as E, virtual machines identified as 6 are located on a physical machine identified as F, and virtual machines identified as 7 are located on a physical machine identified as H. For ease of representation, the identification of the physical machines can be simplified, such as Figure 7C As shown, it can be simplified to 1-8. In addition, in order to facilitate calculation, the vector code corresponding to the position information can be converted into a matrix code. Fig.7D As shown, Figure 7C The vector encoding shown corresponds to the matrix encoding, through which the virtual machine deployment status can be obtained. The number of 1s in each row indicates the number of virtual machines in a physical machine, and the 1 in each column indicates on which physical machine the virtual machine with the identifier corresponding to the column is located.
[0098] S404: The migration management controller generates a plurality of candidate location information according to the current location information of the virtual machine.
[0099] Specifically, the migration management controller may randomly generate a plurality of candidate location information, and encode the plurality of candidate location information in a matrix form to obtain a plurality of migration matrices, each of which corresponds to a migration strategy.
[0100] Furthermore, the specifications of each migration matrix are consistent, that is, the number of rows and the number of columns of each migration matrix are the same, and the difference between them is the position of 1, that is, the corresponding (attribution) relationship between the virtual machine and the physical machine is different.
[0101] S405: The migration management controller selects target location information from a plurality of candidate location information according to the state information.
[0102] In a possible implementation, the migration management controller inputs the multiple candidate location information and the state information into a comprehensive scoring function to obtain a comprehensive score; when the comprehensive score meets a threshold condition, the candidate location information corresponding to the comprehensive score that meets the threshold condition is used as the target location information.
[0103] It should be understood that different candidate location information corresponds to different state information, therefore, the comprehensive scores calculated after inputting the comprehensive scoring function are different, and after calculating each candidate location information, the candidate location information that meets the threshold condition is selected as the target location information. In addition, the threshold condition can be set as needed, for example, it can be set to 0.85, or other values, which are not limited in this application.
[0104] Optionally, the comprehensive score includes a virtual machine resource utilization score, a virtual machine migration overhead score, and a physical machine load balancing value score, and the comprehensive score function is:
[0105] F(x)=W u ·F u (x)+W b ·F b (x)+W m ·F m (x)
[0106] Among them, the F u (x) is the virtual machine resource utilization scoring function, and W u For the F u (x) corresponding weight; the F b (x) is the physical machine load balancing value scoring function, and W b For the F b (x) corresponding weight; the F m (x) is the virtual machine migration cost scoring function, and W m For the F m (x) The corresponding weight.
[0107] Specifically, the migration management controller evaluates each candidate location information from the three objectives of virtual machine resource utilization, virtual machine migration overhead, and physical machine load balancing, so as to ensure that the target location information finally selected can optimize these three objectives at the same time. In addition, the idea of weight sum is also adopted here to achieve multi-objective optimization. Each sub-scoring function (such as virtual machine resource utilization scoring function) corresponds to a weight. The specific value of the weight can be obtained based on empirical values or by other means, and this application does not limit this.
[0108] Furthermore, the resource demand of a virtual machine is the resources required for the virtual machine to run on a physical machine, mainly including the processor (CPU) demand, memory demand and network demand (also known as bandwidth demand) of the virtual machine, and the resource limit of a physical machine is the resources that the physical machine can provide, mainly including the processor limit, memory limit and network limit. The virtual machine resource utilization scoring function can be:
[0109]
[0110] Among them, the The processor demand of all virtual machines in a physical machine, that is, the sum of the processor resources required to create all virtual machines in the physical machine. is the processor limit of the physical machine where the virtual machine is located, that is, the total amount of processor resources that the physical machine where the virtual machine is located can provide; is the memory requirement of all virtual machines in a physical machine, that is, the sum of the memory resources required to create all virtual machines in the physical machine. is the memory limit of the physical machine where the virtual machine is located, that is, the total amount of memory resources that the physical machine where the virtual machine is located can provide; is the network demand of all virtual machines in a physical machine, that is, the sum of network resources required to create all virtual machines in the physical machine. is the network limit of the physical machine where the virtual machine is located, that is, the total amount of network resources that the physical machine where the virtual machine is located can provide; n is the number of physical machines. It should be noted that when each virtual machine is created, a certain amount of processor resources, memory resources and network resources will be allocated to ensure that the virtual machine can run normally on the physical machine.
[0111] It is easy to understand that the maximum utilization rate of virtual machine resources is reflected by the square sum of the utilization rates of various resources in each physical machine. In addition, normalization is performed, that is, divided by 3n, and the calculated F u (x) is the virtual machine resource utilization. It should also be understood that for different candidate location information, the corresponding parameters are different, that is, etc. are not the same, which ultimately leads to the calculated F u (x) is also different.
[0112] For example, assume that there are 8 physical machines, which are labeled 1-8, and the resource limit of each physical machine is fixed, and 12 virtual machines, which are labeled 1-12, and the resource demand of each virtual machine is also fixed. Figure 8 As shown, for candidate location information 1, virtual machines 1, 2, and 3 are located on physical machine 1, virtual machines 4, 6, and 11 are located on physical machine 4, virtual machines 8 and 12 are located on physical machine 6, and virtual machines 5, 7, 9, and 11 are located on physical machine 8. u (x), since there are no virtual machines on physical machines 2, 3, 5, and 7, is 0, the memory requirement and network requirement are also 0, and there are virtual machines 1, 2, and 3 on physical machine 1, then The value of is the sum of the processor requirements of virtual machine 1, virtual machine 2, and virtual machine 3. is the processor limit of physical machine 1. Similarly, we can calculate and For physical machines 4, 6, and 8, the above method can also be used to calculate, and finally the F corresponding to the candidate position information 1 is obtained. u (x).
[0113] For candidate location information 2, virtual machines 2, 3, 5, and 12 are located on physical machine 2, virtual machines 6, 7, 8, and 9 are located on physical machine 3, and virtual machines 1, 4, 10, and 11 are located on physical machine 7. The F corresponding to candidate location information 2 can be calculated according to the above method. u (x). For candidate location information 3, virtual machines 1, 2, and 7 are located on physical machine 1, virtual machines 3, 4, and 8 are located on physical machine 3, virtual machines 5 and 6 are located on physical machine 5, and virtual machines 9, 10, 11, and 12 are located on physical machine 8. The F corresponding to candidate location information 3 is calculated according to the above method. u (x).
[0114] In a possible implementation, the physical machine load balancing value scoring function is:
[0115]
[0116] in, is the processor utilization of the physical machine, that is, the ratio of the processor resources already used by the physical machine to the total amount of processor resources it can provide. is the average processor utilization of the physical machines in the resource pool, that is, the sum of the processor utilizations of all physical machines divided by the total number of physical machines; is the memory utilization of the physical machine, that is, the ratio of the memory resources already used by the physical machine to the total amount of memory resources it can provide. is the average memory utilization of the physical machines in the resource pool, that is, the sum of the memory utilizations of all physical machines divided by the total number of physical machines; is the network utilization rate of the physical machine, that is, the ratio of the network resources already used by the physical machine to the total amount of network resources it can provide. is the average network utilization of the physical machines in the resource pool, that is, the sum of the network utilizations of all physical machines divided by the total number of physical machines.
[0117] It can be seen that the overall load balancing is reflected here by the mean square error of the utilization of various resources in each physical machine, and normalization is also performed. The calculated F b (x) is the load balancing value. It should be understood that for different candidate location information, the corresponding parameters are different, that is, etc. are different, which ultimately leads to the calculated F b (x) are not the same.
[0118] For example, in the above Figure 8 In the candidate location information shown, for different candidate location information, the virtual machines on the same physical machine are not completely consistent, resulting in etc. are inconsistent. For example, the candidate position information 1 corresponds to Corresponding to candidate location information 2 is inconsistent, Similarly, other parameters will also change with the change of candidate position information, which will not be described in detail.
[0119] In a possible implementation, the virtual machine migration cost scoring function is:
[0120]
[0121] in, is the memory requirement of the virtual machine, that is, the amount of memory resources allocated to the virtual machine when it is created. i Whether the virtual machine needs to be migrated from the physical machine to another physical machine, the t i The value is 0 or 1, t i When it is 0, it means that the virtual machine does not need to be migrated from the physical machine to another physical machine; i When it is 1, it indicates that the virtual machine needs to be migrated from the physical machine where it is located to another physical machine, where M is the number of virtual machines in the resource pool.
[0122] It should be understood that when migrating a virtual machine, the migration overhead needs to be minimized as much as possible. Here, the minimization of the virtual machine migration overhead is mainly reflected by the ratio of the total memory requirement of the virtual machine to be migrated to the total memory requirement of all virtual machines. The calculated F m (x) is the virtual machine migration cost. It should be understood that for different candidate location information, the virtual machines that need to be migrated are different compared with the current location information, resulting in the calculated F m (x) are not the same.
[0123] For example, Figure 8The candidate location information shown, assuming the above Fig.7D The location information shown is the current location information, and the candidate location information 1, candidate location information 2 and candidate location information 3 are the location information after migration. Therefore, the virtual machine that needs to be migrated by the candidate location information 2 relative to the current location information is inconsistent with the virtual machine that needs to be migrated by the candidate location information 3 relative to the current location information. The calculated F m (x) is also inconsistent.
[0124] In one possible implementation, when the comprehensive score does not meet the threshold condition, among the candidate position information corresponding to the comprehensive score that does not meet the threshold condition, the candidate position information closest to the threshold condition is selected as the parent candidate position information; the parent candidate position information is processed by a genetic algorithm, and the processing result is input into the comprehensive scoring function until the comprehensive score output by the comprehensive scoring function meets the threshold condition, and the candidate position information corresponding to the comprehensive score that meets the threshold condition is used as the target position information.
[0125] Specifically, randomly generated candidate location information may not meet the requirements, that is, the calculated comprehensive score does not meet the threshold condition, but some of the candidate location information has a relatively high calculated comprehensive score, while some of the candidate location information has a relatively low calculated comprehensive score. In this case, it is necessary to select candidate location information close to the threshold condition as the parent candidate location information and perform genetic algorithm processing. For example, the comprehensive scores corresponding to all candidate location information can be sorted in descending order, and the first 100 or 200 can be selected as the parent candidate location information for genetic algorithm processing.
[0126] It should be understood that the genetic algorithm is a relatively mature search algorithm. The following will briefly introduce how to use the genetic algorithm to determine the target location information.
[0127] First, select a hybridization operator (also called a chromosome) for hybridization, that is, select two candidate position information from the parent candidate position information as the hybridization operator. Fig. 9As shown, a and b are two chromosomes, respectively representing a candidate location information, wherein there are 8 physical machines in chromosome a, and their corresponding identifiers are A, B, C, D, E, F, G, and H. Virtual machines 1, 2, and 4 are located on physical machine A, virtual machine 5 is located on physical machine B, virtual machine 7 and 10 are located on physical machine C, virtual machine 8 is located on physical machine D, virtual machine 3 and virtual machine 6 are located on physical machine E, virtual machine 9 is located on physical machine F, virtual machine 11 is located on physical machine G, and virtual machine 12 is located on physical machine H. There are also 8 physical machines and 12 virtual machines in chromosome b, virtual machine 5 is located on physical machine A, virtual machine 1 is located on physical machine B, virtual machine 7 and virtual machine 8 are located on physical machine C, virtual machine 2 and virtual machine 3 are located on physical machine D, virtual machine 4 and virtual machine 6 are located on physical machine E, virtual machine 10 and virtual machine 11 are located on physical machine F, and virtual machine 9 and virtual machine 12 are located on physical machine H.
[0128] Then, hybridization is performed, for example, the virtual machine on physical machine A in chromosome a replaces the virtual machine on physical machine A in chromosome b. At this time, the original virtual machine on physical machine A in chromosome b needs to be put into a temporary queue, as described above. Fig. 9 shown.
[0129] Next, all virtual machines on the physical machine where duplicate virtual machines appear after replacement are placed in a temporary queue, as described above. Fig. 9 As shown, after the replacement, duplicate virtual machines appear in physical machine B, physical machine D and physical machine E in chromosome b. At this time, virtual machine 1 on physical machine B, virtual machine 2 and virtual machine 3 on physical machine D, and virtual machine 4 and virtual machine 6 on physical machine E need to be put into a temporary queue.
[0130] Finally, the non-repeated virtual machines in the temporary queue (i.e., not present in the chromosome) are reinserted into each physical machine, as shown in Fig. 9 As shown, there are virtual machines 1, 2, 3, 4, 5 and 6 in the temporary queue, among which virtual machines 1, 2 and 4 already exist in chromosome b and do not need to be inserted again, while virtual machines 3, 5 and 6 need to be reinserted into the physical machine in chromosome b, and virtual machines 3, 5 and 6 are inserted into physical machine E. Optionally, a local optimization algorithm can be used for insertion.
[0131] In particular, some chromosomes can be randomly selected for mutation. The specific rule is to randomly mark a physical machine in the chromosome as invalid, and the virtual machines on the physical machine will be put into a temporary queue, and then the virtual machines in the temporary queue will be reinserted into other physical machines in the chromosome using algorithms such as local optimization.
[0132] For example, select Fig. 9 The chromosome a shown in mutates, the physical machine E in the chromosome a is marked as invalid, and the virtual machines 3 and 6 on the physical machine E are placed in a temporary queue. Finally, the local optimization algorithm is used to reinsert the virtual machines 3 and 6 into the physical machine D.
[0133] After hybridization and mutation, more candidate position information will be obtained. These candidate position information and state information will be input into the comprehensive scoring function to obtain the comprehensive score, and it will be determined whether the comprehensive score meets the threshold condition. The candidate position information that meets the threshold condition will be used as the target position information. If all candidate position information still does not meet the threshold condition, the candidate position information closest to the threshold condition will be selected again as the new parent candidate position information, and the above process will be processed again (i.e. hybridization and mutation), and it will be iterated repeatedly until the candidate position information whose comprehensive score meets the threshold condition is finally found.
[0134] S406: The migration management controller determines a virtual machine migration sequence according to the target location information, and migrates the virtual machines in the resource pool according to the virtual machine migration sequence.
[0135] Specifically, after determining the target location information, the migration management controller compares it with the current location information to generate a virtual machine migration sequence.
[0136] For example, Fig.10 As shown, there are 12 virtual machines, which are deployed on 8 physical machines respectively. The initial deployment (i.e., the current location information) is: virtual machine 1 and virtual machine 5 are deployed on physical machine 5, virtual machine 2, virtual machine 9, and virtual machine 11 are deployed on physical machine 4, virtual machine 3 and virtual machine 4 are deployed on physical machine 1, virtual machine 6 is deployed on physical machine 6, virtual machine 7 is deployed on physical machine 8, virtual machine 8 and virtual machine 10 are deployed on physical machine 3, and virtual machine 12 is deployed on physical machine 12, which is the same as the above. Figure 7B The optimized deployment (i.e., target location information) is: virtual machine 1, virtual machine 4, virtual machine 10, and virtual machine 11 are deployed on physical machine 7, virtual machine 2, virtual machine 3, virtual machine 5, and virtual machine 12 are deployed on physical machine 2, and virtual machine 6, virtual machine 7, virtual machine 8, and virtual machine 9 are deployed on physical machine 3, which is consistent with the above Figure 8The candidate location information 2 shown is consistent, that is, the candidate location information 2 is the determined target location information. Therefore, the generated migration sequence is: 5:7, 4:2, 1:2, 1:7, 5:2, 6:3, 8:3, NA, 4:3, 3:7, 4:7, NA. Among them, 5:7 means migrating virtual machine 1 from physical machine to physical machine 7, 4:2 means migrating virtual machine 2 from physical machine 4 to physical machine 2, and the others also mean migrating the corresponding virtual machines from the original physical machine to the new physical machine. NA means no migration is required. For example, virtual machine 8 and virtual machine 12 do not need to be migrated and are still deployed on physical machine 3 and physical machine 2.
[0137] Furthermore, after generating the virtual machine migration sequence, the migration management controller needs to migrate the virtual machine. It should be noted that for the same physical machine, only one virtual machine can be migrated at a time, and at most two migrations are supported at the same time (i.e., one migration out and one migration in). Therefore, in order to improve the migration efficiency, it can be selected to be divided into multiple rounds for migration, and parallel migration is implemented in each round.
[0138] For example, as mentioned above Fig.10 As shown, the parallel migration of virtual machines is completed in four rounds in total. In the first round, virtual machine 1 is migrated from physical machine 5 to physical machine 7, virtual machine 2 is migrated from physical machine 4 to physical machine 2, and virtual machine 6 is migrated from physical machine 6 to physical machine 3 at the same time; after completion, the second round of migration is carried out, and virtual machine 3 is migrated from physical machine 1 to physical machine 2, virtual machine 7 is migrated from physical machine 8 to physical machine 3, and virtual machine 4 is migrated from physical machine 4 to physical machine 7 at the same time; then the third round of migration is carried out, and virtual machine 4 is migrated from physical machine 1 to physical machine 7, virtual machine 5 is migrated from physical machine 5 to physical machine 2, and virtual machine 9 is migrated from physical machine 4 to physical machine 3 at the same time; finally, the fourth round of migration is carried out, and virtual machine 10 is migrated from physical machine 3 to physical machine 7.
[0139] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, correspondingly, related equipment for cooperating in implementing the above scheme is also provided below.
[0140] See also Fig.11 , Fig.11 is a schematic diagram of a computing device provided in an embodiment of the present application. The computing device may be the above Figure 4 The migration management controller in the method embodiment described above may execute Figure 4 The virtual machine migration method embodiment described herein uses the migration management controller as the execution subject of the method and steps. Fig.11 As shown, the computing device 100 includes a display module 110, a processing module 120 and a migration module 130.
[0141] The display module 110 is used to provide a configuration interface, wherein the configuration interface is used to prompt the user to input preset conditions, wherein the preset conditions are used to constrain the migration mode of the virtual machines in the resource pool;
[0142] A processing module 120 is used to obtain the preset condition from the configuration interface, and determine a virtual machine migration sequence according to the preset condition and information related to virtual machines in the resource pool;
[0143] The migration module 130 is used to migrate the virtual machines in the resource pool according to the virtual machine migration sequence.
[0144] As an embodiment, the preset conditions include the physical machine cluster where the virtual machine to be migrated is located, the weight of the target to be optimized, the virtual machines that cannot be migrated and the physical machines that are prioritized for migration. The targets to be optimized include the virtual machine resource utilization, the physical machine load balancing value and the virtual machine migration overhead.
[0145] As an embodiment, the virtual machine related information in the resource pool includes the current location information and status information of the virtual machine, the current location information is used to indicate the physical machine to which the current virtual machine belongs, and the status information includes the resource demand of the virtual machine, the resource usage of the virtual machine and the resource limit of the physical machine where the virtual machine is located. The processing module 120 is specifically used to: generate multiple candidate location information based on the current location information; select target location information from multiple candidate location information based on the status information, wherein when the virtual machines in the resource pool are distributed on the physical machines in the resource pool according to the target location information, the comprehensive score of the virtual machine resource utilization, virtual machine migration overhead and physical machine load balancing value of the resource pool is the highest; determine the virtual machine migration sequence based on the target location information.
[0146] As an embodiment, the processing module 120 is also used to: input the multiple candidate location information and the status information into a comprehensive scoring function respectively to obtain a comprehensive score; when the comprehensive score meets a threshold condition, the candidate location information corresponding to the comprehensive score that meets the threshold condition is used as the target location information.
[0147] As an embodiment, the processing module 120 is also used to: when the comprehensive score does not meet the threshold condition, select the candidate position information closest to the threshold condition from the candidate position information corresponding to the comprehensive score that does not meet the threshold condition as the parent candidate position information; perform genetic algorithm processing on the parent candidate position information, and input the processing result into the comprehensive scoring function until the comprehensive score output by the comprehensive scoring function meets the threshold condition, and use the candidate position information corresponding to the comprehensive score that meets the threshold condition as the target position information.
[0148] As an embodiment, the comprehensive score includes a virtual machine resource utilization score, a virtual machine migration overhead score, and a physical machine load balancing value score, and the comprehensive score function is:
[0149] F(x)=W u ·F u (x)+W b ·F b (x)+W m ·F m (x)
[0150] Among them, the F u (x) is the virtual machine resource utilization scoring function, and W u For the F u (x) corresponding weight; the F b (x) is the physical machine load balancing value scoring function, and W b For the F b (x) corresponding weight; the F m (x) is the virtual machine migration cost scoring function, and W m For the F m (x) The corresponding weight.
[0151] As an embodiment, the resource requirement of the virtual machine includes the processor requirement, memory requirement, and network requirement of the virtual machine, the resource limit of the physical machine includes the processor limit, memory limit, and network limit of the physical machine, and the virtual machine resource utilization scoring function is:
[0152]
[0153] Among them, the is the processor requirement of the virtual machine, is the processor limit of the physical machine where the virtual machine is located; is the memory requirement of the virtual machine, is the memory limit of the physical machine where the virtual machine is located; is the network demand of the virtual machine, is the network limit of the physical machine where the virtual machine is located; and n is the number of physical machines in the resource pool.
[0154] As an embodiment, the physical machine load balancing value scoring function is:
[0155]
[0156] in, is the processor utilization of the physical machine, is the average processor utilization of the physical machines in the resource pool; is the memory utilization of the physical machine. is the average memory utilization of the physical machines in the resource pool; is the network utilization of the physical machine. is the average network utilization of the physical machines in the resource pool.
[0157] As an embodiment, the virtual machine migration cost scoring function is:
[0158]
[0159] in, is the memory requirement of the virtual machine, t i It is used to indicate whether the virtual machine needs to be migrated from the physical machine where it is located to another physical machine. i The value is 0 or 1, t i When it is 0, it means that the virtual machine does not need to be migrated from the physical machine to another physical machine; i When it is 1, it indicates that the virtual machine needs to be migrated from the physical machine where it is located to another physical machine, and M is the number of virtual machines in the resource pool.
[0160] It can be understood that the display module 110 in the embodiment of the present application can be implemented by a display or display-related circuit components, and the processing module 120 and the migration module 130 can be implemented by a processor or processor-related circuit components.
[0161] It should be noted that the structure of the above computing device is only an example and should not constitute a specific limitation. The modules in the computing device can be increased, reduced or merged as needed. In addition, the operation and / or function of each module in the computing device is to achieve the above Figure 4 For the sake of brevity, the corresponding process of the described method will not be repeated here.
[0162] See also Fig.12 , Fig.12 Schematic diagram of a computing device provided in an embodiment of the present application. Fig.12 As shown, the computing device 200 includes: a processor 210, a communication interface 220 and a memory 230, and the processor 210, the communication interface 220 and the memory 230 are interconnected via an internal bus 240. It should be understood that the computing device 200 can be a computing device in cloud computing, or a computing device in an edge environment.
[0163] The processor 210 may be composed of one or more general-purpose processors, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0164] The bus 240 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 240 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0165] The memory 230 may include a volatile memory, such as a random access memory (RAM); the memory 230 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 230 may also include a combination of the above types. The memory 230 may be used to store programs and data so that the processor 210 can call the program code stored in the memory 230 to implement the above virtual machine migration method. The program code may be used to implement Fig.11 The functional modules of the computing device shown, or used to implement Figure 4 The method steps in the method embodiment shown are performed by a migration management controller.
[0166] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it can implement part or all of the steps of any one of the above method embodiments.
[0167] An embodiment of the present invention further provides a computer program, which includes instructions. When the computer program is executed by a computer, the computer can execute part or all of the steps of any virtual machine migration method.
[0168] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0169] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, some steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0170] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0171] The units described above 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
Claims
1. A virtual machine migration method, characterized in that: include: Providing a configuration interface, the configuration interface is used to prompt the user to enter a preset condition, the preset condition is used to constrain the migration mode of the virtual machine in the resource pool; Acquire the preset condition from the configuration interface, the virtual machine related information in the resource pool includes current location information and status information of the virtual machine, the current location information is used to indicate the physical machine to which the current virtual machine belongs, and the status information includes the resource demand of the virtual machine, the resource usage of the virtual machine and the resource limit of the physical machine where the virtual machine is located; Generate multiple candidate position information according to the current position information, and input the multiple candidate position information and the state information into a comprehensive scoring function to obtain a comprehensive score; When the comprehensive score does not meet the threshold condition, among the candidate position information corresponding to the comprehensive score that does not meet the threshold condition, select the candidate position information closest to the threshold condition as the parent candidate position information; The parent candidate location information is processed by a genetic algorithm, and the processing result is input into the comprehensive scoring function until the comprehensive score output by the comprehensive scoring function meets the threshold condition, and the candidate location information corresponding to the comprehensive score that meets the threshold condition is used as the target location information, wherein the comprehensive score of the virtual machine resource utilization, virtual machine migration overhead and physical machine load balancing value of the resource pool is the highest when the virtual machines of the resource pool are distributed on the physical machines in the resource pool according to the target location information; Determine a virtual machine migration sequence according to the target location information; The virtual machines in the resource pool are migrated according to the virtual machine migration sequence.
2. The method according to claim 1, characterized in that The preset conditions include the physical machine cluster where the virtual machine to be migrated is located, the weight of the target to be optimized, the virtual machines that cannot be migrated and the physical machines that are preferentially migrated. The targets to be optimized include the virtual machine resource utilization, the physical machine load balancing value and the virtual machine migration overhead.
3. The method according to claim 1 or 2, characterized in that Selecting target location information from a plurality of candidate location information according to the state information includes: Inputting the plurality of candidate position information and the state information into a comprehensive scoring function to obtain a comprehensive score; When the comprehensive score meets the threshold condition, the candidate location information corresponding to the comprehensive score meeting the threshold condition is used as the target location information.
4. The method according to claim 1 or 2, characterized in that: The comprehensive score includes the virtual machine resource utilization score, the virtual machine migration overhead score and the physical machine load balancing value score. The comprehensive score function is: F(x)=W u ·F u (x)+W b ·F b (x)+W m ·F m (x) Among them, the F u (x) is the virtual machine resource utilization scoring function, and W u For the F u (x) corresponding weight; the F b (x) is the physical machine load balancing value scoring function, and W b For the F b (x) corresponding weight; the F m (x) is the virtual machine migration cost scoring function, and W m For the F m (x) The corresponding weight.
5. The method according to claim 4, characterized in that The resource requirements of the virtual machine include the processor requirements, memory requirements, and network requirements of the virtual machine. The resource limits of the physical machine include the processor limits, memory limits, and network limits of the physical machine. The virtual machine resource utilization scoring function is: Among them, the is the processor requirement of the virtual machine, is the processor limit of the physical machine where the virtual machine is located; is the memory requirement of the virtual machine, is the memory limit of the physical machine where the virtual machine is located; is the network demand of the virtual machine, is the network limit of the physical machine where the virtual machine is located; and n is the number of physical machines in the resource pool.
6. The method according to claim 4, characterized in that The physical machine load balancing value scoring function is: Among them, the is the processor utilization of the physical machine, is the average processor utilization of the physical machines in the resource pool; is the memory utilization of the physical machine. is the average memory utilization of the physical machines in the resource pool; is the network utilization of the physical machine. is the average network utilization of the physical machines in the resource pool.
7. The method according to claim 4, characterized in that The resource requirement of the virtual machine includes the memory requirement of the virtual machine, and the virtual machine migration cost scoring function is: in, is the memory requirement of the virtual machine, t i It is used to indicate whether the virtual machine needs to be migrated from the physical machine where it is located to another physical machine. i The value is 0 or 1, t i When it is 0, it means that the virtual machine does not need to be migrated from the physical machine to another physical machine; i When it is 1, it indicates that the virtual machine needs to be migrated from the physical machine where it is located to another physical machine, and M is the number of virtual machines in the resource pool.
8. The method according to claim 1 or 2, characterized in that: The configuration interface is also used to prompt the user to input a virtual machine migration cycle, and the virtual machines in the resource pool are periodically migrated according to the virtual machine migration cycle.
9. A computing device, characterized in that include: A display module, used for providing a configuration interface, wherein the configuration interface is used for prompting a user to input preset conditions, wherein the preset conditions are used for constraining a migration mode of a virtual machine in a resource pool; a processing module, configured to obtain the preset condition from the configuration interface, wherein the virtual machine related information in the resource pool includes the current location information and status information of the virtual machine, the current location information is used to indicate the physical machine to which the current virtual machine belongs, and the status information includes the resource demand of the virtual machine, the resource usage of the virtual machine, and the resource limit of the physical machine where the virtual machine is located; generate multiple candidate location information according to the current location information, and input the multiple candidate location information and the status information into a comprehensive scoring function to obtain a comprehensive score; When the comprehensive score does not meet the threshold condition, among the candidate position information corresponding to the comprehensive score that does not meet the threshold condition, the candidate position information closest to the threshold condition is selected as the parent candidate position information; the parent candidate position information is processed by a genetic algorithm, and the processing result is input into the comprehensive scoring function until the comprehensive score output by the comprehensive scoring function meets the threshold condition, and the candidate position information corresponding to the comprehensive score that meets the threshold condition is used as the target position information, wherein when the virtual machines of the resource pool are distributed on the physical machines in the resource pool according to the target position information, the comprehensive score of the virtual machine resource utilization, the virtual machine migration overhead and the physical machine load balancing value of the resource pool is the highest; Determine the virtual machine migration sequence according to the target location information; determine the virtual machine migration sequence according to the preset conditions and the virtual machine related information in the resource pool; A migration module is used to migrate the virtual machines in the resource pool according to the virtual machine migration sequence.
10. The computing device of claim 9, wherein: The preset conditions include the physical machine cluster where the virtual machine to be migrated is located, the weight of the target to be optimized, the virtual machines that cannot be migrated and the physical machines that are preferentially migrated. The targets to be optimized include the virtual machine resource utilization, the physical machine load balancing value and the virtual machine migration overhead.
11. The computing device according to claim 9 or 10, characterized in that: The processing module is further used for: Inputting the plurality of candidate position information and the state information into a comprehensive scoring function to obtain a comprehensive score; When the comprehensive score meets the threshold condition, the candidate location information corresponding to the comprehensive score meeting the threshold condition is used as the target location information.
12. The computing device according to claim 9 or 10, characterized in that The comprehensive score includes the virtual machine resource utilization score, the virtual machine migration overhead score and the physical machine load balancing value score. The comprehensive score function is: F(x)=W u ·F u (x)+W b ·F b (x)+W m ·F m (x) Among them, the F u (x) is the virtual machine resource utilization scoring function, and W u For the F u (x) corresponding weight; the F b (x) is the physical machine load balancing value scoring function, and W b For the F b (x) corresponding weight; the F m (x) is the virtual machine migration cost scoring function, and W m For the F m (x) The corresponding weight.
13. The computing device according to claim 12, characterized in that The resource requirements of the virtual machine include the processor requirements, memory requirements, and network requirements of the virtual machine. The resource limits of the physical machine include the processor limits, memory limits, and network limits of the physical machine. The virtual machine resource utilization scoring function is: Among them, the is the processor requirement of the virtual machine, is the processor limit of the physical machine where the virtual machine is located; is the memory requirement of the virtual machine, is the memory limit of the physical machine where the virtual machine is located; is the network demand of the virtual machine, is the network limit of the physical machine where the virtual machine is located; and n is the number of physical machines in the resource pool.
14. The computing device according to claim 12, wherein: The physical machine load balancing value scoring function is: Among them, the is the processor utilization of the physical machine, is the average processor utilization of the physical machines in the resource pool; is the memory utilization of the physical machine. is the average memory utilization of the physical machines in the resource pool; is the network utilization of the physical machine. is the average network utilization of the physical machines in the resource pool.
15. The computing device according to claim 12, wherein: The resource requirement of the virtual machine includes the memory requirement of the virtual machine, and the virtual machine migration cost scoring function is: in, is the memory requirement of the virtual machine, t i It is used to indicate whether the virtual machine needs to be migrated from the physical machine where it is located to another physical machine. i The value is 0 or 1, t i When it is 0, it means that the virtual machine does not need to be migrated from the physical machine to another physical machine; i When it is 1, it indicates that the virtual machine needs to be migrated from the physical machine where it is located to another physical machine, and M is the number of virtual machines in the resource pool.
16. The computing device of claim 9 or 10, wherein: The configuration interface is also used to prompt the user to input a virtual machine migration cycle, and the virtual machines in the resource pool are periodically migrated according to the virtual machine migration cycle.
17. A computing device, characterized in that The computing device includes a processor and a memory, wherein the processor and the memory are connected via an internal bus, the memory stores instructions, and the processor calls the instructions in the memory to execute the method according to any one of claims 1 to 8.
18. A computer storage medium storing a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
19. A computer program product, the computer program comprising instructions, which, when executed by a computer, causes the computer to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Application-oriented dynamic resource allocation method for IaaS (Infrastructure As A Service) layer
CN104679595A