Virtual machine migration method, device, electronic device and storage medium
By optimizing the migration based on the traffic correlation value of the virtual machine in the node network, the problem of long network topology distance during virtual machine migration in the existing technology is solved, and the effect of reducing the node network load and improving the service quality is achieved.
Patent Information
- Application Number
- CN202111519104.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-13
AI Technical Summary
The existing automated online migration method of virtual machines is mainly based on the utilization rate of node physical resources. As a result, the communication relationship between virtual machines in the node network is ignored, which results in the distance of the network topology during virtual machine migration, increased communication loss, and poor service quality. reduce.
Migrate according to the traffic correlation value of each virtual machine in the overloaded node. By calculating the correlation between the virtual machine and other virtual machines, uplink switches and cross-switches, the migration priority is determined, and the migration is performed in sequence until the node load is less than Preset threshold.
Effectively reduce the node network load, reduce communication losses caused by the distance between virtual machines in the network topology, improve service quality, and optimize the distribution of virtual machines to reduce communication losses.
Smart Images

Figure CN114035906B
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to a virtual machine migration method, device, electronic device and storage medium. Background Art
[0002] The allocation and creation of virtual machines on each physical node in the node network generally only considers whether the node resources meet the needs of the virtual machine. This method easily leads to uneven distribution of virtual machines between nodes, and the business network load (north-south traffic) of virtual machines in a single node often changes with the change of user scale. When the overall business network load of the node is too large, it will affect the communication capability and service quality of each virtual machine in the node, and even cause business interruption. Using the migration of virtual machines in the business network overload node is an effective way to solve the above problems.
[0003] Most of the existing methods for automated online migration of virtual machines use the node physical resource utilization as the decision standard for virtual machine migration. When the node network is in use, there is often a communication relationship between multiple virtual machines, that is, multiple virtual machines communicate with each other and jointly provide external services. For example, a large software application is split into multiple simple container applications that can be deployed independently. These simple container applications are deployed in different virtual machines respectively. These applications communicate closely with each other and jointly provide external services (east-west traffic). In this case, the method of using the node physical resource utilization as the decision standard for virtual machine migration is likely to cause problems such as increased communication loss and reduced service quality due to the increased network topology distance between virtual machines when the virtual machine migrates. Summary of the invention
[0004] To solve the above technical problems, the embodiments of the present application provide a virtual machine migration method and device, an electronic device, and a computer-readable storage medium, which migrate virtual machines according to the traffic correlation numerical value of each virtual machine in the overloaded node, thereby efficiently reducing the load on the node network.
[0005] 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.
[0006] According to one aspect of an embodiment of the present application, a virtual machine migration method is provided, comprising: calculating the traffic correlation value of each virtual machine in an overloaded node according to the communication relationship between the virtual machines in the node network, the traffic correlation value being obtained according to the correlation between the corresponding virtual machine and other virtual machines in the node network; adding the corresponding virtual machines to a queue to be migrated in sequence according to the numerical value of the traffic correlation value of each virtual machine in ascending order; and performing migration processing on each virtual machine in the queue to be migrated in sequence until the load of the overloaded node is less than a preset threshold.
[0007] In one embodiment, the calculating the traffic correlation value of each virtual machine respectively according to the communication relationship of each virtual machine in the overloaded node in the node network includes:
[0008] Calculating a first correlation between any two virtual machines in the overloaded node;
[0009] Calculating a second correlation between any virtual machine in the overloaded node and any virtual machine in other nodes of an upstream switch, where the upstream switch is an upstream switch of the overloaded node;
[0010] Calculating a third correlation between any virtual machine in the overloaded node and any virtual machine in a node across a switch, where the across switch is a switch that has communication interaction with the uplink switch;
[0011] The traffic correlation value of each virtual machine is calculated respectively according to the first correlation, the second correlation and the third correlation corresponding to each virtual machine.
[0012] In one embodiment, the step of sequentially migrating each virtual machine in the queue to be migrated until the load of the overloaded node is less than a preset threshold comprises:
[0013] Obtaining a first virtual machine from the head of the queue to be migrated, migrating the first virtual machine to other nodes in the node network, and deleting elements in the head of the queue to be migrated, wherein the other nodes include a node where a virtual machine having the greatest correlation with the first virtual machine is located;
[0014] The steps of obtaining the first virtual machine from the head of the queue to be migrated, migrating the first virtual machine to other nodes in the node network, and deleting the elements in the head of the queue to be migrated are executed in a loop until the load of the overloaded node is less than the preset threshold.
[0015] In one embodiment, obtaining the first virtual machine from the head of the queue to be migrated and migrating the first virtual machine to another node in the node network includes:
[0016] Determine whether there is a correlation between the first virtual machine and other virtual machines;
[0017] If it does not exist, the node with the smallest load in the node network is used as the target node, and the first virtual machine is migrated to the target node.
[0018] In one embodiment, obtaining the first virtual machine from the head of the queue to be migrated and migrating the first virtual machine to another node in the node network includes:
[0019] According to the correlation values between the first virtual machine and other virtual machines, obtaining a second virtual machine, wherein the correlation value between the second virtual machine and the first virtual machine is the largest;
[0020] If the second virtual machine is deployed on the overloaded node, the node with the smallest load on the upstream switch of the overloaded node is used as the target node, and the first virtual machine is migrated to the target node.
[0021] In one embodiment, obtaining the first virtual machine from the head of the queue to be migrated and migrating the first virtual machine to another node in the node network includes:
[0022] According to the correlation values between the first virtual machine and other virtual machines, obtaining a second virtual machine, wherein the correlation value between the second virtual machine and the first virtual machine is the largest;
[0023] If the second virtual machine is deployed on a cross-switch, determining whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine, wherein the cross-switch is another switch that has communication interaction with the uplink switch of the overloaded node;
[0024] If the conditions are met, migrating the first virtual machine to the node where the second virtual machine is located;
[0025] Otherwise, the node with the smallest load on the cross-switch where the second virtual machine is located is used as the target node, and the first virtual machine is migrated to the target node.
[0026] In one embodiment, obtaining the first virtual machine from the head of the queue to be migrated and migrating the first virtual machine to another node in the node network includes:
[0027] According to the correlation values between the first virtual machine and other virtual machines, obtaining a second virtual machine, wherein the correlation value between the second virtual machine and the first virtual machine is the largest;
[0028] If the second virtual machine is deployed on the upstream switch of the overloaded node, determining whether the node where the second virtual machine is located meets the migration requirements of the first virtual machine;
[0029] If the conditions are met, migrating the first virtual machine to the node where the second virtual machine is located;
[0030] Otherwise, the node with the smallest load on the uplink switch is used as the target node, and the first virtual machine is migrated to the target node.
[0031] According to one aspect of an embodiment of the present application, a virtual machine migration device is provided, including: a traffic correlation value acquisition module, configured to calculate the traffic correlation value of each virtual machine in an overloaded node according to the communication relationship between the virtual machines in the node network, respectively, and the traffic correlation value is obtained according to the correlation between the corresponding virtual machine and other virtual machines in the node network; a queue to be migrated acquisition module, configured to add the corresponding virtual machines to the queue to be migrated in sequence according to the numerical value of the traffic correlation value of each virtual machine and the arrangement order from small to large; a migration module, configured to perform migration processing on each virtual machine in the queue to be migrated in sequence until the load of the overloaded node is less than a preset threshold.
[0032] According to one aspect of an embodiment of the present application, there is provided an electronic device, comprising one or more processors; and a storage device for storing one or more computer programs, wherein when the one or more computer programs are executed by the one or more processors, the electronic device implements the virtual machine migration method as described above.
[0033] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the virtual machine migration method as described above.
[0034] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the virtual machine migration method provided in the above various optional embodiments.
[0035] In the technical solution provided in the embodiments of the present application, the virtual machines to be migrated first are determined according to the numerical values of the traffic correlation values of the virtual machines in the overloaded nodes. While reducing the load of the overloaded nodes, virtual machines with smaller traffic correlation values are migrated first, thereby reducing the problem of increased communication loss caused by the increased network topology distance between virtual machines with strong correlation when migrating virtual machines with strong correlation in the overloaded nodes.
[0036] 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
[0037] The drawings herein are incorporated into the specification and constitute a part of the specification, showing 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 those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0038] Figure 1 It is a schematic diagram of an implementation environment involved in this application;
[0039] Figure 2 is a flowchart of a virtual machine migration method shown in an exemplary embodiment of the present application;
[0040] Figure 3 yes Figure 2 A flowchart of step S210 in the illustrated embodiment in an exemplary embodiment;
[0041] Figure 4 yes Figure 2 A flow chart of step S250 in the illustrated embodiment in an exemplary embodiment;
[0042] Figure 5 yes Figure 4 A flowchart of step S410 in the illustrated embodiment in an exemplary embodiment;
[0043] Figure 6 yes Figure 4 A flowchart of step S410 in the illustrated embodiment in another exemplary embodiment;
[0044] Figure 7 yes Figure 4 A flowchart of step S410 in the illustrated embodiment in another exemplary embodiment;
[0045] Figure 8 yes Figure 4 A flowchart of step S410 in the illustrated embodiment in another exemplary embodiment;
[0046] Fig. 9 is a structural schematic diagram of a virtual machine migration device shown in another exemplary embodiment of the present application;
[0047] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0048] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[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] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0052] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0053] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0054] The virtual machine migration method and device, electronic device, and storage medium proposed in the embodiments of the present application involve artificial intelligence technology and machine learning technology, and these embodiments will be described in detail below.
[0055] The implementation environment includes a terminal 100 and a server 200, and the terminal 100 and the server 200 communicate with each other through a wired or wireless network. The terminal 100 is used to collect node network data, and the node network data includes the structure of the node network, the load of each node in the node network, the communication flow data of each node in the node network, etc.; at the same time, the terminal 100 also inputs the collected node network data to the server 200, and the server 200 processes the node network data, and according to the load of each node in the node network, the node with a load greater than a preset threshold is regarded as an overloaded node, and then according to the communication relationship of each virtual machine in the overloaded node in the node network, the flow correlation value of each virtual machine is calculated respectively, and the migration priority of the virtual machine in the overloaded node is confirmed by the flow correlation value, and the virtual machine with a high priority is migrated to other nodes, thereby reducing the load of the overloaded node.
[0056] Exemplarily, after collecting the node network data, the terminal 100 sends the node network data to the server 200, and the server 200 processes the node network data, such as treating the nodes with a load greater than a preset threshold as overloaded nodes according to the load of each node in the node network, and calculating the traffic correlation value of each virtual machine according to the communication relationship between each virtual machine in the overloaded node in the node network, and the traffic correlation value is obtained according to the correlation between the corresponding virtual machine and other virtual machines in the node network; according to the numerical value of the traffic correlation value of each virtual machine, the corresponding virtual machine is added to the queue to be migrated in sequence in the order of the numerical value from small to large; and each virtual machine in the queue to be migrated is migrated in sequence until the load of the overloaded node is less than the preset threshold.
[0057] Among them, the terminal 100 can be any electronic device that can realize data visualization, such as a smart phone, a tablet, a laptop, a computer, etc., and there is no restriction here. The server end 200 can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, wherein multiple servers can form a blockchain, and the server is a node on the blockchain. The server end 200 can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network) and big data and artificial intelligence platforms, and there is no restriction here.
[0058] Figure 2 FIG. 1 is a flow chart showing a method for virtual machine migration according to an exemplary embodiment. Figure 2 As shown, in an exemplary embodiment, the method may include steps S210 to S250, which are described in detail as follows:
[0059] Step S210: Calculate the traffic correlation value of each virtual machine according to the communication relationship between each virtual machine in the overloaded node in the node network.
[0060] In this embodiment, nodes in the node network whose node load (actual network throughput) is greater than a preset threshold are called overloaded nodes. Overloaded nodes will cause communication loss in the node network and affect the service quality. The preset threshold in this embodiment can be set separately according to the actual bandwidth conditions of different nodes.
[0061] In this embodiment, the traffic correlation value is obtained according to the correlation between the corresponding virtual machine and other virtual machines in the node network. Specifically, for any virtual machine A in the overloaded node, the correlation between the virtual machine A and other virtual machines that have a communication relationship with the virtual machine A is obtained. For example, if the virtual machine A communicates with some virtual machines in the overloaded node, multiple first correlations between the virtual machine A and any virtual machine that has a communication relationship in the overloaded node are first calculated. In the node network, the virtual machines in the overloaded node communicate with each other through the overloaded node and the uplink switch in the access layer. Multiple nodes may be linked to one uplink switch, and the virtual machines between the multiple nodes may also have a communication relationship. Therefore, the second correlation between the virtual machine A and the virtual machines in other nodes under the uplink switch of the overloaded node may also be calculated. At the same time, for the node network, there may be multiple switches in the access layer, and the traffic passing through the multiple switches in the access layer is also aggregated through the switches in the aggregation layer, that is, there may also be a communication relationship between the multiple switches in the access layer. Therefore, the third correlation between the virtual machine A and the virtual machines under the cross-switch in the access layer that communicate with the uplink switch of the overloaded node may also be calculated.
[0062] Thus, the first correlation, the second correlation, and the third correlation of the virtual machine A can be obtained, and the traffic correlation value of the virtual machine A can be obtained through the three correlations of the virtual machine A.
[0063] Step S230: according to the numerical values of the traffic correlation values of the virtual machines, the corresponding virtual machines are added to the queue to be migrated in order from small to large.
[0064] The traffic correlation value in this embodiment can characterize the communication relationship of virtual machine A, such as which node the virtual machine A frequently communicates with in the node network. If the traffic correlation value is larger, it proves that the traffic correlation between virtual machine A and virtual machines in the overloaded node or other nodes under the upstream switch is strong, and the communication is frequent. If virtual machine A is migrated to other nodes, the network topology distance between virtual machines with strong correlation will become farther, thereby increasing communication loss, and further affecting the service quality of network nodes. Therefore, the migration priority of virtual machine A should be lowered, that is, other virtual machines with high priority should be migrated first; if the traffic correlation value is smaller, it means that virtual machine A has a strong correlation with the traffic of virtual machines in the cross-switch node and frequently communicates with virtual machines in the cross-switch node. In this case, the migration priority of virtual machine A can be increased, and virtual machine A can be migrated to the node where the virtual machine with the greatest correlation is located to reduce the communication loss between virtual machines.
[0065] Therefore, the migration priority of each virtual machine can be determined by the traffic correlation value of each virtual machine in the overloaded node, and the traffic correlation values are sorted from small to large. Then, the corresponding virtual machines are put into the queue to be migrated in order of arrangement, to ensure that the virtual machine with the smallest traffic correlation value is at the head of the queue to be migrated. From the head to the end of the queue to be migrated, the traffic correlation value corresponding to each virtual machine gradually increases.
[0066] Step S250: Migrate each virtual machine in the queue to be migrated in sequence until the load of the overloaded node is less than a preset threshold.
[0067] In this embodiment, according to the "first in, first out" feature of the queue, each virtual machine in the queue to be migrated is migrated in turn. For example, when migrating the virtual machines in the queue to be migrated, the virtual machine at the head of the queue is migrated, and then the opposite virtual machine is deleted. The second column element of the queue to be migrated is the head of the queue, and then the opposite virtual machine is migrated. After each migration of a virtual machine, the load of the overloaded node is compared with a preset threshold. This operation is repeated until, after a virtual machine is migrated, the load of the overloaded node is less than the preset threshold, that is, the load of the overloaded node is within the normal communication range, and then the migration of the virtual machines in the queue to be migrated is stopped.
[0068] In this embodiment, the migration location can be determined based on the correlation between the virtual machine to be migrated and other virtual machines, or based on the size of the node load in the node network, such as migrating to a node with a smaller load. No specific restrictions are made here.
[0069] In this embodiment, there may be multiple overloaded nodes in a node network. In actual applications, all overloaded nodes in a node network can be added to an overloaded node queue, and then the virtual machine migration of each overloaded node in the overloaded node queue can be performed in turn through the above method, ultimately achieving the purpose of reducing the node network load.
[0070] Of course, the load of each node in the node network can also be monitored in real time, and thresholds can be set according to the actual node bandwidth conditions. When the actual network throughput of the node is greater than the set threshold, the node business network is determined to be overloaded. When a new overloaded node appears, the new overloaded node is added to the overloaded node queue, indicating that the virtual machines in the nodes of the overloaded node queue need to be migrated. In this way, real-time monitoring and regulation of the node network load can be achieved, effectively avoiding SLA (service level agreement) reduction or even business interruption caused by excessive business network load.
[0071] In this embodiment, the traffic correlation value of each virtual machine is determined by the communication relationship in the node network, and the traffic correlation is used as the judgment standard for the migration priority in the overloaded node. The virtual machine with smaller traffic correlation is the virtual machine with smaller correlation with the virtual machine in the overloaded node and has a lower communication frequency. Therefore, the virtual machine with smaller traffic correlation is used as the virtual machine to be migrated first, while reducing the load of the overloaded node, reducing the problem of the longer network topological distance between virtual machines with stronger correlation caused by migrating virtual machines with greater correlation with the virtual machines in the overloaded node, and the increase in communication loss caused by the longer topological distance. On the other hand, the virtual machines are added to the queue to be migrated in turn according to the numerical value of the traffic correlation value, and the virtual machines with high priority are migrated in turn through the queue, so that the migration is faster and more convenient. Furthermore, migrating virtual machines in the above manner can effectively optimize the distribution of virtual machines in the node network when multiple virtual machines communicate with each other to provide services externally, so that the distance between virtual machines with communication relationship in the node network is closer, thereby reducing communication loss.
[0072] Figure 3 yes Figure 2 The flowchart of step S210 in the embodiment shown is in an exemplary embodiment. Figure 3 As shown, in an exemplary embodiment, the process of respectively calculating the traffic correlation value of each virtual machine according to the communication relationship of each virtual machine in the overloaded node in the node network may include steps S310 to S370, which are described in detail as follows:
[0073] Step S310: Calculate a first correlation between any two virtual machines in the overloaded node.
[0074] In this implementation, the correlation value of each virtual machine in the overloaded node is obtained by the correlation between the corresponding virtual machine and other virtual machines. Specifically, the first correlation between any two virtual machines in the overloaded node can be used to obtain the first correlation between a virtual machine and any other virtual machine in the overloaded node. For example, for virtual machine A in the overloaded node, first obtain the virtual machines that have a communication relationship with virtual machine A from the virtual machines in the overloaded node. If virtual machine B has a communication relationship with virtual machine A, then use the correlation calculation algorithm to calculate the first correlation between virtual machine A and virtual machine B. If there is no communication relationship between virtual machine A and virtual machine B, then the first correlation between virtual machine A and virtual machine B is 0.
[0075] Step S330: Calculate a second correlation between any virtual machine in the overloaded node and any virtual machine in other nodes of the upstream switch.
[0076] In this embodiment, the uplink switch is the uplink switch of the overloaded node in the access layer, and the virtual machines in the overloaded node communicate with each other through the overloaded node and the uplink switch in the access layer. Multiple nodes can be connected to one uplink switch, and the virtual machines in the multiple nodes communicate with each other through the uplink switch. The multiple nodes include the overloaded node, and multiple virtual machines are respectively arranged under the other nodes. The second correlation is obtained by calculating the correlation between any virtual machine A in the overloaded node and any virtual machine C in other nodes in the uplink switch except the overloaded node.
[0077] Through the above process, the second correlation between any virtual machine A in the overloaded node and any virtual machine C in other nodes of the upstream switch that has a communication relationship with the virtual machine A can be obtained. Similarly, if there is no communication relationship between the virtual machine A and the virtual machine C in the overloaded node, the first correlation between the virtual machine A and the virtual machine C is 0.
[0078] Step S350: Calculate a third correlation between any virtual machine in the overloaded node and any virtual machine in a node across switches.
[0079] In this embodiment, the cross-switch is a switch that has communication interaction with the upstream switch. For the node network, there may be multiple switches in the access layer, and the traffic passing through the multiple switches in the access layer is also aggregated through the switch in the aggregation layer, that is, there may be a communication relationship between the multiple switches in the access layer. Therefore, the switch located in the access layer and having a communication relationship with the upstream switch of the overloaded node is called a cross-switch.
[0080] Through the communication relationship between any virtual machine A in the overloaded node and any virtual machine D in the node across the switch, the third correlation can be obtained based on the correlation calculation algorithm. Similarly, if there is no communication relationship between virtual machine A and virtual machine D in the overloaded node, the first correlation between virtual machine A and virtual machine D is 0.
[0081] Step S370: Calculate the traffic correlation value of each virtual machine according to the first correlation, the second correlation, and the third correlation corresponding to each virtual machine.
[0082] In this embodiment, if it is necessary to calculate the traffic correlation value of a virtual machine A in an overloaded node, the first correlation between virtual machine A and any virtual machine in the overloaded node is obtained from step S310, and all first correlations of virtual machine A are added to obtain the total correlation (communication frequency) representing the relationship between virtual machine A and the virtual machines in the overloaded node; then the second correlation between virtual machine A and any virtual machine in other nodes of the upstream switch is obtained from step S330, and all second correlations of virtual machine A are added to obtain the total correlation representing the relationship between virtual machine A and virtual machines in other nodes in the upstream switch, and then the third correlation between virtual machine A and any virtual machine in a node across switches is obtained from step S350, and all third correlations of virtual machine A are added to obtain the total correlation representing the relationship between virtual machine A and virtual machines in other nodes across switches, and then the traffic correlation of virtual machine A is calculated through the total correlation between virtual machine A and virtual machines in the overloaded node, virtual machines in other nodes in the upstream switch, and virtual machines in other nodes across switches.
[0083] Specifically, the traffic correlation value of each virtual machine can be calculated by the following formula:
[0084]
[0085] Where R(i) is the traffic correlation of virtual machine i in the overloaded node, j is any virtual machine outside i in the overloaded node, N1 is the overloaded node, is the first correlation between virtual machine i and virtual machine j, Nr is the node r in the uplink switch of the overloaded node except the overloaded node, S1 is the uplink switch of the overloaded node, m∈Nr is the virtual machine m in the node r, is the second correlation between virtual machine i and virtual machine m, Nq is node q in cross-switch w, Sw is cross-switch w, n is virtual machine n of node q in cross-switch w, is the third correlation between virtual machine i and virtual machine n.
[0086] In this embodiment, a method for calculating the traffic correlation of corresponding virtual machines is proposed by the total correlation between the virtual machines in the overloaded node and the virtual machines in the overloaded node, the virtual machines in other nodes in the upstream switch, and the virtual machines in other nodes across switches. The traffic correlation of the virtual machine can be used to characterize the correlation between the corresponding virtual machine and the overloaded node, the upstream switch, and the across switches. Finally, the migration priority of the corresponding virtual machine is determined according to the traffic correlation, so that virtual machines with lower correlation to the overloaded node are migrated first according to the traffic correlation, thereby reducing the problem of increased communication loss caused by the migration of some virtual machines with higher traffic correlation.
[0087] Figure 4 yes Figure 2 The flowchart of step S250 in the embodiment shown is in an exemplary embodiment. Figure 4 As shown, in an exemplary embodiment, the process of sequentially performing migration processing on each virtual machine in the queue to be migrated until the load of the overloaded node is less than a preset threshold may include steps S410 to S470, which are described in detail as follows:
[0088] Step S410: Obtain a first virtual machine from the head of the queue to be migrated, migrate the first virtual machine to another node in the node network, and delete the element in the head of the queue to be migrated.
[0089] When migrating virtual machines in overloaded nodes, the correlation of east-west traffic between virtual machines may cause the network topology distance between highly correlated virtual machines to become farther, thereby increasing communication loss and affecting the service quality of network nodes.
[0090] In this embodiment, the virtual machines in the overloaded nodes are migrated to reduce the load of the overloaded nodes. Figure 2 It can be seen that the queue to be migrated represents the priority of the migration of the virtual machines in the overloaded node. Therefore, the virtual machine corresponding to the head of the queue to be migrated is the virtual machine with the highest migration priority.
[0091] After obtaining the first virtual machine from the queue to be migrated, the node where the virtual machine with the largest correlation value with the first virtual machine is located can be selected as the migration destination based on the first correlation, second correlation, and third correlation of the first virtual machine. The first virtual machine can also be migrated to other nodes with less load. No specific restrictions are made here. After determining the migration target node, the cloud management API (interface) and the hot migration system can be called.
[0092] After the first virtual machine is migrated, the element at the head of the queue to be migrated may be deleted, proving that the virtual machine corresponding to the deleted element has been migrated.
[0093] Step S430: Determine whether the load of the overloaded node is less than a preset threshold.
[0094] After migrating a virtual machine in the migration queue, the load of the overloaded node is checked again to see if it is less than the preset threshold. If so, it proves that the load of the overloaded node has achieved a normal communication level and will not cause a large amount of communication loss. Otherwise, the load of the overloaded node is still too heavy and will cause communication loss.
[0095] Step S450: If not, go to step S410.
[0096] If the load of the overloaded node is still greater than the preset threshold, the load of the overloaded node is still too heavy and will cause communication loss. At this time, go to step S410, obtain the first virtual machine from the queue to be migrated, and migrate the first virtual machine. Since the elements corresponding to the virtual machines that have been migrated in the queue to be migrated have been deleted, the first virtual machine obtained in this step is still the first element of the queue to be migrated, and is still considered to be the head of the queue here, that is, the first virtual machine obtained at this time is the next element of the element deleted from the queue to be migrated.
[0097] Step S470: Otherwise, end.
[0098] In this embodiment, step S410 is looped and step S430 is used to determine whether the overloaded node is still overloaded after the virtual machine migration is performed, until the load of the overloaded node is less than a preset threshold, then the loop is terminated, i.e., the virtual machines in the queue to be migrated are no longer migrated.
[0099] In this embodiment, the virtual machines in the overloaded node are migrated to other nodes according to the order of migration priority based on the order of the queues to be migrated. While effectively reducing the load of the overloaded node, it is more scientific to migrate the queues to be migrated according to the priority order, and it will not cause the virtual machines that are highly correlated with the overloaded node to migrate to other nodes, resulting in the network topology distance between virtual machines becoming longer, the communication loss increasing, and the service quality being impaired.
[0100] Figure 5 yes Figure 4 The flowchart of step S410 in the embodiment shown is in an exemplary embodiment. Figure 5 As shown, in an exemplary embodiment, the process of obtaining the first virtual machine from the head of the queue to be migrated and migrating the first virtual machine to other nodes in the node network may include steps S510 to S530, which are described in detail as follows:
[0101] Step S510: Determine whether there is a correlation between the first virtual machine and other virtual machines.
[0102] In this embodiment, the migration destination of the first virtual machine may be determined through the correlation between the first virtual machine and other virtual machines.
[0103] Step S530: If it does not exist, the node with the smallest load in the node network is set as the target node, and the first virtual machine is migrated to the target node.
[0104] In some cases, the first virtual machine does not communicate or interact with any other virtual machines, that is, the first virtual machine can realize business communication through the node and the switch alone. Then, the migration of the first virtual machine to any location will not cause the communication network topology distance between the virtual machines to become farther, thereby increasing the communication loss. The node with the smallest load can be selected as the target node in the node network, and the first virtual machine can be migrated to the target node. On the one hand, the load of the overloaded node is reduced. On the other hand, selecting the node with the smallest load as the target node will not cause the target node to be overloaded. Compared with other nodes as target nodes, this is more scientific.
[0105] In this embodiment, the first virtual machine that does not communicate or interact with any other virtual machines is migrated to a node with the smallest load in the node network. This reduces the load of overloaded nodes and makes the node with the smallest load the target node for migration more scientific than other nodes as target nodes, and reduces the possibility of causing the target node to be overloaded.
[0106] Figure 6 yes Figure 4 The flowchart of step S410 in the embodiment shown is in an exemplary embodiment. Figure 6 As shown, in an exemplary embodiment, the process of obtaining the first virtual machine from the head of the queue to be migrated and migrating the first virtual machine to other nodes in the node network may include steps S610 to S630, which are described in detail as follows:
[0107] Step S610: Acquire a second virtual machine according to the correlation values between the first virtual machine and other virtual machines.
[0108] In this embodiment, the correlation value between the second virtual machine and the first virtual machine is the largest.
[0109] In this embodiment, the virtual machine with the largest correlation value with the first virtual machine can be selected as the second virtual machine based on the numerical values of the first correlation, the second correlation, and the third correlation of the first virtual machine. If the first virtual machine has the largest correlation value whose value is the first correlation m, and the first correlation m is the first linear correlation between the first virtual machine and virtual machine M, then virtual machine M will be selected as the second virtual machine.
[0110] Step S630: If the second virtual machine is deployed on an overloaded node, a node with the smallest load on an upstream switch of the overloaded node is used as a target node, and the first virtual machine is migrated to the target node.
[0111] In this embodiment, if the second virtual machine is deployed on the overloaded node, that is, the first correlation between the first virtual machine and the second virtual machine is the largest, it indicates that the first virtual machine has a high correlation with the overloaded node, but because the load of the overloaded node is too large, and the migration priority of the first virtual machine is still the highest among the existing virtual machines in the overloaded node, if the first virtual machine has a high correlation with other virtual machines in the upstream switch, but does not exceed the first correlation with the second virtual machine, that is, the first virtual machine still needs to be migrated. At this time, the node with the smallest load on the upstream switch of the overloaded node can be used as the target node, and the first virtual machine can be migrated to the target node. While reducing the load of the overloaded node, the network topology distance between virtual machines with strong correlation is reduced, thereby increasing communication loss.
[0112] This embodiment proposes that when the virtual machine with the strongest correlation with the first virtual machine is in an overloaded node, the first virtual machine is migrated to the node with the smallest load on the upstream switch, while reducing the load of the overloaded node, the network topology distance between the first virtual machine and the second virtual machine is not excessively expanded, and the problems of increasing the network topology distance between virtual machines with strong correlation, increasing communication loss, and reducing service quality caused by migrating the first virtual machine to other nodes or nodes in other switches are prevented.
[0113] Figure 7 yes Figure 4 The flowchart of step S410 in the embodiment shown is in an exemplary embodiment. Figure 7 As shown, in an exemplary embodiment, the process of obtaining the first virtual machine from the head of the queue to be migrated and migrating the first virtual machine to other nodes in the node network may include steps S710 to S770, which are described in detail as follows:
[0114] Step S710: Acquire a second virtual machine according to the correlation values between the first virtual machine and other virtual machines.
[0115] In this embodiment, the correlation value between the second virtual machine and the first virtual machine is the largest.
[0116] In this embodiment, the virtual machine with the largest correlation value with the first virtual machine can be selected as the second virtual machine based on the numerical values of the first correlation, the second correlation, and the third correlation of the first virtual machine. If the correlation value of the first virtual machine with the largest correlation value is the third correlation n, and the third correlation n is the third linear correlation between the first virtual machine and virtual machine N, then virtual machine N will be selected as the second virtual machine.
[0117] Step S730: If the second virtual machine is deployed on the cross-switch, determine whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine.
[0118] In this embodiment, the cross-switch is another switch that has communication interaction with the upstream switch of the overloaded node.
[0119] In this embodiment, it is determined whether the second virtual machine is on the cross-switch. If the third correlation between the second virtual machine and the first virtual machine is the largest, the second virtual machine can be a virtual machine in a node on the cross-switch. At this time, the communication between the second virtual machine and the first virtual machine is most frequent. Therefore, the node where the second virtual machine is located is determined, and the load of the node where the second virtual machine is located is detected to determine whether the remaining resources of the node where the second virtual machine is located meet the needs of the first virtual machine, that is, whether the migration of the first virtual machine will cause the node where the second virtual machine is located to be overloaded.
[0120] Step S750: If the conditions are met, migrate the first virtual machine to the node where the second virtual machine is located.
[0121] If the remaining resources of the node where the second virtual machine is located meet the needs of the first virtual machine, the first virtual machine can be migrated to the node where the second virtual machine is located. At this time, the network topology distance between the first virtual machine and the second virtual machine with the strongest correlation with the first virtual machine (the most frequent communication) is the shortest, and the communication loss is the least.
[0122] Step S770: Otherwise, the node with the smallest load on the cross-switch where the second virtual machine is located is used as the target node, and the first virtual machine is migrated to the target node.
[0123] If the remaining resources of the node where the second virtual machine is located do not meet the migration requirements of the first virtual machine, it proves that migrating the first virtual machine to the node where the second virtual machine is located will cause the node where the second virtual machine is located to be overloaded. In this case, the node with the smallest load on the cross-switch where the second virtual machine is located is used as the target node, and the first virtual machine is migrated to the target node. While reducing the load of the overloaded node, migrating the first virtual machine to the node with the smallest load on the cross-switch where the second virtual machine is located can reduce the network topology distance between the first virtual machine and the second virtual machine, and avoid the problem of excessive node load caused by migrating to the node where the second virtual machine is located.
[0124] In this embodiment, the node where the second virtual machine with the greatest correlation with the first virtual machine is located is selected as the migration node, so that the network topology distance between the virtual machines with the strongest correlation is the shortest and the communication loss is the least. At the same time, when the remaining resources of the node where the second virtual machine is located do not meet the migration requirements of the first virtual machine, the node with the smallest load on the cross-switch where the second virtual machine is located is selected as the migration target node, while reducing the network topology distance between the first virtual machine and the second virtual machine, avoiding the problem of excessive node load caused by migration to the node where the second virtual machine is located.
[0125] Figure 8 yes Figure 4The flowchart of step S410 in the embodiment shown is in an exemplary embodiment. Figure 8 As shown, in an exemplary embodiment, the process of obtaining the first virtual machine from the head of the queue to be migrated and migrating the first virtual machine to other nodes in the node network may include steps S810 to S870, which are described in detail as follows:
[0126] Step S810: Acquire a second virtual machine according to the correlation values between the first virtual machine and other virtual machines.
[0127] In this embodiment, the correlation value between the second virtual machine and the first virtual machine is the largest.
[0128] In this embodiment, the virtual machine with the largest correlation value with the first virtual machine can be selected as the second virtual machine based on the numerical values of the first correlation, the second correlation, and the third correlation of the first virtual machine. If the first virtual machine has the largest correlation value of the second correlation s, and the third correlation s is the third linear correlation between the first virtual machine and virtual machine S, then virtual machine S is selected as the second virtual machine.
[0129] Step S830: If the second virtual machine is deployed on the uplink switch of the overloaded node, determine whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine.
[0130] In this embodiment, it is determined whether the second virtual machine is on the upstream switch. If the second correlation between the second virtual machine and the first virtual machine is the largest, the second virtual machine can be a virtual machine in other nodes on the upstream switch. At this time, the second virtual machine and the first virtual machine communicate most frequently. Therefore, the node where the second virtual machine is located is determined, and the load of the node where the second virtual machine is located is detected to determine whether the remaining resources of the node where the second virtual machine is located meet the needs of the first virtual machine, that is, whether the migration of the first virtual machine will cause the node where the second virtual machine is located to be overloaded.
[0131] Step S850: If the conditions are met, migrate the first virtual machine to the node where the second virtual machine is located.
[0132] If the remaining resources of the node where the second virtual machine is located meet the needs of the first virtual machine, the first virtual machine can be migrated to the node where the second virtual machine is located. At this time, the network topology distance between the first virtual machine and the second virtual machine with the strongest correlation with the first virtual machine (the most frequent communication) is the shortest, and the communication loss is the least.
[0133] Step S870: Otherwise, the node with the smallest load on the upstream switch is set as the target node, and the first virtual machine is migrated to the target node.
[0134] If the remaining resources of the node where the second virtual machine is located do not meet the migration requirements of the first virtual machine, it proves that migrating the first virtual machine to the node where the second virtual machine is located will cause the node where the second virtual machine is located to be overloaded. At this time, the node with the smallest load on the upstream switch is set as the target node, and the first virtual machine is migrated to the target node. While reducing the load of the overloaded node, migrating the first virtual machine to the node with the smallest load on the upstream switch can control the network topology distance between the first virtual machine and the second virtual machine, and avoid the problem of excessive node load caused by migrating to the node where the second virtual machine is located.
[0135] In this embodiment, the node where the second virtual machine with the greatest correlation with the first virtual machine is located is selected as the migration node, so that the network topology distance between the virtual machines with the strongest correlation is the shortest and the communication loss is the least. At the same time, when the remaining resources of the node where the second virtual machine is located do not meet the migration requirements of the first virtual machine, the node with the smallest load on the cross-switch where the second virtual machine is located is selected as the migration target node. While controlling the network topology distance between the first virtual machine and the second virtual machine, the problem of excessive node load caused by migration to the node where the second virtual machine is located is avoided.
[0136] Fig. 9 FIG. 1 is a schematic diagram showing a structure of a virtual machine migration device according to another exemplary embodiment. Fig. 9 As shown, in an exemplary embodiment, the virtual machine migration device includes:
[0137] The traffic correlation value acquisition module 910 is configured to calculate the traffic correlation value of each virtual machine according to the communication relationship of each virtual machine in the overloaded node in the node network, and the traffic correlation value is obtained according to the correlation between the corresponding virtual machine and other virtual machines in the node network;
[0138] The to-be-migrated queue acquisition module 930 is configured to sequentially add the corresponding virtual machines to the to-be-migrated queue in ascending order according to the numerical values of the traffic correlation values of the virtual machines;
[0139] The migration module 950 is configured to sequentially perform migration processing on each virtual machine in the queue to be migrated until the load of the overloaded node is less than a preset threshold.
[0140] In this embodiment, the above structure reduces the load on the overloaded node while reducing the migration of virtual machines that are highly correlated with the virtual machines in the overloaded node, thereby reducing the network topology distance between the highly correlated virtual machines and the increase in communication loss.
[0141] In one embodiment, the traffic correlation value acquisition module 910 includes:
[0142] A first correlation obtaining unit, configured to calculate a first correlation between any two virtual machines in the overloaded node;
[0143] A second correlation obtaining unit is configured to calculate a second correlation between any virtual machine in the overloaded node and any virtual machine in other nodes of an upstream switch, where the upstream switch is an upstream switch of the overloaded node;
[0144] A third correlation obtaining unit is configured to calculate a third correlation between any virtual machine in the overloaded node and any virtual machine in a node across switches, where the across switches are switches that have communication interactions with the uplink switch;
[0145] The traffic correlation value acquiring unit is configured to respectively calculate the traffic correlation value of each virtual machine according to the first correlation, the second correlation and the third correlation corresponding to each virtual machine.
[0146] In one embodiment, the migration module 950 includes:
[0147] A migration unit, configured to obtain a first virtual machine from a head of a queue to be migrated, migrate the first virtual machine to another node in the node network, and delete an element in the head of the queue to be migrated;
[0148] The loop unit is configured to loop through the steps of obtaining the first virtual machine from the head of the queue to be migrated, migrating the first virtual machine to other nodes in the node network, and deleting the elements in the head of the queue to be migrated until the load of the overloaded node is less than a preset threshold.
[0149] In one embodiment, the migration unit comprises:
[0150] A correlation determination section configured to determine whether there is a correlation between the first virtual machine and other virtual machines;
[0151] The first migration section is configured to, if it does not exist, take the node with the smallest load in the node network as the target node, and migrate the first virtual machine to the target node.
[0152] In one embodiment, the migration unit comprises:
[0153] A second virtual machine search section is configured to obtain a second virtual machine according to the correlation values between the first virtual machine and other virtual machines, wherein the correlation value between the second virtual machine and the first virtual machine is the largest;
[0154] The second migration section is configured to, if the second virtual machine is deployed on an overloaded node, use the node with the smallest load on the upstream switch of the overloaded node as the target node, and migrate the first virtual machine to the target node.
[0155] In one embodiment, the migration unit comprises:
[0156] A second virtual machine query section is configured to obtain a second virtual machine according to the correlation values between the first virtual machine and other virtual machines, wherein the correlation value between the second virtual machine and the first virtual machine is the largest;
[0157] The third judgment section is configured to judge whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine if the second virtual machine is deployed on the cross-switch, where the cross-switch is another switch that has communication interaction with the upstream switch of the overloaded node;
[0158] A third migration section is configured to migrate the first virtual machine to the node where the second virtual machine is located if the conditions are met;
[0159] The fourth migration section is configured as follows: otherwise, the node with the smallest load on the cross-switch where the second virtual machine is located is used as the target node, and the first virtual machine is migrated to the target node.
[0160] In one embodiment, the migration unit comprises:
[0161] A second virtual machine acquisition section is configured to acquire a second virtual machine according to the correlation values between the first virtual machine and other virtual machines, wherein the correlation value between the second virtual machine and the first virtual machine is the largest;
[0162] The fourth judgment module is configured to judge whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine if the second virtual machine is deployed on the upstream switch of the overloaded node;
[0163] The fifth migration section is configured to migrate the first virtual machine to the node where the second virtual machine is located if the conditions are met;
[0164] The sixth migration section is configured as follows: otherwise, the node with the smallest load on the upstream switch is used as the target node, and the first virtual machine is migrated to the target node.
[0165] It should be noted that the virtual machine migration device provided in the above embodiment and the virtual machine migration method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0166] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the virtual machine migration method provided in the above-mentioned embodiments.
[0167] Fig.10A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0168] It should be noted that Fig.10 The computer system 1600 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.
[0169] like Fig.10 As shown, the computer system 1600 includes a central processing unit (CPU) 1601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1602 or the program loaded from the storage part 1608 to the random access memory (RAM) 1603, such as executing the method in the above embodiment. In RAM 1603, various programs and data required for system operation are also stored. CPU 1601, ROM 1602 and RAM 1603 are connected to each other through bus 1604. Input / output (I / O) interface 1605 is also connected to bus 1604.
[0170] The following components are connected to the I / O interface 1605: an input section 1606 including a keyboard, a mouse, etc.; an output section 1607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to the I / O interface 1605 as needed. A removable medium 1611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1610 as needed so that a computer program read therefrom is installed into the storage section 1608 as needed.
[0171] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart 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 includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1609, and / or installed from a removable medium 1611. When the computer program is executed by a central processing unit (CPU) 1601, various functions defined in the system of the present application are executed.
[0172] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can 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 can be any tangible medium containing or storing a program, which can 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 can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program 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 computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0173] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the 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 flowchart, and the combination of boxes in the block diagram or flowchart 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.
[0174] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0175] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the virtual machine migration method as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0176] Another aspect of the present application also provides a computer program product or a computer program, the computer program product or the computer program includes a computer instruction, the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the virtual machine migration method provided in each of the above embodiments.
[0177] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A virtual machine migration method, characterized in that: include: According to the communication relationship of each virtual machine in the overloaded node in the node network, respectively calculate the flow correlation value of each virtual machine, the flow correlation value is obtained according to the correlation between the corresponding virtual machine and other virtual machines in the node network; The calculating the flow correlation value of each virtual machine respectively according to the communication relationship of each virtual machine in the overloaded node in the node network includes: Calculating a first correlation between any two virtual machines in the overloaded node; Calculating a second correlation between any virtual machine in the overloaded node and any virtual machine in other nodes of an upstream switch, where the upstream switch is an upstream switch of the overloaded node; Calculating a third correlation between any virtual machine in the overloaded node and any virtual machine in a node across a switch, where the across switch is a switch that has communication interaction with the uplink switch; Calculate the traffic correlation value of each virtual machine according to the first correlation, the second correlation and the third correlation corresponding to each virtual machine; According to the numerical values of the traffic correlation values of the virtual machines, the corresponding virtual machines are sequentially added to the queue to be migrated in ascending order of numerical values; The migration process is performed on each virtual machine in the queue to be migrated in sequence until the load of the overloaded node is less than a preset threshold.
2. The method according to claim 1, characterized in that The step of sequentially migrating each virtual machine in the queue to be migrated until the load of the overloaded node is less than a preset threshold comprises: Obtaining a first virtual machine from the head of the queue to be migrated, migrating the first virtual machine to another node in the node network, and deleting an element in the head of the queue to be migrated; The steps of obtaining the first virtual machine from the head of the queue to be migrated, migrating the first virtual machine to other nodes in the node network, and deleting the elements in the head of the queue to be migrated are executed in a loop until the load of the overloaded node is less than the preset threshold.
3. The method according to claim 2, characterized in that The acquiring the first virtual machine from the head of the queue to be migrated, and migrating the first virtual machine to another node in the node network includes: Determine whether there is a correlation between the first virtual machine and other virtual machines; If it does not exist, the node with the smallest load in the node network is used as the target node, and the first virtual machine is migrated to the target node.
4. The method according to claim 2, characterized in that: The acquiring the first virtual machine from the head of the queue to be migrated, and migrating the first virtual machine to another node in the node network includes: According to the correlation values between the first virtual machine and other virtual machines, obtaining a second virtual machine, wherein the correlation value between the second virtual machine and the first virtual machine is the largest; If the second virtual machine is deployed on the overloaded node, the node with the smallest load on the upstream switch of the overloaded node is used as the target node, and the first virtual machine is migrated to the target node.
5. The method according to claim 2, characterized in that: The acquiring the first virtual machine from the head of the queue to be migrated, and migrating the first virtual machine to another node in the node network includes: According to the correlation values between the first virtual machine and other virtual machines, obtaining a second virtual machine, wherein the correlation value between the second virtual machine and the first virtual machine is the largest; If the second virtual machine is deployed on a cross-switch, determining whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine, wherein the cross-switch is another switch that has communication interaction with the uplink switch of the overloaded node; If the conditions are met, migrating the first virtual machine to the node where the second virtual machine is located; Otherwise, the node with the smallest load on the cross-switch where the second virtual machine is located is used as the target node, and the first virtual machine is migrated to the target node.
6. The method according to claim 2, characterized in that The acquiring the first virtual machine from the head of the queue to be migrated, and migrating the first virtual machine to another node in the node network includes: According to the correlation values between the first virtual machine and other virtual machines, obtaining a second virtual machine, wherein the correlation value between the second virtual machine and the first virtual machine is the largest; If the second virtual machine is deployed on the upstream switch of the overloaded node, determining whether the node where the second virtual machine is located meets the migration requirements of the first virtual machine; If the conditions are met, migrating the first virtual machine to the node where the second virtual machine is located; Otherwise, the node with the smallest load on the uplink switch is used as the target node, and the first virtual machine is migrated to the target node.
7. A virtual machine migration device, characterized in that: include: A traffic correlation value acquisition module, configured to calculate the traffic correlation value of each virtual machine in the overloaded node according to the communication relationship between the virtual machines in the node network, wherein the traffic correlation value is obtained according to the correlation between the corresponding virtual machine and other virtual machines in the node network; The traffic correlation value acquisition module includes: A first correlation obtaining unit, configured to calculate a first correlation between any two virtual machines in the overloaded node; A second correlation obtaining unit, configured to calculate a second correlation between any virtual machine in the overloaded node and any virtual machine in other nodes of an upstream switch, wherein the upstream switch is an upstream switch of the overloaded node; A third correlation obtaining unit is configured to calculate a third correlation between any virtual machine in the overloaded node and any virtual machine in a node across a switch, wherein the across switch is a switch that has communication interaction with the uplink switch; A traffic correlation value acquiring unit, configured to respectively calculate the traffic correlation value of each virtual machine according to the first correlation, the second correlation and the third correlation corresponding to each virtual machine; A queue acquisition module to be migrated is configured to add the corresponding virtual machines to the queue to be migrated in sequence according to the numerical values of the traffic correlation values of the virtual machines and in the order of the numerical values from small to large; The migration module is configured to sequentially perform migration processing on each virtual machine in the queue to be migrated until the load of the overloaded node is less than a preset threshold.
8. An electronic device, characterized in that: include: one or more processors; A storage device, used to store one or more computer programs, when the one or more computer programs are executed by the one or more processors, enables the electronic device to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 6.
