CN114035906A - Virtual machine migration method and device, electronic equipment and storage medium - Google Patents

Virtual machine migration method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114035906A
CN114035906A CN202111519104.XA CN202111519104A CN114035906A CN 114035906 A CN114035906 A CN 114035906A CN 202111519104 A CN202111519104 A CN 202111519104A CN 114035906 A CN114035906 A CN 114035906A
Authority
CN
China
Prior art keywords
virtual machine
node
correlation
virtual
migrated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111519104.XA
Other languages
Chinese (zh)
Inventor
师春雨
李阳春
樊勇兵
黄志兰
朱万意
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202111519104.XA priority Critical patent/CN114035906A/en
Publication of CN114035906A publication Critical patent/CN114035906A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a virtual machine migration method, a virtual machine migration device, an electronic device and a storage medium, wherein the method comprises the following steps: respectively calculating the traffic correlation value of each virtual machine according to the communication relation of each virtual machine in the overload node 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; according to the numerical value of the flow correlation value of each virtual machine, sequentially adding the corresponding virtual machines into a queue to be migrated according to the arrangement sequence of the numerical values from small to large; and migrating all the virtual machines of the queue to be migrated in sequence until the load of the overload node is smaller than a preset threshold value. According to the technical scheme, the virtual machines which are preferentially migrated are determined according to the numerical value of the traffic relevance value of the virtual machines in the overload node, so that the load of the overload node is reduced, and the problem of communication loss increase caused by the fact that the network topology distance between the virtual machines with strong relevance is increased is solved.

Description

