CN107819708B - Data processing method, system and equipment based on virtual machine migration - Google Patents

Data processing method, system and equipment based on virtual machine migration Download PDF

Info

Publication number
CN107819708B
CN107819708B CN201610818470.8A CN201610818470A CN107819708B CN 107819708 B CN107819708 B CN 107819708B CN 201610818470 A CN201610818470 A CN 201610818470A CN 107819708 B CN107819708 B CN 107819708B
Authority
CN
China
Prior art keywords
virtual machine
source
target
host
state
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.)
Active
Application number
CN201610818470.8A
Other languages
Chinese (zh)
Other versions
CN107819708A (en
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.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610818470.8A priority Critical patent/CN107819708B/en
Publication of CN107819708A publication Critical patent/CN107819708A/en
Application granted granted Critical
Publication of CN107819708B publication Critical patent/CN107819708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/252Store and forward routing
    • 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

Abstract

The application provides a data processing method, a system and equipment based on virtual machine migration, wherein the method comprises the following steps: receiving a data message with a destination address as a source virtual machine; and sending the data message to a target virtual machine according to the forwarding route, wherein the target virtual machine is the virtual machine after the source virtual machine is migrated. For improving the reliability of data processing.

Description

Data processing method, system and equipment based on virtual machine migration
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data processing method, system, and device based on virtual machine migration.
Background
At present, a plurality of virtual machines can be deployed on a host machine, and when the load of the host machine is too large or the host machine fails, the virtual machines on the host machine can be migrated to other host machines.
When a source virtual machine in a source host needs to be migrated, migrating the source virtual machine in the following manner: firstly, creating a target virtual machine on a target host machine, wherein the target virtual machine on the target host machine is in a pause state at the moment; then, the source virtual machine of the source host computer starts to synchronize the memory with the target virtual machine, when the memory dirty pages of the source virtual machine are smaller than a preset threshold value, the source virtual machine is switched to a pause state, and all the memory dirty pages and other system states (such as a CPU register and a device state) are synchronized to the target virtual machine. At this time, the source virtual machine and the target virtual machine are both in a suspended state, and neither the source virtual machine nor the target virtual machine is accessible.
After the source virtual machine synchronizes all data to the target virtual machine, the target virtual machine needs to send a notification message to the core switch, for example, the target virtual machine may broadcast a free Address Resolution Protocol (ARP) message, so that the core switch updates the location of the virtual machine (for example, the port number of the target virtual machine) according to the notification message. After the core switch updates the position of the virtual machine, the target virtual machine can be switched to a running state.
The period from the time when the source virtual machine is switched to the pause state to the time when the target virtual machine is switched to the running state is a down time period, in the down time period, the source virtual machine and the target virtual machine are both in the pause state, and the source virtual machine and the target virtual machine are not accessible. In the process that the target virtual machine sends the notification message to the core switch, if any midway switch has a blocking packet loss, the core switch cannot receive the notification message, and the target virtual machine cannot be switched to the running state; or, in the process of sending the notification message to the core switch by the target virtual machine, if any intermediate switch is delayed too much, or the core switch is overloaded and cannot process the notification message in time, the down time period is too long.
However, in the prior art, the data packets sent to the source virtual machine during the down time period are discarded, resulting in lower reliability of data processing.
Disclosure of Invention
The application provides a data processing method, system and device based on virtual machine migration. For improving the reliability of data processing.
In one aspect, the present application provides a virtual machine migration-based data processing system comprising a virtual machine monitor and a virtual switch, wherein,
the virtual machine monitor is used for switching the state of a source virtual machine into a pause state and sending a pause notification to the virtual switch;
the virtual switch is used for configuring a forwarding route;
the virtual switch is further configured to receive, after receiving the suspension notification, a data packet addressed to the source virtual machine, and send the data packet to a target virtual machine according to the forwarding route; and the target virtual machine is the virtual machine after the source virtual machine is migrated.
In one possible embodiment, the virtual switch configures a forwarding route, including:
the virtual switch requests the virtual machine monitor to acquire the address of a target host machine where the target virtual machine is located according to the suspension notice;
and the virtual switch configures the forwarding route according to the address of the source virtual machine and the address of the target host machine.
In another possible implementation manner, the sending, by the virtual switch, the data packet to the target virtual machine according to the forwarding route includes:
the virtual switch acquires the address of the target host machine in the forwarding route;
the virtual switch encapsulates the data message according to the addresses of a source host machine and the target host machine, wherein the source host machine is the host machine where the source virtual machine is located;
and the virtual switch sends the encapsulated data message to the target virtual machine through a preset tunnel.
In another possible implementation, the encapsulating, by the virtual switch, the data packet according to the addresses of the source host and the target host includes:
the virtual switch determines an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the host, and the destination address is the IP address of the target host;
and the virtual switch encapsulates the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
In another possible embodiment, the preset tunnel is a virtual extensible local area network VXLAN tunnel or a multi-protocol label switching MPLS tunnel.
In another possible implementation manner, the sending, by the virtual switch, the data packet to the target virtual machine according to the forwarding route includes:
and the virtual switch sends the data message to the target virtual machine, so that the target virtual switch in the target host machine sends the data message to the target virtual machine after the state of the target virtual machine is switched to the running state.
In another possible implementation manner, the sending, by the virtual switch, the data packet to the target virtual machine according to the forwarding route includes:
the virtual switch acquires the state of the target virtual machine;
and the virtual switch sends the data message to the target virtual machine according to the state of the target virtual machine.
In another possible implementation manner, the sending, by the virtual switch, the data packet to the target virtual machine according to the state of the target virtual machine includes:
if the state of the target virtual machine is the running state, the virtual switch sends the data message to the target virtual machine;
and if the state of the target virtual machine is a suspended state, caching the data message by the virtual switch until the data message is sent to the target virtual machine after the state of the target virtual machine is determined to be switched to a running state.
In another aspect, the present application provides a data processing method based on virtual machine migration, which is applied to a virtual switch, and the method includes:
receiving a data message with a destination address as a source virtual machine;
and sending the data message to a target virtual machine according to the forwarding route, wherein the target virtual machine is the virtual machine after the source virtual machine is migrated.
In a possible implementation manner, the sending the data packet to the target virtual machine according to the forwarding route includes:
acquiring the address of a target host machine where the target virtual machine is located in the forwarding route;
encapsulating the data message according to the address of a source host machine and the address of the target host machine, wherein the source host machine is the host machine where the source virtual machine is located;
and sending the encapsulated data message to the target virtual machine through a preset tunnel.
In another possible implementation, the encapsulating the data packet according to the addresses of the source host and the target host includes:
determining an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the host, and the destination address is the IP address of the target host;
and encapsulating the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
In another possible embodiment, the preset tunnel is a virtual extensible local area network VXLAN tunnel or a multi-protocol label switching MPLS tunnel.
In another aspect, the present application provides a data processing method based on virtual machine migration, which is applied to a virtual machine monitor, and the method includes:
switching the state of the source virtual machine to a pause state;
and sending a source virtual machine pause notification to a source virtual switch corresponding to the source virtual machine, so that the source virtual switch sends a data message to the target virtual machine according to a forwarding route after receiving the data message with a destination address of the source virtual machine.
In one possible embodiment, the switching the state of the source virtual machine to the suspended state includes:
sending data information in the source virtual machine to the target virtual machine, wherein the data information comprises memory data;
acquiring a dirty memory page in the source virtual machine;
and when the internal dirty page is determined to be smaller than a preset threshold value, switching the state of the source virtual machine to a suspended state.
In another possible implementation manner, before sending the data information in the source virtual machine to the target virtual machine, the method further includes:
and sending the configuration information of the source virtual machine to a target virtual machine monitor corresponding to a target virtual machine, so that the target virtual machine monitor configures the target virtual machine according to the configuration information.
In another possible implementation, after switching the state of the source virtual machine to the suspended state, the method further includes:
and sending residual data information to a target virtual machine, wherein the residual data information comprises the current internal dirty page and system state parameters.
In another possible embodiment, the system state parameters include: CPU state and register state.
In another possible implementation, the sending the data information in the source virtual machine to the target virtual machine includes:
and sending the shared address of the hard disk data to a target virtual machine so that the target virtual machine acquires the hard disk data according to the shared address.
In another possible implementation, the sending the data information in the source virtual machine to the target virtual machine includes:
sending all memory data to a target virtual machine;
and acquiring the memory dirty pages one by one, and sending the memory dirty pages to the target virtual machine.
In another aspect, the present application provides a virtual switch, comprising:
the receiving module is used for receiving a data message with a destination address as a source virtual machine;
and the sending module is used for sending the data message to a target virtual machine according to a forwarding route, wherein the target virtual machine is a virtual machine after the source virtual machine is migrated.
In one possible implementation, the sending module includes an obtaining unit, a packaging unit and a sending unit, wherein,
the obtaining unit is configured to obtain, in the forwarding route, an address of a target host where the target virtual machine is located;
the encapsulation unit is used for encapsulating the data message according to the address of a source host machine and the address of the target host machine, wherein the source host machine is the host machine where the source virtual machine is located;
and the sending unit is used for sending the encapsulated data message to the target virtual machine through a preset tunnel.
In another possible implementation, the encapsulation unit is specifically configured to:
determining an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the host, and the destination address is the IP address of the target host;
and encapsulating the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
In another possible embodiment, the preset tunnel is a virtual extensible local area network VXLAN tunnel or a multi-protocol label switching MPLS tunnel.
In another aspect, the present application provides a virtual machine monitor, comprising:
the switching module is used for switching the state of the source virtual machine into a pause state;
and the sending module is used for sending a source virtual machine pause notification to a source virtual switch corresponding to the source virtual machine so that the source virtual switch sends a data message to the target virtual machine according to a forwarding route after receiving the data message with a destination address of the source virtual machine.
In a possible implementation manner, the sending module is further configured to send data information in the source virtual machine to the target virtual machine, where the data information includes memory data;
correspondingly, the switching module is specifically configured to: and acquiring a memory dirty page in the source virtual machine, and switching the state of the source virtual machine to a suspended state when the memory dirty page is determined to be smaller than a preset threshold value.
In another possible implementation manner, the sending module is further configured to send, before the sending module sends the data information in the source virtual machine to the target virtual machine, the configuration information of the source virtual machine to a target virtual machine monitor corresponding to the target virtual machine, so that the target virtual machine monitor configures the target virtual machine according to the configuration information.
In another possible implementation manner, the sending module is further configured to send, after the switching module switches the state of the source virtual machine to the suspended state, remaining data information to the target virtual machine, where the remaining data information includes the current dirty memory page and the system state parameter.
In another possible embodiment, the system state parameters include: CPU state and register state.
In another possible implementation manner, the data information is hard disk data, and correspondingly, the sending module is specifically configured to:
and sending the shared address of the hard disk data to a target virtual machine so that the target virtual machine acquires the hard disk data according to the shared address.
In another possible implementation manner, the data information is memory data, and correspondingly, the sending module is specifically configured to:
sending all memory data to a target virtual machine;
and acquiring the memory dirty pages one by one, and sending the memory dirty pages to the target virtual machine.
In another aspect, the present application provides a virtual switch comprising a receiver, a transmitter, and a processor, wherein,
the receiver is used for receiving a data message with a destination address of a source virtual machine;
the sender is configured to send the data packet to a target virtual machine when the processor determines that the state of the source virtual machine is a suspended state, where the target virtual machine is a virtual machine after the source virtual machine is migrated.
In a possible implementation manner, the processor is further configured to obtain an address of a target host where the target virtual machine is located in the forwarding route, and encapsulate the data packet according to the address of a source host and the address of the target host, where the source host is the host where the source virtual machine is located;
correspondingly, the sender is specifically configured to send the encapsulated data packet to the target virtual machine through a preset tunnel.
In another possible implementation, the processor is specifically configured to:
determining an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the host, and the destination address is the IP address of the target host;
and encapsulating the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
In another possible embodiment, the preset tunnel is a virtual extensible local area network VXLAN tunnel or a multi-protocol label switching MPLS tunnel.
In another aspect, the present application provides a virtual machine monitor comprising a transmitter and a processor, wherein,
the processor is used for switching the state of the source virtual machine into a pause state;
the sender is configured to send a source virtual machine suspension notification to a source virtual switch corresponding to the source virtual machine, so that the source virtual switch sends a data packet to the target virtual machine according to a forwarding route after receiving the data packet with a destination address of the source virtual machine.
In a possible implementation manner, the transmitter is further configured to transmit data information in the source virtual machine to the target virtual machine, where the data information includes memory data;
accordingly, the processor is specifically configured to: and acquiring a memory dirty page in the source virtual machine, and switching the state of the source virtual machine to a suspended state when the memory dirty page is determined to be smaller than a preset threshold value.
In another possible implementation manner, the sender is further configured to send, before sending the data information in the source virtual machine to the target virtual machine, the configuration information of the source virtual machine to a target virtual machine monitor corresponding to the target virtual machine, so that the target virtual machine monitor configures the target virtual machine according to the configuration information.
In another possible implementation manner, the transmitter is further configured to transmit, after the processor switches the state of the source virtual machine to the suspended state, remaining data information to the target virtual machine, where the remaining data information includes the current in-memory dirty page and the system state parameter.
In another possible embodiment, the system state parameters include: CPU state and register state.
In another possible implementation, the data information is hard disk data, and correspondingly, the transmitter is specifically configured to:
and sending the shared address of the hard disk data to a target virtual machine so that the target virtual machine acquires the hard disk data according to the shared address.
In another possible implementation manner, the data information is memory data, and correspondingly, the transmitter is specifically configured to:
sending all memory data to a target virtual machine;
and acquiring the memory dirty pages one by one, and sending the memory dirty pages to the target virtual machine.
In the application, in the process of migrating the virtual machine, after the source virtual machine monitor switches the source virtual machine to the suspended state, a source virtual machine suspension notification is sent to the source virtual switch, so that after the source virtual switch acquires the data packet with the destination address as the source virtual machine, the source virtual switch sends the data packet to the target virtual machine according to the configured forwarding route, so that the target virtual machine processes the data packet. The data message sent to the source virtual machine in the virtual machine migration process is prevented from being discarded, and the reliability of data processing is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is an application scenario diagram of a data processing method based on virtual machine migration according to the present invention;
FIG. 2 is a first flowchart of a data processing method based on virtual machine migration according to the present invention;
FIG. 3 is a second flowchart of a data processing method based on virtual machine migration according to the present invention;
fig. 4 is a flowchart three of a data processing method based on virtual machine migration according to the present invention;
fig. 5 is a schematic flow chart of a data message forwarding method provided in the present invention;
FIG. 6 is a fourth flowchart of a data processing method based on virtual machine migration according to the present invention;
fig. 7 is a first schematic structural diagram of a virtual switch provided in the present invention;
fig. 8 is a schematic structural diagram of a virtual switch provided in the present invention;
FIG. 9 is a schematic structural diagram of a virtual machine monitor according to the present invention;
fig. 10 is a schematic diagram of a hardware structure of a virtual switch provided in the present invention;
fig. 11 is a schematic diagram of a hardware structure of the virtual machine monitor provided in the present invention.
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 invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Fig. 1 is a schematic view of an application scenario of a data processing method based on virtual machine migration according to the present invention, please refer to fig. 1, which includes a source host 101, a target host 102, and a client 103. The source host 101 is provided with a source virtual machine 1011, a source virtual switch 1012, and a source virtual machine monitor 1013. The target host 102 is provided with a target virtual machine 1021, a target virtual switch 1022, and a target virtual machine monitor 1023.
In this application, a plurality of preset interfaces are provided between the source virtual switch 1012 and the source virtual machine monitor 1013, so that the source virtual machine 1012 can communicate with the source virtual machine monitor 1013 through the preset interfaces. The source virtual machine monitor 1013 may control the state of the source virtual machine 1011, and the source virtual machine monitor 1013 may switch the state of the source virtual machine 1011 to a suspended state or an operating state. The source virtual switch 1012 may acquire the state of the source virtual machine 1011 from the source virtual machine monitor 1013 through a preset port, and perform corresponding processing on the data packet sent to the source virtual machine 1011 according to the state of the source virtual machine 1011.
In the migration process from the source virtual machine 1011 to the target virtual machine 1021, after the source virtual switch 1012 determines that the state of the source virtual machine is switched from the running state to the suspended state, the source virtual switch 1012 configures a corresponding forwarding route, so that when the source virtual switch 1012 receives a data packet sent to the source virtual machine 1011, the data packet can be forwarded to the target virtual machine 1021 according to the configured forwarding route, so that the target virtual machine 1021 processes the data packet. The data message sent to the source virtual machine in the virtual machine migration process is prevented from being discarded, and the reliability of data processing is improved.
In the application, the virtual switch is a switch module which runs on a host machine where the virtual machine is located and is realized based on software, and the virtual switch is used for data forwarding. The virtual machine monitor is a software system deployed in the host machine, the virtual machine monitor is used for monitoring and managing the virtual machines in the host machine, and the virtual machine monitor is also used for communicating with the virtual machine monitors in other host machines so as to realize migration of the virtual machines.
It should be noted that each host may also be provided with one or more other virtual machines. The virtual switch in each host may be a switch module implemented by software and/or hardware, and is configured to provide a data forwarding function for different virtual machines. The virtual machine monitor in each host is used to create one or more virtual machines on the host, and manage the virtual machines on the host, for example, manage configuration information, state information, and the like of the virtual machines.
It should be noted that, in the embodiment of the present invention, the source host and the target host are substantially the same and may be both devices such as a computer and a server, and for convenience of description, the host where the virtual machine is located before migration is referred to as the source host, and the host where the virtual machine is located after migration is referred to as the target host. Similarly, for convenience of description, the virtual machine provided in the source host is referred to as a source switch, the virtual switch provided in the source host is referred to as a source virtual switch, and the virtual machine monitor provided in the source host is referred to as a source virtual machine monitor; the virtual machine set in the target host is called a target switch, the virtual switch set in the target host is called a target virtual switch, and the virtual machine monitor set in the target host is called a target virtual machine monitor.
Hereinafter, the technical solutions shown in the present application are described in detail through specific embodiments, and the following specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a first flowchart of a data processing method based on virtual machine migration according to the present invention, please refer to fig. 2, where the method may include:
s201, starting the virtual machine live migration.
S202, the source virtual machine monitor sends the memory data in the source virtual machine to the target virtual machine.
S203, the source virtual machine monitor judges whether the internal memory dirty page is smaller than a preset threshold value.
If yes, go to step S204.
If not, go to S202.
And S204, the source virtual machine monitor sends residual data information to the target virtual machine, wherein the residual data information comprises the current internal dirty page and the system state parameter.
S205, the source virtual machine monitor switches the state of the source virtual machine to a pause state.
S206, the source virtual machine monitor sends a source virtual machine pause notification to the source virtual switch.
S207, configuring a forwarding route by the source virtual switch; the starting address of the forwarding route is the address of the source virtual machine, and the ending address of the forwarding route is the address of the target host machine.
S208, the source virtual switch receives the data message with the destination address as the source virtual machine.
S209, the source virtual switch sends a data message to the target virtual machine according to the forwarding route.
S210, after the source virtual switch determines that the state of the target virtual machine is the running state, the message forwarding is finished.
In the embodiment shown in fig. 2, S201 to S206 are processes of virtual machine migration, and in S201 to S206, a source virtual machine monitor controls migration of data information (including memory data and the like) in a source virtual machine to a target virtual machine. S207-S210 are processes of the data packet sent to the source virtual machine by the source virtual switch in the down time period. The embodiment shown in fig. 2 will be described in detail below.
When a source virtual machine in a source host needs to be migrated, a target host to which the source virtual machine needs to be migrated is determined. After the target host is determined, establishing a connection between a source virtual machine monitor and a target virtual machine monitor, where the source virtual machine monitor obtains configuration information of the source virtual machine, optionally, the configuration information may include CPU configuration, graphics card configuration, network configuration, and the like, and sends the configuration information of the source virtual machine to the target virtual machine monitor, and the target virtual machine monitor creates a target virtual machine on the target host according to the configuration information of the source virtual machine, so that the configurations of the target virtual machine and the source virtual machine are the same.
After the target virtual machine monitor creates the target virtual machine at the target host, the target virtual machine monitor sends creation completion prompt information to the source virtual machine monitor. After the source virtual machine monitor receives the creation completion prompt message, the source virtual machine monitor starts to control synchronization of data information to the target virtual machine, where the data information may include hard disk data, memory data, and system state parameters. Optionally, the source virtual machine monitor may send data information in the source virtual machine to the target virtual machine monitor, and the target virtual machine monitor synchronizes the received data information to the target virtual machine.
When the source virtual machine monitor controls to synchronize the memory data to the target virtual machine, the source virtual machine monitor may send all the memory data to the target virtual machine, then successively obtain the dirty memory pages (changed memory pages), and send the dirty memory pages to the target virtual machine. Optionally, all the memory pages may be sent to the target virtual machine first, in the process of sending all the memory pages to the target virtual machine, the memory data of the source virtual machine may change, after all the memory pages are sent to the target virtual machine, the changed dirty memory pages are acquired, and the dirty memory pages are sent to the target virtual machine; in the process of sending the internal memory dirty pages to the target virtual machine, new internal memory dirty pages may also appear in the source virtual machine, and after the internal memory dirty pages are sent to the target virtual machine, the new internal memory dirty pages are continuously acquired, and so on, until the source virtual machine monitor determines that the current internal memory dirty pages in the source virtual machine are smaller than the preset threshold value, the state of the source virtual machine is switched to a suspended state. Optionally, the preset threshold may be set according to actual needs, for example, the preset threshold may be 10 pages, 8 pages, and the like.
After the source virtual machine monitor switches the state of the source virtual machine to the suspended state, the source virtual machine monitor sends a suspension notification to the source virtual switch through a preset interface.
The source virtual switch configures a forwarding route. Optionally, the source virtual switch may pre-configure the forwarding route, or may reconfigure the forwarding route after receiving the suspension notification, and optionally, the source virtual switch may request the virtual machine monitor to acquire an address of a target host where the target virtual machine is located, and configure the forwarding route according to the address of the source virtual machine and the address of the target host, where a start address of the forwarding route is an address of the source virtual machine, and a stop address of the forwarding route is an address of the target host.
After the source virtual switch is configured with the forwarding route, after the source virtual switch receives the data message with the destination address of the source virtual machine, the source virtual switch sends the data message to the target virtual machine according to the forwarding route. Optionally, the source virtual switch may send the data packet to the target virtual machine according to the forwarding route through the following two possible implementation manners.
One possible implementation is:
and the source virtual switch acquires the state of the target virtual machine and sends a data message to the target virtual machine according to the state of the target virtual machine.
In this feasible implementation manner, after the source virtual switch receives the data packet whose destination address is the source virtual machine, the source virtual switch caches the data packet, obtains the state of the target virtual machine, and sends the data packet to the target virtual machine according to the state of the target virtual machine.
And if the state of the target virtual machine is the running state, the source virtual switch sends the cached data message to the target virtual machine.
And if the state of the target virtual machine is in the pause state, continuing to cache the data message until the cached data message is sent to the target virtual machine after the state of the target virtual machine is determined to be switched to the running state.
In the process, the source virtual switch caches the data message, and when the target virtual machine is in the running state, the source virtual machine sends the cached data message to the target virtual machine, so that the target virtual machine can receive the data message and process the data message, and the reliability of processing the data is further improved.
Another possible implementation:
and the source virtual switch sends the received data message to the target virtual switch, so that the target virtual switch sends the data message to the target virtual machine after the state of the target virtual machine is switched to the running state.
In this feasible implementation manner, after the source virtual switch receives the data packet whose destination address is the source virtual machine, the source virtual switch directly sends the data packet to the target virtual switch, the target virtual switch caches the data packet, and after the state of the target virtual machine is switched to the running state, the target virtual switch sends the cached data packet to the target virtual machine.
In the process, the target virtual switch caches the data message, and after the state of the target virtual machine is switched to the running state, the target virtual switch can quickly send the cached data message to the target virtual machine, and the target virtual machine processes the data message, so that the efficiency of processing the data message by the target virtual machine can be improved.
When the source virtual switch sends the data packet to the target virtual machine, optionally, the source virtual switch may send the data packet to the target virtual machine through a preset tunnel. Optionally, the virtual switch acquires an IP address of the target host in the forwarding route, determines an IP header according to the IP address of the source host and the IP address of the target host, where a source address in the IP header is the IP address of the host and a destination address is the IP address of the target host, encapsulates the data packet according to the IP header and the tunnel identifier, obtains an encapsulated data packet, and sends the encapsulated data packet to the target virtual machine through the preset tunnel. Optionally, the preset tunnel may be a Virtual Extensible local area network (VXLAN) tunnel or a Multi-Protocol Label Switching (MPLS) tunnel.
In the process of encapsulating the data message, the IP header is added to the data message, so that the encapsulated data message can be sent from the source host to the target virtual machine. By adding the preset tunnel identifier in the data message, the target virtual switch in the target host machine can be ensured to perform corresponding analysis on the encapsulated data message according to the preset tunnel identifier so as to obtain the data message before encapsulation. Optionally, in the actual application process, during the process of encapsulating the data message, the data message may also be encapsulated in a UDP message.
And the source virtual switch repeatedly executes the process until the source virtual switch determines that the state of the target virtual machine is the running state, and then the message forwarding is finished.
In the application, in the process of virtual machine migration, after a source virtual switch acquires a data message with a destination address of a source virtual machine, the source virtual switch sends the data message to a target virtual machine according to a forwarding route. The data message sent to the source virtual machine in the virtual machine migration process is prevented from being discarded, and the reliability of data processing is improved.
The method shown in the foregoing embodiment is described in detail below by taking an interaction process of a source virtual switch, a source virtual machine monitor, and a target virtual switch as an example, and specifically, please refer to the embodiment shown in fig. 3.
Fig. 3 is a second flowchart of a data processing method based on virtual machine migration according to the present invention, please refer to fig. 3, where the method may include:
s301, the source virtual machine monitor sends data information in the source virtual machine to the target virtual machine monitor;
s302, the target virtual machine monitor synchronizes data information to the target virtual machine;
s303, when the source virtual machine monitor determines that the current internal memory dirty page in the source virtual machine is smaller than a preset threshold value, switching the state of the source virtual machine to a pause state;
s304, the source virtual machine monitor sends a source virtual machine pause notification to a source virtual switch corresponding to the source virtual machine;
s305, the source virtual switch receives a data message with a destination address as a source virtual machine;
s306, the source virtual switch determines an IP header according to the IP addresses of the source host and the target host;
s307, the source virtual switch encapsulates the data message according to the IP header and the tunnel identifier;
s308, the source virtual switch sends the encapsulated data message to the target virtual switch;
s309, the target virtual switch decapsulates the encapsulated data message to obtain a data message;
s310, the target virtual switch judges whether the state of the target virtual machine is an operating state;
if yes, go to S311;
if not, go to S312;
s311, sending a data message to a target virtual machine;
s312, caching the data message until the state of the target virtual machine is switched to the running state, and sending the data message to the target virtual machine
And S313, the target virtual machine processes the data message.
In the embodiment shown in fig. 3, during virtual machine migration, after the target virtual machine monitor creates the target virtual machine in the target host, the source virtual machine monitor sends data information in the source virtual machine to the target virtual machine monitor, and the target virtual machine monitor synchronizes the data information to the target virtual machine.
In the process that the source virtual machine monitor sends data information to the target virtual machine monitor, when the source virtual machine monitor determines that a current internal memory dirty page in the source virtual machine is smaller than a preset threshold value, the state of the source virtual machine is switched to a suspended state, and a source virtual machine suspension notification is sent to a source virtual switch corresponding to the source virtual machine.
After the source virtual switch receives the pause notification of the source virtual machine, if the source virtual switch receives the data message of which the destination address is the source virtual machine, the source virtual switch determines an IP head according to the IP addresses of the source host machine and the target host machine, encapsulates the data message according to the IP head and the tunnel identifier to obtain the encapsulated data message, and sends the encapsulated data message to the target virtual switch.
After the target virtual switch receives the encapsulated data message, decapsulating the encapsulated data message to obtain a data message, caching the data message of the target virtual machine until the target virtual machine is determined to be in an operating state, and sending the data message to the target virtual machine so that the target virtual machine processes the data message. The data message sent to the source virtual machine in the virtual machine migration process is prevented from being discarded, and the reliability of data processing is improved.
Next, a data processing method based on virtual machine migration will be described in detail with the embodiment shown in fig. 4, with the source virtual switch as the execution principal.
Fig. 4 is a flowchart of a third method for processing data based on virtual machine migration according to the present invention, please refer to fig. 4, where the method may include:
s401, receiving a data message with a destination address as a source virtual machine.
S402, sending a data message to a target virtual machine according to the forwarding route, wherein the target virtual machine is a virtual machine after the source virtual machine is migrated.
The executing body of the method may be a source virtual switch, the source virtual switch may be set in a source host where the source virtual machine is located, the source virtual switch may be implemented by software and/or hardware, and the source virtual switch may provide a data forwarding function for a virtual machine in the source host.
In the embodiment of the present invention, the source virtual machine and the target virtual machine are virtual machines having the same function and located in different host machines, and the source virtual machine and the target virtual machine have the same Internet Protocol (IP) Address and Media Access Control (MAC) Address. Optionally, the source virtual machine and the target virtual machine may further have the same configuration information, where the configuration information includes Central Processing Unit (CPU) configuration, memory configuration, network card configuration, video card configuration, and the like. In an actual application process, only one of the source virtual machine and the target virtual machine processes a running state at the same time, and the source virtual machine and the target virtual machine have the same IP address and MAC address, so that the source virtual machine and the target virtual machine are the same virtual machine for other devices.
In the process of migrating the virtual machine, data information in the source virtual machine needs to be migrated to the target virtual machine. In the data migration process, the state of the source virtual machine is an operating state, and the state of the target virtual machine is a suspended state. After the data migration is completed, the state of the source virtual machine is switched to a suspended state, at this time, the target virtual machine may start running, but after the core switch needs to update the network state, the target virtual machine may receive the data packet and process the data packet, so after the data migration is completed, before the core switch updates the network state (within a dowmtime period), the state of the target virtual machine is the suspended state. After the core switch updates the network state (after the period of dowmtime), the target virtual machine may receive the data packet and process the data packet, and at this time, the state of the target virtual machine is the running state. Specifically, the states of the source virtual machine and the target virtual machine may be as shown in table 1:
TABLE 1
Time period State of source virtual machine State of target virtual machine
In the process of data migration Operation of Pausing
Period of dowmtime Pausing Pausing
After period of dowmtime Pausing Operation of
Optionally, the source virtual machine monitor in the source host may control data in the source virtual machine to migrate, and correspondingly, the source virtual machine monitor may also control the state of the source virtual machine, specifically: after the source virtual machine monitor has migrated the data in the source virtual machine, the source virtual machine monitor may switch the state of the source virtual machine to a suspended state.
After the source virtual machine monitor switches the state of the source virtual machine into a suspended state, sending a source virtual machine suspension notification to a source virtual switch corresponding to the source virtual machine, so that after the source virtual switch receives a data message with a destination address as the source virtual machine, the source virtual switch sends the data message to a target virtual machine according to a forwarding route, wherein the starting address of the forwarding route is the address of the source virtual machine, and the ending address of the forwarding route is the address of the target host machine.
In the application, in the process of virtual machine migration, after a source virtual switch acquires a data message with a destination address of a source virtual machine, the source virtual switch sends the data message to a target virtual machine according to a forwarding route. The data message sent to the source virtual machine in the virtual machine migration process is prevented from being discarded, and the reliability of data processing is improved.
Fig. 5 is a schematic flow chart of a data packet forwarding method provided in the present invention, please refer to fig. 5, which may include:
s501, obtaining the address of the target host machine where the target virtual machine is located in the forwarding route.
S502, encapsulating the data message according to the addresses of the source host and the target host, wherein the source host is the host where the source virtual machine is located.
S503, sending the encapsulated data message to the target virtual machine through a preset tunnel.
In the embodiment shown in fig. 5, when the source virtual switch needs to send a data packet to the target host, the source virtual switch may first encapsulate the data packet according to the addresses of the source host and the target host, and send the encapsulated data packet to the target host through the preset tunnel. Optionally, the preset tunnel may be a VXLAN tunnel or MPLS tunnel. Optionally, the source virtual switch may determine an IP header according to IP addresses of the source host and the target host, and encapsulate the data packet according to the IP header and a preset tunnel identifier, where a source address in the IP header is an address of the host and a destination address is an address of the target host.
In the process of encapsulating the data message, the IP header is added to the data message, so that the encapsulated data message can be sent from the source host to the target virtual machine. By adding the preset tunnel identifier in the data message, the target virtual switch in the target host machine can be ensured to perform corresponding analysis on the encapsulated data message according to the preset tunnel identifier so as to obtain the data message before encapsulation. Optionally, in the actual application process, during the process of encapsulating the data message, the data message may also be encapsulated in a UDP message.
The method shown in the embodiment of fig. 5 is described in detail below by taking the preset tunnel as a VxLAN tunnel as an example and by specific examples.
For example, assume that the IP addresses of the source virtual machine and the target virtual machine are 192.168.1.1, the IP address of the source host is 10.1.1.1, the IP address of the target host is 10.1.1.2, and the IP address of the client that sends the datagram to the virtual machine (the source virtual machine or the target virtual machine) is 192.168.1.100.
In the process of virtual machine migration, after a source virtual machine is switched to a suspended state, a source virtual switch requests a virtual machine monitor to acquire an address of a target host machine where the target virtual machine is located, and configures a forwarding route according to the address of the source virtual machine and the address of the target host machine as follows:
192.168.1.1—>10.1.1.2;
when a client sends a data packet to a virtual machine, it is assumed that the data packet is as shown in table 2:
table 2:
Figure BDA0001113361020000181
in the data packet shown in table 2, the data in the IP header indicates that the IP address of the sending end (client) of the data packet is 192.168.1.100, and the IP address of the receiving end (source virtual machine) is 192.168.1.1. Payload represents the Payload in the data message, which may include the specific data in the data message.
The source virtual switch obtains an IP header for outer layer encapsulation according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address (10.1.1.1) of the source host, and the destination address is the IP address (10.1.1.2) of the target host. Optionally, the data packet obtained by encapsulating the data packet by the source virtual switch may be as shown in table 3:
TABLE 3
Figure BDA0001113361020000182
After the source virtual switch encapsulates the data message to obtain the encapsulated data message shown in table 3, the source virtual switch sends the data message to the target virtual machine through the VxLAN tunnel, specifically, the encapsulated data message is sent to the target virtual switch first, the target virtual switch analyzes the encapsulated data message to obtain the pre-encapsulated data message shown in table 2, and the pre-encapsulated data message is sent to the target virtual machine.
It should be noted that, in the actual application process, the source virtual switch may also send the data packet to the target virtual machine in other manners, for example, the source virtual switch may send the data packet to the target virtual machine in manners such as a wired network, a wireless network, and openflow message.
The following describes in detail a data processing method based on virtual machine migration by using a source virtual machine monitor as an execution subject and using the embodiment shown in fig. 6.
Fig. 6 is a fourth flowchart of a data processing method based on virtual machine migration according to the present invention, please refer to fig. 6, where the method may include:
s601, switching the state of the source virtual machine to a pause state;
s602, sending a source virtual machine pause notification to a source virtual switch corresponding to the source virtual machine, so that the source virtual switch sends a data message to a target virtual machine according to a forwarding route after receiving the data message with a destination address as the source virtual machine.
The execution subject of the method may be a source virtual machine monitor, where the source virtual machine monitor is disposed in a source host, and the source virtual machine monitor is configured to create one or more virtual machines on the source host and manage the virtual machines on the source host, for example, manage configuration information, state information, and the like of the virtual machines in the source host.
When a source virtual machine in a source host machine needs to be migrated, a target host machine is determined first, and a target virtual machine is created in the target host machine through a target virtual machine monitor in the target host machine. Optionally, the source virtual machine monitor and the target virtual machine monitor in the source virtual machine may communicate, so that the target virtual machine monitor creates the target virtual machine according to the configuration information of the source virtual machine, so that the configuration information of the target virtual machine is the same as the configuration information of the source virtual machine. Optionally, the configuration information may include a CPU configuration, a graphics card configuration, a network configuration, and the like.
After the target virtual machine monitor creates the completed target virtual machine, the source virtual machine monitor may start to control the source virtual machine to send data information in the source virtual machine to the target virtual machine. Optionally, the source virtual machine monitor may send data information in the source virtual machine to the target virtual machine monitor, and the target virtual machine monitor synchronizes the received data information to the target virtual machine. Optionally, the data information includes hard disk data, memory data, and system status parameters.
When sending memory data to the target virtual machine, all the memory data may be sent to the target virtual machine, then the memory dirty pages (changed memory pages) are successively acquired, and the memory dirty pages are sent to the target virtual machine. Optionally, all the memory pages may be sent to the target virtual machine first, in the process of sending all the memory pages to the target virtual machine, the memory data of the source virtual machine may change, after all the memory pages are sent to the target virtual machine, the changed dirty memory pages are acquired, and the dirty memory pages are sent to the target virtual machine; in the process of sending the internal memory dirty pages to the target virtual machine, new internal memory dirty pages may also appear in the source virtual machine, and after the internal memory dirty pages are sent to the target virtual machine, the new internal memory dirty pages are continuously acquired, and so on, until the source virtual machine monitor determines that the current internal memory dirty pages in the source virtual machine are smaller than the preset threshold value, the state of the source virtual machine is switched to a suspended state. Optionally, the preset threshold may be set according to actual needs, for example, the preset threshold may be 10 pages, 8 pages, and the like.
After the source virtual machine monitor switches the state of the source virtual machine to the suspension state, the source virtual machine monitor sends a source virtual machine suspension notification to a source virtual switch corresponding to the source virtual machine, so that the source virtual switch sends a data message to a target virtual machine after receiving the data message with a destination address as the source virtual machine. In this way, when the source virtual machine is in a suspended state, the switch of the source virtual machine can be prevented from discarding the data packet with the destination address as the source virtual machine.
In the application, in the process that a source virtual machine monitor controls a source virtual machine to perform data migration to a target virtual machine, when it is determined that a current internal memory dirty page in the source virtual machine is smaller than a preset threshold, the state of the source virtual machine is switched to a suspended state, and a source virtual machine suspension notification is sent to a source virtual switch corresponding to the source virtual machine, so that the source virtual switch sends a data message to the target virtual machine after receiving the data message with a destination address as the source virtual machine. The method and the device avoid discarding the data message with the destination address as the source virtual machine by the switch of the source virtual machine when the source virtual machine is in the pause state, thereby improving the reliability of data processing.
On the basis of the embodiment shown in fig. 6, optionally, when sending the hard disk data to the target virtual machine, the shared address of the hard disk data may be sent to the target virtual machine, so that the target virtual machine may obtain the hard disk data according to the shared address. Optionally, after the state of the source virtual machine is switched to the suspended state, the source virtual machine monitor may send remaining data information to the target virtual machine, where the remaining data information includes a current internal dirty page and system state parameters. Optionally, the system state parameter includes a CPU state, a register state, and the like of the virtual machine.
On the basis of the embodiment shown in fig. 6, after the data migration is completed (the data in the source virtual machine is synchronized to the target virtual machine), the state of the source virtual machine is switched to the suspended state. After the data migration is completed, the target virtual machine needs to send a notification message to the core switch to notify the core switch that the host where the source virtual machine is located changes, so that the core switch updates the corresponding relationship between the source virtual machine and the host, after the core switch updates the corresponding relationship, the target virtual machine can normally run, and in this period (downtime period), the source virtual machine and the target virtual machine are both in a suspended state. Optionally, the notification message may be an Address Resolution Protocol (ARP) message, and correspondingly, the core switch may update the switch CAM table according to the ARP message. In the down time period, since the core switch has not updated the corresponding relationship between the source virtual machine and the host machine, the data packet sent to the virtual machine in the down time period is still sent to the source virtual machine. After the core switch updates the corresponding relationship between the source virtual machine and the host machine, the data message sent to the virtual machine is sent to the target virtual machine, and the target virtual machine processes the data message.
Fig. 7 is a schematic structural diagram of a virtual switch provided in the present invention, please refer to fig. 7, where the virtual switch may include:
a receiving module 11, configured to receive a data packet with a source virtual machine as a destination address;
a sending module 12, configured to send the data packet to a target virtual machine according to a forwarding route, where the target virtual machine is a virtual machine after the source virtual machine is migrated.
The virtual switch shown in the embodiment of the present invention may execute the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
Fig. 8 is a schematic structural diagram of a virtual switch provided by the present invention, and referring to fig. 8 on the basis of the embodiment shown in fig. 7, the sending module 12 includes an obtaining unit 121, an encapsulating unit 122, and a sending unit 123, wherein,
the obtaining unit 121 is configured to obtain, in the forwarding route, an address of a target host where the target virtual machine is located;
the encapsulating unit 122 is configured to encapsulate the data packet according to an address of a source host and an address of the target host, where the source host is a host where the source virtual machine is located;
the sending unit 123 is configured to send the encapsulated data packet to the target virtual machine through a preset tunnel.
In a possible implementation, the encapsulating unit 122 is specifically configured to:
determining an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the host, and the destination address is the IP address of the target host;
and encapsulating the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
In another possible embodiment, the preset tunnel is a VXLAN tunnel or an MPLS tunnel.
The virtual switch shown in the embodiment of the present invention may execute the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
Fig. 9 is a schematic structural diagram of a virtual machine monitor provided in the present invention, please refer to fig. 9, where the virtual machine monitor may include:
the switching module 21 is used for switching the state of the source virtual machine to a pause state;
the sending module 22 is configured to send a source virtual machine suspension notification to a source virtual switch corresponding to the source virtual machine, so that the source virtual switch sends a data packet to the target virtual machine according to a forwarding route after receiving the data packet with a destination address of the source virtual machine.
The virtual machine monitor shown in the embodiment of the present invention can execute the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
In a possible implementation manner, the sending module 22 is further configured to send data information in the source virtual machine to the target virtual machine, where the data information includes memory data;
correspondingly, the switching module 21 is specifically configured to: and acquiring a memory dirty page in the source virtual machine, and switching the state of the source virtual machine to a suspended state when the memory dirty page is determined to be smaller than a preset threshold value.
In another possible implementation manner, the sending module 22 is further configured to send, before the sending module 22 sends the data information in the source virtual machine to the target virtual machine, the configuration information of the source virtual machine to a target virtual machine monitor corresponding to the target virtual machine, so that the target virtual machine monitor configures the target virtual machine according to the configuration information.
In another possible implementation manner, the sending module 22 is further configured to send, after the switching module 21 switches the state of the source virtual machine to the suspended state, remaining data information to the target virtual machine, where the remaining data information includes the current internal dirty page and the system state parameter.
In another possible embodiment, the system state parameters include: CPU state and register state.
In another possible implementation manner, the data information is hard disk data, and correspondingly, the sending module 22 is specifically configured to:
and sending the shared address of the hard disk data to a target virtual machine so that the target virtual machine acquires the hard disk data according to the shared address.
In another possible implementation manner, the data information is memory data, and correspondingly, the sending module 22 is specifically configured to:
sending all memory data to a target virtual machine;
and acquiring the memory dirty pages one by one, and sending the memory dirty pages to the target virtual machine.
The virtual machine monitor shown in the embodiment of the present invention can execute the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
Fig. 10 is a schematic diagram of a hardware structure of a virtual switch according to the present invention, and referring to fig. 10, the virtual switch includes a receiver 31, a transmitter 32, a processor 33, a memory 34, and a communication bus 35. Wherein, the memory 34 is used for storing application programs; the processor 33 may read the application program in the memory 34 and execute the application program; a communication bus 35 is used to enable connections between the various devices, wherein,
the receiver 31 is configured to receive a data packet with a destination address as a source virtual machine;
the sender 32 is configured to send the data packet to a target virtual machine when the processor 33 determines that the state of the source virtual machine is the suspended state, where the target virtual machine is a virtual machine after the source virtual machine is migrated.
The virtual switch shown in the embodiment of the present invention may execute the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
In a possible implementation manner, the processor 33 is further configured to obtain an address of a target host where the target virtual machine is located in the forwarding route, and encapsulate the data packet according to the address of a source host and the address of the target host, where the source host is the host where the source virtual machine is located;
correspondingly, the sender 32 is specifically configured to send the encapsulated data packet to the target virtual machine through a preset tunnel.
In another possible implementation, the processor 33 is specifically configured to:
determining an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the host, and the destination address is the IP address of the target host;
and encapsulating the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
In another possible embodiment, the preset tunnel is a virtual extensible local area network VXLAN tunnel or a multi-protocol label switching MPLS tunnel.
The virtual switch shown in the embodiment of the present invention may execute the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
Fig. 11 is a schematic diagram of a hardware structure of the virtual machine monitor according to the present invention, please refer to fig. 11, which includes a transmitter 41, a processor 42, a memory 43 and a communication bus 44. Wherein, the memory 43 is used for storing application programs; the processor 42 may read the application program in the memory 43 and execute the application program; a communication bus 44 is used to enable connections between the various devices, wherein,
the processor 42 is configured to switch the state of the source virtual machine to a suspended state;
the sender 41 is configured to send a source virtual machine suspension notification to a source virtual switch corresponding to the source virtual machine, so that the source virtual switch sends a data packet to the target virtual machine according to a forwarding route after receiving the data packet with a destination address of the source virtual machine.
The virtual machine monitor shown in the embodiment of the present invention can execute the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
In another possible implementation manner, the transmitter 41 is further configured to transmit data information in the source virtual machine to the target virtual machine, where the data information includes memory data;
accordingly, the processor 42 is specifically configured to: and acquiring a memory dirty page in the source virtual machine, and switching the state of the source virtual machine to a suspended state when the memory dirty page is determined to be smaller than a preset threshold value.
In another possible embodiment, the sender 41 is further configured to send, before the sender 41 sends the data information in the source virtual machine to the target virtual machine, the configuration information of the source virtual machine to a target virtual machine monitor corresponding to the target virtual machine, so that the target virtual machine monitor configures the target virtual machine according to the configuration information.
In another possible embodiment, the transmitter 41 is further configured to, after the processor 42 switches the state of the source virtual machine to the suspended state, transmit remaining data information to the target virtual machine, where the remaining data information includes the current internal dirty page and the system state parameter.
In another possible embodiment, the system state parameters include: CPU state and register state.
In another possible implementation, the data information is hard disk data, and correspondingly, the transmitter 41 is specifically configured to:
and sending the shared address of the hard disk data to a target virtual machine so that the target virtual machine acquires the hard disk data according to the shared address.
In another possible implementation manner, the data information is memory data, and correspondingly, the transmitter 41 is specifically configured to:
sending all memory data to a target virtual machine;
and acquiring the memory dirty pages one by one, and sending the memory dirty pages to the target virtual machine.
The virtual machine monitor shown in the embodiment of the present invention can execute the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effect are similar, which are not described herein again.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (30)

1. A data processing system based on virtual machine migration, which is characterized by comprising a virtual machine monitor and a virtual switch, wherein the system is arranged in a source host machine, the source host machine is also provided with a source virtual machine, wherein,
the virtual machine monitor is used for switching the state of the source virtual machine into a pause state and sending a pause notification to the virtual switch;
the virtual switch is used for requesting the virtual machine monitor to acquire the address of a target host according to the suspension notice, and configuring a forwarding route according to the address of the source virtual machine and the address of the target host;
the virtual switch is further configured to, after receiving the suspension notification, receive a data packet addressed to the source virtual machine, cache the data packet, and obtain a state of a target virtual machine, and when the state of the target virtual machine is an operating state, send the data packet to the target virtual machine according to the forwarding route; the target virtual machine is the virtual machine after the source virtual machine is migrated, and the target virtual machine is arranged in the target host machine.
2. The system of claim 1, wherein the virtual switch sends the data packet to a target virtual machine according to the forwarding route, comprising:
the virtual switch acquires the address of the target host machine in the forwarding route;
the virtual switch encapsulates the data message according to the addresses of the source host and the target host;
and the virtual switch sends the encapsulated data message to the target virtual machine through a preset tunnel.
3. The system of claim 2, wherein the virtual switch encapsulates the data packet according to addresses of a source host and the target host, comprising:
the virtual switch determines an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the source host, and the destination address is the IP address of the target host;
and the virtual switch encapsulates the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
4. The system according to claim 2 or 3, wherein the predetermined tunnel is a virtual extensible local area network (VXLAN) tunnel or a multi-protocol label switching (MPLS) tunnel.
5. The system of claim 1, wherein after the virtual switch obtains the state of the target virtual machine, the system further comprises:
and if the state of the target virtual machine is a suspended state, caching the data message by the virtual switch until the data message is sent to the target virtual machine after the state of the target virtual machine is determined to be switched to a running state.
6. A data processing method based on virtual machine migration is applied to a virtual switch, the virtual switch is arranged in a source host, the source host is also provided with a source virtual machine and a virtual machine monitor, and the method comprises the following steps:
receiving a pause notification from the virtual machine monitor, the pause notification indicating that the state of the source virtual machine is switched to a paused state;
requesting the virtual machine monitor to acquire the address of a target host machine according to the suspension notice, and configuring a forwarding route according to the address of the source virtual machine and the address of the target host machine;
receiving a data message with a destination address of the source virtual machine; caching the data message and acquiring the state of a target virtual machine;
and when the state of the target virtual machine is an operating state, sending the data message to the target virtual machine according to the forwarding route, wherein the target virtual machine is a virtual machine after the source virtual machine is migrated, and the target virtual machine is arranged in the target host machine.
7. The method of claim 6, wherein sending the data packet to a target virtual machine according to a forwarding route comprises:
acquiring the address of a target host machine where the target virtual machine is located in the forwarding route;
packaging the data message according to the address of the source host and the address of the target host;
and sending the encapsulated data message to the target virtual machine through a preset tunnel.
8. The method of claim 7, wherein encapsulating the data packet according to the addresses of the source host and the target host comprises:
determining an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the source host, and the destination address is the IP address of the target host;
and encapsulating the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
9. The method according to any of claims 6-8, wherein the pre-established tunnel is a virtual extensible local area network, VXLAN, tunnel or a multiprotocol Label switching, MPLS, tunnel.
10. A data processing method based on virtual machine migration is applied to a virtual machine monitor, the virtual machine monitor is located in a source host, the source host is further provided with a source virtual machine, a virtual switch runs on the source host, the virtual switch is a switch module which runs on the source host where the source virtual machine is located and is realized based on software, and the method comprises the following steps:
switching the state of the source virtual machine to a pause state;
sending a source virtual machine pause notification to a source virtual switch corresponding to the source virtual machine, wherein the pause notification is used for indicating the source virtual switch to request the virtual machine monitor to acquire an address of a target host, the address of the target host and the address of the source virtual machine are used for configuring a forwarding route for the virtual switch, and the forwarding route is used for caching a data message after the source virtual switch receives the data message of which the destination address is the source virtual machine and acquiring the state of the target virtual machine; and when the state of the target virtual machine is an operating state, sending the data message to the target virtual machine, wherein the target virtual machine is the virtual machine after the source virtual machine is migrated.
11. The method of claim 10, wherein switching the state of the source virtual machine to the suspended state comprises:
sending data information in the source virtual machine to the target virtual machine, wherein the data information comprises memory data;
acquiring a dirty memory page in the source virtual machine;
and when the internal dirty page is determined to be smaller than a preset threshold value, switching the state of the source virtual machine to a suspended state.
12. The method of claim 11, further comprising, prior to sending data information in the source virtual machine to the target virtual machine:
and sending the configuration information of the source virtual machine to a target virtual machine monitor corresponding to a target virtual machine, so that the target virtual machine monitor configures the target virtual machine according to the configuration information.
13. The method according to any one of claims 10 to 11, wherein after switching the state of the source virtual machine to the suspended state, further comprising:
and sending residual data information to the target virtual machine, wherein the residual data information comprises the current internal dirty page and system state parameters.
14. The method of claim 13, wherein the system state parameters comprise: CPU state and register state.
15. The method according to claim 11 or 12, wherein the data information is hard disk data, and accordingly, sending the data information in the source virtual machine to the target virtual machine includes:
and sending the shared address of the hard disk data to a target virtual machine so that the target virtual machine acquires the hard disk data according to the shared address.
16. The method according to claim 11 or 12, wherein the data information is memory data, and accordingly, sending the data information in the source virtual machine to the target virtual machine includes:
sending all memory data to a target virtual machine;
and acquiring the memory dirty pages one by one, and sending the memory dirty pages to the target virtual machine.
17. A virtual switch disposed in a source host, the source host further disposed with a source virtual machine and a virtual machine monitor, comprising:
a receiving module, configured to receive a pause notification from the virtual machine monitor, where the pause notification indicates that a state of the source virtual machine is switched to a pause state; requesting the virtual machine monitor to acquire the address of a target host machine according to the suspension notice, and configuring a forwarding route according to the address of the source virtual machine and the address of the target host machine;
the receiving module is further configured to receive a data packet with a destination address of the source virtual machine; caching the data message and acquiring the state of a target virtual machine;
a sending module, configured to, when the state of the target virtual machine is an operating state, according to the forwarding route,
and sending the data message to the target virtual machine, wherein the target virtual machine is the virtual machine after the source virtual machine is migrated, and the target virtual machine is arranged in the target host machine.
18. The virtual switch of claim 17, wherein the sending module comprises an obtaining unit, an encapsulating unit, and a sending unit, wherein,
the obtaining unit is configured to obtain, in the forwarding route, an address of a target host where the target virtual machine is located;
the encapsulation unit is used for encapsulating the data message according to the address of the source host and the address of the target host;
and the sending unit is used for sending the encapsulated data message to the target virtual machine through a preset tunnel.
19. The virtual switch of claim 18, wherein the encapsulation unit is specifically configured to:
determining an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the source host, and the destination address is the IP address of the target host;
and encapsulating the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
20. A virtual machine monitor, located in a source host, the source host being further provided with a source virtual machine, a virtual switch running on the source host, the virtual switch being a switch module based on software implementation running on the source host where the source virtual machine is located, comprising:
the switching module is used for switching the state of the source virtual machine into a pause state;
a sending module, configured to send a source virtual machine suspension notification to a source virtual switch corresponding to the source virtual machine, where the suspension notification is used to instruct the source virtual switch to request the virtual machine monitor to acquire an address of a target host, where the address of the target host and the address of the source virtual machine are used for configuring a forwarding route for the virtual switch, and the forwarding route is used for caching a data packet with a destination address of the source virtual machine and acquiring a state of the target virtual machine after the source virtual switch receives the data packet; and when the state of the target virtual machine is an operating state, sending the data message to the target virtual machine, wherein the target virtual machine is the virtual machine after the source virtual machine is migrated.
21. The virtual machine monitor according to claim 20,
the sending module is further configured to send data information in the source virtual machine to the target virtual machine, where the data information includes memory data;
correspondingly, the switching module is specifically configured to: and acquiring a memory dirty page in the source virtual machine, and switching the state of the source virtual machine to a suspended state when the memory dirty page is determined to be smaller than a preset threshold value.
22. The virtual machine monitor according to claim 21, wherein the sending module is further configured to send configuration information of the source virtual machine to a target virtual machine monitor corresponding to a target virtual machine before the sending module sends data information in the source virtual machine to the target virtual machine, so that the target virtual machine monitor configures the target virtual machine according to the configuration information.
23. The virtual machine monitor according to any one of claims 20-22,
the sending module is further configured to send remaining data information to the target virtual machine after the switching module switches the state of the source virtual machine to the suspended state, where the remaining data information includes a current dirty memory page and system state parameters.
24. A virtual switch comprising a receiver, a transmitter, and a processor, the virtual switch being disposed in a source host, the source host further being disposed with a source virtual machine and a virtual machine monitor, wherein,
the receiver is configured to receive a suspension notification from the virtual machine monitor, where the suspension notification indicates that the state of the source virtual machine is switched to a suspension state;
requesting the virtual machine monitor to acquire the address of a target host machine according to the suspension notice, and configuring a forwarding route according to the address of the source virtual machine and the address of the target host machine;
the receiver is further configured to receive a data packet with a destination address of the source virtual machine; caching the data message and acquiring the state of a target virtual machine;
the sender is configured to send the data packet to the target virtual machine according to the forwarding route when the processor determines that the state of the source virtual machine is a suspended state and the state of the target virtual machine is an operating state, where the target virtual machine is a virtual machine after the source virtual machine is migrated, and the target virtual machine is set in the target host machine.
25. The virtual switch of claim 24,
the processor is further configured to obtain an address of a target host where the target virtual machine is located in the forwarding route, and encapsulate the data packet according to the address of the source host and the address of the target host;
correspondingly, the sender is specifically configured to send the encapsulated data packet to the target virtual machine through a preset tunnel.
26. The virtual switch of claim 25, wherein the processor is specifically configured to:
determining an IP header according to the IP addresses of the source host and the target host, wherein the source address in the IP header is the IP address of the source host, and the destination address is the IP address of the target host;
and encapsulating the data message according to the IP header and the tunnel identifier to obtain the encapsulated data message.
27. A virtual machine monitor comprising a sender and a processor, the virtual machine monitor being located in a source host, the source host further being provided with a source virtual machine, the source host running thereon a virtual switch, the virtual switch being a software-based implementation of a switch module running on the source host where the source virtual machine is located, wherein,
the processor is used for switching the state of the source virtual machine into a pause state;
the sender is configured to send a source virtual machine suspension notification to a source virtual switch corresponding to the source virtual machine, where the suspension notification is used to instruct the source virtual switch to request the virtual machine monitor to acquire an address of a target host, the address of the target host and the address of the source virtual machine are used for configuring a forwarding route for the virtual switch, and the forwarding route is used for caching a data packet with a destination address of the source virtual machine and acquiring a state of the target virtual machine after the source virtual switch receives the data packet; and when the state of the target virtual machine is an operating state, sending the data message to the target virtual machine, wherein the target virtual machine is the virtual machine after the source virtual machine is migrated.
28. The virtual machine monitor according to claim 27,
the sender is further configured to send data information in the source virtual machine to the target virtual machine, where the data information includes memory data;
accordingly, the processor is specifically configured to: and acquiring a memory dirty page in the source virtual machine, and switching the state of the source virtual machine to a suspended state when the memory dirty page is determined to be smaller than a preset threshold value.
29. The virtual machine monitor of claim 28, wherein the transmitter is further configured to transmit configuration information of the source virtual machine to a target virtual machine monitor corresponding to a target virtual machine before the transmitter transmits data information in the source virtual machine to the target virtual machine, so that the target virtual machine monitor configures the target virtual machine according to the configuration information.
30. The virtual machine monitor according to any one of claims 27-29,
the transmitter is further configured to transmit remaining data information to the target virtual machine after the processor switches the state of the source virtual machine to the suspended state, where the remaining data information includes a current dirty memory page and system state parameters.
CN201610818470.8A 2016-09-12 2016-09-12 Data processing method, system and equipment based on virtual machine migration Active CN107819708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610818470.8A CN107819708B (en) 2016-09-12 2016-09-12 Data processing method, system and equipment based on virtual machine migration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610818470.8A CN107819708B (en) 2016-09-12 2016-09-12 Data processing method, system and equipment based on virtual machine migration

Publications (2)

Publication Number Publication Date
CN107819708A CN107819708A (en) 2018-03-20
CN107819708B true CN107819708B (en) 2021-06-22

Family

ID=61601260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610818470.8A Active CN107819708B (en) 2016-09-12 2016-09-12 Data processing method, system and equipment based on virtual machine migration

Country Status (1)

Country Link
CN (1) CN107819708B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448802B (en) * 2021-06-25 2023-11-07 新华三云计算技术有限公司 Method, device, system and server for synchronizing states of hard disks
CN113794657B (en) * 2021-09-14 2023-10-31 迈普通信技术股份有限公司 MAC address migration processing method and device and switching equipment
CN114003349B (en) * 2021-12-30 2022-07-12 杭州优云科技有限公司 Virtual machine migration method and equipment
CN115499385B (en) * 2022-09-21 2023-09-12 中电云数智科技有限公司 Method for preventing packet loss during thermal migration of vDPA virtual machine

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333037A (en) * 2011-10-20 2012-01-25 中兴通讯股份有限公司 Method and device for migrating virtual machine
CN103532815A (en) * 2013-10-09 2014-01-22 中国联合网络通信集团有限公司 Message transmission method and device based on virtual machine migration
CN104468397A (en) * 2014-11-06 2015-03-25 杭州华三通信技术有限公司 Method and device for preventing package loss in thermal transferring and forwarding process of virtual machine
US9210065B2 (en) * 2009-06-22 2015-12-08 Alcatel Lucent Providing cloud-based services using dynamic network virtualization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9210065B2 (en) * 2009-06-22 2015-12-08 Alcatel Lucent Providing cloud-based services using dynamic network virtualization
CN102333037A (en) * 2011-10-20 2012-01-25 中兴通讯股份有限公司 Method and device for migrating virtual machine
CN103532815A (en) * 2013-10-09 2014-01-22 中国联合网络通信集团有限公司 Message transmission method and device based on virtual machine migration
CN104468397A (en) * 2014-11-06 2015-03-25 杭州华三通信技术有限公司 Method and device for preventing package loss in thermal transferring and forwarding process of virtual machine

Also Published As

Publication number Publication date
CN107819708A (en) 2018-03-20

Similar Documents

Publication Publication Date Title
US9577958B2 (en) Method and apparatus for implementing communication between virtual machines
US10397045B2 (en) Method for migrating service of data center, apparatus, and system
US8990808B2 (en) Data relay device, computer-readable recording medium, and data relay method
US10397126B2 (en) VXLAN packet transmission
CN107819708B (en) Data processing method, system and equipment based on virtual machine migration
WO2014136864A1 (en) Packet rewriting apparatus, control apparatus, communication system, packet transmitting method and program
JP6532526B2 (en) Network control method and device
CN108632145B (en) Message forwarding method and leaf node equipment
US9661550B2 (en) Communication apparatus, communication method, and communication system
US10314090B2 (en) Access point management
WO2012041604A1 (en) Aggregation of mobile broadband network interfaces
US20130094514A1 (en) Method and switch for sending packet
US10581669B2 (en) Restoring control-plane connectivity with a network management entity
CN113254148A (en) Virtual machine migration method and cloud management platform
US9847929B2 (en) Cluster and forwarding method
US20160330166A1 (en) Address Acquiring Method and Network Virtualization Edge Device
US20160261719A1 (en) Information processing system, control program, and control method
EP3493058A1 (en) Method and device for migrating a stateful function
US10374948B2 (en) Supporting mobility and multi-homing in the transport layer inside end-hosts
CN114760242B (en) Migration method and device of virtual router, electronic equipment and storage medium
JP5915755B2 (en) Information processing device
EP4184822A1 (en) Method and apparatus for keeping user terminal alive
US11044223B2 (en) Connection establishment for node connected to multiple IP networks
WO2016062085A1 (en) Virtual network realization method, nve and nva device and system
WO2024069219A1 (en) Receive side application auto-scaling

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230615

Address after: Room 1-2-A06, Yungu Park, No. 1008 Dengcai Street, Sandun Town, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: Aliyun Computing Co.,Ltd.

Address before: Grand Cayman capital building, a mailbox four / 847

Patentee before: ALIBABA GROUP HOLDING Ltd.