Virtual machine migration method and related products
By monitoring and predicting the resource load of host nodes in the data center, selecting appropriate sets of migrating and migrating nodes, and migrating virtual machines, the problem of uneven virtual machine allocation between host nodes is solved and resource utilization is improved rate and business processing efficiency.
Patent Information
- Application Number
- CN202111622311.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In the data center, the virtual machine allocation between host nodes is uneven, resulting in node resources scrambling, which may lead to node overload, affect business processing and even lead to business interruption.
By monitoring resource load for multiple host nodes, predicting the load status on each resource dimension, filtering out the migrated node collection and migrating node collection, and migrating virtual machines based on matching detection results to achieve reasonable virtual machine allocation and Resource utilization.
Reasonable virtual machine allocation between host nodes is realized, the risk of resource overload is reduced, business processing efficiency is improved, and business interruption is avoided.
Smart Images

Figure CN114265668B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to a virtual machine migration method, a virtual machine migration device, a computer-readable medium, an electronic device, and a computer program product. Background Art
[0002] When creating and allocating virtual machines on multiple host nodes, data centers only consider whether the resources of the host nodes meet the needs of the virtual machines, which can easily lead to uneven distribution of virtual machines among nodes. The resources required by the virtual machines in the host nodes are adjusted as the business scale changes. When there are too many virtual machines on a single node, the node will often be overloaded due to competition for node resources, affecting business processing and even causing business interruption in serious cases. Summary of the invention
[0003] The purpose of the present application is to provide a virtual machine migration method, a virtual machine migration device, a computer-readable medium, an electronic device and a computer program product, which can at least to some extent overcome the technical problem of unreasonable allocation of virtual machines between host nodes existing in the related art.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a virtual machine migration method is provided, the method comprising:
[0006] Performing resource load monitoring on multiple host nodes to obtain load prediction values of each of the host nodes in multiple resource dimensions;
[0007] Predicting the load status of the host node in each resource dimension according to the load prediction value;
[0008] Screening the plurality of host nodes according to the load status to obtain a set of migrated-out nodes and a set of migrated-in nodes corresponding to each of the resource dimensions;
[0009] A matching detection is performed on the set of nodes to be migrated out and the set of nodes to be migrated in corresponding to the same resource dimension, and virtual machine migration is performed on the host node according to the matching detection result.
[0010] According to one aspect of an embodiment of the present application, a virtual machine migration device is provided, the device comprising:
[0011] A monitoring module is configured to monitor resource loads of multiple host nodes to obtain load prediction values of each of the host nodes in multiple resource dimensions;
[0012] A prediction module, configured to predict the load status of the host node in each resource dimension according to the load prediction value;
[0013] A screening module is configured to screen the plurality of host nodes according to the load status to obtain a set of migrated-out nodes and a set of migrated-in nodes corresponding to each of the resource dimensions;
[0014] The migration module is configured to perform a matching detection on a set of migrated-out nodes and a set of migrated-in nodes corresponding to the same resource dimension, and perform virtual machine migration on the host node according to the matching detection result.
[0015] In some embodiments of the present application, based on the above technical solution, the monitoring module may further include:
[0016] A real-time monitoring module is configured to monitor the resource load of multiple host nodes to obtain real-time resource load values of the host nodes in multiple resource dimensions;
[0017] A period acquisition module is configured to acquire a plurality of historical time periods corresponding to a current time node;
[0018] The load prediction module is configured to predict the load prediction value of the host node in multiple resource dimensions based on the real-time resource load values recorded in each of the historical time periods.
[0019] In one embodiment of the present application, the resource dimension includes at least two of CPU utilization, memory utilization or bandwidth utilization.
[0020] In one embodiment of the present application, based on the above technical solution, the prediction module may further include:
[0021] A threshold acquisition module is configured to acquire an upper threshold and a lower threshold corresponding to the resource dimension;
[0022] an overload determination module, configured to determine that the load state of the host node in the resource dimension is an overload state if the load prediction value is greater than the high threshold;
[0023] a low-load determination module, configured to determine that the load state of the host node in the resource dimension is a low-load state if the load prediction value is less than the low threshold;
[0024] The suitable load determination module is configured to determine that the load state of the host node in the resource dimension is a suitable load state if the load prediction value is less than the upper threshold and greater than the lower threshold.
[0025] In one embodiment of the present application, based on the above technical solution, the screening module may further include:
[0026] an overload screening module, configured to screen host nodes whose load status on the resource dimension is an overload status, and group the host nodes in the overload status into a migration node set corresponding to the resource dimension;
[0027] The low-load screening module is configured to screen host nodes whose load status on the resource dimension is a low-load status, and group the host nodes in the low-load status into a migration node set corresponding to the resource dimension.
[0028] In one embodiment of the present application, based on the above technical solution, the migration module may further include:
[0029] A ratio acquisition module is configured to acquire the resource occupancy ratio of each virtual machine on the host node in the set of migrated-out nodes and the set of migrated-in nodes corresponding to the same resource dimension;
[0030] A migration marking module is configured to mark the virtual machine with the highest resource occupancy ratio on each host node in the migration-out node set as a virtual machine to be migrated;
[0031] A node search module is configured to search the set of migration nodes for a target host node that matches the resource requirements of the virtual machine to be migrated;
[0032] The virtual machine migration module is configured to migrate the virtual machine to be migrated to the target host node.
[0033] In one embodiment of the present application, the node search module can be further configured to: determine whether the virtual machine to be migrated belongs to one or more outgoing node sets; if the virtual machine to be migrated belongs to one outgoing node set, then search for a target host node that matches the resource requirements of the virtual machine to be migrated in the incoming node set corresponding to the outgoing node set; if the virtual machine to be migrated belongs to multiple outgoing node sets, then obtain multiple incoming node sets corresponding to the multiple outgoing node sets, and search for a target host node that matches the resource requirements of the virtual machine to be migrated in the multiple incoming node sets.
[0034] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the virtual machine migration method in the above technical solution is implemented.
[0035] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the virtual machine migration method in the above technical solution by executing the executable instructions.
[0036] According to one aspect of an embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the virtual machine migration method in the above technical solution.
[0037] In the technical solution provided in the embodiment of the present application, by monitoring the resource load of multiple host nodes in multiple dimensions, it is possible to predict in each resource dimension whether each host node will be at risk of overload in the next time period. According to the predicted load status, the host nodes can be screened and a set of outgoing nodes and a set of incoming nodes corresponding to each resource dimension can be formed. After matching detection is performed on the set of outgoing nodes and the set of incoming nodes corresponding to the same resource dimension, virtual machine migration can be performed on the host node according to the matching detection result. Therefore, reasonable virtual machine allocation can be achieved between host nodes, reducing the risk of resource overload in the host node and improving the business processing efficiency of the host node.
[0038] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A target-guided automated online migration system for heterogeneous node virtual machines proposed in an embodiment of the present application is shown.
[0041] Figure 2 A flowchart of the steps of a virtual machine migration method in one embodiment of the present application is shown.
[0042] Figure 3 A flowchart showing the steps of performing resource load monitoring on multiple host nodes in one embodiment of the present application is shown.
[0043] Figure 4 A flowchart of the steps of performing set matching detection in one embodiment of the present application is shown.
[0044] Figure 5 A schematic diagram of a target-guided virtual machine migration node screening and matching strategy in one embodiment of the present application is shown.
[0045] Figure 6 The structural block diagram of the virtual machine migration device provided in an embodiment of the present application is schematically shown.
[0046] Figure 7 The structure block diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0048] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0049] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0050] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0051] The embodiment of the present application relates to a data center implemented based on cloud technology, which is used to migrate virtual machines between multiple host nodes in the data center, thereby improving the rationality of virtual machine distribution.
[0052] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, each item may have its own identification mark in the future, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0053] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's point of view, the resources in the "cloud" can be infinitely expanded, and can be obtained at any time, used on demand, expanded at any time, and paid for by use. As a basic capability provider for cloud computing, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0054] In order to solve the problem of business operations being affected or even interrupted due to unreasonable distribution of virtual machines between host nodes, the virtual machines in the host nodes can be automatically migrated online according to the load changes of each host node.
[0055] To achieve automatic online migration of virtual machines in overloaded nodes, it is necessary to monitor the resource usage of each node and determine the node overload, and on the other hand, it is necessary to select a suitable target node for the virtual machines in the overloaded node to migrate. With the development of technology and the differences in implementation methods of various manufacturers, server nodes from different procurement batches in the data center have led to heterogeneous resource models. Using a unified resource standard to describe the resource usage of heterogeneous nodes will cause great waste; the selection of migration target nodes also needs to consider the best matching principle to improve overall resource utilization.
[0056] In the related technologies of this application, most of the systems for automated online migration of virtual machines determine whether a node is overloaded based on a method of comparing a single resource usage quantity with a high threshold, and then select a node from a specified migration node set as the target node for the virtual machine to be migrated. These systems do not consider multi-dimensional monitoring of node resource usage, resource abstraction of heterogeneous nodes, node load prediction, and optimal matching of migration target nodes during use, which will cause misjudgment of heterogeneous node overload, inaccurate selection of migration target nodes, and further lead to problems such as an increase in invalid migration times and uneven node resource allocation in the data center.
[0057] In response to the above-mentioned related issues, the embodiments of the present application monitor the multi-resource utilization rate of heterogeneous nodes rather than the resource usage quantity, which not only realizes the resource abstraction of heterogeneous nodes, but also realizes multi-dimensional monitoring of the resource usage of each node; defines a virtual machine migration decision module that combines dual thresholds and predicted values of each resource load, and the setting principle of high and low dual thresholds can provide a more accurate description of the node load situation. The intra-node virtual machine migration decision method based on the comparison between the node's next cycle load prediction value and the dual threshold value can reduce the number of invalid migrations while ensuring the service quality; designs a target-guided virtual machine migration node screening and matching strategy, distinguishes the migration host set according to the prediction results of specific resource types and resource load status, and actively matches the specific resource low-load host node as the target node to guide the migration of the virtual machine to be migrated. This method can select the best migration target node for the node in the scenario when the node is overloaded, facing different resource type overload scenarios, so that the node resources inside the data center can be more reasonably and balanced. Utilization.
[0058] Figure 1 The embodiment of the present application shows a target-guided heterogeneous node virtual machine automated online migration system, which can mainly include a node multi-resource load monitoring module, a node virtual machine migration judgment module, a migration target node screening and matching module, and a virtual machine migration control module. The system can realize the accurate load judgment of heterogeneous nodes combined with dual thresholds (high threshold and low threshold) and resource load prediction, the active matching of migration target nodes based on target guidance, and the ability of automated online migration of virtual machines, and solve the problems of node overload misjudgment and inaccurate selection of migration target nodes in the existing system, which leads to an increase in invalid migration times and uneven node resource allocation in the data center.
[0059] Data center heterogeneous host node module: includes host nodes with homogeneous or heterogeneous resource configurations and the virtual machines running on them.
[0060] Node multi-resource load monitoring module: responsible for real-time monitoring and feedback of the utilization of multiple specific resources of heterogeneous host nodes in the data center. Monitor the utilization load indicators of various resources such as CPU, memory and bandwidth of heterogeneous nodes respectively, and realize multi-dimensional real-time feedback of the usage of each node in the data center. Use resource utilization instead of resource usage quantity as load monitoring indicator to realize resource abstraction of heterogeneous nodes.
[0061] Virtual machine migration decision module: Determine whether the node needs to migrate virtual machines based on the node-specific resource load prediction value and the corresponding dual thresholds. Set high and low thresholds for multiple resources of each node; analyze the load conditions of different resources of the node in multiple cycles, and predict the load prediction value of each resource of the node in the next cycle; compare this value with the corresponding resource dual thresholds to predict the load status of the node-specific resources (overload, moderate load and underload), and determine whether the node needs to perform the corresponding virtual machine migration operation for the specific resource;
[0062] Migration target node screening and matching module: responsible for distinguishing specific resource migration in and out of the host set; the virtual machine with the most corresponding resource occupancy in the node of the specific resource migration out host set is used as the virtual machine to be migrated; the target-guided virtual machine migration node screening and matching strategy designed in the embodiment of the present application is used to guide the virtual machine to be migrated to the best target node by actively matching the specific resource migration in host set nodes. The implementation principle of the target-guided virtual machine migration node screening and matching strategy is mainly to first distinguish the migration host set according to the prediction results of the specific resource type and resource load status, add the specific resource low-load node to the corresponding resource migration in host set, add the specific resource low-load node to the corresponding resource migration out host set, and then guide the virtual machine to be migrated to the best target node by actively matching the corresponding resource low-load node, so as to optimize the problem of uneven resource allocation between nodes in the data center;
[0063] Migration control module: responsible for receiving matched migration requests, converting them into cloud management platform API requests and automatically calling them to complete the migration. Responsible for receiving migration requests that have matched the virtual machine to be migrated and the migration target node, converting the request into the corresponding API of the cloud management platform online migration function, and automatically calling the cloud management platform interface to complete the online migration of the virtual machine.
[0064] Cloud management platform: The resource scheduling function module of the data center, responsible for receiving API requests and completing online migration operations.
[0065] The method for performing virtual machine migration in an application scenario by the online migration system provided in an embodiment of the present application may include the following multiple steps.
[0066] (1) The node multi-resource load monitoring module monitors and provides feedback on multiple specific resource loads of each node in real time.
[0067] (2) The node virtual machine migration decision module first analyzes the multi-resource load values of the node in multiple cycle times and obtains the predicted value of each resource load in the next cycle time.
[0068] (3) The predicted value of the specific resource load is then compared with the upper threshold and the lower threshold respectively. If it is greater than the upper threshold, it means that the corresponding resource of the node is overloaded and the corresponding resource virtual machine needs to be migrated out to reduce the load. If it is less than the lower threshold, it means that the corresponding resource of the node is not fully utilized and the corresponding resource virtual machine can be migrated in. If it is within the threshold range, it means that the node is appropriately loaded and the virtual machines in the node do not need to be migrated.
[0069] (4) The migration target node screening and matching module first divides each node into the corresponding resource migration set according to the threshold judgment result.
[0070] (5) Then, for the nodes in the migration set, select the virtual machine with the highest resource occupancy ratio as the virtual machine to be migrated.
[0071] (6) Finally, a target-guided virtual machine migration node screening and matching strategy is used to enable the target node to actively match the virtual machine to be migrated.
[0072] (7) The final control module converts the matched host migration request into the cloud management platform hot migration API to complete the online migration of the virtual machine to be migrated.
[0073] The following is a detailed description of the technical solutions such as the virtual machine migration method, virtual machine migration device, computer-readable medium, electronic device, and computer program product provided by the present application in conjunction with specific implementation methods.
[0074] Figure 2 A flowchart of the steps of a virtual machine migration method in one embodiment of the present application is shown. Figure 2 As shown, the virtual machine migration method may mainly include the following steps S210 to S240.
[0075] Step S210: monitoring resource loads of multiple host nodes to obtain load prediction values of each host node in multiple resource dimensions;
[0076] Step S220: predicting the load status of the host node in each resource dimension according to the load prediction value;
[0077] Step S230: screening multiple host nodes according to the load status to obtain a set of migrated-out nodes and a set of migrated-in nodes corresponding to each resource dimension;
[0078] Step S240: performing a match detection on the set of nodes to be migrated out and the set of nodes to be migrated in corresponding to the same resource dimension, and performing virtual machine migration on the host node according to the match detection result.
[0079] In the virtual machine migration method provided in the embodiment of the present application, by monitoring the resource load of multiple host nodes in multiple dimensions, it is possible to predict in each resource dimension whether each host node will be at risk of overload in the next time period. According to the predicted load status, the host nodes can be screened and a set of outgoing nodes and a set of incoming nodes corresponding to each resource dimension can be formed. After matching detection is performed on the set of outgoing nodes and the set of incoming nodes corresponding to the same resource dimension, the host node can be migrated according to the matching detection result. Therefore, reasonable virtual machine allocation can be achieved between host nodes, reducing the risk of resource overload in the host node and improving the business processing efficiency of the host node.
[0080] The following describes in detail each step of the virtual machine migration method.
[0081] In step S210, resource load monitoring is performed on multiple host nodes to obtain load prediction values of each host node in multiple resource dimensions.
[0082] Figure 3 FIG. 1 is a flowchart showing the steps of monitoring resource loads of multiple host nodes in one embodiment of the present application. Figure 3 As shown, based on the above embodiment, step S210 may further include the following steps S310 to S330.
[0083] Step S310: monitor the resource load of multiple main nodes to obtain real-time resource load values of the host nodes in multiple resource dimensions.
[0084] In one embodiment of the present application, the resource dimension may include at least two of CPU utilization, memory utilization, or bandwidth utilization. According to the virtual machine structure of each host node, the resource dimension corresponding to the virtual machine structure may be monitored, and any two host nodes may have the same virtual machine structure or different virtual machine structures.
[0085] Step S320: Acquire multiple historical time periods corresponding to the current time node.
[0086] In one embodiment of the present application, multiple parallel sliding windows are used to determine the historical time period corresponding to the current time node, and each historical time period may have the same or different period lengths.
[0087] Step S330: predicting load prediction values of the host node in multiple resource dimensions based on the real-time resource load values recorded in each historical time period.
[0088] In one embodiment of the present application, the load average value in each historical time period can be determined based on the real-time resource load values recorded at each time point in each historical time period, and the load average values of multiple historical time periods are weighted and summed according to preset prediction weights to obtain the load prediction value of the host node in the next future time period.
[0089] In one embodiment of the present application, the prediction weight can be determined according to the cycle length of the historical time period and the time interval with the current time node. The prediction weight of the historical time period is negatively correlated with the time interval from the current time node and positively correlated with the cycle length. The smaller the time interval of the historical time period, the closer the business processing state of the host node is, so a larger prediction weight can be assigned to it to increase its influence; the smaller the cycle length of the historical time period, the worse the stability of the state change of the host node, so a smaller prediction weight can be assigned to it to reduce its influence. Specifically, the farther the historical time period from the current time node is, the smaller the prediction weight is, and the closer the historical time period is to the current time node, the larger the prediction weight is. The longer the cycle length of the historical time period has a larger prediction weight, and the shorter the cycle length of the historical time period has a smaller prediction weight.
[0090] In step S220, the load status of the host node in each resource dimension is predicted according to the load prediction value.
[0091] In one embodiment of the present application, an upper threshold and a lower threshold corresponding to the resource dimension are obtained; if the load prediction value is greater than the upper threshold, the load state of the host node in the resource dimension is determined to be an overload state; if the load prediction value is less than the lower threshold, the load state of the host node in the resource dimension is determined to be an underload state; if the load prediction value is less than the upper threshold and greater than the lower threshold, the load state of the host node in the resource dimension is determined to be a suitable load state.
[0092] In step S230, multiple host nodes are screened according to the load status to obtain a set of migrated-out nodes and a set of migrated-in nodes corresponding to each resource dimension.
[0093] In one embodiment of the present application, host nodes whose load status in the resource dimension is an overloaded state are screened, and the host nodes in the overloaded state are organized into a set of migrated nodes corresponding to the resource dimension; host nodes whose load status in the resource dimension is an underloaded state are screened, and the host nodes in the underloaded state are organized into a set of migrated nodes corresponding to the resource dimension.
[0094] In step S240, a matching detection is performed on the set of nodes to be migrated out and the set of nodes to be migrated in corresponding to the same resource dimension, and virtual machine migration is performed on the host node according to the matching detection result.
[0095] Figure 4 FIG. 1 is a flowchart showing the steps of performing set matching detection in one embodiment of the present application. Figure 4 As shown, based on the above embodiment, step S240 may further include the following steps S410 to S440.
[0096] Step S410: obtaining the resource occupancy ratio of each virtual machine on the host node in the set of migrated-out nodes and the set of migrated-in nodes corresponding to the same resource dimension.
[0097] There are multiple virtual machines distributed on a host node. By monitoring the resource usage status of each virtual machine, the resource usage ratio of each virtual machine can be obtained. For example, the CPU, memory, bandwidth and other resources of the host node can be allocated to each virtual machine distributed on the host node according to business needs, and each resource can determine the resource usage ratio of each virtual machine.
[0098] Step S420: In the set of nodes to be migrated, mark the virtual machine with the highest resource occupancy ratio on each host node as a virtual machine to be migrated.
[0099] In one embodiment of the present application, multiple virtual machines distributed on the host node can be sorted according to the resource occupancy ratio of each resource dimension. The virtual machine with the highest resource occupancy ratio has the greatest contribution to the resource load of the host node, so the virtual machine with a high resource occupancy ratio is preferentially marked as the virtual machine to be migrated.
[0100] Step S430: searching the set of migration nodes for a target host node that matches the resource requirements of the virtual machine to be migrated.
[0101] In one embodiment of the present application, it is determined whether the virtual machine to be migrated belongs to one or more out-of-node sets; if the virtual machine to be migrated belongs to one out-of-node set, a target host node that matches the resource requirements of the virtual machine to be migrated is searched in the in-node set corresponding to the out-of-node set; if the virtual machine to be migrated belongs to multiple out-of-node sets, multiple in-node sets corresponding to the multiple out-of-node sets are obtained, and a target host node that matches the resource requirements of the virtual machine to be migrated is searched in the multiple in-node sets.
[0102] Step S440: Migrate the virtual machine to be migrated to the target host node.
[0103] The target host node may initiate a virtual machine migration request to the current host node where the virtual machine to be migrated is located, thereby guiding the virtual machine to be migrated to be automatically migrated to the target host node.
[0104] Figure 5 A schematic diagram of a target-guided virtual machine migration node screening and matching strategy in one embodiment of the present application is shown.
[0105] like Figure 5 As shown, the embodiment of the present application can first compare the multi-resource load prediction value of the next cycle with the high threshold and the low threshold respectively: if the load prediction value of a specific resource of the node (such as the CPU utilization prediction value) is greater than the high threshold of the specific resource of the node (such as the CPU high threshold), it means that the load of the resource of the node will be overloaded within the next one-week cycle, and the node is added to the specific resource migration host set (such as the CPU migration host set); if the load prediction value of a specific resource of the node (such as the CPU utilization prediction value) is less than the high threshold of the specific resource of the node (such as the CPU low threshold), it means that the load of the resource of the node is not fully utilized within the next one-week cycle, and the node is added to the specific resource migration host set (such as the CPU migration host set); if it is between the double thresholds, it means that the node is underloaded within the next one-week cycle, and the virtual machines in the node do not need to be migrated online.
[0106] The virtual machine with the highest resource occupancy rate running in the node in the migration host set (such as the virtual machine VM1 with the highest CPU occupancy rate running in node A in the CPU migration set) is selected as the virtual machine to be migrated.
[0107] The node with the lowest resource utilization in the migration host set and that meets the resource requirements of the migrated virtual machine (such as node B with the lowest CPU resource utilization in the CPU migration set, and the remaining CPU specifications of node B meet the CPU specifications required by VM1) actively matches the migration target, becomes the virtual machine migration target node, and guides the virtual machine migration.
[0108] When a host is in two or more resource migration sets at the same time (such as being in both the CPU and memory migration sets), you can first screen whether there are hosts in the same situation in each corresponding resource migration set (such as the migration node is in both the CPU and memory migration sets). If so, active matching is successful. If there is only one host in a specific resource set (such as the CPU migration set), select another host in the set with the lowest resource utilization and that can meet the virtual machine resource requirements for active matching (such as the node with the lowest memory utilization in the CPU migration set and the remaining memory specification that meets the memory specifications required by the virtual machine VM1 to be migrated).
[0109] If there is no host in the migration set of the corresponding resource, the host with the lowest corresponding resource utilization and meeting the virtual machine resource requirements among all suitable hosts is selected as the target node.
[0110] The embodiments of the present application are applicable to scenarios of automatic online migration of business virtual machines within nodes when load balancing is performed on nodes in a data center with heterogeneous resource models. By monitoring multiple resource utilization load indicators of each heterogeneous node, multi-dimensional real-time feedback of the status of each node in the data center and resource abstraction of heterogeneous nodes can be achieved; the node migration judgment method based on double thresholds and load prediction value comparison not only ensures the accuracy of virtual machine migration within the node and reduces the number of invalid migrations, but also distinguishes different migration sets for different resource types; the target-guided virtual machine migration node screening and matching strategy designed in the embodiments of the present application is used, and the best target node actively matches the virtual machine to be migrated and guides its migration. Automatic online adjustment of virtual machines when the load of heterogeneous nodes in the resource model changes can be achieved to avoid node overload affecting the quality of business services, optimize the problem of uneven resource configuration of heterogeneous nodes in the data center, and improve resource utilization.
[0111] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0112] The following introduces an apparatus embodiment of the present application, which can be used to execute the virtual machine migration method in the above-mentioned embodiment of the present application. Figure 6 The structure block diagram of the virtual machine migration device provided in the embodiment of the present application is schematically shown. Figure 6 As shown, the virtual machine migration device 600 may mainly include:
[0113] The monitoring module 610 is configured to monitor resource loads of multiple host nodes and obtain load prediction values of each of the host nodes in multiple resource dimensions;
[0114] A prediction module 620 is configured to predict the load status of the host node in each resource dimension according to the load prediction value;
[0115] A screening module 630 is configured to screen the plurality of host nodes according to the load status to obtain a set of migrated-out nodes and a set of migrated-in nodes corresponding to each of the resource dimensions;
[0116] The migration module 640 is configured to perform a match detection on a set of migrated-out nodes and a set of migrated-in nodes corresponding to the same resource dimension, and perform virtual machine migration on the host node according to the match detection result.
[0117] In one embodiment of the present application, the monitoring module 610 may further include:
[0118] A real-time monitoring module is configured to monitor the resource load of multiple host nodes to obtain real-time resource load values of the host nodes in multiple resource dimensions;
[0119] A period acquisition module is configured to acquire a plurality of historical time periods corresponding to a current time node;
[0120] The load prediction module is configured to predict the load prediction value of the host node in multiple resource dimensions based on the real-time resource load values recorded in each of the historical time periods.
[0121] In one embodiment of the present application, the resource dimension includes at least two of CPU utilization, memory utilization or bandwidth utilization.
[0122] In one embodiment of the present application, the prediction module 620 may further include:
[0123] A threshold acquisition module is configured to acquire an upper threshold and a lower threshold corresponding to the resource dimension;
[0124] an overload determination module, configured to determine that the load state of the host node in the resource dimension is an overload state if the load prediction value is greater than the high threshold;
[0125] a low-load determination module, configured to determine that the load state of the host node in the resource dimension is a low-load state if the load prediction value is less than the low threshold;
[0126] The suitable load determination module is configured to determine that the load state of the host node in the resource dimension is a suitable load state if the load prediction value is less than the upper threshold and greater than the lower threshold.
[0127] In one embodiment of the present application, the screening module 630 may further include:
[0128] an overload screening module, configured to screen host nodes whose load status on the resource dimension is an overload status, and group the host nodes in the overload status into a migration node set corresponding to the resource dimension;
[0129] The low-load screening module is configured to screen host nodes whose load status on the resource dimension is a low-load status, and group the host nodes in the low-load status into a migration node set corresponding to the resource dimension.
[0130] In one embodiment of the present application, the migration module 640 may further include:
[0131] A ratio acquisition module is configured to acquire the resource occupancy ratio of each virtual machine on the host node in the set of migrated-out nodes and the set of migrated-in nodes corresponding to the same resource dimension;
[0132] A migration marking module is configured to mark the virtual machine with the highest resource occupancy ratio on each host node in the migration-out node set as a virtual machine to be migrated;
[0133] A node search module is configured to search the set of migration nodes for a target host node that matches the resource requirements of the virtual machine to be migrated;
[0134] The virtual machine migration module is configured to migrate the virtual machine to be migrated to the target host node.
[0135] In one embodiment of the present application, the node search module can be further configured to: determine whether the virtual machine to be migrated belongs to one or more outgoing node sets; if the virtual machine to be migrated belongs to one outgoing node set, then search for a target host node that matches the resource requirements of the virtual machine to be migrated in the incoming node set corresponding to the outgoing node set; if the virtual machine to be migrated belongs to multiple outgoing node sets, then obtain multiple incoming node sets corresponding to the multiple outgoing node sets, and search for a target host node that matches the resource requirements of the virtual machine to be migrated in the multiple incoming node sets.
[0136] The specific details of the virtual machine migration device provided in each embodiment of the present application have been described in detail in the corresponding method embodiment and will not be repeated here.
[0137] Figure 7 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.
[0138] It should be noted that Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0139] like Figure 7As shown, the computer system 700 includes a central processing unit 701 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 702 (ROM) or the program loaded from the storage part 708 to the random access memory 703 (RAM). Various programs and data required for system operation are also stored in the random access memory 703. The central processing unit 701, the read-only memory 702 and the random access memory 703 are connected to each other through a bus 704. An input / output interface 705 (Input / Output interface, i.e., I / O interface) is also connected to the bus 704.
[0140] The following components are connected to the input / output interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0141] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processor 701, various functions defined in the system of the present application are executed.
[0142] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0143] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0144] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0145] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0146] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0147] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A virtual machine migration method, characterized in that: include: Performing resource load monitoring on multiple host nodes to obtain load prediction values of each of the host nodes in multiple resource dimensions; Predicting the load status of the host node in each resource dimension according to the load prediction value; Screening the plurality of host nodes according to the load status to obtain a set of migrated-out nodes and a set of migrated-in nodes corresponding to each of the resource dimensions; In the set of migrated nodes and the set of migrated nodes corresponding to the same resource dimension, obtaining the resource occupation ratio of each virtual machine on the host node; In the set of nodes to be migrated, marking the virtual machines with the highest resource occupancy ratio on each host node as virtual machines to be migrated; Determine whether the virtual machine to be migrated belongs to one or more migration-out node sets; If the virtual machine to be migrated belongs to a migration-out node set, searching for a target host node that matches the resource requirements of the virtual machine to be migrated in a migration-in node set corresponding to the migration-out node set; If the virtual machine to be migrated belongs to multiple outgoing node sets, multiple incoming node sets corresponding to the multiple outgoing node sets are obtained, and a target host node matching the resource requirements of the virtual machine to be migrated is searched in the multiple incoming node sets; Migrate the virtual machine to be migrated to the target host node.
2. The virtual machine migration method according to claim 1, characterized in that: Monitoring resource loads of multiple host nodes to obtain load prediction values of each of the host nodes in multiple resource dimensions includes: Perform resource load monitoring on multiple main nodes to obtain real-time resource load values of the host nodes in multiple resource dimensions; Get multiple historical time periods corresponding to the current time node; The load prediction values of the host node in multiple resource dimensions are predicted according to the real-time resource load values recorded in each of the historical time periods.
3. The virtual machine migration method according to claim 1, characterized in that: The resource dimension includes at least two of CPU utilization, memory utilization or bandwidth utilization.
4. The virtual machine migration method according to claim 1, characterized in that: Predicting the load status of the host node in each resource dimension according to the load prediction value includes: Obtaining an upper threshold and a lower threshold corresponding to the resource dimension; If the load prediction value is greater than the high threshold, determining that the load state of the host node in the resource dimension is an overload state; If the load prediction value is less than the low threshold, determining that the load state of the host node in the resource dimension is a low load state; If the load prediction value is smaller than the upper threshold value and larger than the lower threshold value, it is determined that the load state of the host node in the resource dimension is a suitable load state.
5. The virtual machine migration method according to claim 4, characterized in that: The plurality of host nodes are screened according to the load status to obtain a set of migrated-out nodes and a set of migrated-in nodes corresponding to each of the resource dimensions, including: Screening host nodes whose load status in the resource dimension is an overloaded state, and grouping the overloaded host nodes into a migration node set corresponding to the resource dimension; Host nodes whose load status in the resource dimension is a low-load status are screened, and the host nodes in the low-load status are grouped into a migration node set corresponding to the resource dimension.
6. A virtual machine migration device, characterized in that: include: A monitoring module is configured to monitor resource loads of multiple host nodes to obtain load prediction values of each of the host nodes in multiple resource dimensions; A prediction module, configured to predict the load status of the host node in each resource dimension according to the load prediction value; A screening module is configured to screen the plurality of host nodes according to the load status to obtain a set of migrated-out nodes and a set of migrated-in nodes corresponding to each of the resource dimensions; The migration module is configured to obtain the resource occupancy ratio of each virtual machine on the host node in the outgoing node set and the incoming node set corresponding to the same resource dimension; mark the virtual machine with the highest resource occupancy ratio on each host node as the virtual machine to be migrated in the outgoing node set; determine whether the virtual machine to be migrated belongs to one or more outgoing node sets; if the virtual machine to be migrated belongs to one outgoing node set, search for a target host node that matches the resource demand of the virtual machine to be migrated in the incoming node set corresponding to the outgoing node set; if the virtual machine to be migrated belongs to multiple outgoing node sets, obtain multiple incoming node sets corresponding to the multiple outgoing node sets, and search for a target host node that matches the resource demand of the virtual machine to be migrated in the multiple incoming node sets; migrate the virtual machine to be migrated to the target host node.
7. A computer-readable medium, characterized in that The computer readable medium stores a computer program, and when the computer program is executed by a processor, the virtual machine migration method according to any one of claims 1 to 5 is implemented.
8. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to enable the electronic device to perform the virtual machine migration method described in any one of claims 1 to 5 by executing the executable instructions.
9. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the virtual machine migration method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and system for migrating virtual machine under random load
CN109062669A