CN115065630A - Virtual router migration method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN115065630A
CN115065630A CN202210507005.8A CN202210507005A CN115065630A CN 115065630 A CN115065630 A CN 115065630A CN 202210507005 A CN202210507005 A CN 202210507005A CN 115065630 A CN115065630 A CN 115065630A
Authority
CN
China
Prior art keywords
virtual router
host
destination host
information
cache data
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.)
Granted
Application number
CN202210507005.8A
Other languages
Chinese (zh)
Other versions
CN115065630B (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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202210507005.8A priority Critical patent/CN115065630B/en
Publication of CN115065630A publication Critical patent/CN115065630A/en
Application granted granted Critical
Publication of CN115065630B publication Critical patent/CN115065630B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a migration method and a migration device of a virtual router, electronic equipment and a computer storage medium, wherein the method comprises the following steps: receiving a migration request of a first virtual router; determining a target host according to the migration request of the first virtual router; and sending the cache data of the first virtual router to the destination host, so that the destination host determines the second virtual router and writes the cache data of the first virtual router into the second virtual router.

Description

Virtual router migration method and device, electronic equipment and storage medium
Technical Field
The present invention relates to a migration method of a virtual router, and in particular, to a migration method and apparatus of a virtual router, an electronic device, and a computer storage medium.
Background
With the development of internet technology, the existing network system architecture is difficult to meet the deployment requirements of various emerging applications and technologies, and network virtualization is brought forward. The OpenStack platform is a series of cloud computing management platform projects with open software sources, and can provide extensible and elastic cloud computing services for private clouds and public clouds, wherein a virtual router is a core device for implementing network virtualization, and in the OpenStack platform, when network deployment needs to be adjusted or a host of the virtual router fails, the virtual router needs to be migrated to other hosts to continuously undertake original services. However, in the related art, when migrating a virtual router, the cache of the original service is not migrated synchronously, which causes service interruption when migrating the virtual router, and the service needs to be recovered by depending on the application layer to wait for the successful migration of the router, which consumes a long time and seriously affects the user experience. Therefore, how to synchronize the service cache of the migration router in the migration process of the virtual router is an urgent technical problem to be solved.
Disclosure of Invention
The embodiment of the invention provides a migration method and device of a virtual router, electronic equipment and a computer storage medium.
The embodiment of the invention provides a migration method of a virtual router, which is applied to a source host, and comprises the following steps:
receiving a migration request of a first virtual router;
determining a destination host according to the migration request of the first virtual router;
and sending the cache data of the first virtual router to the destination host, so that the destination host determines a second virtual router and writes the cache data of the first virtual router into the second virtual router.
In the foregoing solution, the sending the cache data of the first virtual router to the destination host includes:
sending a migration request of the first virtual router to the destination host;
after receiving the confirmation information sent by the target host, sending the cache data of the first virtual router to the target host; the confirmation information is information that the destination host verifies the migration request passing through the first virtual router; the confirmation information includes: first confirmation information or second confirmation information; the first confirmation information is information sent by the destination host under the condition that a standby virtual router is not configured; the second acknowledgement information is information that the destination host transmits when the standby virtual router is configured.
In the foregoing solution, after sending the cache data of the first virtual router to the destination host when receiving the first acknowledgement information, the method further includes:
and deleting the first virtual router after receiving the information of the completion of the cache data writing sent by the destination host.
In the foregoing solution, after receiving the acknowledgement sent by the destination host, sending the cache data of the first virtual router to the destination host, so that the destination host determines a second virtual router, includes:
under the condition that the first confirmation information is received, sending cache data of the first virtual router to the destination host, enabling the destination host to create a virtual router, and determining the created virtual router as a second virtual router;
and under the condition of receiving the second confirmation information, sending the cache data of the first virtual router to the destination host, so that the destination host determines that the standby virtual router is a second virtual router. After sending the cache data of the first virtual router to the destination host under the condition of receiving the second confirmation information, the method further includes:
receiving second identification information of the standby virtual router sent by the destination host;
and determining the identification information of the first virtual router as second identification information.
In the foregoing solution, after sending the cache data of the first virtual router to the destination host, the method further includes:
and sending the first identification information of the first virtual router to the destination host, so that the destination host determines the identification information of the second virtual router as the first identification information.
The embodiment of the invention also provides another virtual router migration method, which is applied to a target host, wherein the target host is determined by a source host according to the migration request of a first virtual router, and the method comprises the following steps:
receiving cache data of the first virtual router sent by a source host;
and determining a second virtual router, and writing the cache data of the first virtual router into the second virtual router.
In the foregoing solution, the receiving the cache data of the first virtual router sent by the source host includes:
receiving a migration request of the first virtual router sent by the source host;
sending confirmation information to the source host in case of verifying the migration request passing through the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent under the condition that a standby virtual router is not configured; the second acknowledgement information is information sent when the standby virtual router is configured;
and receiving cache data of the first virtual router sent by the source host.
In the foregoing solution, the determining the second virtual router includes:
under the condition of sending first confirmation information to the source host, creating a virtual router, and determining the created virtual router as the second virtual router;
determining that the standby virtual router is the second virtual router when second acknowledgement information is sent to the source host.
The embodiment of the present invention further provides a migration apparatus for a virtual router, which is applied to a source host, and the apparatus at least includes:
a first receiving module, configured to receive a migration request of a first virtual router;
a first determining module, configured to determine a destination host according to the migration request of the first virtual router;
and the sending module is used for sending the cache data of the first virtual router to the target host, so that the target host determines a second virtual router, and writes the cache data of the first virtual router into the second virtual router.
In one implementation manner, the sending module, configured to send the cache data of the first virtual router to the destination host, includes:
sending a migration request of the first virtual router to the destination host;
after receiving the confirmation information sent by the target host, sending the cache data of the first virtual router to the target host; the confirmation information is information that the destination host verifies the migration request passing through the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent by the destination host under the condition that a standby virtual router is not configured; the second acknowledgement information is information that the destination host transmits when the standby virtual router is configured.
In one implementation manner, in a case that the first acknowledgement information is received, after sending the cache data of the first virtual router to the destination host, the method further includes:
and deleting the first virtual router after receiving the information of the completion of the cache data writing sent by the destination host.
In one implementation manner, in a case that the second acknowledgement information is received, after sending the cache data of the first virtual router to the destination host, the method further includes:
receiving second identification information of the standby virtual router sent by the destination host;
and determining the identification information of the first virtual router as second identification information.
In one implementation manner, after the sending module is configured to send the cache data of the first virtual router to the destination host, the method further includes:
and sending the first identification information of the first virtual router to the destination host, so that the destination host determines the identification information of the second virtual router as the first identification information.
The embodiment of the present invention further provides a migration apparatus of a virtual router, which is applied to a destination host, and the apparatus at least includes:
a second receiving module, configured to receive cache data of the first virtual router sent by a source host;
and the second determining module is used for determining a second virtual router and writing the cache data of the first virtual router into the second virtual router.
In one implementation manner, the second determining module is configured to receive cache data of the first virtual router sent by the source host, and includes:
receiving a migration request of the first virtual router sent by the source host;
sending acknowledgement information to the source host upon verifying the migration request that passed the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent under the condition that a standby virtual router is not configured; the second acknowledgement information is information sent when the standby virtual router is configured;
and receiving cache data of the first virtual router sent by the source host.
In one implementation, the second determining module is configured to determine the second virtual router, and includes:
under the condition of sending first confirmation information to the source host, creating a virtual router, and determining the created virtual router as the second virtual router;
determining that the standby virtual router is the second virtual router when second acknowledgement information is sent to the source host.
The embodiment of the present invention further provides an electronic device, which includes a first memory, a first processor, and a computer program that is stored in the first memory and is executable on the first processor, where the first processor implements any one of the foregoing migration methods applied to the virtual router of the source host when executing the program.
The embodiment of the present invention further provides another electronic device, which includes a second memory, a second processor, and a computer program that is stored in the second memory and is executable on the second processor, where the second processor implements any one of the foregoing migration methods applied to the virtual router of the destination host when executing the program.
An embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the migration methods for a virtual router described above.
The embodiment of the invention provides a virtual router migration method, a virtual router migration device, electronic equipment and a computer storage medium, and the method comprises the steps of receiving a migration request of a first virtual router; determining a destination host according to the migration request of the first virtual router; and sending the cache data of the first virtual router to the destination host, so that the destination host determines a second virtual router and writes the cache data of the first virtual router into the second virtual router.
It can be seen that, in the embodiment of the present invention, when a migration request of a first virtual router is received, a destination host may be determined according to the migration request of the first virtual router, and by sending cache data of the first virtual router to the destination host, the destination host may determine a second virtual router, and write the cache data of the first virtual router into the second virtual router, so that the virtual router can migrate cache data in the virtual router synchronously during the migration process, and an original service may also be recovered synchronously after the virtual router migrates to another host, which may not cause service interruption, and may effectively improve user experience.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
Fig. 1 is an application scenario diagram of a migration method for a virtual router according to an embodiment of the present invention;
fig. 2 is an application scenario diagram of another migration method for a virtual router according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a migration method of a virtual router according to an embodiment of the present invention;
fig. 4 is a working schematic diagram of a migration method of a virtual router according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of another migration method for a virtual router according to an embodiment of the present invention;
fig. 6 is a flowchart illustrating a specific implementation of a migration method for a virtual router according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a migration apparatus of a virtual router according to an embodiment of the present invention;
fig. 8 is a schematic diagram of another migration apparatus for a virtual router according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
Detailed Description
In the related art, when network deployment needs to be adjusted or a host of a virtual router fails, the virtual router on a source host needs to be migrated to another host, but when the virtual router is migrated, original service cache data is generally not migrated synchronously, which results in service interruption after the virtual router is migrated, and the original service can be recovered only after the router is migrated successfully by depending on an application layer, which consumes a long time and greatly affects the original service. Under the circumstances, how to synchronize the service cache of the migration router in the migration process of the virtual router is a technical problem to be solved urgently.
In view of the above technical problems, the technical solutions of the embodiments of the present invention are provided. The embodiments of the present invention will be described in further detail below with reference to the drawings and the embodiments. It should be understood that the examples provided herein are merely illustrative of the present invention and are not intended to limit the present invention. In addition, the following embodiments are provided as partial embodiments for implementing the present invention, not all embodiments for implementing the present invention, and the technical solutions described in the embodiments of the present invention may be implemented in any combination without conflict.
It should be noted that, in the embodiments of the present invention, the terms "comprises", "comprising" or any other variation thereof are intended to cover a non-exclusive inclusion, so that a method or apparatus including a series of elements includes not only the explicitly recited elements but also other elements not explicitly listed or inherent to the method or apparatus. Without further limitation, the use of the phrase "including a. -. said." does not exclude the presence of other elements (e.g., steps in a method or elements in a device, such as portions of circuitry, processors, programs, software, etc.) in the method or device in which the element is included.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
For example, although the migration method of a virtual router provided in the embodiment of the present invention includes a series of steps, the migration method of a virtual router provided in the embodiment of the present invention is not limited to the described steps, and similarly, the migration apparatus of a virtual router provided in the embodiment of the present invention includes a series of modules, but the migration apparatus of a virtual router provided in the embodiment of the present invention is not limited to include the explicitly described modules, and may also include modules that need to be set when acquiring relevant information or performing processing based on information.
Embodiments of the invention may be implemented on a terminal and/or a server, where the terminal may be a thin client, a thick client, a hand-held or laptop device, a microprocessor-based system, a set-top box, a programmable consumer electronics, a network personal computer, a small computer system, and so forth. The server may be a small computer system, a mainframe computer system, a distributed cloud computing environment including any of the systems described above, and so forth.
An electronic device such as a server may include program modules that execute computer instructions. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Fig. 1 is a diagram illustrating an application scenario of a migration method of a virtual router according to an embodiment of the present invention. Referring to fig. 1, the network includes a primary Virtual router and a standby Virtual router, where a Virtual Internet Protocol (VIP) address of a host running on the primary Virtual router is 10.113.0.181, and a VIP address of a host running on the standby Virtual router is 10.113.0.182. Fig. 2 is a diagram illustrating an application scenario of another migration method for a virtual router according to an embodiment of the present invention. Referring to fig. 2, when the primary virtual router needs to be migrated to the running host of the standby virtual router, the migration of the primary virtual router can be implemented by modifying the VIP address of the running host of the primary virtual router from 10.113.0.181 to 10.113.0.182.
Based on the application scenarios shown in fig. 1 and fig. 2, the technical solution of the embodiment of the present invention is provided.
Fig. 3 is a schematic flowchart of a migration method of a virtual router according to an embodiment of the present invention, where the method is applied to a source host, and as shown in fig. 3, the flow may include:
step 301: a migration request of a first virtual router is received.
In the embodiment of the present invention, the first Virtual Router is a Virtual Router to be migrated, and it should be noted that a Virtual Router (VR) is a logical device that implements function simulation of a physical Router on a software layer and a hardware layer; hosts are end devices for sending and receiving information, each host having a unique VIP address.
In the embodiment of the invention, a user can send a migration request for migrating the first virtual router to other hosts to the source host.
Step 302: and determining a destination host according to the migration request of the first virtual router.
In this embodiment of the present invention, the migration request of the first virtual router may include: migration authority information of the first virtual router, parameter verification information of the first virtual router, configuration information of the first virtual router, and a VIP address of the destination host. Here, the migration permission information of the first virtual router is used to represent whether the first virtual router has permission to migrate out of the source host, the parameter verification information of the first virtual router is used to represent whether the parameter of the first virtual router is correct, and the configuration information of the first virtual router is used to represent whether the data format migrated by the first virtual router is correct.
In the embodiment of the invention, after a source host receives a migration request of a first virtual router, the migration authority information of the first virtual router is verified, the parameter verification information of the first virtual router is verified under the condition that the migration authority information is verified, the configuration information of the first virtual router is checked under the condition that the parameter verification information is verified, and after no error is confirmed, a destination host is determined according to a VIP (very important person) address of the destination host and the first virtual router starts to be migrated.
Step 303: and sending the cache data of the first virtual router to the destination host, so that the destination host determines the second virtual router and writes the cache data of the first virtual router into the second virtual router.
In some embodiments, sending the cached data of the first virtual router to the destination host comprises:
sending a migration request of a first virtual router to a destination host;
after receiving the confirmation information sent by the target host, sending the cache data of the first virtual router to the target host; the confirmation information is information that the destination host verifies the migration request passing through the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent by the destination host under the condition that a standby virtual router is not configured; the second acknowledgement information is information that the destination host transmits when the standby virtual router is configured.
In the embodiment of the invention, when a client accesses a virtual router, the virtual router correspondingly establishes a Session (Session), and the Session records the request of the client for accessing the virtual router and the reply information of the virtual router responding the client, namely the Session is the cache data of the virtual router. Illustratively, the cache data of the first virtual router indicates that, when the first virtual router runs on the source host, each client communicates with the first virtual router to cache data in the process, and the first virtual router can read the cache data and can execute corresponding business operations according to the cache data.
In this embodiment of the present invention, the second virtual router refers to a virtual router running on the destination host, and the second virtual router may also execute the service operation of the first virtual router by writing the cache data of the first virtual router into the second virtual router.
In the embodiment of the invention, the standby virtual router is a virtual router which is not connected with the Internet, namely, the standby virtual router does not have cache data and can not execute related business operation. If the cache data of the relevant service is written into the standby virtual router, the standby virtual router can execute the relevant service operation.
In the embodiment of the invention, a source host sends a migration request of a first virtual router to a destination host according to a VIP (very important person) address of the destination host, the destination host verifies the received migration request, after verifying that the first virtual router has the authority of migrating to the destination host, the destination host sends confirmation information to the source host, the source host sends cache data of the first virtual router to the destination host after receiving the confirmation information sent by the destination host, and the destination host determines a second virtual router and writes the cache data of the first virtual router into the second virtual router, so that the second virtual router can execute business operation of the first virtual router, and the first virtual router is migrated to the destination host from the source host.
In the embodiment of the invention, after receiving a migration request, a destination host firstly determines whether a standby virtual router is currently configured on the destination host, and if the standby virtual router is not configured, the destination host sends first confirmation information to a source host, and the source host needs to migrate a first virtual router and cache data of the first virtual router to the destination host, so that migration of the first virtual router is realized; if the standby virtual router is configured and the second confirmation information is sent to the source host, the source host only needs to write the cache data of the first virtual router into the standby virtual router in the destination host, and therefore the first virtual router is switched to the standby virtual router.
In the embodiment of the present invention, as shown in fig. 4, a first virtual router runs on a source host, and when the source host receives a migration request of the first virtual router, the source host determines a destination host according to the migration request, for example, when the destination host is a host 1, after the host 1 receives the migration request, it is determined that no standby virtual router is configured in the host 1, the host 1 sends first confirmation information to the source host, and after the source host receives the first confirmation information, the source host migrates the first virtual router and the cache data of the first virtual router to the host 1, that is, completes the migration of the first virtual router.
In the embodiment of the present invention, as shown in fig. 4, when the destination host is the host 2, and after the host 2 receives the migration request, it is determined that the host 2 is configured with the standby virtual router, the host 2 sends the second acknowledgement information to the source host, and after the source host receives the second acknowledgement information, the source host sends the cache data of the first virtual router to the host 2, and the host 2 writes the cache data of the first virtual router into the standby virtual router, that is, completes the switching from the first virtual router to the standby virtual router.
In practical applications, the steps 301 to 303 are implemented by a Processor based on an electronic Device, and the Processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor.
It can be seen that, in the embodiment of the present invention, when receiving a migration request of a first virtual router, a source host determines a destination host according to the migration request, and after receiving confirmation information sent by the destination host, sends cache data of the first virtual router to the destination host, and the destination host determines a second virtual router, and writes the cache data of the first virtual router into the second virtual router, so that the second virtual router can execute a service operation of the first virtual router, that is, the migration of the first virtual router from the source host to the destination host is completed. It can be seen that, in the embodiment of the present invention, when the first virtual router is migrated, the cache data in the first virtual router is migrated synchronously, so that the original service can also be recovered synchronously after the first virtual router is migrated to the destination host, service interruption caused by virtual router migration is not caused, migration time of the first virtual router can be shortened, and use experience of a user is effectively improved.
In some embodiments, after sending the cache data of the first virtual router to the destination host in case of receiving the first acknowledgement information, the method further includes:
and deleting the first virtual router after receiving the information of the completion of the writing of the cache data sent by the destination host.
In some embodiments, when the destination host is not configured with a virtual standby router, after the cache data of the first virtual router is written into the second virtual router created by the destination host, the destination host sends information that the cache data is written into the source host, and after the source host receives the information that the cache data is written into the destination host, it may be determined that the first virtual router and the cache data of the first virtual router have been migrated to the destination host, and then the virtual router configured on the source host does not perform related business operations any more, and therefore, the source host deletes the first virtual router. Therefore, the source host deletes the first virtual router after the migration of the first virtual router is completed, and the occupation of network resources by useless virtual routers can be reduced.
In some embodiments, after sending the cache data of the first virtual router to the destination host in case of receiving the second acknowledgement information, the method further includes:
receiving second identification information of the standby virtual router sent by the destination host;
and determining the identification information of the first virtual router as second identification information.
In some embodiments, the identification information (Role) is used to identify the attribute of the virtual router, and the identification information of the virtual router may include, for example: if the identification information of the virtual router is master, the virtual router executes the relevant service operation under the normal condition, and if the identification information of the virtual router is back up, the virtual router replaces the virtual router (master) to execute the relevant service operation when the virtual router (master) has a fault.
In some embodiments, in a case where the source host receives the second confirmation information, it is described that the destination host is configured with the virtual standby router, and determines that the virtual standby router is the second virtual router, the source host sends the cache data of the first virtual router to the destination host, the destination host sends the second identification information of the standby virtual router to the source host, and the source host may use the second identification information as the identification information of the first virtual router.
It can be seen that, after the first virtual router is switched to the standby virtual router, the identification information of the standby virtual router is used as the identification information of the first virtual router, that is, the attribute conversion between the first virtual router and the standby virtual router is completed, which is beneficial for a user to determine the operation condition of the virtual router according to the identification information of the virtual router.
In some embodiments, after sending the cache data of the first virtual router to the destination host, the method further includes:
and sending the first identification information of the first virtual router to the destination host, so that the destination host determines the identification information of the second virtual router as the first identification information.
In some embodiments, the source host sends the first identification information of the first virtual router to the destination host, and the destination host uses the first identification information of the first virtual router as the identification information of the second virtual router, that is, identifies the attribute of the second virtual router, thereby determining the operation condition of the second virtual router.
Fig. 5 is a schematic flowchart of another migration method of a virtual router, which is provided in an embodiment of the present invention and is applied to a destination host, as shown in fig. 5, the flow may include:
step 501: and receiving the cache data of the first virtual router sent by the source host.
In the embodiment of the present invention, the cache data represents service cache data of the first virtual router when running on the source host, and the source host sends the cache data of the first virtual router to the destination host.
Step 502: and determining a second virtual router, and writing the cache data of the first virtual router into the second virtual router.
In the embodiment of the invention, the destination host determines the second virtual router and writes the cache data of the first virtual router into the second virtual router, so that the second virtual router can execute the service operation of the first virtual router, thereby completing the migration of the first virtual router from the source host to the destination host.
It can be seen that, in the embodiment of the present invention, after the destination host receives the cache data of the first virtual router sent by the source host, the destination host determines the second virtual router, and writes the cache data of the first virtual router into the second virtual router, so that the second virtual router can execute the service operation of the first virtual router, that is, the migration of the first virtual router from the source host to the destination host is completed. It can be seen that, in the embodiment of the present invention, when the first virtual router is migrated, the cache data in the first virtual router is migrated synchronously, so that the original service can be recovered synchronously after the first virtual router is migrated to the destination host.
In some embodiments, receiving the cache data of the first virtual router sent by the source host includes:
receiving a migration request of a first virtual router sent by a source host;
sending confirmation information to the source host under the condition of verifying the migration request passing through the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent under the condition that a standby virtual router is not configured; the second confirmation information is information transmitted under the condition that the standby virtual router is configured;
and receiving the cache data of the first virtual router sent by the source host.
In some embodiments, after receiving a migration request of a first virtual router, a destination host determines whether a standby virtual router is currently configured on the destination host, and if the standby virtual router is not configured, sends first confirmation information to a source host; and if the standby virtual router is configured, sending second confirmation information to the source host.
In some embodiments, determining the second virtual router comprises:
under the condition of sending first confirmation information to the source host, creating a virtual router, and determining the created virtual router as a second virtual router;
and under the condition of sending second confirmation information to the source host, determining that the standby virtual router is the second virtual router.
In some embodiments, in the case of sending the first acknowledgement information to the source host, which indicates that the destination host is not configured with a standby virtual router, the source host needs to migrate the first virtual router and the cache data of the first virtual router to the destination host, and therefore, the destination host creates one virtual router and determines the created virtual router as a second virtual router, where the second virtual router may perform related business operations after writing the cache data of the first virtual router.
In some embodiments, in the case of sending the second acknowledgement information to the source host, which indicates that the destination host is configured with the standby virtual router, the source host only needs to send the cache data of the first virtual router to the destination host, and therefore, the destination host determines the standby virtual router as the second virtual router and writes the cache data of the first virtual router into the second virtual router.
It can be seen that, when the standby virtual router is configured, the destination host determines the standby virtual router as the second virtual router, and when the standby virtual router is not configured, a virtual router is created first, and then the created virtual router is determined as the second virtual router, that is, whether the destination host can execute corresponding operations according to the situation that the standby virtual router is configured can be determined, and the migration efficiency of the first virtual router can be effectively improved.
In some embodiments, in the case of sending the first acknowledgement information to the source host, after writing the cache data of the first virtual router to the second virtual router, information that the writing of the cache data is completed is sent to the source host.
In some embodiments, in the case of sending the second acknowledgement information to the source host, that is, the destination host is configured with the virtual standby router and determines the virtual standby router as the second virtual router, the source host sends the cache data of the first virtual router to the destination host, and the destination host sends the second identification information of the standby virtual router to the source host, and the source host may use the second identification information as the identification information of the first virtual router.
In some embodiments, after receiving the cache data of the first virtual router sent by the source host, the first identification information of the first virtual router is received, and the identification information of the second virtual router is determined to be the first identification information.
Fig. 6 is a schematic flowchart of a specific implementation of a migration method for a virtual router according to an embodiment of the present invention, and as shown in fig. 6, the flowchart may include:
step 601: the management plane of the source host receives a migration request of the first virtual router.
In some embodiments, in the virtual internet, the idea of layering is utilized to separate data from control. The host is used as a device in the network, and each host device can be divided into a management plane, a control plane and a data plane, wherein the management plane is used for arranging virtual network resources, the control plane is equivalent to a middle point of a communication process and is used for scheduling resources of the data plane, and the data plane is used for specifically realizing corresponding requests.
Step 602: the management surface of the source host verifies the migration authority information of the first virtual router.
Step 603: the management surface of the source host verifies the parameter verification information of the first virtual router.
Step 604: the management plane of the source host checks the configuration information of the first virtual router.
Step 605: the management plane of the source host sends a migration request of the first virtual router to the management plane of the destination host.
In some embodiments, the source host may determine the destination host based on the migration request of the first virtual router.
Step 606: the management plane of the destination host sends confirmation information to the management plane of the source host.
In some embodiments, the destination host verifies the received migration request, and after verifying that the first virtual router has the right to migrate to the destination host, the destination host sends a confirmation message to the source host.
Step 607: the management plane of the destination host sends information identifying the second virtual router to the control plane.
Step 608: the control plane of the destination host sends information identifying the second virtual router to the data plane.
Step 609: and the management surface of the source host sends information for migrating the cache data of the first virtual router to the control surface.
Step 610: and the control surface of the source host sends information for migrating the cache data of the first virtual router to the data surface.
Step 611: and the data plane of the source host sends the cache data of the first virtual router to the data plane of the destination host.
Step 612, the data plane of the destination host writes the cache data of the first virtual router into the second virtual router, and determines the identification information of the first virtual router as the identification information of the second virtual router.
Step 613: and the data surface of the target host sends the information of the completion of the writing of the cache data to the control surface.
Step 614: and the control surface of the target host sends the information of the completion of the cache data writing to the management surface.
Step 615: and the management surface of the target host sends the information of the completion of the cache data writing to the management surface of the source host.
Step 616: the management plane of the source host sends information to the control plane to delete the first virtual router.
Step 617: the control plane of the source host sends information for deleting the first virtual router to the data plane.
Step 618: the data plane of the source host deletes the first virtual router.
In various embodiments of the present application, the sequence numbers of the above steps/processes do not mean the execution sequence, and the execution sequence of the steps/processes should be determined by their functions and inherent logics, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Based on the same technical concept as the foregoing embodiment, referring to fig. 7, an embodiment of the present invention provides a migration apparatus for a virtual router, which is applied to a source host, and the apparatus at least includes:
a first receiving module 701, configured to receive a migration request of a first virtual router;
a first determining module 702, configured to determine a destination host according to the migration request of the first virtual router;
a sending module 703 is configured to send the cache data of the first virtual router to the destination host, so that the destination host determines a second virtual router, and writes the cache data of the first virtual router into the second virtual router.
In one implementation manner, the sending module 703 is configured to send the cache data of the first virtual router to the destination host, and includes:
sending a migration request of the first virtual router to the destination host;
after receiving the confirmation information sent by the target host, sending the cache data of the first virtual router to the target host; the confirmation information is information that the destination host verifies the migration request passing through the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent by the destination host under the condition that a standby virtual router is not configured; the second acknowledgement information is information that the destination host transmits when the standby virtual router is configured.
In one implementation manner, in a case that the first acknowledgement information is received, after sending the cache data of the first virtual router to the destination host, the method further includes:
and deleting the first virtual router after receiving the information of the completion of the cache data writing sent by the destination host.
In one implementation manner, in a case that the second acknowledgement information is received, after sending the cache data of the first virtual router to the destination host, the method further includes:
receiving second identification information of the standby virtual router sent by the destination host;
and determining the identification information of the first virtual router as second identification information.
In an implementation manner, the sending module 703, after sending the cache data of the first virtual router to the destination host, further includes:
and sending the first identification information of the first virtual router to the destination host, so that the destination host determines that the identification information of the second virtual router is the first identification information.
Based on the same technical concept of the foregoing embodiment, referring to fig. 8, another migration apparatus of a virtual router provided in an embodiment of the present invention is applied to a destination host, and the apparatus at least includes:
a second receiving module 801, configured to receive cache data of the first virtual router sent by a source host;
a second determining module 802, configured to determine a second virtual router, and write the cache data of the first virtual router into the second virtual router.
In one implementation manner, the second determining module 802 is configured to receive cache data of the first virtual router sent by the source host, and includes:
receiving a migration request of the first virtual router sent by the source host;
sending acknowledgement information to the source host upon verifying the migration request that passed the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent under the condition that a standby virtual router is not configured; the second acknowledgement information is information sent when the standby virtual router is configured;
and receiving cache data of the first virtual router sent by the source host.
In one implementation, the second determining module 802 is configured to determine the second virtual router, and includes:
under the condition of sending first confirmation information to the source host, creating a virtual router, and determining the created virtual router as the second virtual router;
determining that the standby virtual router is the second virtual router when second acknowledgement information is sent to the source host.
It should be noted that the above description of the embodiment of the apparatus, similar to the above description of the embodiment of the method, has similar beneficial effects as the embodiment of the method. For technical details not disclosed in the embodiments of the apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be noted that, in the embodiment of the present invention, if the method is implemented in the form of a software functional module and sold or used as a standalone product, the method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a terminal, a server, etc.) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present invention further provides a computer program product, where the computer program product includes computer-executable instructions, and the computer-executable instructions are used to implement any one of the migration methods of a virtual router provided in the embodiment of the present invention.
Accordingly, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions are used to implement any one of the migration methods of a virtual router provided in the foregoing embodiments.
In some embodiments, functions or modules included in the apparatus provided in the embodiments of the present invention may be used to execute the method described in the above method embodiments, and for specific implementation, reference may be made to the description of the above method embodiments, and for brevity, details are not described here again.
Based on the same technical concept as the foregoing embodiment, referring to fig. 9, a first electronic device 900 according to an embodiment of the present invention may include: a first memory 910 and a first processor 920, a computer program being executable on the first processor 920 by the first electronic device 900, the first processor 920 implementing a migration method of a virtual router applied to any one of source hosts when executing the program; wherein,
a first memory 910 for storing computer programs and data;
a first processor 920, configured to execute the computer program stored in the first memory 910, so as to implement any one of the foregoing embodiments of the migration method applied to the virtual router of the source host.
Based on the same technical concept as the foregoing embodiment, referring to fig. 10, an embodiment of the present invention provides another electronic device, which is a second electronic device 1000, and may include: a second memory 1010 and a second processor 1020, wherein the second electronic device 1000 is a computer program that can run on the second processor 1020, and the second processor 1020 executes the computer program to implement the migration method of the virtual router applied to any one of the destination hosts; wherein,
a second memory 1010 for storing computer programs and data;
a second processor 1020 for executing the computer program stored in the second memory 1010 to implement any one of the foregoing embodiments of the migration method applied to the virtual router of the destination host.
The foregoing description of the various embodiments is intended to highlight different sites among the various embodiments, and that the same or similar sites may be referred to one another, which are not repeated herein for brevity.
The methods disclosed in the method embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in various product embodiments provided by the application can be combined arbitrarily to obtain new product embodiments without conflict.
The features disclosed in the various method or apparatus embodiments provided herein may be combined in any combination to arrive at new method or apparatus embodiments without conflict.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, and for example, the division of the unit is only one logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication between the components shown or discussed may be through some interfaces, and the indirect coupling or communication between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of grid units; some or all of the units can be selected according to actual practice to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing module, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps of implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer-readable storage medium, and when executed, executes the steps including the method embodiments.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.

