[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN107547400B - Virtual machine migration method and device - Google Patents

Virtual machine migration method and device Download PDF

Info

Publication number
CN107547400B
CN107547400B CN201710476005.5A CN201710476005A CN107547400B CN 107547400 B CN107547400 B CN 107547400B CN 201710476005 A CN201710476005 A CN 201710476005A CN 107547400 B CN107547400 B CN 107547400B
Authority
CN
China
Prior art keywords
tunnel router
virtual machine
address
message
tunnel
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
CN201710476005.5A
Other languages
Chinese (zh)
Other versions
CN107547400A (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.)
New H3C Information Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201710476005.5A priority Critical patent/CN107547400B/en
Publication of CN107547400A publication Critical patent/CN107547400A/en
Application granted granted Critical
Publication of CN107547400B publication Critical patent/CN107547400B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure provides a virtual machine migration method and device, the method comprising: recording the corresponding relation between a first address of the virtual machine and a second address of the first tunnel router in a mapping table; when the virtual machine is online on a second tunnel router, querying the mapping table through a first address of the virtual machine; if a second address corresponding to the first address exists in the mapping table, sending a first message to a first tunnel router according to the second address, wherein the first message carries a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, a forwarding table entry corresponding to the virtual machine is modified according to the third address of the second tunnel router. By the technical scheme, when the virtual machine is migrated, the service interruption time can be shortened.

Description

Virtual machine migration method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a virtual machine migration method and apparatus.
Background
LISP (Location/ID Separation Protocol) is a network establishment concept of separating Location and identity, and can divide an IP address into an EID (Endpoint ID) and an RLOC (routing locator), and introduce a mapping relationship between the EID and the RLOC. The EID is used for identifying the host, does not have a global routing function and can be migrated independently of the RLOC; RLOC is used for network-wide routing.
With the development of big data and virtualization technologies, Virtual Machine (VM) migration on a physical server becomes a common technical means, as shown in fig. 1, which is a schematic diagram of cross-segment migration in a LISP network. When the virtual machine 112 migrates from the tunnel router 121 to the tunnel router 122, the tunnel router 122 senses that the virtual machine joins, and sends a Map-Register message carrying an IP address of the virtual machine 112 to the mapping server. After receiving the Map-Register message, the MS determines that the virtual machine 112 has migrated, records the mapping relationship between the IP address of the virtual machine 112 and the IP address of the tunnel router 122 in the EID-to-RLOC mapping relationship, deletes the mapping relationship between the IP address of the virtual machine 112 and the IP address of the tunnel router 121, and sends a Map-Notify message to the tunnel router 121. After receiving the Map-Notify message, the tunnel router 121 determines that the virtual machine 112 is migrated, and deletes the relevant information of the virtual machine 112.
However, after the virtual machine 112 is migrated, during the period of time when the tunnel router 121 does not delete the relevant information of the virtual machine 112, if the tunnel router 121 receives the message sent by the virtual machine 111 to the virtual machine 112, the tunnel router 121 still forwards the message to the virtual machine 112 according to the original entry, but the message cannot be really transmitted to the virtual machine 112, so that the message is lost, and the service of the virtual machine 112 is interrupted.
Disclosure of Invention
The present disclosure provides a virtual machine migration method, applied to a second tunnel router, including:
recording the corresponding relation between a first address of the virtual machine and a second address of the first tunnel router in a mapping table; wherein the first tunnel router is a tunnel router accessed before the virtual machine is migrated;
when the virtual machine is online on the second tunnel router, querying the mapping table through the first address of the virtual machine; if a second address corresponding to the first address exists in the mapping table, sending a first message to a first tunnel router according to the second address, wherein the first message carries a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, a forwarding table entry corresponding to the virtual machine is modified according to the third address of the second tunnel router.
The present disclosure provides a virtual machine migration method, applied to a first tunnel router, including:
receiving a first message sent by a second tunnel router; the first message carries a third address of the second tunnel router and a first address of a virtual machine on line of the second tunnel router;
if the forwarding table entry corresponding to the virtual machine locally exists according to the first address of the virtual machine, sending a detection message to the virtual machine according to the first address of the virtual machine, sensing that the virtual machine leaves if a response message aiming at the detection message is not received within a preset time, and modifying the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
The present disclosure provides a virtual machine migration apparatus, which is applied to a second tunnel router, and includes:
the recording module is used for recording the corresponding relation between the first address of the virtual machine and the second address of the first tunnel router in the mapping table; the first tunnel router is accessed before the virtual machine is migrated;
the query module is used for querying the mapping table through the first address of the virtual machine when the virtual machine is online on the second tunnel router;
and a sending module, configured to send, when a second address corresponding to the first address exists in the mapping table, a first message to a first tunnel router according to the second address, where the first message carries a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, a forwarding table entry corresponding to the virtual machine is modified according to the third address of the second tunnel router.
The present disclosure provides a virtual machine migration apparatus, applied to a first tunnel router, including:
the receiving module is used for receiving a first message sent by the second tunnel router; the first message carries a third address of the second tunnel router and a first address of a virtual machine on line of the second tunnel router;
a sending module, configured to send a detection message to the virtual machine according to the first address of the virtual machine when it is determined that a forwarding table entry corresponding to the virtual machine locally exists according to the first address of the virtual machine;
and the processing module is used for sensing that the virtual machine leaves when the response message aiming at the detection message is not received within the preset time, and modifying the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
The present disclosure provides a machine-readable storage medium for use with a second tunnel router, the machine-readable storage medium having stored thereon computer instructions that, when executed, perform the following:
recording the corresponding relation between a first address of the virtual machine and a second address of the first tunnel router in a mapping table; wherein the first tunnel router is a tunnel router accessed before the virtual machine is migrated;
when the virtual machine is online on the second tunnel router, querying the mapping table through the first address of the virtual machine; if a second address corresponding to the first address exists in the mapping table, sending a first message to a first tunnel router according to the second address, wherein the first message carries a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, a forwarding table entry corresponding to the virtual machine is modified according to the third address of the second tunnel router.
The present disclosure provides a machine-readable storage medium for use with a first tunnel router, the machine-readable storage medium having stored thereon computer instructions that, when executed, perform the following:
receiving a first message sent by a second tunnel router; the first message carries a third address of the second tunnel router and a first address of a virtual machine on line of the second tunnel router;
if the forwarding table entry corresponding to the virtual machine locally exists according to the first address of the virtual machine, sending a detection message to the virtual machine according to the first address of the virtual machine, sensing that the virtual machine leaves if a response message aiming at the detection message is not received within a preset time, and modifying the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
Based on the above technical solution, in the embodiment of the present disclosure, in a scenario of virtual machine migration of the LISP network, when the virtual machine migrates, it may be ensured that the service is not interrupted or interrupted by a small amount as much as possible, thereby shortening service interruption time, accelerating convergence speed, improving migration timeliness of the virtual machine, and enabling the service to be switched quickly.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present disclosure or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings of the embodiments of the present disclosure.
FIG. 1 is a schematic diagram of a networking of a span segment migration in a LISP network;
FIG. 2 is a flow chart of a virtual machine migration method in one embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an application scenario in an embodiment of the present disclosure;
FIG. 4 is a block diagram of a virtual machine migration apparatus according to an embodiment of the present disclosure;
FIG. 5 is a hardware block diagram of a second tunnel router in one embodiment of the present disclosure;
fig. 6 is a block diagram of a virtual machine migration apparatus according to another embodiment of the present disclosure;
fig. 7 is a hardware configuration diagram of a first tunnel router in an embodiment of the present disclosure.
Detailed Description
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information in the embodiments of the present disclosure, such information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
The embodiment of the disclosure provides a virtual machine migration method, which can be applied to a LISP network including a plurality of tunnel routers and a mapping server. The Mapping Server may be an MS (Mapping Server) or an MR (Mapping Resolver). The Tunnel Router may be an xTR (Tunnel Router), and the xTR may be an ITR (Ingress Tunnel Router) or an ETR (Egress Tunnel Router).
The ITR and the ETR are opposite, for example, when the host 1 sends a message to the host 2, the ITR is in the LISP domain where the host 1 is located, the ETR is in the LISP domain where the host 2 is located, when the host 2 sends a message to the host 1, the ITR is in the LISP domain where the host 2 is located, and the ETR is in the LISP domain where the host 1 is located.
In one example, the tunnel routers may include a first tunnel router that is a pre-virtual machine migration tunnel router and a second tunnel router that is a post-virtual machine migration tunnel router. For example, when virtual machine a migrates from tunnel router 1 to tunnel router 2, then the first tunnel router is tunnel router 1 and the second tunnel router is tunnel router 2.
Referring to fig. 2, a flowchart of the virtual machine migration method is shown, and the method may include the following steps:
step 201, the second tunnel router records the corresponding relationship between the first address of the virtual machine and the second address of the first tunnel router (i.e. the tunnel router accessed before the virtual machine is migrated) in the mapping table.
In one example, for the process of "the second tunnel router records the correspondence of the first address of the virtual machine and the second address of the first tunnel router in the mapping table", the following ways may be included, but are not limited to: the first method is that after a first tunnel router sends a first address of a virtual machine and a second address of the first tunnel router to a mapping server according to a request of the virtual machine connected with the first tunnel router, a second tunnel router receives a second message sent by the mapping server, the second message carries the first address of the virtual machine and the second address of the first tunnel router, and the corresponding relation between the first address and the second address is recorded in a mapping table. And secondly, after the first tunnel router sends the first address of the virtual machine and the second address of the first tunnel router to the second tunnel router according to the request of the virtual machine connected with the first tunnel router, the second tunnel router receives a message carrying the first address of the virtual machine and the second address of the first tunnel router, and records the corresponding relation between the first address and the second address in the mapping table. And in the third mode, the second tunnel router directly configures the corresponding relation between the first address of the virtual machine and the second address of the first tunnel router in the mapping table.
For the first method, an embodiment may be: when the virtual machine is online on the first tunnel router (namely the first tunnel router receives a request sent by the virtual machine connected with the first tunnel router), the first tunnel router sends a message carrying the first address of the virtual machine and the second address of the first tunnel router to the mapping server. And after receiving the message sent by the first tunnel router, the mapping server sends a second message carrying the first address of the virtual machine and the second address of the first tunnel router to the second tunnel router. After receiving the second message sent by the mapping server, the second tunnel router may record a correspondence between the first address of the virtual machine and the second address of the first tunnel router in the mapping table.
Step 202, when the virtual machine is online on the second tunnel router, the second tunnel router queries the mapping table through the first address of the virtual machine. If the mapping table has the second address corresponding to the first address, it indicates that the virtual machine is migrated from another tunnel router to the second tunnel router, and step 203 is executed. If the mapping table does not have the second address corresponding to the first address, it indicates that the virtual machine is not migrated from the other tunnel router to the second tunnel router, and the processing is performed by using the conventional process, which is not described herein again.
After the virtual machine is online on the first tunnel router, if the virtual machine is online on the second tunnel router, the virtual machine is migrated from the first tunnel router to the second tunnel router.
Step 203, the second tunnel router sends the first message to the first tunnel router according to the second address existing in the mapping table. The first message may carry a first address of the virtual machine, a third address of the second tunnel router, and the first message is used to indicate that the virtual machine has migrated to the second tunnel router.
Step 204, the first tunnel router receives a first message sent by the second tunnel router, and if it is determined that a forwarding table entry corresponding to the virtual machine exists locally according to the first address of the virtual machine, a detection message is sent to the virtual machine according to the first address of the virtual machine, where the detection message is used to detect whether the virtual machine is online.
After receiving the first message, the first tunnel router may parse a first address of the virtual machine from the first message, query a forwarding table entry through the first address, if a forwarding table entry corresponding to the first address exists (that is, a forwarding table entry corresponding to the virtual machine exists), indicate that the virtual machine is online in the first tunnel router, and send a detection message to the virtual machine according to the first address of the virtual machine.
Step 205, if the first tunnel router does not receive the response message for the detection message within the preset time, it is perceived that the virtual machine leaves, and the forwarding table entry corresponding to the virtual machine is modified according to the third address of the second tunnel router, that is, the outgoing interface of the forwarding table entry may be the interface corresponding to the third address.
In an example, the process for "the first tunnel router modifies the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router" may include, but is not limited to, the following manners: the first tunnel router determines a second interface connected with the second tunnel router on the first tunnel router according to the third address of the second tunnel router (the next hop of the second interface is the third address of the second tunnel router); and modifying the output interface of the forwarding table entry corresponding to the virtual machine into the second interface.
In an example, after the first tunnel router modifies the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router, an acknowledgement response message (e.g., an ACK message) for the first message may also be sent to the second tunnel router. For example, the first tunnel router parses the third address of the second tunnel router from the first message, and sends an acknowledgement response message to the second tunnel router according to the third address.
Further, after the second tunnel router sends the first message to the first tunnel router according to the second address, if an acknowledgement response message for the first message sent by the first tunnel router is received within a preset time, it is determined that the virtual machine has been migrated from the first tunnel router to the second tunnel router, that is, the currently online virtual machine is a valid virtual machine. Therefore, the second tunnel router sends a third message to the mapping server, where the third message may carry the first address of the virtual machine and the third address of the second tunnel router. After receiving the third message, the mapping server may modify the correspondence between the first address and the second address recorded in the EID/RLOC entry into the correspondence between the first address and the third address.
In one example, after the first tunnel router sends the detection message to the virtual machine, if the first tunnel router receives a response message for the detection message within a preset time, it senses that the virtual machine is still on-line with the first tunnel router, retains a forwarding table entry corresponding to the virtual machine, and may send a negative acknowledgement response message (e.g., a NACK message) for the first message to the second tunnel router, or refuse to send the response message for the first message to the second tunnel router (i.e., not return any response message to the second tunnel router). For example, the first tunnel router may carry a third address of the second tunnel router from the first message and send a negative acknowledgement response message to the second tunnel router based on the third address.
Further, after the second tunnel router sends the first message to the first tunnel router according to the second address, if an acknowledgement response message for the first message sent by the first tunnel router is not received within a preset time (e.g., a negative acknowledgement response message is received within the preset time or any response message is not received), the second tunnel router determines that the virtual machine is not migrated from the first tunnel router to the second tunnel router, i.e., the virtual machine currently online is a non-legal virtual machine. Therefore, the second tunnel router does not send a third message to the mapping server and does not trigger the mapping server to update the EID/RLOC entry.
In one example, when the virtual machine is online on the second tunnel router, the second tunnel router may further record, in the EID/RLOC entry, a correspondence of the first address of the virtual machine, the third address of the second tunnel router, and the first interface connected to the virtual machine on the second tunnel router. Based on this, after the second tunnel router sends the first message to the first tunnel router according to the second address, if the acknowledgement response message for the first message sent by the first tunnel router is not received within the preset time, the corresponding relationship among the first address, the third address, and the first interface may also be deleted from the EID/RLOC entry.
In the above embodiment, the first address of the virtual machine may be an IP address and/or a MAC address of the virtual machine, the second address of the first tunnel router may be an IP address and/or a MAC address of the first tunnel router, and the third address of the second tunnel router may be an IP address and/or a MAC address of the second tunnel router.
Based on the above technical solution, in the embodiment of the present disclosure, in a scenario of virtual machine migration of the LISP network, when the virtual machine migrates, it may be ensured that the service is not interrupted or interrupted by a small amount as much as possible, thereby shortening the service interruption time, accelerating the convergence speed, improving the migration timeliness of the virtual machine, and enabling the service to be switched quickly.
The above technical solution is further described below with reference to the application scenario shown in fig. 3. In fig. 3, it is assumed that the IP address of the virtual machine 311 is 4.1.1.1, the IP address of the virtual machine 312 is 5.1.1.1, the IP address of the tunnel router 321 is 10.0.0.2, the IP address of the tunnel router 322 is 11.0.0.2, and the IP address of the tunnel router 323 is 12.0.0.2. If virtual machine 312 migrates from tunnel router 321 to tunnel router 322, tunnel router 321 is a first tunnel router and tunnel router 322 is a second tunnel router.
In the application scenario, the virtual machine migration method may include the following steps:
step 1, when the virtual machine 311 is online on the tunnel router 321 (i.e. the tunnel router 321 receives a request sent by the virtual machine 311 connected to the tunnel router 321), the tunnel router 321 may record the correspondence between the interfaces a and 4.1.1.1, 10.0.0.2 in the EID/RLOC entry, as shown in table 1.
Similarly, when the virtual machine 312 is online on the tunnel router 321, the tunnel router 321 may record the corresponding relationship between 5.1.1.1, 10.0.0.2 and the interface B in the EID/RLOC entry, as shown in table 1.
TABLE 1
Figure BDA0001328268860000081
Figure BDA0001328268860000091
Step 2, the tunnel router 321 sends a fourth message to the mapping server, where the fourth message may carry a correspondence relationship between 4.1.1.1 and 10.0.0.2, and a correspondence relationship between 5.1.1.1 and 10.0.0.2.
Step 3, after receiving the fourth message, the mapping server records the corresponding relationship between 4.1.1.1 and 10.0.0.2 and the corresponding relationship between 5.1.1.1 and 10.0.0.2 in the EID/RLOC entry, as shown in table 2.
TABLE 2
EID RLOC
4.1.1.1 10.0.0.2
5.1.1.1 10.0.0.2
And step 4, the mapping server sends a second message to the tunnel router 322 and the tunnel router 323, wherein the second message can carry the corresponding relation between 4.1.1.1 and 10.0.0.2 and the corresponding relation between 5.1.1.1 and 10.0.0.2.
For the correspondence between 4.1.1.1 and 10.0.0.2 and the correspondence between 5.1.1.1 and 10.0.0.2 sent by the tunnel router 321, the mapping server may send a second message to each tunnel router other than the tunnel router 321, that is, the second message is sent to the tunnel router 322 and the tunnel router 323.
In one example, the mapping server may send the second message to tunnel router 322 and/or tunnel router 323 upon registration of tunnel router 322 and/or tunnel router 323 for the sending opportunity of the second message. Alternatively, the mapping server may determine the mapping relationship between the EID and the RLOC,
the second message is sent to tunnel router 322 and/or tunnel router 323. Alternatively, the mapping server may periodically send a second message to tunnel router 322 and/or tunnel router 323. Alternatively, the mapping server may send the second message to tunnel router 322 and/or tunnel router 323 upon receiving the message from tunnel router 322 and/or tunnel router 323. The transmission timing is not limited.
Step 5, after receiving the second message, the tunnel router 322 records the corresponding relationship between 4.1.1.1 and 10.0.0.2, and the corresponding relationship between 5.1.1.1 and 10.0.0.2 in the mapping table, as shown in table 3. The tunnel router 323 records the correspondence between 4.1.1.1 and 10.0.0.2, and the correspondence between 5.1.1.1 and 10.0.0.2 in the mapping table.
TABLE 3
Figure BDA0001328268860000092
Figure BDA0001328268860000101
The above process is a processing flow when the virtual machine 311 and the virtual machine 312 come on-line at the tunnel router 321, that is, a processing flow before the virtual machine 312 migrates from the tunnel router 321 to the tunnel router 322, and when the virtual machine 312 migrates from the tunnel router 321 to the tunnel router 322, the process may further include the following steps:
step 6, when the virtual machine 312 comes online at the tunnel router 322 (i.e., the virtual machine 312 has migrated from the tunnel router 321 to the tunnel router 322), then the tunnel router 322 may record the correspondence of 5.1.1.1, 11.0.0.2 and interface C in the EID/RLOC entry, as an example shown in table 4.
TABLE 4
EID RLOC Outlet interface
5.1.1.1 11.0.0.2 Interface C
Step 7, the tunnel router 322 obtains 10.0.0.2 corresponding to 5.1.1.1 by looking up the mapping table shown in table 3 with 5.1.1.1, that is, the virtual machine 312 is migrated from other tunnel routers to the tunnel router 322.
Step 8, the tunnel router 322 sends the first message according to 10.0.0.2, that is, the first message is sent to the tunnel router 321 corresponding to 10.0.0.2. This first message may carry 5.1.1.1 for virtual machine 312, 11.0.0.2 for tunnel router 322, to indicate that virtual machine 312 has migrated to tunnel router 322.
Step 9, the tunnel router 321 sends a detection message to the virtual machine 312 after receiving the first message.
For example, the tunnel router 321 obtains the outgoing interface as interface B by querying the EID/RLOC table entry shown in table 1 by 5.1.1.1, and sends a detection message (e.g., an ICMP message) to the virtual machine 312 through interface B.
In one example, tunnel router 321 may also set a timer after sending the detection message to virtual machine 312. If a response message for the detection message is not received within a preset time, executing step 10; if a response message to the detection message is received within a preset time, step 15 is executed.
Step 10, the tunnel router 321 senses that the virtual machine 312 leaves, and modifies a forwarding table entry corresponding to the virtual machine 312 according to 11.0.0.2 of the tunnel router 322. For example, assuming that the interface on the tunnel router 321 corresponding to 11.0.0.2 is interface D, that is, the IP address of the next hop of interface D is 11.0.0.2, that is, the tunnel router 321 is connected to the tunnel router 322 through interface D, the tunnel router 321 may modify the outgoing interface of the forwarding table entry corresponding to the virtual machine 312 to interface D, as shown in table 5.
TABLE 5
EID RLOC Outlet interface
4.1.1.1 10.0.0.2 Interface A
5.1.1.1 10.0.0.2 Interface D
Step 11, the tunnel router 321 sends an acknowledgement response message (e.g. an ACK message) for the first message to the tunnel router 322 corresponding to 11.0.0.2 according to 11.0.0.2 carried in the first message.
Step 12, after receiving the acknowledgement response message, the tunnel router 322 may send a third message to the mapping server, where the third message may carry the corresponding relationship between 5.1.1.1 and 11.0.0.2.
After sending the first message to tunnel router 321, tunnel router 322 determines that virtual machine 312 has migrated from tunnel router 321 to tunnel router 322 if receiving an acknowledgement response message sent by tunnel router 321 for the first message within a preset time, and may send a third message to the mapping server, where the third message may carry a correspondence relationship between 5.1.1.1 and 11.0.0.2.
Step 13, after receiving the third message, the mapping server modifies the EID/RLOC entry shown in table 2 according to the corresponding relationship between 5.1.1.1 and 11.0.0.2, such as the modified EID/RLOC entry shown in table 6.
TABLE 6
EID RLOC
4.1.1.1 10.0.0.2
5.1.1.1 11.0.0.2
Step 14, the mapping server triggers each tunnel router to send the traffic to 5.1.1.1 to 11.0.0.2 instead of 10.0.0.2 according to the traditional flow, which is not described in detail again.
Step 15, the tunnel router 321 senses that the virtual machine 312 is still on line in the tunnel router 321, retains the forwarding table entry corresponding to 312, and sends a negative acknowledgement response message (such as a NACK message) for the first message to the tunnel router 322 corresponding to 11.0.0.2 according to 11.0.0.2 carried in the first message, or refuses to send a response message (i.e., does not return any response message) for the first message to the tunnel router 322.
Step 16, after tunnel router 322 sends the first message to tunnel router 321, if an acknowledgement response message for the first message sent by tunnel router 321 is not received within a preset time, tunnel router 322 determines that virtual machine 312 has not migrated from tunnel router 321 to tunnel router 322.
Step 17, the tunnel router 322 may delete the corresponding relationship between 5.1.1.1, 11.0.0.2 and the interface C from the EID/RLOC entry shown in table 4, so as to obtain the deleted EID/RLOC entry.
Based on the same concept as the above method, the embodiment of the present disclosure further provides a virtual machine migration apparatus, which is applied to the second tunnel router, as shown in fig. 4, and is a structural diagram of the virtual machine migration apparatus.
A recording module 401, configured to record, in a mapping table, a correspondence between a first address of a virtual machine and a second address of a first tunnel router; the first tunnel router is accessed before the virtual machine is migrated;
a query module 402, configured to query the mapping table through the first address of the virtual machine when the virtual machine is online on the second tunnel router;
a sending module 403, configured to send, when a second address corresponding to the first address exists in the mapping table, a first message to the first tunnel router according to the second address, where the first message carries a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, the first tunnel router modifies a forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
In an example, the recording module 401 is specifically configured to, in a process of recording a correspondence between a first address of a virtual machine and a second address of a first tunnel router in a mapping table, receive a second message sent by a mapping server after the first tunnel router sends, according to a request of a virtual machine connected to the first tunnel router, the first address of the virtual machine and the second address of the first tunnel router to the mapping server, where the second message carries the first address of the virtual machine and the second address of the first tunnel router; and recording the corresponding relation between the first address and the second address in a mapping table.
In one example, the virtual machine migration apparatus further includes (not embodied in the figure):
a determining module, configured to determine that the virtual machine is not migrated from the first tunnel router to the second tunnel router if an acknowledgement response message for the first message is not received within a preset time after the sending module 403 sends the first message to the first tunnel router according to the second address; and if the confirmation response message aiming at the first message is received within the preset time, determining that the virtual machine is migrated from the first tunnel router to the second tunnel router.
In terms of hardware, a hardware architecture diagram of the second tunnel router provided in the embodiment of the present disclosure may specifically refer to fig. 5. The method comprises the following steps: a machine-readable storage medium and a processor, wherein:
a machine-readable storage medium: the instruction code is stored.
A processor: the instruction codes stored in the machine-readable storage medium are read and executed by communicating with the machine-readable storage medium, so as to realize the virtual machine migration operation disclosed by the above examples of the disclosure.
Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
Based on the same concept as the above method, the embodiment of the present disclosure further provides a virtual machine migration apparatus, which is applied to the first tunnel router, and as shown in fig. 6, is a structural diagram of the virtual machine migration apparatus.
A receiving module 601, configured to receive a first message sent by a second tunnel router; the first message carries a third address of the second tunnel router and a first address of a virtual machine on line on the second tunnel router;
a sending module 602, configured to send a detection message to the virtual machine according to the first address of the virtual machine when it is determined that a forwarding table entry corresponding to the virtual machine exists locally according to the first address of the virtual machine;
a processing module 603, configured to, when a response message to the detection message is not received within a preset time, perceive that the virtual machine leaves, and modify a forwarding entry corresponding to the virtual machine according to the third address of the second tunnel router.
In an example, the sending module 602 is further configured to send, to the second tunnel router, an acknowledgement response message for the first message after the processing module modifies a forwarding table entry corresponding to the virtual machine according to a third address of the second tunnel router;
the sending module 602 is further configured to, after sending the detection message to the virtual machine, if a response message to the detection message is received within a preset time, perceive that the virtual machine is online in the first tunnel router, and send a negative acknowledgement response message to the first message to the second tunnel router, or refuse to send the response message to the first message to the second tunnel router.
In an example, the processing module 603 is specifically configured to, in a process of modifying a forwarding table entry corresponding to the virtual machine according to a third address of the second tunnel router, determine a second interface, connected to the second tunnel router, on the first tunnel router according to the third address of the second tunnel router; and modifying the output interface of the forwarding table entry corresponding to the virtual machine into the second interface.
In terms of hardware, a hardware architecture diagram of the first tunnel router provided in the embodiment of the present disclosure may specifically refer to fig. 7. The method comprises the following steps: a machine-readable storage medium and a processor, wherein:
a machine-readable storage medium: the instruction code is stored.
A processor: the instruction codes stored in the machine-readable storage medium are read and executed by communicating with the machine-readable storage medium, so as to realize the virtual machine migration operation disclosed by the above examples of the disclosure.
Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
Based on the same concept as the method, the embodiment of the present disclosure further provides a machine-readable storage medium, where the machine-readable storage medium is applied to a second tunnel router, and the machine-readable storage medium stores thereon several computer instructions, and when executed, the computer instructions perform the following processes:
recording the corresponding relation between a first address of the virtual machine and a second address of the first tunnel router in a mapping table; wherein the first tunnel router is a tunnel router accessed before the virtual machine is migrated;
when the virtual machine is online on the second tunnel router, querying the mapping table through the first address of the virtual machine; if a second address corresponding to the first address exists in the mapping table, sending a first message to a first tunnel router according to the second address, wherein the first message carries a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, a forwarding table entry corresponding to the virtual machine is modified according to the third address of the second tunnel router.
Based on the same concept as the method, the embodiment of the present disclosure further provides a machine-readable storage medium, where the machine-readable storage medium is applied to a first tunnel router, and the machine-readable storage medium stores several computer instructions, and when executed, the computer instructions perform the following processes:
receiving a first message sent by a second tunnel router; the first message carries a third address of the second tunnel router and a first address of a virtual machine on line of the second tunnel router;
if the forwarding table entry corresponding to the virtual machine locally exists according to the first address of the virtual machine, sending a detection message to the virtual machine according to the first address of the virtual machine, sensing that the virtual machine leaves if a response message aiming at the detection message is not received within a preset time, and modifying the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in practicing the disclosure.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the disclosed embodiments may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (which may include, but is not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present disclosure and is not intended to limit the present disclosure. Various modifications and variations of this disclosure will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure should be included in the scope of the claims of the present disclosure.

Claims (14)

1. A virtual machine migration method is applied to a second tunnel router and comprises the following steps:
recording the corresponding relation between a first address of the virtual machine and a second address of the first tunnel router in a mapping table; wherein the first tunnel router is a tunnel router accessed before the virtual machine is migrated;
when the virtual machine is online on the second tunnel router, querying the mapping table through the first address of the virtual machine; if a second address corresponding to the first address exists in the mapping table, sending a first message to a first tunnel router according to the second address, wherein the first message carries the first address of the virtual machine and a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, a forwarding table entry corresponding to the virtual machine is modified according to the third address of the second tunnel router.
2. The method according to claim 1, wherein the step of recording, in the mapping table, a correspondence between a first address of the virtual machine and a second address of the first tunnel router specifically includes:
when a first tunnel router sends a first address of a virtual machine and a second address of the first tunnel router to a mapping server according to a request of the virtual machine connected with the first tunnel router, receiving a second message sent by the mapping server, wherein the second message carries the first address of the virtual machine and the second address of the first tunnel router; and recording the corresponding relation between the first address and the second address in a mapping table.
3. The method of claim 1, wherein after sending the first message to the first tunnel router based on the second address, the method further comprises:
if the confirmation response message aiming at the first message is not received within the preset time, determining that the virtual machine is not migrated from the first tunnel router to the second tunnel router;
and if the confirmation response message aiming at the first message is received within the preset time, determining that the virtual machine is migrated from the first tunnel router to the second tunnel router.
4. A virtual machine migration method is applied to a first tunnel router and comprises the following steps:
receiving a first message sent by a second tunnel router; the first message carries a third address of the second tunnel router and a first address of a virtual machine on line of the second tunnel router;
if the forwarding table entry corresponding to the virtual machine locally exists according to the first address of the virtual machine, sending a detection message to the virtual machine according to the first address of the virtual machine, sensing that the virtual machine leaves if a response message aiming at the detection message is not received within a preset time, and modifying the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
5. The method of claim 4, wherein after the modifying the forwarding entry corresponding to the virtual machine according to the third address of the second tunnel router, the method further comprises: sending an acknowledgement response message for the first message to the second tunnel router;
after sending the detection message to the virtual machine, the method further includes: and if the response message aiming at the detection message is received within the preset time, sensing that the virtual machine is on line at the first tunnel router, and sending a denial response message aiming at the first message to the second tunnel router, or refusing to send the response message aiming at the first message to the second tunnel router.
6. The method according to claim 4 or 5, wherein the modifying the forwarding entry corresponding to the virtual machine according to the third address of the second tunnel router specifically includes:
determining a second interface connected with the second tunnel router on the first tunnel router according to the third address of the second tunnel router;
and modifying the output interface of the forwarding table entry corresponding to the virtual machine into the second interface.
7. A virtual machine migration apparatus applied to a second tunnel router includes:
the recording module is used for recording the corresponding relation between the first address of the virtual machine and the second address of the first tunnel router in the mapping table; the first tunnel router is accessed before the virtual machine is migrated;
the query module is used for querying the mapping table through the first address of the virtual machine when the virtual machine is online on the second tunnel router;
a sending module, configured to send, when a second address corresponding to the first address exists in the mapping table, a first message to a first tunnel router according to the second address, where the first message carries the first address of the virtual machine and a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, the first tunnel router modifies a forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
8. The apparatus of claim 7,
the recording module is specifically configured to, in a process of recording a correspondence between a first address of a virtual machine and a second address of a first tunnel router in a mapping table, receive a second message sent by a mapping server after the first tunnel router sends, to the mapping server, the first address of the virtual machine and the second address of the first tunnel router according to a request of a virtual machine connected to the first tunnel router, where the second message carries the first address of the virtual machine and the second address of the first tunnel router; and recording the corresponding relation between the first address and the second address in a mapping table.
9. The apparatus of claim 7, further comprising:
a determining module, configured to determine that the virtual machine is not migrated from the first tunnel router to the second tunnel router if an acknowledgement response message for the first message is not received within a preset time after the sending module sends the first message to the first tunnel router according to the second address; and if the confirmation response message aiming at the first message is received within the preset time, determining that the virtual machine is migrated from the first tunnel router to the second tunnel router.
10. A virtual machine migration apparatus applied to a first tunnel router includes:
the receiving module is used for receiving a first message sent by the second tunnel router; the first message carries a third address of the second tunnel router and a first address of a virtual machine on line of the second tunnel router;
a sending module, configured to send a detection message to the virtual machine according to the first address of the virtual machine when it is determined that a forwarding table entry corresponding to the virtual machine locally exists according to the first address of the virtual machine;
and the processing module is used for sensing that the virtual machine leaves when the response message aiming at the detection message is not received within the preset time, and modifying the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
11. The apparatus of claim 10,
the sending module is further configured to send a confirmation response message for the first message to the second tunnel router after the processing module modifies the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router;
the sending module is further configured to, after sending the detection message to the virtual machine, if a response message to the detection message is received within a preset time, perceive that the virtual machine is online in the first tunnel router, and send a negative acknowledgement response message to the first message to the second tunnel router, or refuse to send the response message to the first message to the second tunnel router.
12. The apparatus of claim 10 or 11,
the processing module is specifically configured to determine, according to the third address of the second tunnel router, a second interface on the first tunnel router, where the second interface is connected to the second tunnel router, in a process of modifying a forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router;
and modifying the output interface of the forwarding table entry corresponding to the virtual machine into the second interface.
13. A machine-readable storage medium for use with a second tunnel router, the machine-readable storage medium having stored thereon computer instructions that, when executed, perform:
recording the corresponding relation between a first address of the virtual machine and a second address of the first tunnel router in a mapping table; wherein the first tunnel router is a tunnel router accessed before the virtual machine is migrated;
when the virtual machine is online on the second tunnel router, querying the mapping table through the first address of the virtual machine; if a second address corresponding to the first address exists in the mapping table, sending a first message to a first tunnel router according to the second address, wherein the first message carries the first address of the virtual machine and a third address of the second tunnel router, so that when the first tunnel router senses that the virtual machine leaves, a forwarding table entry corresponding to the virtual machine is modified according to the third address of the second tunnel router.
14. A machine-readable storage medium for use with a first tunnel router, the machine-readable storage medium having stored thereon computer instructions that, when executed, perform:
receiving a first message sent by a second tunnel router; the first message carries a third address of the second tunnel router and a first address of a virtual machine on line of the second tunnel router;
if the forwarding table entry corresponding to the virtual machine locally exists according to the first address of the virtual machine, sending a detection message to the virtual machine according to the first address of the virtual machine, sensing that the virtual machine leaves if a response message aiming at the detection message is not received within a preset time, and modifying the forwarding table entry corresponding to the virtual machine according to the third address of the second tunnel router.
CN201710476005.5A 2017-06-21 2017-06-21 Virtual machine migration method and device Active CN107547400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710476005.5A CN107547400B (en) 2017-06-21 2017-06-21 Virtual machine migration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710476005.5A CN107547400B (en) 2017-06-21 2017-06-21 Virtual machine migration method and device

Publications (2)

Publication Number Publication Date
CN107547400A CN107547400A (en) 2018-01-05
CN107547400B true CN107547400B (en) 2020-05-12

Family

ID=60970305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710476005.5A Active CN107547400B (en) 2017-06-21 2017-06-21 Virtual machine migration method and device

Country Status (1)

Country Link
CN (1) CN107547400B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161439B (en) * 2016-06-30 2019-11-26 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN109189549A (en) * 2018-08-01 2019-01-11 新华三技术有限公司 Virtual machine migration method and device
CN111698164B (en) * 2020-06-11 2021-11-19 北京金山云网络技术有限公司 Network routing method and device of virtual machine and management server
CN113872844B (en) * 2020-06-30 2023-07-18 华为技术有限公司 Method for establishing VXLAN tunnel and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104780102A (en) * 2015-04-07 2015-07-15 杭州华三通信技术有限公司 Information processing method and device for virtual machine migration in LISP (locator identity separation protocol) network
CN104780109A (en) * 2015-04-27 2015-07-15 杭州华三通信技术有限公司 Virtual machine migration method and device
CN105591935A (en) * 2015-08-26 2016-05-18 杭州华三通信技术有限公司 Method and device for updating EID-RLOC mapping relation after virtual machine migration
CN105591921A (en) * 2015-09-28 2016-05-18 杭州华三通信技术有限公司 Method and device for determination of host migration state

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9369473B2 (en) * 2013-09-06 2016-06-14 Cisco Technology, Inc. Method and system for extending network resources campus-wide based on user role and location

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104780102A (en) * 2015-04-07 2015-07-15 杭州华三通信技术有限公司 Information processing method and device for virtual machine migration in LISP (locator identity separation protocol) network
CN104780109A (en) * 2015-04-27 2015-07-15 杭州华三通信技术有限公司 Virtual machine migration method and device
CN105591935A (en) * 2015-08-26 2016-05-18 杭州华三通信技术有限公司 Method and device for updating EID-RLOC mapping relation after virtual machine migration
CN105591921A (en) * 2015-09-28 2016-05-18 杭州华三通信技术有限公司 Method and device for determination of host migration state

Also Published As

Publication number Publication date
CN107547400A (en) 2018-01-05

Similar Documents

Publication Publication Date Title
CN108667695B (en) Backup method and device for BRAS transfer control separation
CN106998297B (en) A kind of virtual machine migration method and device
US8826381B2 (en) Node device and method to prevent overflow of pending interest table in name based network system
EP3451592B1 (en) Packet transmission between vxlan domains
CN107547400B (en) Virtual machine migration method and device
KR101857511B1 (en) Method and apparatus for determining virtual machine migration
CN107547349B (en) Virtual machine migration method and device
CN103888358B (en) Routing method, device, system and gateway equipment
CN108259218B (en) IP address allocation method and device
CN106878184B (en) Data message transmission method and device
CN109495320B (en) Data message transmission method and device
CN110505621B (en) Terminal migration processing method and device
CN112887229B (en) Session information synchronization method and device
CN108600109A (en) A kind of message forwarding method and device
CN107547364A (en) Route sending-down method, device and the network equipment
CN109728972B (en) Network connection detection method and device
CN114172853B (en) Configuration method and device of traffic forwarding and bare computer server
CN108259348B (en) Message transmission method and device
CN106878052B (en) User migration method and device
CN104780110B (en) Message transmitting method and equipment during a kind of virtual machine (vm) migration
CN104780201A (en) Data packet processing method and device for use in IPVS (Internet Protocol Virtual Server) cluster
CN111131484A (en) Node mounting method, device, network node and storage medium
CN107547675A (en) A kind of user equipment migration method and apparatus
CN108810183B (en) Method and device for processing conflicting MAC addresses and machine-readable storage medium
CN108259340B (en) Topology information transmission method and device

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

Effective date of registration: 20230529

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right