Virtual machine migration method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of information technologies, and in particular, to a virtual machine migration method and apparatus, an electronic device, and a storage medium.
Background
The allocation and creation of virtual machines on each physical node in a node network generally only consider whether node resources meet the requirements of the virtual machines, which easily causes uneven allocation of the virtual machines among the nodes, and the service network load (flow in the north-south direction) of the virtual machines in a single node often changes along with the change of the user scale, when the load of the whole service network of the node is too large, the communication capacity and the service quality of each virtual machine in the node are affected, and even service interruption is caused. Using virtual machine migration within the traffic network overload node is an effective solution to the above-mentioned problems.
Most of existing automatic online migration methods for virtual machines use the utilization rate of physical resources of nodes as the judgment of the migration standard of the virtual machines, when a node network is applied, a communication relationship often exists among a plurality of virtual machines, that is, when the plurality of virtual machines communicate with each other to provide services to the outside, for example, a large-scale software application is split into a plurality of simple container applications which can be deployed independently, the simple container applications are deployed in different virtual machines respectively, and the applications communicate closely and provide services to the outside (flow in the east-west direction), under which the judgment method using the utilization rate of physical resources of nodes as the migration standard of the virtual machines easily causes the problems of increased communication loss, reduced service quality and the like caused by the fact that the network topology distance between the virtual machines is increased when the virtual machines migrate.
Disclosure of Invention
In order to solve the foregoing technical problems, embodiments of the present application provide a virtual machine migration method and apparatus, an electronic device, and a computer-readable storage medium, where the virtual machine migration is performed according to the traffic correlation value of each virtual machine in an overloaded node, so that the load of a node network can be efficiently reduced.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a virtual machine migration method, including: respectively calculating flow correlation values of all virtual machines in an overload node according to the communication relation of all virtual machines in a node network, wherein the flow correlation values are obtained according to the correlation between corresponding virtual machines and other virtual machines in the node network; according to the numerical value of the flow correlation value of each virtual machine, sequentially adding the corresponding virtual machines into a queue to be migrated according to the arrangement sequence of the numerical values from small to large; sequentially carrying out migration processing on all the virtual machines of the queue to be migrated until the load of the overload node is smaller than a preset threshold value
In an embodiment, the calculating the traffic correlation value of each virtual machine in the overloaded node according to the communication relationship of each virtual machine in the node network includes:
calculating a first correlation between any two virtual machines in the overload node;
calculating a second correlation between any virtual machine in the overload node and any virtual machine in other nodes of an upper connection switch, wherein the upper connection switch is the upper connection switch of the overload node;
calculating a third correlation between any virtual machine in the overload node and any virtual machine in a node across switches, wherein the cross switches are switches which have communication interaction with the upper-connected switch;
and respectively calculating the flow correlation value of each virtual machine according to the first correlation, the second correlation and the third correlation corresponding to each virtual machine.
In an embodiment, the sequentially migrating each virtual machine of the queue to be migrated until the load of the overloaded node is less than a preset threshold includes:
acquiring 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 comprise nodes where the virtual machine with the largest correlation with the first virtual machine is located;
and circularly executing the steps of acquiring 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 elements in the head of the queue to be migrated until the load of the overload node is smaller than the preset threshold value.
In an embodiment, the acquiring a 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:
judging whether correlation exists between the first virtual machine and other virtual machines;
and if the first virtual machine does not exist, taking the node with the minimum load in the node network as a target node, and migrating the first virtual machine to the target node.
In an embodiment, the acquiring a 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:
acquiring a second virtual machine according to the magnitude of the correlation value 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;
and if the second virtual machine is deployed on the overload node, taking the node with the minimum load on the uplink switch of the overload node as a target node, and migrating the first virtual machine to the target node.
In an embodiment, the acquiring a 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:
acquiring a second virtual machine according to the magnitude of the correlation value 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;
if the second virtual machine is deployed on a cross-switch, judging whether a node where the second virtual machine is located meets the migration requirement of the first virtual machine, wherein the cross-switch is another switch which has communication interaction with an upper-link switch of the overload node;
if yes, migrating the first virtual machine to a node where the second virtual machine is located;
otherwise, taking the node with the minimum load on the cross-switch where the second virtual machine is located as a target node, and migrating the first virtual machine to the target node.
In an embodiment, the acquiring a 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:
acquiring a second virtual machine according to the magnitude of the correlation value 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;
if the second virtual machine is deployed on the uplink switch of the overload node, judging whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine;
if yes, migrating the first virtual machine to a node where the second virtual machine is located;
otherwise, taking the node with the minimum load on the upper connection exchanger as a target node, and migrating the first virtual machine to the target node.
According to an aspect of an embodiment of the present application, there is provided a virtual machine migration apparatus, including: the system comprises a traffic correlation value acquisition module, a node network and a traffic correlation value calculation module, wherein the traffic correlation value acquisition module is configured to respectively calculate traffic correlation values of all virtual machines in an overload node according to communication relations of all virtual machines in the node network, and the traffic correlation values are obtained according to correlations between corresponding virtual machines and other virtual machines in the node network; the queue to be migrated acquiring module is configured to sequentially add the corresponding virtual machines into a queue to be migrated according to an arrangement sequence of values from small to large according to the value size of the traffic correlation value of each virtual machine; and the migration module is configured to sequentially perform migration processing on the virtual machines of the queue to be migrated until the load of the overload node is smaller than a preset threshold value.
According to an aspect of an embodiment of the present application, there is provided an electronic device including one or more processors; storage means for storing one or more computer programs that, when executed by the one or more processors, cause the electronic device to implement the virtual machine migration method as described above.
According to an aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored thereon computer-readable instructions, which, when executed by a processor of a computer, cause the computer to execute the virtual machine migration method as described above.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the virtual machine migration method provided in the various alternative embodiments described above.
In the technical scheme provided by the embodiment of the application, the virtual machines which are preferentially migrated are determined according to the numerical value of the traffic relevance value of the virtual machines in the overload node, so that the load of the overload node is reduced, the virtual machines with smaller traffic relevance value are preferentially migrated, and the problem of communication loss increase caused by the fact that the network topology distance between the virtual machines with stronger relevance is increased when the virtual machines with larger relevance to the virtual machines in the overload node are migrated is solved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a schematic illustration of an implementation environment to which the present application relates;
FIG. 2 is a flow chart illustrating a method of virtual machine migration in accordance with an exemplary embodiment of the present application;
FIG. 3 is a flow chart of step S210 in the embodiment shown in FIG. 2 in an exemplary embodiment;
FIG. 4 is a flow chart of step S250 in the embodiment shown in FIG. 2 in an exemplary embodiment;
FIG. 5 is a flow chart of step S410 in the embodiment shown in FIG. 4 in an exemplary embodiment;
FIG. 6 is a flow chart of step S410 in the embodiment shown in FIG. 4 in another exemplary embodiment;
FIG. 7 is a flow chart of step S410 in the embodiment shown in FIG. 4 in another exemplary embodiment;
FIG. 8 is a flow chart of step S410 in the embodiment shown in FIG. 4 in another exemplary embodiment;
fig. 9 is a schematic structural diagram of a virtual machine migration apparatus according to another exemplary embodiment of the present application;
FIG. 10 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It should also be noted that: reference to "a plurality" in this application means two or more. "and/or" describe the association relationship of the associated objects, meaning that there may be three relationships, e.g., A and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The virtual machine migration method and apparatus, the electronic device, and the storage medium provided in the embodiments of the present application relate to artificial intelligence technology and machine learning technology, and the embodiments will be described in detail below.
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 configured to collect node network data, where the node network data includes a structure of a node network, a load of each node in the node network, communication traffic data of each node in the node network, and the like; meanwhile, the terminal 100 also inputs the collected node network data to the server 200, the server 200 processes the node network data, the nodes with loads larger than a preset threshold value are used as overload nodes according to the loads of the nodes in the node network, then the traffic correlation values of the virtual machines are respectively calculated according to the communication relations of the virtual machines in the overload nodes in the node network, the migration priorities of the virtual machines in the overload nodes are confirmed through the traffic correlation values, and the virtual machines with high priorities are migrated to other nodes, so that the loads of the overload nodes are reduced.
Exemplarily, after the terminal 100 collects the node network data, the node network data is sent to the server 200, the server 200 performs data processing on the node network data, if a node with a load larger than a preset threshold is used as an overload node according to a load of each node in the node network, a traffic correlation value of each virtual machine in the overload node is respectively calculated according to a communication relationship of each virtual machine in the node network, and the traffic correlation value is obtained according to a correlation between the corresponding virtual machine and other virtual machines in the node network; according to the numerical value of the flow correlation value of each virtual machine, sequentially adding the corresponding virtual machines into a queue to be migrated according to the arrangement sequence of the numerical values from small to large; and migrating all the virtual machines of the queue to be migrated in sequence until the load of the overload node is smaller than a preset threshold value.
The terminal 100 may be any electronic device capable of implementing data visualization, such as a smart phone, a tablet, a notebook, and a computer, and is not limited in this respect. The server 200 may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, where the plurality of servers may form a block chain, and the server is a node on the block chain, and the server 200 may also be a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, CDN (Content Delivery Network ), big data, and artificial intelligence platform, which is not limited herein.
FIG. 2 is a flowchart illustrating a method of virtual machine migration in accordance with an exemplary embodiment. As shown in fig. 2, in an exemplary embodiment, the method may include steps S210 to S250, which are described in detail as follows:
step S210: and respectively calculating the traffic correlation value of each virtual machine in the overload node according to the communication relation of each virtual machine in the node network.
In this embodiment, a node in the node network whose node load (actual network throughput) is greater than a preset threshold is referred to as an overloaded node, where the overloaded node may cause communication loss in the node network to affect service quality, and the preset thresholds in this embodiment may be set according to actual bandwidth conditions of different nodes, respectively.
In this embodiment, the traffic relevance value is obtained according to the relevance between the corresponding virtual machine and other virtual machines in the node network, specifically, for any virtual machine a in the overload node, the relevance between the virtual machine a and the other virtual machines in communication relationship with the virtual machine a is obtained, and if the virtual machine a is in communication with some virtual machines in the overload node, a plurality of first relevance between the virtual machine a and any virtual machine in communication relationship with the overload node are first calculated; the virtual machine in the overload node in the node network carries out service communication through the overload node and an upper connection switch in an access layer, a plurality of nodes can be linked under one upper connection switch, and the virtual machines among the nodes can also have communication relations, so that the second correlation between the virtual machine A and the virtual machines in other nodes under the upper connection switch of the overload node can be calculated; meanwhile, for the node network, there may be a plurality of switches in the access layer, and the traffic passing through the switches in the access layer is further subjected to traffic aggregation through the switches in the aggregation layer, that is, there may also be a communication relationship between the switches in the access layer, so that a third correlation between the virtual machine a and a virtual machine under a cross-switch in the access layer, which has communication with the upper switch of the overloaded node, may also be calculated.
Therefore, the first correlation, the second correlation and the third correlation of the virtual machine A can be obtained, and the flow correlation value of the virtual machine A can be obtained through the three correlations of the virtual machine A.
Step S230: and according to the numerical value of the flow correlation value of each virtual machine, sequentially adding the corresponding virtual machines into the queue to be migrated according to the arrangement sequence of the numerical values from small to large.
The traffic correlation value in this embodiment can represent a communication relationship of the virtual machine a, for example, can represent a node with which the virtual machine a communicates frequently in the node network. If the traffic correlation value is larger, it proves that the traffic correlation between the virtual machine a and the virtual machine in the overloaded node or the virtual machines in other nodes below the uplink switch is strong, and the communication is frequent, then if the virtual machine a is migrated to other nodes, the network topology distance between the virtual machines with strong correlation is increased, so that the communication loss is increased, and the service quality of the network node is further affected, so that the migration priority of the virtual machine a should be reduced, that is, the migration of other virtual machines with high priority is performed first; if the traffic relevance value is smaller, the traffic relevance between the virtual machine A and the virtual machine in the cross-switch node is strong, the communication with the virtual machine in the cross-switch is frequent, the migration priority of the virtual machine A can be increased, the virtual machine A is migrated to the node where the virtual machine with the largest relevance is located, and the communication loss between the virtual machines is reduced.
Therefore, the migration priority of each virtual machine can be determined through the traffic relevance value of each virtual machine in the overload node, the virtual machines are respectively placed into the queue to be migrated according to the numerical value of the traffic relevance value in the descending order, and the traffic relevance value corresponding to each virtual machine is gradually increased from the head of the queue to the tail of the queue to be migrated when the virtual machine with the minimum traffic relevance value is at the head of the queue to be migrated.
Step S250: and migrating all the virtual machines of the queue to be migrated in sequence until the load of the overload node is smaller than a preset threshold value.
In this embodiment, migration processing is performed on each virtual machine of a queue to be migrated in sequence according to the "first-in first-out" characteristic of the queue, if the virtual machine of the queue to be migrated is migrated, the virtual machine at the head of the queue is migrated, then the virtual machine at the head of the queue is deleted, the second row element of the queue to be migrated is the head of the queue, then the virtual machine at the head of the queue is migrated, and after one virtual machine is migrated each time, the load of the overload node is compared with the preset threshold value, and the operation is repeated in this way until the load of the overload node is smaller than the preset threshold value after one virtual machine is migrated, that is, the load of the overload node is already in the normal communication range, and then migration of the virtual machines in the queue to be migrated is stopped.
In this embodiment, the migration position may be determined according to the correlation between the virtual machine to be migrated and another virtual machine, or may be determined according to the size of the node load in the node network, for example, the virtual machine is migrated to a node with a smaller load, which is not limited herein.
In this embodiment, a plurality of overload nodes may exist in one node network, and in practical application, all the overload nodes in one node network may be added into one overload node queue, and then virtual machine migration is performed on each overload node in the overload node queue in sequence by the above method, so as to finally achieve the purpose of reducing the load of the node network.
Certainly, the load of each node in the node network can be monitored in real time, the threshold value is set according to the actual condition of the node bandwidth, when the actual network throughput of the node is larger than the set threshold value, the node service network is overloaded, and when a new overloaded node appears, the new overloaded node is added into an overloaded node queue to indicate that the virtual machines in the nodes of the overloaded node queue need to be migrated, so that the real-time monitoring and control of the node network load can be realized, and the reduction of SLA (service level agreement) and even service interruption caused by the overhigh service network load can be effectively avoided.
In this embodiment, a traffic correlation value of each virtual machine is determined through a communication relationship in a node network, and the traffic correlation is used as a criterion for evaluating a migration priority in an overload node, where a virtual machine with a smaller traffic correlation is a virtual machine with a smaller correlation with the virtual machine in the overload node, and the communication frequency is lower, so that the virtual machine with a smaller traffic correlation is used as a virtual machine that preferentially migrates, and thus, while the load of the overload node is reduced, the problems of network topology distance increase between virtual machines with a stronger correlation caused by migrating a virtual machine with a larger correlation with the virtual machine in the overload node and communication loss increase caused by the fact that the topology distance increases are reduced; on the other hand, the virtual machines are sequentially added into the queue to be migrated according to the value of the traffic relevance value, and the virtual machines with high priority are sequentially migrated through the queue, so that the migration is quicker and more convenient; moreover, the virtual machine migration performed by the method can effectively optimize the virtual machine distribution of the node network under the condition that the mutual communication among the plurality of virtual machines provides services to the outside, so that the distance among the virtual machines with the communication relation in the node network is closer, and the communication loss is reduced.
Fig. 3 is a flow chart of step S210 in an exemplary embodiment in the embodiment shown in fig. 2. As shown in fig. 3, in an exemplary embodiment, the process of calculating the traffic correlation value of each virtual machine in the overloaded node according to the communication relationship of each virtual machine in the node network may include steps S310 to S370, which are described in detail as follows:
step S310: a first correlation between any two virtual machines within the overloaded node is computed.
In this embodiment, the correlation value of each virtual machine in the overloaded node is obtained by the correlation between the corresponding virtual machine and another virtual machine, specifically, the first correlation between a certain virtual machine and any other virtual machine in the overloaded node can be obtained by the first correlation before any two virtual machines in the overloaded node, for example, for the virtual machine a in the overloaded node, the virtual machine having a communication relationship with the virtual machine a is obtained in the virtual machine in the overloaded node, if a communication relationship exists between a certain virtual machine B and the virtual machine a, the first correlation between the virtual machine a and the virtual machine B is calculated by using a correlation calculation algorithm, and if a communication relationship does not exist between the virtual machine a and the virtual machine B, the first correlation between the virtual machine a and the virtual machine B is 0.
Step S330: a second correlation is computed between any virtual machine in the overloaded node and any virtual machine in other nodes of the upstream switch.
In this embodiment, the upper switch is an overload node and is in an access layer, the virtual machines in the overload node perform service communication through the overload node and the upper switch in the access layer, a plurality of nodes may be linked below one upper switch, the virtual machines in the plurality of nodes perform service communication through the upper switch, the plurality of nodes include the overload node, a plurality of virtual machines are respectively disposed below other nodes, and the second correlation is obtained by performing correlation calculation on any virtual machine a in the overload node and any virtual machine C in other nodes except the overload node in the upper switch.
Through the above process, the second correlation between any virtual machine a in the overloaded node and any virtual machine C in the other node of the uplink switch, which has a communication relationship with the virtual machine a, can be obtained, and similarly, if there is no communication relationship between the virtual machine a in the overloaded node and the virtual machine C, the first correlation between the virtual machine a and the virtual machine C is 0.
Step S350: a third correlation is calculated between any virtual machine in the overloaded node and any virtual machine in a node across switches.
In this embodiment, the cross switch is a switch that has communication interaction with the upper switches, for the node network, the access layer may have a plurality of switches, and the traffic passing through the switches of the access layer is further aggregated by the switches of the aggregation layer, that is, a communication relationship may also exist between the switches of the access layer, so the switch that is located in the access layer and has a communication relationship with the upper switch of the overloaded node is referred to as the cross switch.
Through the communication relationship between any virtual machine A in the overload node and any virtual machine D in the node crossing the switch, the third correlation can be obtained based on the correlation calculation algorithm, and similarly, if the communication relationship does not exist between the virtual machine A in the overload node and the virtual machine D, the first correlation between the virtual machine A and the virtual machine D is 0.
Step S370: and respectively calculating the flow correlation value of each virtual machine according to the first correlation, the second correlation and the third correlation corresponding to each virtual machine.
In this embodiment, if a traffic correlation value of a virtual machine a in the overload node needs to be calculated, the first correlation between the virtual machine a and any virtual machine in the overload node is obtained in step S310, and all the first correlations of the virtual machine a are added to obtain a total correlation (communication ac frequency) representing the virtual machine a and the virtual machines in the overload node; then, the second correlation between the virtual machine a and any virtual machine in other nodes of the upper switch is obtained in step S330, and all the second correlations of the virtual machine a are added to obtain a total correlation between the virtual machine a and any virtual machine in other nodes of the upper switch, then the third correlation between the virtual machine a and any virtual machine in nodes of the cross switch is obtained in step S350, and all the third correlations of the virtual machine a are added to obtain a total correlation between the virtual machine a and virtual machines in other nodes of the cross switch, and then the traffic correlation of the virtual machine a is calculated from the total correlation between the virtual machine a and the virtual machine in the overloaded node, the virtual machine in other nodes of the upper switch, and the virtual machine in other nodes of the cross switch. Is composed of
Specifically, the flow correlation value of each virtual machine can be calculated by the following formula:
Figure BDA0003406836240000101
wherein R (i) is the traffic correlation of the virtual machine i in the overload node, j is any virtual machine out of the virtual machine i in the overload node, N1 is the overload node,
Figure BDA0003406836240000102
for the first correlation between the virtual machine i and the virtual machine j, Nr is a node r except the overloaded node in the overloaded node uplink switch, S1 is the overloaded node uplink switch, me belongs to Nr is a virtual machine m in the node r,
Figure BDA0003406836240000103
for a second correlation between virtual machine i and virtual machine m, Nq is node q across switch w, Sw is cross switch w, n is virtual machine n across node q in switch w,
Figure BDA0003406836240000104
is a third correlation between virtual machine i and virtual machine n.
In this embodiment, a method for calculating a traffic correlation of a corresponding virtual machine through a total correlation between a virtual machine in an overload node and virtual machines in the overload node, other nodes in an upper switch, and other nodes in a cross switch is provided, the traffic correlation of the corresponding virtual machine and the overload node, the upper switch, and the cross switch can be represented, and finally, a migration priority of the corresponding virtual machine is determined through the traffic correlation, so that a virtual machine with a low correlation to the overload node is preferentially migrated through the traffic correlation, and a problem of communication loss increase caused by migration of some virtual machines with a high traffic correlation is reduced.
Fig. 4 is a flowchart of step S250 in an exemplary embodiment in the embodiment shown in fig. 2. As shown in fig. 4, in an exemplary embodiment, the process of sequentially migrating each virtual machine of the queue to be migrated until the load of the overloaded node is less than the preset threshold may include steps S410 to S470, which are described in detail as follows:
step S410: and acquiring 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 elements in the head of the queue to be migrated.
When migrating virtual machines in overloaded nodes, the correlation of east-west traffic among the virtual machines may cause the network topology distance between the virtual machines with strong correlation to become far, thereby increasing communication loss, and further affecting the service quality of network nodes.
In this embodiment, the virtual machines in the overloaded node are migrated to reduce the load of the overloaded node, and as can be seen from fig. 2, the queue to be migrated represents the priority of virtual machine migration in the overloaded node, so that the virtual machine corresponding to the head of the queue to be migrated is the virtual machine with the highest migration priority.
After the first virtual machine is obtained from the queue to be migrated, according to the first correlation, the second correlation, and the third correlation of the first virtual machine, the node where the virtual machine with the largest correlation value with the first virtual machine is located may be selected as the migration destination, or the first virtual machine may be migrated to another node with a smaller load.
After the first virtual machine is migrated, the elements in the queue head of the queue to be migrated may be deleted, which proves that the virtual machine corresponding to the deleted elements has been migrated.
Step S430: and judging whether the load of the overload node is smaller than a preset threshold value or not.
After a virtual machine in a queue to be migrated is migrated, detecting the load of the overload node again, and detecting whether the load is smaller than a preset threshold value, if so, proving that the load of the overload node can achieve a normal communication level and cannot cause a large amount of communication loss, otherwise, the load of the overload node is still too heavy, and the communication loss is caused.
Step S450: if not, go to step S410.
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 communication loss is caused, at this time, the step S410 is performed, the first virtual machine is obtained from the queue to be migrated, and the first virtual machine obtained in the step is still the first element of the queue to be migrated, and is still considered as the head of the queue, because the element corresponding to the virtual machine that has been migrated in the past in the queue to be migrated has been deleted, that is, the first virtual machine obtained at this time is the next element of the element deleted in the queue to be migrated.
Step S470: otherwise, ending.
In this embodiment, step S410 is cycled, and step S430 is performed to determine whether the overloaded node is overloaded after the virtual machine is migrated, until the load of the overloaded node is smaller than the preset threshold, the cycle is ended, that is, the virtual machines in the queue to be migrated are not migrated any more.
In this embodiment, virtual machines in the overloaded node are migrated to other nodes according to the migration priority order according to the order of the queues to be migrated, so that the migration of the queues to be migrated is more scientific according to the priority order while the load of the overloaded node is effectively reduced, and the virtual machines with strong correlation with the overloaded node are migrated to other nodes, which causes that the network topology distance between the virtual machines becomes longer, the communication loss increases, and the service quality is damaged.
Fig. 5 is a flowchart of step S410 in an exemplary embodiment in the embodiment shown in fig. 4. As shown in fig. 5, in an exemplary embodiment, the process of 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 may include steps S510 to S530, which are described in detail as follows:
step S510: and judging whether correlation exists between the first virtual machine and other virtual machines.
In this embodiment, the migration destination of the first virtual machine can be determined by correlation between the first virtual machine and another virtual machine.
Step S530: and if the first virtual machine does not exist, taking the node with the minimum load in the node network as a target node, and migrating the first virtual machine to the target node.
Under a certain condition, the first virtual machine does not perform communication interaction with any other virtual machine, that is, the first virtual machine can realize service communication with the switch through the node alone, and then migration of the first virtual machine to any position does not cause the topological distance of the communication network between the virtual machines to be increased, so that the communication loss is increased, that is, the node with the minimum load can be selected as the target node in the node network, and the first virtual machine is migrated to the target node, so that the load of the overloaded node is reduced on one hand, and on the other hand, selection of the node with the minimum load as the target node does not cause too large load of the target node, and compared with other nodes as the target nodes, the method is more scientific.
In this embodiment, no communication interaction is performed with any other virtual machine, the first virtual machine is migrated to the node with the smallest load in the node network, and the node with the smallest load is more scientific as a migration target node than other nodes as target nodes while the load of the overloaded node is reduced, so that the possibility of the target node being overloaded is lower.
Fig. 6 is a flowchart of step S410 in an exemplary embodiment in the embodiment shown in fig. 4. As shown in fig. 6, in an exemplary embodiment, the process of acquiring 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:
step S610: and acquiring a second virtual machine according to the correlation value between the first virtual machine and other virtual machines.
In this embodiment, the correlation value between the second virtual machine and the first virtual machine is the largest.
In this embodiment, the virtual machine with the largest correlation value with the first virtual machine may be selected as the second virtual machine according to the magnitudes of the first correlation, the second correlation, and the third correlation of the first virtual machine, and if the correlation value in the first virtual machine is the largest correlation value M, and the first correlation value M is the first line correlation between the first virtual machine and the virtual machine M, the virtual machine M is taken as the second virtual machine.
Step S630: and if the second virtual machine is deployed on the overload node, taking the node with the minimum load on the uplink switch of the overload node as a target node, and migrating the first virtual machine to the target node.
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 overloaded node is overloaded, and the migration priority of the first virtual machine is still the highest of the migration priorities of the existing virtual machines within the overloaded node, if the first virtual machine has a larger relevance with other virtual machines of the uplink switch, but the first relevance with the second virtual machine is not exceeded, the first virtual machine still needs to be migrated, at this time, the node with the minimum load on the uplink switch of the overloaded node is taken as the target node, and the first virtual machine is migrated to the target node, the load of the overload node is reduced, and meanwhile, the network topology distance between the virtual machines with strong correlation is reduced to be far, so that the communication loss is increased.
The embodiment provides that when the virtual machine with the strongest correlation of the first virtual machine is in the overloaded node, the first virtual machine is migrated to the node with the smallest load on the upper-connected switch, so that the load of the overloaded node is reduced, the network topology distance between the first virtual machine and the second virtual machine is not excessively expanded, and the problems of longer network topology distance between the virtual machines with stronger correlation, increased communication loss, reduced service quality and the like caused by migrating the first virtual machine to other nodes or nodes in other switches are prevented.
Fig. 7 is a flowchart of step S410 in an exemplary embodiment in the embodiment shown in fig. 4. As shown in fig. 7, in an exemplary embodiment, the process of 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 may include steps S710 to S770, which are described in detail as follows:
step S710: and acquiring a second virtual machine according to the correlation value between the first virtual machine and other virtual machines.
In this embodiment, the correlation value between the second virtual machine and the first virtual machine is the largest.
In this embodiment, the virtual machine with the largest value of the first virtual correlation can be selected as the second virtual machine according to the magnitudes of the first correlation, the second correlation and the third correlation of the first virtual machine, and if the largest value of the correlation in the first virtual machine is the third correlation N, and the third correlation N is the third line correlation between the first virtual machine and the virtual machine N, the virtual machine N is taken as the second virtual machine.
Step S730: and if the second virtual machine is deployed on the cross-switch, judging whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine.
In this embodiment, the cross switch is another switch that has communication interaction with the uplink switch of the overloaded node.
In this embodiment, it is determined whether the second virtual machine is on a cross-switch, if the third correlation between the second virtual machine and the first virtual machine is the largest, that is, only the second virtual machine is a certain virtual machine in a certain node on the cross-switch, at this time, communication between the second virtual machine and the first virtual machine is the most frequent, so that the node where the second virtual machine is located is determined, the load of the node where the second virtual machine is located is detected, and it is determined whether the remaining resources of the node where the second virtual machine is located meet the requirement of the first virtual machine, that is, whether the node where the second virtual machine is located is overloaded after the first virtual machine is migrated.
Step S750: and if so, migrating the first virtual machine to the node where the second virtual machine is located.
If the remaining resources of the node where the second virtual machine is located meet the requirement of the first virtual machine, the first virtual machine can be migrated to the node where the second virtual machine is located, and at this time, the network topology distance between the first virtual machine and the second virtual machine with the strongest correlation (most frequent communication) with the first virtual machine is shortest, and the communication loss is least.
Step S770: otherwise, taking the node with the minimum load on the cross-switch where the second virtual machine is located as the target node, and migrating the first virtual machine to the target node.
If the remaining resources of the node where the second virtual machine is located do not meet the migration requirement of the first virtual machine, it is proved that the node where the second virtual machine is located is overloaded due to the fact that the first virtual machine migrates to the node where the second virtual machine is located, the node where the second virtual machine is located and which has the smallest load on the cross-switch is taken as a target node, the first virtual machine migrates to the target node, the overload node load is reduced, meanwhile, the first virtual machine migrates to the node where the second virtual machine is located and which has the smallest load on the cross-switch, the network topology distance between the first virtual machine and the second virtual machine can be reduced, and meanwhile, the problem of the node load caused by the node where the second virtual machine migrates to the node is avoided.
In this embodiment, the node where the second virtual machine with the largest 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, the communication loss is the least, and meanwhile, when the remaining resources of the node where the second virtual machine is located do not meet the migration requirement 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, so that the problem of node load caused by migrating to the node where the second virtual machine is located is avoided while the network topology distance between the first virtual machine and the second virtual machine is reduced.
Fig. 8 is a flowchart of step S410 in an exemplary embodiment in the embodiment shown in fig. 4. As shown in fig. 8, in an exemplary embodiment, the process of acquiring 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:
step S810: and acquiring a second virtual machine according to the correlation value between the first virtual machine and other virtual machines.
In this embodiment, the correlation value between the second virtual machine and the first virtual machine is the largest.
In this embodiment, the virtual machine with the largest value of the first virtual correlation can be selected as the second virtual machine according to the magnitudes of the first correlation, the second correlation and the third correlation of the first virtual machine, and if the largest value of the correlation in the first virtual machine is the second correlation S and the third correlation S is the third line correlation between the first virtual machine and the virtual machine S, the virtual machine S is taken as the second virtual machine.
Step S830: and if the second virtual machine is deployed on the uplink switch of the overload node, judging whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine.
In this embodiment, it is determined whether the second virtual machine is on the uplink switch, and if the second correlation between the second virtual machine and the first virtual machine is the largest, only the second virtual machine may be a certain virtual machine in other nodes on the uplink switch, and at this time, communication between the second virtual machine and the first virtual machine is the most frequent, so that the node where the second virtual machine is located is determined, the load of the node where the second virtual machine is located is detected, and it is determined whether the remaining resources of the node where the second virtual machine is located meet the requirement of the first virtual machine, that is, whether the node where the second virtual machine is located is overloaded after the first virtual machine is migrated.
Step S850: and if so, migrating the first virtual machine to the node where the second virtual machine is located.
If the remaining resources of the node where the second virtual machine is located meet the requirement of the first virtual machine, the first virtual machine can be migrated to the node where the second virtual machine is located, and at this time, the network topology distance between the first virtual machine and the second virtual machine with the strongest correlation (most frequent communication) with the first virtual machine is shortest, and the communication loss is least.
Step S870: otherwise, taking the node with the minimum load on the uplink switch as a target node, and migrating the first virtual machine to the target node.
If the remaining resources of the node where the second virtual machine is located do not meet the migration requirement of the first virtual machine, it is proved that the node where the second virtual machine is located is overloaded due to the fact that the first virtual machine migrates to the node where the second virtual machine is located, at this time, the node with the smallest load on the upper switch is taken as the target node, the first virtual machine migrates to the target node, the overload node load is reduced, meanwhile, the first virtual machine migrates to the node with the smallest load on the upper switch, the network topological distance between the first virtual machine and the second virtual machine can be controlled, and meanwhile, the problem that the node load is overloaded due to the fact that the node where the second virtual machine migrates to the node where the second virtual machine is located is avoided.
In this embodiment, the node where the second virtual machine with the largest 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, the communication loss is the least, and meanwhile, when the remaining resources of the node where the second virtual machine is located do not meet the migration requirement 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, and the problem of node load caused by migrating to the node where the second virtual machine is located is avoided while the network topology distance between the first virtual machine and the second virtual machine is controlled.
Fig. 9 is a schematic structural diagram illustrating a virtual machine migration apparatus according to another exemplary embodiment. As shown in fig. 9, in an exemplary embodiment, the virtual machine migration apparatus includes:
a traffic correlation value obtaining module 910, configured to respectively calculate traffic correlation values of the virtual machines in the overloaded node according to communication relationships of the virtual machines in the node network, where the traffic correlation values are obtained according to correlations between the corresponding virtual machines and other virtual machines in the node network;
a queue to be migrated obtaining module 930 configured to, according to the magnitude of the traffic correlation value of each virtual machine, sequentially add the corresponding virtual machines to the queue to be migrated in an order from small to large;
the migration module 950 is configured to sequentially perform migration processing on the virtual machines of the queue to be migrated until the load of the overloaded node is smaller than a preset threshold.
In this embodiment, by using the above structure, while the load of the overload node is reduced, the problems of long network topology distance between virtual machines with strong correlation, increased communication loss, and the like caused by migrating a virtual machine with large correlation with a virtual machine in the overload node are reduced.
In one embodiment, the traffic correlation value obtaining module 910 includes:
the first correlation obtaining unit is configured to calculate a first correlation between any two virtual machines in the overload 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 another node of the upper switch, where the upper switch is the upper switch of the overloaded node;
a third correlation obtaining unit, 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 cross switches are switches having communication interaction with the upper connected switch;
and the flow correlation value acquisition unit is configured to calculate the flow correlation values of the virtual machines according to the first correlation, the second correlation and the third correlation corresponding to the virtual machines.
In one embodiment, the migration module 950 includes:
the migration unit is configured to acquire a first virtual machine from the head of the queue to be migrated, migrate the first virtual machine to other nodes in the node network, and delete elements in the head of the queue to be migrated;
and the circulating unit is configured to circularly execute the steps of acquiring 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 elements in the head of the queue to be migrated until the load of the overload node is less than a preset threshold value.
In one embodiment, the migration unit includes:
the correlation judging plate is configured to judge whether correlation exists between the first virtual machine and other virtual machines;
and the first migration plate is configured to, if the first migration plate does not exist, take the node with the minimum load in the node network as the target node and migrate the first virtual machine to the target node.
In one embodiment, the migration unit includes:
the second virtual machine searching plate is configured to obtain a second virtual machine according to the correlation value between the first virtual machine and other virtual machines, and the correlation value between the second virtual machine and the first virtual machine is the largest;
and the second migration plate is configured to take the node with the minimum load on the uplink switch of the overload node as a target node and migrate the first virtual machine to the target node if the second virtual machine is deployed on the overload node.
In one embodiment, the migration unit includes:
the second virtual machine query board is configured to acquire a second virtual machine according to the magnitude of the correlation value between the first virtual machine and other virtual machines, and the correlation value between the second virtual machine and the first virtual machine is the largest;
a third judging plate, configured to judge whether a node where a second virtual machine is located meets a migration requirement of the first virtual machine if the second virtual machine is deployed on a cross-switch, where the cross-switch is another switch that has communication interaction with an upper switch of the overloaded node;
a third migration plate configured to migrate the first virtual machine to a node where the second virtual machine is located if the first migration plate is satisfied;
and the fourth migration plate is configured to, if not, take the node with the minimum load on the cross-switch where the second virtual machine is located as the target node, and migrate the first virtual machine to the target node.
In one embodiment, the migration unit includes:
a second virtual machine obtaining block configured to obtain a second virtual machine according to the magnitude of the correlation value between the first virtual machine and another virtual machine, the correlation value between the second virtual machine and the first virtual machine being the largest;
a fourth judgment board 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 uplink switch of the overloaded node;
a fifth migration plate configured to migrate the first virtual machine to a node where the second virtual machine is located if the first migration plate is satisfied;
and the sixth migration plate is configured to, if not, take the node with the minimum load on the uplink switch as the target node, and migrate the first virtual machine to the target node.
It should be noted that the virtual machine migration apparatus provided in the foregoing embodiment and the virtual machine migration method provided in the foregoing embodiment belong to the same concept, and specific ways for the modules and units to execute operations have been described in detail in the method embodiment, and are not described herein again.
An embodiment of the present application further provides an electronic device, including: one or more processors; the storage device is configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device is enabled to implement the virtual machine migration method provided in the foregoing embodiments.
FIG. 10 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
It should be noted that the computer system 1600 of the electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 10, computer system 1600 includes a Central Processing Unit (CPU)1601, which can perform various appropriate actions and processes, such as executing the methods in the above-described embodiments, according to a program stored in a Read-Only Memory (ROM) 1602 or a program loaded from a storage portion 1608 into a Random Access Memory (RAM) 1603. In the RAM 1603, various programs and data necessary for system operation are also stored. The CPU 1601, ROM 1602, and RAM 1603 are connected to each other via a bus 1604. An Input/Output (I/O) interface 1605 is also connected to the bus 1604.
The following components are connected to the I/O interface 1605: an input portion 1606 including a keyboard, a mouse, and the like; an output section 1607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 1608 including a hard disk and the like; and a communication section 1609 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1609 performs communication processing via a network such as the internet. The driver 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, or the like is mounted on the drive 1610 as necessary, so that a computer program read out therefrom is mounted in the storage portion 1608 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1609, and/or installed from the removable media 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.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied 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 foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Another aspect of the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the foregoing virtual machine migration method. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist separately without being incorporated in the electronic device.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the 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 provided in the above embodiments.
The above description is only a preferred exemplary embodiment of the present application, and is not intended to limit the embodiments of the present application, and those skilled in the art can easily make various changes and modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A virtual machine migration method is characterized by comprising the following steps:
respectively calculating flow correlation values of all virtual machines in an overload node according to the communication relation of all virtual machines in a node network, wherein the flow correlation values are obtained according to the correlation between corresponding virtual machines and other virtual machines in the node network;
according to the numerical value of the flow correlation value of each virtual machine, sequentially adding the corresponding virtual machines into a queue to be migrated according to the arrangement sequence of the numerical values from small to large;
and sequentially carrying out migration processing on each virtual machine of the queue to be migrated until the load of the overload node is smaller than a preset threshold value.
2. The method according to claim 1, wherein the calculating the traffic correlation value of each virtual machine in the overloaded node according to the communication relationship of each virtual machine in the node network comprises:
calculating a first correlation between any two virtual machines in the overload node;
calculating a second correlation between any virtual machine in the overload node and any virtual machine in other nodes of an upper connection switch, wherein the upper connection switch is the upper connection switch of the overload node;
calculating a third correlation between any virtual machine in the overload node and any virtual machine in a node across switches, wherein the cross switches are switches which have communication interaction with the upper-connected switch;
and respectively calculating the flow correlation value of each virtual machine according to the first correlation, the second correlation and the third correlation corresponding to each virtual machine.
3. The method according to claim 1, wherein the sequentially migrating the virtual machines in the queue to be migrated until the load of the overloaded node is less than a preset threshold value comprises:
acquiring 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;
and circularly executing the steps of acquiring 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 elements in the head of the queue to be migrated until the load of the overload node is smaller than the preset threshold value.
4. The method according to claim 3, wherein the obtaining a 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 comprises:
judging whether correlation exists between the first virtual machine and other virtual machines;
and if the first virtual machine does not exist, taking the node with the minimum load in the node network as a target node, and migrating the first virtual machine to the target node.
5. The method according to claim 3, wherein the obtaining a 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 comprises:
acquiring a second virtual machine according to the magnitude of the correlation value 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;
and if the second virtual machine is deployed on the overload node, taking the node with the minimum load on the uplink switch of the overload node as a target node, and migrating the first virtual machine to the target node.
6. The method according to claim 3, wherein the obtaining a 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 comprises:
acquiring a second virtual machine according to the magnitude of the correlation value 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;
if the second virtual machine is deployed on a cross-switch, judging whether a node where the second virtual machine is located meets the migration requirement of the first virtual machine, wherein the cross-switch is another switch which has communication interaction with an upper-link switch of the overload node;
if yes, migrating the first virtual machine to a node where the second virtual machine is located;
otherwise, taking the node with the minimum load on the cross-switch where the second virtual machine is located as a target node, and migrating the first virtual machine to the target node.
7. The method according to claim 3, wherein the obtaining a 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 comprises:
acquiring a second virtual machine according to the magnitude of the correlation value 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;
if the second virtual machine is deployed on the uplink switch of the overload node, judging whether the node where the second virtual machine is located meets the migration requirement of the first virtual machine;
if yes, migrating the first virtual machine to a node where the second virtual machine is located;
otherwise, taking the node with the minimum load on the upper connection exchanger as a target node, and migrating the first virtual machine to the target node.
8. A virtual machine migration apparatus, comprising:
the system comprises a traffic correlation value acquisition module, a node network and a traffic correlation value calculation module, wherein the traffic correlation value acquisition module is configured to respectively calculate traffic correlation values of all virtual machines in an overload node according to communication relations of all virtual machines in the node network, and the traffic correlation values are obtained according to correlations between corresponding virtual machines and other virtual machines in the node network;
the queue to be migrated acquiring module is configured to sequentially add the corresponding virtual machines into a queue to be migrated according to an arrangement sequence of values from small to large according to the value size of the traffic correlation value of each virtual machine;
and the migration module is configured to sequentially perform migration processing on the virtual machines of the queue to be migrated until the load of the overload node is smaller than a preset threshold value.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more computer programs that, when executed by the one or more processors, cause the electronic device to implement the method of any of claims 1-7.
10. A computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the method of any one of claims 1-7.
CN202111519104.XA 2021-12-13 2021-12-13 Virtual machine migration method and device, electronic equipment and storage medium Pending CN114035906A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111519104.XA CN114035906A (en) 2021-12-13 2021-12-13 Virtual machine migration method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111519104.XA CN114035906A (en) 2021-12-13 2021-12-13 Virtual machine migration method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114035906A true CN114035906A (en) 2022-02-11