Claims (13)

1. A migration method of a virtual router, applied to a source host, includes:
receiving a migration request of a first virtual router;
determining a destination host according to the migration request of the first virtual router;
and sending the cache data of the first virtual router to the destination host, so that the destination host determines a second virtual router and writes the cache data of the first virtual router into the second virtual router.
2. The method according to claim 1, wherein the sending the cache data of the first virtual router to the destination host comprises:
sending a migration request of the first virtual router to the destination host;
after receiving the confirmation information sent by the target host, sending the cache data of the first virtual router to the target host; the confirmation information is information that the destination host verifies the migration request passing through the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent by the destination host under the condition that a standby virtual router is not configured; the second acknowledgement information is information that the destination host transmits when the standby virtual router is configured.
3. The method according to claim 2, wherein after sending the cache data of the first virtual router to the destination host in case of receiving the first acknowledgement information, further comprising:
and deleting the first virtual router after receiving the information of the completion of the cache data writing sent by the destination host.
4. The method according to claim 2, wherein after sending the cache data of the first virtual router to the destination host in case of receiving the second acknowledgement information, further comprising:
receiving second identification information of the standby virtual router sent by the destination host;
and determining the identification information of the first virtual router as second identification information.
5. The method of claim 1, wherein after sending the cached data for the first virtual router to the destination host, further comprising:
and sending the first identification information of the first virtual router to the destination host, so that the destination host determines the identification information of the second virtual router as the first identification information.
6. A migration method of a virtual router is applied to a destination host, wherein the destination host is determined by a source host according to a migration request of a first virtual router, and the method comprises the following steps:
receiving cache data of the first virtual router sent by a source host;
and determining a second virtual router, and writing the cache data of the first virtual router into the second virtual router.
7. The method according to claim 6, wherein the receiving the cache data of the first virtual router sent by the source host comprises:
receiving a migration request of the first virtual router sent by the source host;
sending acknowledgement information to the source host upon verifying the migration request that passed the first virtual router; the confirmation information includes: first acknowledgement information or second acknowledgement information; the first confirmation information is information sent under the condition that a standby virtual router is not configured; the second acknowledgement information is information sent when the standby virtual router is configured;
and receiving the cache data of the first virtual router sent by the source host.
8. The method of claim 7, wherein determining the second virtual router comprises:
under the condition that first confirmation information is sent to the source host, creating a virtual router, and determining the created virtual router as the second virtual router;
determining that the standby virtual router is the second virtual router when second acknowledgement information is sent to the source host.
9. Migration apparatus of a virtual router, applied to a source host, the apparatus comprising at least:
a first receiving module, configured to receive a migration request of a first virtual router;
a first determining module, configured to determine a destination host according to the migration request of the first virtual router;
and the sending module is used for sending the cache data of the first virtual router to the destination host, so that the destination host determines a second virtual router and writes the cache data of the first virtual router into the second virtual router.
10. Migration apparatus of a virtual router, applied to a destination host, the apparatus at least comprising:
the second receiving module is used for receiving the cache data of the first virtual router sent by the source host;
and the second determining module is used for determining a second virtual router and writing the cache data of the first virtual router into the second virtual router.
11. An electronic device, comprising a first memory, a first processor, and a computer program stored on the first memory and executable on the first processor, wherein the first processor implements the migration method of the virtual router according to any one of claims 1 to 5 when executing the program.
12. An electronic device, comprising a second memory, a second processor, and a computer program stored on the second memory and executable on the second processor, wherein the second processor implements the migration method of the virtual router according to any one of claims 6 to 8 when executing the program.
13. A computer storage medium storing a computer program; characterized in that said computer program, when executed, is capable of implementing a migration method of a virtual router according to any one of claims 1 to 8.
CN202210507005.8A 2022-05-10 2022-05-10 Migration method and device of virtual router, electronic equipment and storage medium Active CN115065630B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210507005.8A CN115065630B (en) 2022-05-10 2022-05-10 Migration method and device of virtual router, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210507005.8A CN115065630B (en) 2022-05-10 2022-05-10 Migration method and device of virtual router, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115065630A true CN115065630A (en) 2022-09-16
CN115065630B CN115065630B (en) 2024-04-09

Family

ID=83199630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210507005.8A Active CN115065630B (en) 2022-05-10 2022-05-10 Migration method and device of virtual router, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115065630B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090037679A1 (en) * 2007-08-01 2009-02-05 Balakumar Kaushik Data migration without interrupting host access
US20110066753A1 (en) * 2009-06-11 2011-03-17 Brocade Communications Systems, Inc. Virtual router redundancy for server virtualization
US20110134931A1 (en) * 2009-12-08 2011-06-09 Jacobus Van Der Merwe Virtual router migration
CN104243427A (en) * 2013-06-19 2014-12-24 日电(中国)有限公司 Virtual machine online migration method and data package transmission method and device
US20150043379A1 (en) * 2013-08-09 2015-02-12 Fujitsu Limited Method of controlling virtual router, computer-readable recording medium, and control device
CN104780109A (en) * 2015-04-27 2015-07-15 杭州华三通信技术有限公司 Virtual machine migration method and device
CN107885758A (en) * 2016-09-30 2018-04-06 华为技术有限公司 The data migration method and dummy node of a kind of dummy node
CN111698164A (en) * 2020-06-11 2020-09-22 北京金山云网络技术有限公司 Network routing method and device of virtual machine and management server
CN111988223A (en) * 2020-08-19 2020-11-24 杭州迪普科技股份有限公司 Virtual machine migration method and network system
CN112445571A (en) * 2019-09-05 2021-03-05 中移(苏州)软件技术有限公司 Virtual machine migration and management method, server and computer readable storage medium
CN112486626A (en) * 2016-08-30 2021-03-12 华为技术有限公司 Method and device for determining virtual machine migration
CN113918263A (en) * 2021-11-11 2022-01-11 盐城金堤科技有限公司 Virtual routing method, device and equipment of view component and computer storage medium
CN114003349A (en) * 2021-12-30 2022-02-01 杭州优云科技有限公司 Virtual machine migration method and equipment
CN114003334A (en) * 2020-07-28 2022-02-01 中移(苏州)软件技术有限公司 Virtual machine live migration network interruption optimization method, device, equipment, storage medium and system

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090037679A1 (en) * 2007-08-01 2009-02-05 Balakumar Kaushik Data migration without interrupting host access
US20110066753A1 (en) * 2009-06-11 2011-03-17 Brocade Communications Systems, Inc. Virtual router redundancy for server virtualization
US20110134931A1 (en) * 2009-12-08 2011-06-09 Jacobus Van Der Merwe Virtual router migration
CN104243427A (en) * 2013-06-19 2014-12-24 日电(中国)有限公司 Virtual machine online migration method and data package transmission method and device
US20150043379A1 (en) * 2013-08-09 2015-02-12 Fujitsu Limited Method of controlling virtual router, computer-readable recording medium, and control device
JP2015035776A (en) * 2013-08-09 2015-02-19 富士通株式会社 Virtual router control method, virtual router control program and controller
CN104780109A (en) * 2015-04-27 2015-07-15 杭州华三通信技术有限公司 Virtual machine migration method and device
CN112486626A (en) * 2016-08-30 2021-03-12 华为技术有限公司 Method and device for determining virtual machine migration
CN107885758A (en) * 2016-09-30 2018-04-06 华为技术有限公司 The data migration method and dummy node of a kind of dummy node
CN112445571A (en) * 2019-09-05 2021-03-05 中移(苏州)软件技术有限公司 Virtual machine migration and management method, server and computer readable storage medium
CN111698164A (en) * 2020-06-11 2020-09-22 北京金山云网络技术有限公司 Network routing method and device of virtual machine and management server
CN114003334A (en) * 2020-07-28 2022-02-01 中移(苏州)软件技术有限公司 Virtual machine live migration network interruption optimization method, device, equipment, storage medium and system
CN111988223A (en) * 2020-08-19 2020-11-24 杭州迪普科技股份有限公司 Virtual machine migration method and network system
CN113918263A (en) * 2021-11-11 2022-01-11 盐城金堤科技有限公司 Virtual routing method, device and equipment of view component and computer storage medium
CN114003349A (en) * 2021-12-30 2022-02-01 杭州优云科技有限公司 Virtual machine migration method and equipment

Also Published As

Publication number Publication date
CN115065630B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
US11704144B2 (en) Creating virtual machine groups based on request
US10691504B2 (en) Container based service management
US10073747B2 (en) Reducing recovery time in disaster recovery/replication setup with multitier backend storage
US20190384535A1 (en) Enhanced soft fence of devices
US10185637B2 (en) Preserving management services with distributed metadata through the disaster recovery life cycle
US9582319B2 (en) Migrating virtual machines across network separated data centers
US10324799B2 (en) Enhanced application write performance
CN106469085B (en) The online migration method, apparatus and system of virtual machine
US9813423B2 (en) Trust-based computing resource authorization in a networked computing environment
CN107402722B (en) Data migration method and storage device
US10061665B2 (en) Preserving management services with self-contained metadata through the disaster recovery life cycle
CN107632937B (en) Method and device for testing virtual machine cluster and readable storage medium
US10452502B2 (en) Handling node failure in multi-node data storage systems
US20180205612A1 (en) Clustered containerized applications
US9971589B2 (en) Upgrade management for a shared pool of configurable computing resources
CN103118073A (en) Virtual machine data persistence storage system and method in cloud environment
KR20230024416A (en) Virtual Machine Migration Methods, Devices, Storage Media and Electronic Devices Between Cloud Platforms
CN114675938A (en) Heterogeneous cluster virtual machine migration method and system and cloud platform
US20230055511A1 (en) Optimizing clustered filesystem lock ordering in multi-gateway supported hybrid cloud environment
US9904600B2 (en) Generating initial copy in replication initialization
US10692168B1 (en) Availability modes for virtualized graphics processing
US10140054B2 (en) Retrospective snapshots in log structured storage systems
US10552404B2 (en) Retrospective snapshots in log-structured storage systems
CN115499298B (en) Virtual machine live migration method, device, equipment and medium
US10146652B2 (en) Resilient distributed storage system

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