Family

ID=80146757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111519104.XA Pending CN114035906A (en) 2021-12-13 2021-12-13 Virtual machine migration method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114035906A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118729A (en) * 2022-06-28 2022-09-27 中国电信股份有限公司 Container migration method, system and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118729A (en) * 2022-06-28 2022-09-27 中国电信股份有限公司 Container migration method, system and storage medium

Similar Documents

Publication Publication Date Title
CN108768716A (en) A kind of micro services routing resource and device
US20220229809A1 (en) Method and system for flexible, high performance structured data processing
CN111966289A (en) Partition optimization method and system based on Kafka cluster
CN114065864B (en) Federal learning method, federal learning device, electronic apparatus, and storage medium
CN117032938B (en) Operator parallel scheduling method and device, electronic equipment and storage medium
CN114461407B (en) Data processing method, data processing device, distribution server, data processing system, and storage medium
CN112261120A (en) Cloud-side cooperative task unloading method and device for power distribution internet of things
CN114780244A (en) Container cloud resource elastic allocation method and device, computer equipment and medium
CN113553138A (en) Cloud resource scheduling method and device
CN117135131A (en) Task resource demand perception method for cloud edge cooperative scene
CN105635285B (en) A kind of VM migration scheduling method based on state aware
CN113377488A (en) Method, system and equipment for resource migration
CN114035906A (en) Virtual machine migration method and device, electronic equipment and storage medium
CN116841753B (en) Stream processing and batch processing switching method and switching device
CN116627771A (en) Log acquisition method, device, electronic equipment and readable storage medium
CN115774602A (en) Container resource allocation method, device, equipment and storage medium
CN113434270B (en) Data resource scheduling method and device, electronic equipment and storage medium
CN114756301A (en) Log processing method, device and system
CN108984271A (en) Load balancing method and related equipment
CN112395081A (en) Resource online automatic recovery method, system, server and storage medium
CN115065685B (en) Cloud computing resource scheduling method, device, equipment and medium
CN113641670B (en) Data storage and data retrieval method and device, electronic equipment and storage medium
CN115242648B (en) Expansion and contraction capacity discrimination model training method and operator expansion and contraction capacity method
CN116841746A (en) Task migration method, device, equipment and medium
CN117762348A (en) Distributed storage method, device and equipment for files and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination