WO2023103741A1 - Virtual switch upgrading method and device, electronic device and storage medium - Google Patents

Virtual switch upgrading method and device, electronic device and storage medium Download PDF

Info

Publication number
WO2023103741A1
WO2023103741A1 PCT/CN2022/132687 CN2022132687W WO2023103741A1 WO 2023103741 A1 WO2023103741 A1 WO 2023103741A1 CN 2022132687 W CN2022132687 W CN 2022132687W WO 2023103741 A1 WO2023103741 A1 WO 2023103741A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual switch
version
virtual
switch
new version
Prior art date
Application number
PCT/CN2022/132687
Other languages
French (fr)
Chinese (zh)
Inventor
徐斌斌
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023103741A1 publication Critical patent/WO2023103741A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • the embodiments of the present application relate to the technical field of communications, and in particular to a virtual switch upgrade method, device, electronic device, and computer-readable storage medium.
  • the current telecom 5G core network business uses a virtual machine virtualized by a general-purpose server as a business carrier.
  • the internal virtual machine of the general server carrying the telecom 5G service and the cross-general server virtual machine need to implement the virtual machine through a user-mode virtual switch based on the virtual switch data plane development kit (OpenvSwitch-Datapath Development Kit, referred to as "OVS-DPDK”) architecture. business interconnection.
  • general-purpose servers generally enable the Link Aggregation Control Protocol (LACP for short) to monitor the link quality with the uplink hardware switch.
  • LACP Link Aggregation Control Protocol
  • the state machine of the LACP protocol on the general server side also needs to be maintained by the virtual switch to ensure that the business of the external link of the general server can be reached in two directions. It can be seen that the stability of the virtual switch can ensure the reliability of the upper-layer service interaction. Therefore, the importance of the virtual switch as a bridge for virtual machine service interaction is particularly prominent.
  • the virtual switch program implemented by software inevitably needs to be repaired or version upgraded.
  • the virtual switch process needs to be restarted, and the process used for upper-layer service forwarding will also exit synchronously, making the upper layer
  • the service interaction link is unreachable.
  • services between virtual machines cannot communicate with each other, which may have a relatively large negative impact on services.
  • the purpose of the embodiments of the present application is to provide a virtual switch upgrade method, device, electronic device and computer-readable storage medium, so as to shorten the service suspension time during the virtual switch upgrade process and ensure uninterrupted services as much as possible.
  • the embodiment of the present application provides a method for upgrading a virtual switch, including: creating and initializing a new version of the virtual switch during the process of performing service forwarding by the old version of the virtual switch; freezing the service forwarding work of the old version of the virtual switch, and The virtual machine information in the old version of the virtual switch is migrated to the new version of the virtual switch; the virtual machine information includes the information used by the virtual machine connected to the old version of the virtual switch for network communication; based on the virtual machine information migrated to the new version of the virtual switch and from the The old version of the virtual switch is migrated to the network card in the new version of the virtual switch, and the service forwarding work is switched to the new version of the virtual switch for execution.
  • the embodiment of the present application also provides a virtual switch upgrade device, the virtual switch upgrade device is deployed on a physical machine, and a virtual machine and an old version virtual switch connected to the virtual machine are also deployed on the physical machine;
  • the virtual switch upgrade device includes :
  • the deployment module is used to create and initialize the new version of the virtual switch when the old version of the virtual switch performs business forwarding work;
  • the network card migration module is used to migrate the network card in the old version of the virtual switch to the new version of the virtual switch;
  • the virtual machine information migration module used to freeze the service forwarding work of the old version of the virtual switch after the initialization of the new version of the virtual switch is completed, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch;
  • the virtual machine information and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, and the business forwarding work is switched to the new version of the virtual switch for execution.
  • the embodiment of the present application also provides an electronic device, including: at least one processor; and a memory connected to the at least one processor in communication; wherein, the at least one processor is used to run a virtual machine, and an old version virtual machine connected to the virtual machine
  • the switch ; the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor, so that at least one processor can execute the above virtual switch upgrade method.
  • Embodiments of the present application also provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above method for upgrading a virtual switch is implemented.
  • FIG. 1 is a flowchart of a method for upgrading a virtual switch according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for upgrading a virtual switch according to another embodiment of the present application
  • FIG. 3 is a schematic diagram of a migration scenario of an aggregation group member network card according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of a virtual switch upgrade device according to an embodiment of the present application.
  • Fig. 5 is a schematic structural diagram of an electronic device according to another implementation manner of the present application.
  • An embodiment of the present application relates to a method for upgrading a virtual switch.
  • create and initialize the new version of the virtual switch in the process of performing service forwarding by the old version of the virtual switch, create and initialize the new version of the virtual switch; freeze the service forwarding work of the old version of the virtual switch, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch ;
  • the virtual machine information includes the information used by the virtual machine connected to the old version of the virtual switch for network communication; based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, the business The forwarding work is switched to the new version of the virtual switch for execution.
  • FIG. 1 The specific flow of the method for upgrading a virtual switch in this implementation manner may be shown in FIG. 1 .
  • the forwarding plane (datapath) of the virtual switch needs to receive packets from physical network cards or virtual machine ports, parse the packets, and modify and forward the packets accordingly according to the flow table saved in the datapath. Finally, the service interworking function between virtual machines is realized.
  • datapath is a part of the virtual switch, when the virtual switch is restarted due to fault repair or version upgrade, the datapath running as a thread will also quit working with the exit of the virtual switch process, which means that during the virtual switch restart phase , the receiving, parsing, processing, and forwarding of service packets are suspended, and services between virtual machines cannot communicate.
  • the startup process of the new version of the virtual switch involves a series of tasks such as data path development kit (Datapath Develop Kit, "DPDK”) huge page memory initialization, physical network card initialization, physical network card LACP negotiation, and OpenFlow flow rule initialization.
  • Datapath Develop Kit "DPDK” huge page memory initialization
  • physical network card initialization physical network card LACP negotiation
  • OpenFlow flow rule initialization OpenFlow flow rule initialization
  • the initialization of these resources and the LACP link negotiation process take a lot of time, which greatly lengthens the service recovery time between virtual machines.
  • the present application proposes a virtual switch upgrade method to shorten the service suspension time during the virtual switch upgrade process and ensure uninterrupted services as much as possible.
  • the virtual switch upgrade method involved in this embodiment can be used in large-scale virtualized commercial networks such as 5G core network elements of mobile operators.
  • Step 101 creating and initializing a new version of the virtual switch when the old version of the virtual switch performs service forwarding.
  • the virtual switch of the new version can be created and initialized without interrupting its normal operation while the virtual switch of the old version is performing service forwarding work.
  • the initialization of the new version of the virtual switch includes initializing the DPDK huge page memory, backing up the OpenFlow flow rules, and preparing related resources for the new version of the virtual switch for forwarding.
  • Initializing the new version of the virtual switch may also include initializing shared memory for storing virtual machine information.
  • the part of the virtual switch upgrade device deployed in the new version of the virtual switch may send an initialization completion notification.
  • a new-version virtual switch is created and initialized in response to a virtual switch upgrade instruction.
  • the virtual switch upgrade instruction may be generated according to the situation that the virtual switch needs to perform fault repair or version upgrade.
  • Step 102 freezing the service forwarding work of the old version virtual switch, and migrating the virtual machine information in the old version virtual switch to the new version virtual switch; wherein, the virtual machine information includes the network communication information of the virtual machine connected to the old version virtual switch.
  • step 102 may include freezing the service forwarding work of the old-version virtual switch, the old-version virtual switch writes the virtual machine information in the old-version virtual switch to a preset shared memory, and the new-version virtual switch reads the virtual machine information from the shared memory .
  • shared memory is used to migrate virtual machine information.
  • the network card in the old version of the virtual switch can also be migrated to the new version of the virtual switch.
  • the network card migration involved in this example may be implemented by the part of the virtual switch upgrade device deployed in the new version of the virtual switch to send a network card migration completion notification.
  • Step 103 based on the virtual machine information migrated to the virtual switch of the new version and the network card previously migrated from the virtual switch of the old version to the virtual switch of the new version, switch the service forwarding work to the virtual switch of the new version for execution.
  • the unit of the virtual switch upgrade device deployed in the new version of the virtual switch can rebuild the virtual sending and receiving queue and communicate with the virtual operating system emulator (Quick Emulator, referred to as "QEMU"), the front-end and back-end links are reconnected, so that the service forwarding work can be switched to the new version of the virtual switch for execution.
  • QEMU virtual operating system emulator
  • the unit of the virtual switch upgrade device deployed in the new version virtual switch may send a reconstruction end message to the old version virtual switch, so as to trigger the exit process of the old version virtual switch.
  • the virtual switch upgrade method involved in this embodiment has no correlation with the version before and after the upgrade, that is, no matter what business function changes or upgrades the new version of the virtual switch performs, it can realize uninterrupted business during the virtual switch upgrade stage.
  • the new version of the virtual switch when the old version of the virtual switch performs service forwarding, the new version of the virtual switch can be created and initialized without interrupting services. Then freeze the service forwarding work of the old version of the virtual switch, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch.
  • the virtual machine information includes the information used for network communication by the virtual machine connected to the old version of the virtual switch, so that the new version of the virtual switch can obtain information required for network communication.
  • the service forwarding work is switched to the new-version virtual switch for execution.
  • the service suspension time can be greatly shortened, and the service is not interrupted as much as possible.
  • Another embodiment of the present application relates to a method for upgrading a virtual switch.
  • create and initialize the new version of the virtual switch in the process of performing service forwarding by the old version of the virtual switch, create and initialize the new version of the virtual switch; freeze the service forwarding work of the old version of the virtual switch, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch ;
  • the virtual machine information includes the information used by the virtual machine connected to the old version of the virtual switch for network communication; based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, the business The forwarding work is switched to the new version of the virtual switch for execution.
  • FIG. 2 The specific flow of the method for upgrading a virtual switch in this implementation manner may be shown in FIG. 2 .
  • Step 201 Create and initialize a new version of the virtual switch during service forwarding by the old version of the virtual switch.
  • Step 202 migrate some member network cards in the network card aggregation group in the old version virtual switch to the new version virtual switch; wherein, the network cards migrated from the old version virtual switch to the new version virtual switch in advance refer to some member network cards.
  • the duration of freezing the service forwarding work of the old-version virtual switch determines the length of service delay caused by the upgrade of the virtual switch. Therefore, in this step, the network card aggregation group is dynamically adjusted. There is no need to migrate the network card during the period when the service is suspended and forwarded, which can shorten the service freeze time of the old version of the virtual switch, that is, reduce the delay of service forwarding caused by the upgrade.
  • the network card migration involved in step 202 may be to migrate a member network card in the network card aggregation group in the old version virtual switch to the new version virtual switch. If the NIC aggregation group in the old-version virtual switch includes multiple NICs, one of the member NICs can be migrated first.
  • Step 203 freezing the service forwarding work of the old version virtual switch, and migrating the virtual machine information in the old version virtual switch to the new version virtual switch; wherein, the virtual machine information includes the network communication information of the virtual machine connected to the old version virtual switch.
  • Step 204 based on the virtual machine information migrated to the new version virtual switch and the network card previously migrated from the old version virtual switch to the new version virtual switch, switch the service forwarding work to the new version virtual switch for execution.
  • step 204 may include: recovering virtual machine communication according to the virtual machine information; wherein, the recovery of virtual machine communication includes rebuilding the message sending and receiving queue of the virtual machine and reconnecting the link between the virtual switch of the new version and the virtual machine ; Among them, after the locking state of some member network cards and uplink switch ports is released and the virtual machine communication is restored, the new version of the virtual switch performs service forwarding.
  • the reconstruction of the sending and receiving queues for communication between virtual machines and the link reconnection between the new version of the virtual switch and the virtual machines can enable the new version of the virtual switch to perform business forwarding work smoothly in the future.
  • link reconnection-related work can also be performed during the freeze time.
  • step 202 may include: releasing some member network cards in the NIC aggregation group in the old version virtual switch, and adding some member network cards released by the old version virtual switch to the new version virtual switch; Some member network cards in the network are connected to the ports of the uplink switch, and some member network cards and the ports of the uplink switch are set to the locked state.
  • the steps in this example are performed before the freezing time, which can further shorten the time, that is, shorten the suspension time of service forwarding.
  • the part of the virtual switch upgrade device deployed in the old-version virtual The switch can add this NIC.
  • step 204 involves the step of switching the service forwarding work to the new version of the virtual switch based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, It may include: releasing the locking state of some member network cards and uplink switch ports.
  • the establishment of connections between some member NICs added to the new version virtual switch and the port of the uplink switch may include: specifying the identification identifiers of some member NICs added to the new version virtual switch as: The identification marks in the switches are the same; based on the specified identification marks, some member network cards in the new version of the virtual switch are connected to the ports of the uplink switch. It can avoid the upgrade perception of the virtual switch by the peer hardware switch device.
  • Figure 3 shows the migration scenario of the aggregation group member NICs involved in this example.
  • the hardware NICs eth0 and eth1 on the server are added to the aggregation group, and the LACP protocol is used to maintain the protocol status of the aggregation group member NICs with the ports of the uplink hardware switch to ensure the normal forwarding of incoming and outgoing services from the server.
  • migrating member NIC ports of the aggregation group first exit the aggregation group member NIC eht1 of the old virtual switch process, and add eth1 to the aggregation group of the new virtual switch process.
  • the peer hardware switch can normally perform LACP negotiation with the new version of the virtual switch, that is, service interworking. Both the control network card eth1 and the uplink hardware switch ports are locked.
  • the LACP state transition process is started synchronously, that is, the forwarding link between the new version of the virtual switch process and the uplink switch is opened through the migrated member network card eth1.
  • Step 205 Migrate other member network cards except some member network cards in the network card aggregation group in the old version virtual switch to the new version virtual switch, and belong to the same network card aggregation group in the new version virtual switch as some member network cards.
  • the new version of the virtual switch completes the addition of other member NICs of the NIC aggregation group, that is, the virtual switch upgrade process is completed.
  • step 201, step 203, and step 204 in this embodiment are the same as those in the previous embodiment.
  • the relevant technical details mentioned in the previous embodiment are still valid in this embodiment. In order to reduce repetition, No more details will be given in this embodiment.
  • the new version of the virtual switch when the old version of the virtual switch performs service forwarding, can be created and initialized without interrupting services. Migrate some member NICs in the NIC aggregation group in the old version of the virtual switch to the new version of the virtual switch, thereby freezing the service forwarding work of the old version of the virtual switch, and migrating the information of the virtual machines in the old version of the virtual switch to the new version of the virtual switch, which can make the new version
  • the virtual switch obtains the information required for network communication. Then, based on the migrated virtual machine information and the network card migrated from the old-version virtual switch to the new-version virtual switch in advance, the service forwarding work is switched to the new-version virtual switch for execution.
  • This implementation mode does not need to suspend the service of the virtual switch during the creation and initialization stages of the new version of the virtual switch, and when the network card is migrated.
  • the service suspension time can be greatly shortened. , to achieve uninterrupted services as much as possible, which can improve the robustness and reliability of the current 5G service network.
  • An implementation manner of the present application relates to an upgrade device of a virtual switch, as shown in FIG. 4 .
  • the virtual switch upgrade device is deployed on a physical machine (not shown in the figure), and a virtual machine (not shown in the figure) and an old version virtual switch (not shown in the figure) connected to the virtual machine are also deployed on the physical machine;
  • the virtual switch Upgraded equipment includes:
  • the deployment module 401 is configured to create and initialize a new version of the virtual switch when the old version of the virtual switch performs service forwarding work;
  • the network card migration module 402 is used to migrate the network card in the old version of the virtual switch to the new version of the virtual switch;
  • the virtual machine information migration module 403 is used to freeze the service forwarding work of the old version of the virtual switch after the initialization of the new version of the virtual switch is completed, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch;
  • the switching module 404 is configured to switch the service forwarding work to the new version virtual switch for execution based on the virtual machine information migrated to the new version virtual switch and the network card previously migrated from the old version virtual switch to the new version virtual switch.
  • the modules mentioned above can be divided into multiple parts or units that are deployed independently or deployed in an old-version virtual switch to implement the same function.
  • the virtual machine information migration module 403 may have a part deployed separately in the physical machine, which is used to freeze the service forwarding work of the old-version virtual switch; The information is migrated to the new version of the virtual switch.
  • the above multiple units deployed in the physical machine and the virtual switch together form the virtual machine information migration module 403 .
  • the network card migration module 402 can also be used to migrate some member network cards in the network card aggregation group in the old version of the virtual switch to the new version after creating and initializing the new version of the virtual switch and before freezing the service forwarding work of the old version of the virtual switch In the virtual switch; wherein, the network cards that are migrated from the old version of the virtual switch to the new version of the virtual switch in advance refer to some member network cards; the network card migration module 402 can also be used to transfer information based on the virtual machine in the new version of the virtual switch and pre-migrate from the old version of the virtual switch After the switch is migrated to the NICs in the new version of the virtual switch, and the service forwarding work is switched to the new version of the virtual switch, the other member NICs in the NIC aggregation group in the old version of the virtual switch are migrated to the new version of the virtual switch. Some member NICs belong to the same NIC aggregation group in the new version of the virtual switch.
  • the network card migration module 402 can also be used to release some member network cards in the network card aggregation group in the old version virtual switch, and add some member network cards released by the old version virtual switch to the new version virtual switch; Some member network cards in the virtual switch are connected to the ports of the uplink switch, and some member network cards and the ports of the uplink switch are set to a locked state; in this example, the switching module 404 can also be used to connect some member network cards to the uplink switch The locked state of the port is released.
  • the switching module 404 can also be used to restore the virtual machine communication according to the information of the virtual machine; wherein, the restoration of the virtual machine communication includes rebuilding the message sending and receiving queue of the virtual machine and the link between the new version of the virtual switch and the virtual machine. Route reconnection; Among them, after the locking status of some member NICs and uplink switch ports is released and the virtual machine communication is restored, the new version of the virtual switch performs service forwarding.
  • the network card migration module 402 can also be used to specify the identification of some member network cards added to the new version of the virtual switch as: the same as the identification of some member network cards in the old version of the virtual switch; based on the specified identification, Connect some member NICs in the new version of the virtual switch to the ports of the uplink switch.
  • the network card migration module 402 may also be used to migrate a member network card in the network card aggregation group in the old version virtual switch to the new version virtual switch.
  • the network card migration module 402 can also be used to freeze the service forwarding work of the old version of the virtual switch, and based on the virtual machine information migrated to the new version of the virtual switch and migrate from the old version of the virtual switch to the new version of the virtual switch in advance Before switching the service forwarding work to the new version of the virtual switch, the network card in the old version of the virtual switch is migrated to the new version of the virtual switch.
  • the virtual machine information migration module 403 can also be used to write the virtual machine information in the old version virtual switch into the preset shared memory after freezing the service forwarding work of the old version virtual switch, and the new version virtual switch Read virtual machine information from shared memory.
  • the deploying module 401 may also be configured to create and initialize a new version of the virtual switch in response to a virtual switch upgrade instruction during the process of performing service forwarding by the old version of the virtual switch.
  • the virtual switch upgrade device provided in this embodiment can create and initialize a new version of the virtual switch without interrupting services during the process of performing service forwarding by the old version of the virtual switch. Then freeze the service forwarding work of the old version of the virtual switch, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch.
  • the virtual machine information includes the information used for network communication by the virtual machine connected to the old version of the virtual switch, so that the new version of the virtual switch can obtain information required for network communication.
  • the service forwarding work is switched to the new-version virtual switch for execution.
  • the service suspension time can be greatly shortened, and the service is not interrupted as much as possible.
  • modules involved in the above embodiments of the present application are logical modules.
  • a logical unit can be a physical unit, or a part of a physical unit, and can also Combination of physical units.
  • units that are not closely related to solving the technical problems proposed in the present application are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.
  • the embodiment of the present application also provides a virtual switch upgrading device, as shown in FIG. 5 , including at least one processor 501; An old version virtual switch that runs a virtual machine and is connected to the virtual machine; the memory 502 stores instructions that can be executed by at least one processor 501, and the instructions are executed by at least one processor 501, so that at least one processor 501 can perform the above-mentioned virtual switch upgrade method.
  • the memory 502 and the processor 501 are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors 501 and various circuits of the memory 502 together.
  • the bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein.
  • the bus interface provides an interface between the bus and the transceivers.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium.
  • the data processed by the processor 501 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor 501 .
  • Processor 501 is responsible for managing the bus and general processing, and may also provide various functions including timing, peripheral interface, voltage regulation, power management and other control functions. Instead, the memory 502 may be used to store data used by the processor 501 when performing operations.
  • the virtual switch upgrade device involved in the previous implementation manner may also be deployed in the electronic device involved in this implementation manner.
  • Embodiments of the present application also provide a computer-readable storage medium storing a computer program.
  • the computer program is executed by the processor, the above virtual switch upgrading method is implemented.
  • the virtual switch upgrade device involved in the foregoing implementation manners may also be deployed in the computer-readable storage medium involved in this implementation manner.
  • a device which can be A single chip microcomputer, a chip, etc.
  • a processor processor
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

Disclosed are a virtual switch upgrading method and device, an electronic device and a storage medium. The virtual switch upgrading method comprises: in the process that an old version of a virtual switch executes service forwarding work, creating and initializing a new version of the virtual switch; freezing the service forwarding work of the old version of the virtual switch, and migrating virtual machine information in the old version of the virtual switch into the new version of the virtual switch, wherein the virtual machine information comprises information used by a virtual machine connected to the old version of the virtual switch for network communications; and on the basis of the virtual machine information migrated into the new version of the virtual switch and a network card pre-migrated from the old version of the virtual switch to the new version of the virtual switch, switching the service forwarding work to the new version of the virtual switch for execution.

Description

一种虚拟交换机升级方法、设备、电子设备和存储介质A virtual switch upgrade method, device, electronic device and storage medium
相关申请related application
本申请要求于2021年12月7日申请的、申请号为202111486398.0的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims priority to a Chinese patent application with application number 202111486398.0 filed on December 7, 2021, the entire contents of which are hereby incorporated by reference.
技术领域technical field
本申请实施方式涉及通信技术领域,特别涉及一种虚拟交换机升级方法、设备、电子设备和计算机可读存储介质。The embodiments of the present application relate to the technical field of communications, and in particular to a virtual switch upgrade method, device, electronic device, and computer-readable storage medium.
背景技术Background technique
当前电信5G核心网业务使用通用服务器虚拟出来的虚拟机作为业务载体。承载电信5G业务的通用服务器内部虚拟机、跨通用服务器虚拟机之间需要通过基于虚拟交换机数据面开发套件(OpenvSwitch-Datapath Develop Kit,简称“OVS-DPDK”)架构的用户态虚拟交换机实现虚拟机之间业务的互联互通。另外,在商用场景下,通用服务器一般会启用链路汇聚控制协议(Link Aggregation Control Protocol,简称“LACP”)来监控与上联硬件交换机之间的链路质量。通用服务器侧LACP协议状态机也需要由虚拟交换机来维护,确保通用服务器对外链路的业务双向可达。可见虚拟交换机的稳定才能确保上层业务交互的可靠性,因此,作为虚拟机业务交互桥梁的虚拟交换机的重要性尤为突出。The current telecom 5G core network business uses a virtual machine virtualized by a general-purpose server as a business carrier. The internal virtual machine of the general server carrying the telecom 5G service and the cross-general server virtual machine need to implement the virtual machine through a user-mode virtual switch based on the virtual switch data plane development kit (OpenvSwitch-Datapath Development Kit, referred to as "OVS-DPDK") architecture. business interconnection. In addition, in commercial scenarios, general-purpose servers generally enable the Link Aggregation Control Protocol (LACP for short) to monitor the link quality with the uplink hardware switch. The state machine of the LACP protocol on the general server side also needs to be maintained by the virtual switch to ensure that the business of the external link of the general server can be reached in two directions. It can be seen that the stability of the virtual switch can ensure the reliability of the upper-layer service interaction. Therefore, the importance of the virtual switch as a bridge for virtual machine service interaction is particularly prominent.
然而,由软件实现的虚拟交换机程序难免需要进行故障修复或者版本升级,而在故障修改或版本升级的过程中需要进行虚拟交换机进程的重启,用于上层业务转发的进程也会同步退出,使得上层业务交互链路不可达。在虚拟交换机升级阶段,虚拟机之间的业务无法互通,可能会对业务产生较大的负面影响。However, the virtual switch program implemented by software inevitably needs to be repaired or version upgraded. In the process of fault modification or version upgrade, the virtual switch process needs to be restarted, and the process used for upper-layer service forwarding will also exit synchronously, making the upper layer The service interaction link is unreachable. During the upgrade phase of the virtual switch, services between virtual machines cannot communicate with each other, which may have a relatively large negative impact on services.
发明内容Contents of the invention
本申请实施方式的目的在于提供一种虚拟交换机升级方法、设备、电子设备和计算机可读存储介质,用以缩短虚拟交换机升级过程中业务暂停的时间,尽可能保证业务不中断。The purpose of the embodiments of the present application is to provide a virtual switch upgrade method, device, electronic device and computer-readable storage medium, so as to shorten the service suspension time during the virtual switch upgrade process and ensure uninterrupted services as much as possible.
为实现上述目的,本申请实施方式提供了一种虚拟交换机升级方法,包括:在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机;冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内;其中,虚拟机信息包括与旧版虚拟交换机连接的虚拟机用于网络通信的信息;基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。In order to achieve the above purpose, the embodiment of the present application provides a method for upgrading a virtual switch, including: creating and initializing a new version of the virtual switch during the process of performing service forwarding by the old version of the virtual switch; freezing the service forwarding work of the old version of the virtual switch, and The virtual machine information in the old version of the virtual switch is migrated to the new version of the virtual switch; the virtual machine information includes the information used by the virtual machine connected to the old version of the virtual switch for network communication; based on the virtual machine information migrated to the new version of the virtual switch and from the The old version of the virtual switch is migrated to the network card in the new version of the virtual switch, and the service forwarding work is switched to the new version of the virtual switch for execution.
为实现上述目的,本申请实施方式还提供了一种虚拟交换机升级设备,虚拟交换机升级设备部署在物理机上,物理机上还部署有虚拟机、与虚拟机连接的旧版虚拟交换机;虚拟交换机升级设备包括:部署模块,用于在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机;网卡迁移模块,用于将旧版虚拟交换机中的网卡迁移到新版虚拟交换机内;虚拟机信息迁移模块,用于在新版虚拟交换机初始化完成后,冻结旧版虚拟交换机 的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内;切换模块,用于基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。In order to achieve the above purpose, the embodiment of the present application also provides a virtual switch upgrade device, the virtual switch upgrade device is deployed on a physical machine, and a virtual machine and an old version virtual switch connected to the virtual machine are also deployed on the physical machine; the virtual switch upgrade device includes : The deployment module is used to create and initialize the new version of the virtual switch when the old version of the virtual switch performs business forwarding work; the network card migration module is used to migrate the network card in the old version of the virtual switch to the new version of the virtual switch; the virtual machine information migration module , used to freeze the service forwarding work of the old version of the virtual switch after the initialization of the new version of the virtual switch is completed, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch; The virtual machine information and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, and the business forwarding work is switched to the new version of the virtual switch for execution.
本申请的实施方式还提供了一种电子设备,包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,至少一处理器用于运行虚拟机、与虚拟机连接的旧版虚拟交换机;存储器存储有可被至少一处理器执行的指令,指令被至少一处理器执行,以使至少一处理器能够执行上述的虚拟交换机升级方法。The embodiment of the present application also provides an electronic device, including: at least one processor; and a memory connected to the at least one processor in communication; wherein, the at least one processor is used to run a virtual machine, and an old version virtual machine connected to the virtual machine The switch; the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor, so that at least one processor can execute the above virtual switch upgrade method.
本申请的实施方式还提供了一种存储有计算机程序的计算机可读存储介质,计算机程序被处理器执行时实现上述的虚拟交换机升级方法。Embodiments of the present application also provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above method for upgrading a virtual switch is implemented.
附图说明Description of drawings
一个或多个实施方式通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施方式的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute a limitation to the embodiments. Elements with the same reference numerals in the drawings represent similar elements. Unless otherwise stated, the drawings in the drawings are not limited to scale.
图1是根据本申请一实施方式中的虚拟交换机升级方法流程图;FIG. 1 is a flowchart of a method for upgrading a virtual switch according to an embodiment of the present application;
图2是根据本申请另一实施方式中的虚拟交换机升级方法流程图;FIG. 2 is a flowchart of a method for upgrading a virtual switch according to another embodiment of the present application;
图3是根据本申请一实施方式中的聚合组成员网卡的迁移场景示意图;FIG. 3 is a schematic diagram of a migration scenario of an aggregation group member network card according to an embodiment of the present application;
图4是根据本申请一实施方式中的虚拟交换机升级设备的结构示意图;FIG. 4 is a schematic structural diagram of a virtual switch upgrade device according to an embodiment of the present application;
图5是根据本申请另一实施方式中的电子设备的结构示意图。Fig. 5 is a schematic structural diagram of an electronic device according to another implementation manner of the present application.
具体实施方式Detailed ways
为使本申请实施方式的目的、技术方案和优点更加清楚,下面将结合附图对本申请的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本申请各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施方式的划分是为了描述方便,不应对本申请的具体实现方式构成任何限定,各个实施方式在不矛盾的前提下可以相互结合相互引用。In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the various embodiments of the present application will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that, in each implementation manner of the present application, many technical details are provided for readers to better understand the present application. However, even without these technical details and various changes and modifications based on the following implementation modes, the technical solution claimed in this application can also be realized. The division of the following implementations is for the convenience of description, and should not constitute any limitation to the specific implementations of the present application, and the implementations can be combined and referenced to each other on the premise of no contradiction.
本申请的一实施方式涉及虚拟交换机升级方法。在本实施方式中,在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机;冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内;其中,虚拟机信息包括与旧版虚拟交换机连接的虚拟机用于网络通信的信息;基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。本实施方式的虚拟交换机升级方法的具体流程可以如图1所示。An embodiment of the present application relates to a method for upgrading a virtual switch. In this embodiment, in the process of performing service forwarding by the old version of the virtual switch, create and initialize the new version of the virtual switch; freeze the service forwarding work of the old version of the virtual switch, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch ; Among them, the virtual machine information includes the information used by the virtual machine connected to the old version of the virtual switch for network communication; based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, the business The forwarding work is switched to the new version of the virtual switch for execution. The specific flow of the method for upgrading a virtual switch in this implementation manner may be shown in FIG. 1 .
用户态虚拟机之间的业务交互,需要由虚拟交换机的转发面(datapath)从物理网卡或者虚拟机端口接收报文、解析报文、根据datapath保存的流表对报文进行相应修改及转发,最终实现虚拟机间业务互通功能。而datapath作为虚拟交换机的组成部分,当虚拟交换机因为故障修复或版本升级进行重启操作时,作为线程运行的datapath也会随着虚拟交换机进程的退出而退出工作,这就意味着在虚拟交换机重启阶段,业务报文的接收、解析、处理及转发行为被暂停,虚拟机间业务无法互通。For business interaction between virtual machines in user mode, the forwarding plane (datapath) of the virtual switch needs to receive packets from physical network cards or virtual machine ports, parse the packets, and modify and forward the packets accordingly according to the flow table saved in the datapath. Finally, the service interworking function between virtual machines is realized. As datapath is a part of the virtual switch, when the virtual switch is restarted due to fault repair or version upgrade, the datapath running as a thread will also quit working with the exit of the virtual switch process, which means that during the virtual switch restart phase , the receiving, parsing, processing, and forwarding of service packets are suspended, and services between virtual machines cannot communicate.
而新版虚拟交换机启动的过程中,涉及数据面开发套件(Datapath Develop Kit,简称“DPDK”)巨页内存初始化、物理网卡初始化、物理网卡LACP协商以及OpenFlow流规则初始化等一系列工作。这部分资源的初始化以及LACP链路协商过程耗时较多,使得虚拟机间业务恢复时间被大大拉长。针对上述问题,本申请提出了虚拟交换机升级方法,用以缩短虚拟交换机升级过程中业务暂停的时间,尽可能保证业务不中断。本实施方式涉及的虚拟交换机升级方法可以用于移动运营商5G核心网网元等大规模虚拟化商用组网。The startup process of the new version of the virtual switch involves a series of tasks such as data path development kit (Datapath Develop Kit, "DPDK") huge page memory initialization, physical network card initialization, physical network card LACP negotiation, and OpenFlow flow rule initialization. The initialization of these resources and the LACP link negotiation process take a lot of time, which greatly lengthens the service recovery time between virtual machines. In view of the above problems, the present application proposes a virtual switch upgrade method to shorten the service suspension time during the virtual switch upgrade process and ensure uninterrupted services as much as possible. The virtual switch upgrade method involved in this embodiment can be used in large-scale virtualized commercial networks such as 5G core network elements of mobile operators.
下面对本实施方式中的虚拟交换机升级方法的实现细节进行具体的说明,以下内容仅为方便理解本方案的实现细节,并非实施本方案的必须。具体流程如图1所示,可包括如下步骤:The implementation details of the virtual switch upgrading method in this embodiment will be described in detail below. The following content is only for the convenience of understanding the implementation details of the solution, and is not necessary for implementing the solution. The specific process is shown in Figure 1, and may include the following steps:
步骤101,在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机。 Step 101 , creating and initializing a new version of the virtual switch when the old version of the virtual switch performs service forwarding.
在本步骤中,在旧版虚拟交换机执行业务转发工作的过程中,无需中断其正常运行即可进行对新版虚拟交换机的创建和初始化。其中对新版虚拟交换机的初始化包括初始化DPDK巨页内存、备份OpenFlow流规则以及准备好新版虚拟交换机进行转发工作所需的相关资源。对新版虚拟交换机的初始化还可以包括初始化用于存放虚拟机信息的共享内存。在实际实施时,在新版虚拟交换机的初始化进程结束后可以由虚拟交换机升级设备部署在新版虚拟交换机中的部分发送初始化完成通知。In this step, the virtual switch of the new version can be created and initialized without interrupting its normal operation while the virtual switch of the old version is performing service forwarding work. The initialization of the new version of the virtual switch includes initializing the DPDK huge page memory, backing up the OpenFlow flow rules, and preparing related resources for the new version of the virtual switch for forwarding. Initializing the new version of the virtual switch may also include initializing shared memory for storing virtual machine information. In actual implementation, after the initialization process of the new version of the virtual switch is completed, the part of the virtual switch upgrade device deployed in the new version of the virtual switch may send an initialization completion notification.
在一个例子中,在旧版虚拟交换机执行业务转发工作的过程中,响应于虚拟交换机升级指令,创建并初始化新版虚拟交换机。其中,虚拟交换机升级指令可以根据虚拟交换机需要进行故障修复或者版本升级的情况生成。In an example, in the process of performing service forwarding by the old-version virtual switch, a new-version virtual switch is created and initialized in response to a virtual switch upgrade instruction. Wherein, the virtual switch upgrade instruction may be generated according to the situation that the virtual switch needs to perform fault repair or version upgrade.
步骤102,冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内;其中,虚拟机信息包括与旧版虚拟交换机连接的虚拟机用于网络通信的信息。 Step 102, freezing the service forwarding work of the old version virtual switch, and migrating the virtual machine information in the old version virtual switch to the new version virtual switch; wherein, the virtual machine information includes the network communication information of the virtual machine connected to the old version virtual switch.
在一个例子中,步骤102可以包括冻结旧版虚拟交换机的业务转发工作后,旧版虚拟交换机将旧版虚拟交换机内的虚拟机信息写入预设的共享内存,新版虚拟交换机从共享内存读取虚拟机信息。在本例中,利用共享内存实现虚拟机信息的迁移。In an example, step 102 may include freezing the service forwarding work of the old-version virtual switch, the old-version virtual switch writes the virtual machine information in the old-version virtual switch to a preset shared memory, and the new-version virtual switch reads the virtual machine information from the shared memory . In this example, shared memory is used to migrate virtual machine information.
在另一个例子中,在步骤102后,还可以将旧版虚拟交换机内的网卡迁移到新版虚拟交换机内。本例中涉及的网卡迁移,在实际实施时,可以由虚拟交换机升级设备部署在新版虚拟交换机中的部分发送网卡迁移完成通知。In another example, after step 102, the network card in the old version of the virtual switch can also be migrated to the new version of the virtual switch. The network card migration involved in this example may be implemented by the part of the virtual switch upgrade device deployed in the new version of the virtual switch to send a network card migration completion notification.
步骤103,基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。 Step 103, based on the virtual machine information migrated to the virtual switch of the new version and the network card previously migrated from the virtual switch of the old version to the virtual switch of the new version, switch the service forwarding work to the virtual switch of the new version for execution.
在本步骤中,在虚拟机信息和网卡迁移到新版虚拟交换机内后,部署在新版虚拟交换机中的虚拟交换机升级设备的单元可以进行虚拟收发队列重建以及与虚拟操作系统模拟器(Quick Emulator,简称“QEMU”)之间前后端链路重连,使得业务转发工作能够切换到新版虚拟交换机内执行。在重建包括新版虚拟交换机的通信链路之后,可以由部署在新版虚拟交换机中的虚拟交换机升级设备的单元向旧版虚拟交换机发送重建结束消息,以触发旧版虚拟交换机退出进程。In this step, after the virtual machine information and network card are migrated to the new version of the virtual switch, the unit of the virtual switch upgrade device deployed in the new version of the virtual switch can rebuild the virtual sending and receiving queue and communicate with the virtual operating system emulator (Quick Emulator, referred to as "QEMU"), the front-end and back-end links are reconnected, so that the service forwarding work can be switched to the new version of the virtual switch for execution. After the communication link including the new version virtual switch is rebuilt, the unit of the virtual switch upgrade device deployed in the new version virtual switch may send a reconstruction end message to the old version virtual switch, so as to trigger the exit process of the old version virtual switch.
值得一提的是,本实施方式涉及的虚拟交换机升级方法对于升级前后版本无关联依赖,即不管新版虚拟交换机进行何种业务功能改动或升级,均能够实现在虚拟交换机升级阶段业 务不中断。It is worth mentioning that the virtual switch upgrade method involved in this embodiment has no correlation with the version before and after the upgrade, that is, no matter what business function changes or upgrades the new version of the virtual switch performs, it can realize uninterrupted business during the virtual switch upgrade stage.
在本实施方式中,在旧版虚拟交换机执行业务转发工作的过程中,无需中断业务即可创建并初始化新版虚拟交换机。进而冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内。其中,虚拟机信息包括与旧版虚拟交换机连接的虚拟机用于网络通信的信息,能够使得新版虚拟交换机获取到网络通信所需信息。进而基于迁移的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。相比于在虚拟交换机的整个升级过程中停止转发的升级方法,能够大大缩短业务暂停的时间,尽可能的实现业务不中断。In this embodiment, when the old version of the virtual switch performs service forwarding, the new version of the virtual switch can be created and initialized without interrupting services. Then freeze the service forwarding work of the old version of the virtual switch, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch. Wherein, the virtual machine information includes the information used for network communication by the virtual machine connected to the old version of the virtual switch, so that the new version of the virtual switch can obtain information required for network communication. Then, based on the migrated virtual machine information and the network card migrated from the old-version virtual switch to the new-version virtual switch in advance, the service forwarding work is switched to the new-version virtual switch for execution. Compared with the upgrade method of stopping forwarding during the whole upgrade process of the virtual switch, the service suspension time can be greatly shortened, and the service is not interrupted as much as possible.
本申请的另一实施方式涉及一种虚拟交换机升级方法。在本实施方式中,在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机;冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内;其中,虚拟机信息包括与旧版虚拟交换机连接的虚拟机用于网络通信的信息;基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。本实施方式的虚拟交换机升级方法的具体流程可以如图2所示。Another embodiment of the present application relates to a method for upgrading a virtual switch. In this embodiment, in the process of performing service forwarding by the old version of the virtual switch, create and initialize the new version of the virtual switch; freeze the service forwarding work of the old version of the virtual switch, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch ; Among them, the virtual machine information includes the information used by the virtual machine connected to the old version of the virtual switch for network communication; based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, the business The forwarding work is switched to the new version of the virtual switch for execution. The specific flow of the method for upgrading a virtual switch in this implementation manner may be shown in FIG. 2 .
下面对本实施方式中的虚拟交换机升级方法的实现细节进行具体的说明,以下内容仅为方便理解本方案的实现细节,并非实施本方案的必须。具体流程如图2所示,可包括如下步骤:The implementation details of the virtual switch upgrading method in this embodiment will be described in detail below. The following content is only for the convenience of understanding the implementation details of the solution, and is not necessary for implementing the solution. The specific process is shown in Figure 2, and may include the following steps:
步骤201,在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机。Step 201: Create and initialize a new version of the virtual switch during service forwarding by the old version of the virtual switch.
步骤202,将旧版虚拟交换机内网卡聚合组中的部分成员网卡迁移到新版虚拟交换机内;其中,预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡是指部分成员网卡。 Step 202, migrate some member network cards in the network card aggregation group in the old version virtual switch to the new version virtual switch; wherein, the network cards migrated from the old version virtual switch to the new version virtual switch in advance refer to some member network cards.
冻结旧版虚拟交换机的业务转发工作的时长决定了虚拟交换机升级造成的业务延误时长,因此,在本步骤中,对于网卡聚合组进行动态调整。无需在业务暂停转发的时间段内迁移网卡,能够缩短旧版虚拟交换机的业务冻结时间,即减少由于升级导致的业务转发延误时长。The duration of freezing the service forwarding work of the old-version virtual switch determines the length of service delay caused by the upgrade of the virtual switch. Therefore, in this step, the network card aggregation group is dynamically adjusted. There is no need to migrate the network card during the period when the service is suspended and forwarded, which can shorten the service freeze time of the old version of the virtual switch, that is, reduce the delay of service forwarding caused by the upgrade.
在一个例子中,步骤202涉及的网卡迁移可以是将旧版虚拟交换机内网卡聚合组中的一个成员网卡迁移到新版虚拟交换机内。在旧版虚拟交换机内网卡聚合组包括多个网卡的情况下,可以先进行其中一个成员网卡的迁移。In an example, the network card migration involved in step 202 may be to migrate a member network card in the network card aggregation group in the old version virtual switch to the new version virtual switch. If the NIC aggregation group in the old-version virtual switch includes multiple NICs, one of the member NICs can be migrated first.
步骤203,冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内;其中,虚拟机信息包括与旧版虚拟交换机连接的虚拟机用于网络通信的信息。 Step 203, freezing the service forwarding work of the old version virtual switch, and migrating the virtual machine information in the old version virtual switch to the new version virtual switch; wherein, the virtual machine information includes the network communication information of the virtual machine connected to the old version virtual switch.
步骤204,基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。 Step 204, based on the virtual machine information migrated to the new version virtual switch and the network card previously migrated from the old version virtual switch to the new version virtual switch, switch the service forwarding work to the new version virtual switch for execution.
在一个例子中,步骤204可以包括:根据虚拟机信息恢复虚拟机通信;其中,虚拟机通信的恢复包括虚拟机的报文收发队列的重建以及新版虚拟交换机与虚拟机之间的链路重连;其中,部分成员网卡和上联交换机端口的锁定状态被解除后且虚拟机通信被恢复后,新版虚拟交换机执行业务转发工作。在本例中进行虚拟机之间通信交互的收发队列的重建以及新版虚拟交换机与虚拟机之间的链路重连,能够使得新版虚拟交换机在后续顺利进行业务转发工作。In one example, step 204 may include: recovering virtual machine communication according to the virtual machine information; wherein, the recovery of virtual machine communication includes rebuilding the message sending and receiving queue of the virtual machine and reconnecting the link between the virtual switch of the new version and the virtual machine ; Among them, after the locking state of some member network cards and uplink switch ports is released and the virtual machine communication is restored, the new version of the virtual switch performs service forwarding. In this example, the reconstruction of the sending and receiving queues for communication between virtual machines and the link reconnection between the new version of the virtual switch and the virtual machines can enable the new version of the virtual switch to perform business forwarding work smoothly in the future.
本领域的相关技术人员可以理解,除本例中的在冻结时间之后进行链路重连相关工作之外,链路重连相关工作也可以在冻结时间之中进行。Those skilled in the art can understand that, in addition to performing link reconnection-related work after the freeze time in this example, link reconnection-related work can also be performed during the freeze time.
在另一个例子中,步骤202可以包括:将旧版虚拟交换机内网卡聚合组中的部分成员网卡释放,并将被旧版虚拟交换机释放的部分成员网卡添加到新版虚拟交换机内;将添加到新版虚拟交换机内的部分成员网卡与上联交换机端口建立连接,并将部分成员网卡和上联交换机端口设定为锁定状态。本例中的步骤在冻结时间之前进行,能够进一步缩短时间,即缩短业务转发工作暂停的时间。In another example, step 202 may include: releasing some member network cards in the NIC aggregation group in the old version virtual switch, and adding some member network cards released by the old version virtual switch to the new version virtual switch; Some member network cards in the network are connected to the ports of the uplink switch, and some member network cards and the ports of the uplink switch are set to the locked state. The steps in this example are performed before the freezing time, which can further shorten the time, that is, shorten the suspension time of service forwarding.
在实际实施时,本例中涉及的将旧版虚拟交换机内网卡聚合组中的部分成员网卡释放的步骤完成后可以由虚拟交换机升级设备部署在旧版虚拟交换机中的部分发送网卡释放通知,使得新版虚拟交换机能够添加该网卡。In actual implementation, after the step of releasing some member NICs in the NIC aggregation group in the old-version virtual switch involved in this example is completed, the part of the virtual switch upgrade device deployed in the old-version virtual The switch can add this NIC.
在本例中,步骤204涉及的基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行的步骤中,可以包括:将部分成员网卡和上联交换机端口的锁定状态解除。In this example, step 204 involves the step of switching the service forwarding work to the new version of the virtual switch based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, It may include: releasing the locking state of some member network cards and uplink switch ports.
本例涉及的将添加到新版虚拟交换机内的部分成员网卡与上联交换机端口建立连接,可以包括:将添加到新版虚拟交换机内的部分成员网卡的识别标识指定为:与部分成员网卡在旧版虚拟交换机中的识别标识相同;基于指定的识别标识,将新版虚拟交换机内的部分成员网卡与上联交换机端口建立连接。能够免于对端硬件交换机设备对虚拟交换机的升级感知。In this example, the establishment of connections between some member NICs added to the new version virtual switch and the port of the uplink switch may include: specifying the identification identifiers of some member NICs added to the new version virtual switch as: The identification marks in the switches are the same; based on the specified identification marks, some member network cards in the new version of the virtual switch are connected to the ports of the uplink switch. It can avoid the upgrade perception of the virtual switch by the peer hardware switch device.
本例涉及的聚合组成员网卡的迁移场景示意图如图3所示。旧版虚拟交换机进程正常工作状态下,服务器上硬件网卡eth0、eth1加入聚合组,与上联硬件交换机端口之间通过LACP协议维护聚合组成员网卡协议状态,以确保服务器出入向业务的正常转发。聚合组成员网卡口迁移时,首先将旧版虚拟交换机进程聚合组成员网卡eht1退出,并将eth1添加到新虚拟交换机进程的聚合组中。进而通过指定新版虚拟交换机进程聚合组成员网卡的识别标识system-id,使得对端硬件交换机能够正常与新版虚拟交换机之间进行LACP协商,即业务互通。控制网卡eth1和上联硬件交换机端口均处于锁定状态。当进行虚拟机信息迁移的步骤时,同步启动LACP状态跃迁流程即通过迁移的成员网卡eth1打通新版虚拟交换机进程与上联交换机之间的转发链路。在虚拟机信息迁移的步骤结束后,原虚拟交换机释放对应聚合组下成员网卡eth0后,将eth0动态添加到新虚拟交换机进程的聚合组中,完成整个硬件网卡设备的升级切换过程。Figure 3 shows the migration scenario of the aggregation group member NICs involved in this example. When the old version of the virtual switch process is working normally, the hardware NICs eth0 and eth1 on the server are added to the aggregation group, and the LACP protocol is used to maintain the protocol status of the aggregation group member NICs with the ports of the uplink hardware switch to ensure the normal forwarding of incoming and outgoing services from the server. When migrating member NIC ports of the aggregation group, first exit the aggregation group member NIC eht1 of the old virtual switch process, and add eth1 to the aggregation group of the new virtual switch process. Furthermore, by specifying the identification identifier system-id of the member NICs of the process aggregation group of the new version of the virtual switch, the peer hardware switch can normally perform LACP negotiation with the new version of the virtual switch, that is, service interworking. Both the control network card eth1 and the uplink hardware switch ports are locked. When the virtual machine information migration step is performed, the LACP state transition process is started synchronously, that is, the forwarding link between the new version of the virtual switch process and the uplink switch is opened through the migrated member network card eth1. After the virtual machine information migration step is completed, after the original virtual switch releases the member network card eth0 under the corresponding aggregation group, eth0 is dynamically added to the aggregation group of the new virtual switch process, and the upgrade and switching process of the entire hardware network card device is completed.
步骤205,将旧版虚拟交换机内网卡聚合组中除部分成员网卡外的其他成员网卡迁移到新版虚拟交换机内,且与部分成员网卡归属于新版虚拟交换机内的同一网卡聚合组。Step 205: Migrate other member network cards except some member network cards in the network card aggregation group in the old version virtual switch to the new version virtual switch, and belong to the same network card aggregation group in the new version virtual switch as some member network cards.
在本步骤中,可以先将旧版虚拟交换机内网卡聚合组中除部分成员网卡外的其他成员网卡释放,再由虚拟交换机升级设备部署在旧版虚拟交换机中的部分发送网卡释放通知,进而可以退出旧版虚拟交换机。在旧版虚拟交换机退出后,新版虚拟交换机完成网卡聚合组其他成员网卡的添加,即完成虚拟交换机升级流程。In this step, you can first release the other member NICs in the NIC aggregation group in the old version of the virtual switch except some member NICs, and then send the network card release notification to the part of the virtual switch upgrade device deployed in the old version of the virtual switch, and then you can exit the old version virtual switch. After the old version of the virtual switch exits, the new version of the virtual switch completes the addition of other member NICs of the NIC aggregation group, that is, the virtual switch upgrade process is completed.
不难看出,本实施方式中的步骤201、步骤203以及步骤204与前述实施方式中的步骤对应相同,上一实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,在本实施方式中不再赘述。It is not difficult to see that step 201, step 203, and step 204 in this embodiment are the same as those in the previous embodiment. The relevant technical details mentioned in the previous embodiment are still valid in this embodiment. In order to reduce repetition, No more details will be given in this embodiment.
在本实施方式中,在旧版虚拟交换机执行业务转发工作的过程中,无需中断业务即可创建并初始化新版虚拟交换机。将旧版虚拟交换机内网卡聚合组中的部分成员网卡迁移到新版 虚拟交换机内,进而冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内,能够使得新版虚拟交换机获取到网络通信所需信息。进而基于迁移的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。再对旧版虚拟交换机内的其他成员网卡进行迁移。本实施方式在新版虚拟交换机创建以及初始化阶段,以及对网卡进行迁移时均无需暂停虚拟交换机的业务,相比于在虚拟交换机的整个升级过程中停止转发的升级方法,能够大大缩短业务暂停的时间,尽可能的实现业务不中断,能够提升当前5G业务网络的健壮性和可靠性。In this embodiment, when the old version of the virtual switch performs service forwarding, the new version of the virtual switch can be created and initialized without interrupting services. Migrate some member NICs in the NIC aggregation group in the old version of the virtual switch to the new version of the virtual switch, thereby freezing the service forwarding work of the old version of the virtual switch, and migrating the information of the virtual machines in the old version of the virtual switch to the new version of the virtual switch, which can make the new version The virtual switch obtains the information required for network communication. Then, based on the migrated virtual machine information and the network card migrated from the old-version virtual switch to the new-version virtual switch in advance, the service forwarding work is switched to the new-version virtual switch for execution. Then migrate other member NICs in the old version of the virtual switch. This implementation mode does not need to suspend the service of the virtual switch during the creation and initialization stages of the new version of the virtual switch, and when the network card is migrated. Compared with the upgrade method of stopping forwarding during the entire upgrade process of the virtual switch, the service suspension time can be greatly shortened. , to achieve uninterrupted services as much as possible, which can improve the robustness and reliability of the current 5G service network.
本申请的一实施方式涉及一种虚拟交换机的升级设备,如图4所示。虚拟交换机升级设备部署在物理机(图中未示出)上,物理机上还部署有虚拟机(图中未示出)、与虚拟机连接的旧版虚拟交换机(图中未示出);虚拟交换机升级设备包括:An implementation manner of the present application relates to an upgrade device of a virtual switch, as shown in FIG. 4 . The virtual switch upgrade device is deployed on a physical machine (not shown in the figure), and a virtual machine (not shown in the figure) and an old version virtual switch (not shown in the figure) connected to the virtual machine are also deployed on the physical machine; the virtual switch Upgraded equipment includes:
部署模块401,用于在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机;The deployment module 401 is configured to create and initialize a new version of the virtual switch when the old version of the virtual switch performs service forwarding work;
网卡迁移模块402,用于将旧版虚拟交换机中的网卡迁移到新版虚拟交换机内;The network card migration module 402 is used to migrate the network card in the old version of the virtual switch to the new version of the virtual switch;
虚拟机信息迁移模块403,用于在新版虚拟交换机初始化完成后,冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内;The virtual machine information migration module 403 is used to freeze the service forwarding work of the old version of the virtual switch after the initialization of the new version of the virtual switch is completed, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch;
切换模块404,用于基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。The switching module 404 is configured to switch the service forwarding work to the new version virtual switch for execution based on the virtual machine information migrated to the new version virtual switch and the network card previously migrated from the old version virtual switch to the new version virtual switch.
值得一提的是,上述涉及的各模块可以分成单独部署以及部署在旧版虚拟交换机等内实现同一功能的多个部分或单元。如虚拟机信息迁移模块403可以存在单独部署在物理机中的部分,用于冻结旧版虚拟交换机的业务转发工作;同时存在部署在旧版虚拟交换机中的部分,用于将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内。上述部署在物理机以及虚拟交换机中的多个单元共同组成虚拟机信息迁移模块403。It is worth mentioning that the modules mentioned above can be divided into multiple parts or units that are deployed independently or deployed in an old-version virtual switch to implement the same function. For example, the virtual machine information migration module 403 may have a part deployed separately in the physical machine, which is used to freeze the service forwarding work of the old-version virtual switch; The information is migrated to the new version of the virtual switch. The above multiple units deployed in the physical machine and the virtual switch together form the virtual machine information migration module 403 .
在一个例子中,网卡迁移模块402还可以用于在创建并初始化新版虚拟交换机之后,且在冻结旧版虚拟交换机的业务转发工作之前,将旧版虚拟交换机内网卡聚合组中的部分成员网卡迁移到新版虚拟交换机内;其中,预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡是指部分成员网卡;网卡迁移模块402还可以用于在基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行之后,将旧版虚拟交换机内网卡聚合组中除部分成员网卡外的其他成员网卡迁移到新版虚拟交换机内,且与部分成员网卡归属于新版虚拟交换机内的同一网卡聚合组。In an example, the network card migration module 402 can also be used to migrate some member network cards in the network card aggregation group in the old version of the virtual switch to the new version after creating and initializing the new version of the virtual switch and before freezing the service forwarding work of the old version of the virtual switch In the virtual switch; wherein, the network cards that are migrated from the old version of the virtual switch to the new version of the virtual switch in advance refer to some member network cards; the network card migration module 402 can also be used to transfer information based on the virtual machine in the new version of the virtual switch and pre-migrate from the old version of the virtual switch After the switch is migrated to the NICs in the new version of the virtual switch, and the service forwarding work is switched to the new version of the virtual switch, the other member NICs in the NIC aggregation group in the old version of the virtual switch are migrated to the new version of the virtual switch. Some member NICs belong to the same NIC aggregation group in the new version of the virtual switch.
在一个例子中,网卡迁移模块402还可以用于将旧版虚拟交换机内网卡聚合组中的部分成员网卡释放,并将被旧版虚拟交换机释放的部分成员网卡添加到新版虚拟交换机内;将添加到新版虚拟交换机内的部分成员网卡与上联交换机端口建立连接,并将部分成员网卡和上联交换机端口设定为锁定状态;在本例中切换模块404还可以用于将部分成员网卡和上联交换机端口的锁定状态解除。In an example, the network card migration module 402 can also be used to release some member network cards in the network card aggregation group in the old version virtual switch, and add some member network cards released by the old version virtual switch to the new version virtual switch; Some member network cards in the virtual switch are connected to the ports of the uplink switch, and some member network cards and the ports of the uplink switch are set to a locked state; in this example, the switching module 404 can also be used to connect some member network cards to the uplink switch The locked state of the port is released.
在一个例子中,切换模块404,还可以用于根据虚拟机信息恢复虚拟机通信;其中,虚拟机通信的恢复包括虚拟机的报文收发队列的重建以及新版虚拟交换机与虚拟机之间的链路重连;其中,部分成员网卡和上联交换机端口的锁定状态被解除后且虚拟机通信被恢复后,新版虚拟交换机执行业务转发工作。In one example, the switching module 404 can also be used to restore the virtual machine communication according to the information of the virtual machine; wherein, the restoration of the virtual machine communication includes rebuilding the message sending and receiving queue of the virtual machine and the link between the new version of the virtual switch and the virtual machine. Route reconnection; Among them, after the locking status of some member NICs and uplink switch ports is released and the virtual machine communication is restored, the new version of the virtual switch performs service forwarding.
在一个例子中,网卡迁移模块402还可以用于将添加到新版虚拟交换机内的部分成员网卡的识别标识指定为:与部分成员网卡在旧版虚拟交换机中的识别标识相同;基于指定的识别标识,将新版虚拟交换机内的部分成员网卡与上联交换机端口建立连接。In an example, the network card migration module 402 can also be used to specify the identification of some member network cards added to the new version of the virtual switch as: the same as the identification of some member network cards in the old version of the virtual switch; based on the specified identification, Connect some member NICs in the new version of the virtual switch to the ports of the uplink switch.
在一个例子中,网卡迁移模块402还可以用于将旧版虚拟交换机内网卡聚合组中的一个成员网卡迁移到新版虚拟交换机内。In an example, the network card migration module 402 may also be used to migrate a member network card in the network card aggregation group in the old version virtual switch to the new version virtual switch.
在另一个例子中,网卡迁移模块402还可以用于在冻结旧版虚拟交换机的业务转发工作之后,且在基于迁移到新版虚拟交换机内的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行之前,将旧版虚拟交换机内的网卡迁移到新版虚拟交换机内。In another example, the network card migration module 402 can also be used to freeze the service forwarding work of the old version of the virtual switch, and based on the virtual machine information migrated to the new version of the virtual switch and migrate from the old version of the virtual switch to the new version of the virtual switch in advance Before switching the service forwarding work to the new version of the virtual switch, the network card in the old version of the virtual switch is migrated to the new version of the virtual switch.
在另一个例子中,虚拟机信息迁移模块403还可以用于在冻结旧版虚拟交换机的业务转发工作后,旧版虚拟交换机将旧版虚拟交换机内的虚拟机信息写入预设的共享内存,新版虚拟交换机从共享内存读取虚拟机信息。In another example, the virtual machine information migration module 403 can also be used to write the virtual machine information in the old version virtual switch into the preset shared memory after freezing the service forwarding work of the old version virtual switch, and the new version virtual switch Read virtual machine information from shared memory.
在另一个例子中,部署模块401还可以用于在旧版虚拟交换机执行业务转发工作的过程中,响应于虚拟交换机升级指令,创建并初始化新版虚拟交换机。In another example, the deploying module 401 may also be configured to create and initialize a new version of the virtual switch in response to a virtual switch upgrade instruction during the process of performing service forwarding by the old version of the virtual switch.
本实施方式提供的虚拟交换机升级设备能够在旧版虚拟交换机执行业务转发工作的过程中,无需中断业务即可创建并初始化新版虚拟交换机。进而冻结旧版虚拟交换机的业务转发工作,并将旧版虚拟交换机内的虚拟机信息迁移到新版虚拟交换机内。其中,虚拟机信息包括与旧版虚拟交换机连接的虚拟机用于网络通信的信息,能够使得新版虚拟交换机获取到网络通信所需信息。进而基于迁移的虚拟机信息以及预先从旧版虚拟交换机迁移到新版虚拟交换机内的网卡,将业务转发工作切换到新版虚拟交换机内执行。相比于在虚拟交换机的整个升级过程中停止转发的升级方法,能够大大缩短业务暂停的时间,尽可能的实现业务不中断。The virtual switch upgrade device provided in this embodiment can create and initialize a new version of the virtual switch without interrupting services during the process of performing service forwarding by the old version of the virtual switch. Then freeze the service forwarding work of the old version of the virtual switch, and migrate the virtual machine information in the old version of the virtual switch to the new version of the virtual switch. Wherein, the virtual machine information includes the information used for network communication by the virtual machine connected to the old version of the virtual switch, so that the new version of the virtual switch can obtain information required for network communication. Then, based on the migrated virtual machine information and the network card migrated from the old-version virtual switch to the new-version virtual switch in advance, the service forwarding work is switched to the new-version virtual switch for execution. Compared with the upgrade method of stopping forwarding during the whole upgrade process of the virtual switch, the service suspension time can be greatly shortened, and the service is not interrupted as much as possible.
值得一提的是,本申请上述实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本申请的创新部分,本实施方式中并没有将与解决本申请所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that all the modules involved in the above embodiments of the present application are logical modules. In practical applications, a logical unit can be a physical unit, or a part of a physical unit, and can also Combination of physical units. In addition, in order to highlight the innovative part of the present application, units that are not closely related to solving the technical problems proposed in the present application are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.
本申请的实施方式还提供一种虚拟交换机升级设备,如图5所示,包括至少一个处理器501;以及,与至少一个处理器501通信连接的存储器502;其中,至少一处理器501用于运行虚拟机、与虚拟机连接的旧版虚拟交换机;存储器502存储有可被至少一个处理器501执行的指令,指令被至少一个处理器501执行,以使至少一个处理器501能够执行上述虚拟交换机升级方法。The embodiment of the present application also provides a virtual switch upgrading device, as shown in FIG. 5 , including at least one processor 501; An old version virtual switch that runs a virtual machine and is connected to the virtual machine; the memory 502 stores instructions that can be executed by at least one processor 501, and the instructions are executed by at least one processor 501, so that at least one processor 501 can perform the above-mentioned virtual switch upgrade method.
其中,存储器502和处理器501采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器501和存储器502的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器501处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器501。Wherein, the memory 502 and the processor 501 are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors 501 and various circuits of the memory 502 together. The bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein. The bus interface provides an interface between the bus and the transceivers. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium. The data processed by the processor 501 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor 501 .
处理器501负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器502可以被用于存储处理器501在执行操 作时所使用的数据。上一实施方式中涉及的虚拟交换机升级设备也可以部署在本实施方式涉及的电子设备中。 Processor 501 is responsible for managing the bus and general processing, and may also provide various functions including timing, peripheral interface, voltage regulation, power management and other control functions. Instead, the memory 502 may be used to store data used by the processor 501 when performing operations. The virtual switch upgrade device involved in the previous implementation manner may also be deployed in the electronic device involved in this implementation manner.
上述产品可执行本申请实施方式所提供的方法,具备执行方法相应的功能模块和有益效果,未在本实施方式中详尽描述的技术细节,可参见本申请实施方式所提供的方法。The above-mentioned products can execute the methods provided in the embodiments of this application, and have the corresponding functional modules and beneficial effects for executing the methods. For technical details not described in detail in this embodiment, please refer to the methods provided in the embodiments of this application.
本申请的实施方式还提供一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述的虚拟交换机升级方法。前述实施方式中涉及的虚拟交换机升级设备也可以部署在本实施方式涉及的计算机可读存储介质中。Embodiments of the present application also provide a computer-readable storage medium storing a computer program. When the computer program is executed by the processor, the above virtual switch upgrading method is implemented. The virtual switch upgrade device involved in the foregoing implementation manners may also be deployed in the computer-readable storage medium involved in this implementation manner.
本领域技术人员可以理解,实现上述实施方式方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those skilled in the art can understand that all or part of the steps in the method of the above-mentioned embodiments can be completed by instructing related hardware through a program, the program is stored in a storage medium, and includes several instructions to make a device (which can be A single chip microcomputer, a chip, etc.) or a processor (processor) executes all or part of the steps of the methods in various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .
上述实施方式是提供给本领域普通技术人员来实现和使用本申请的,本领域普通技术人员可以在不脱离本申请的发明思想的情况下,对上述实施方式做出种种修改或变化,因而本申请的保护范围并不被上述实施方式所限,而应该符合权利要求书所提到的创新性特征的最大范围。The above-mentioned embodiments are provided for those of ordinary skill in the art to implement and use this application. Those of ordinary skill in the art can make various modifications or changes to the above-mentioned embodiments without departing from the inventive idea of this application. Therefore, this The protection scope of the application is not limited by the above-mentioned embodiments, but should conform to the maximum scope of the innovative features mentioned in the claims.

Claims (12)

  1. 一种虚拟交换机升级方法,包括:A method for upgrading a virtual switch, comprising:
    在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机;Create and initialize the new version of the virtual switch while the old version of the virtual switch is performing service forwarding work;
    冻结所述旧版虚拟交换机的业务转发工作,并将所述旧版虚拟交换机内的虚拟机信息迁移到所述新版虚拟交换机内;其中,所述虚拟机信息包括与所述旧版虚拟交换机连接的虚拟机用于网络通信的信息;freezing the service forwarding work of the old-version virtual switch, and migrating the virtual machine information in the old-version virtual switch to the new-version virtual switch; wherein, the virtual machine information includes a virtual machine connected to the old-version virtual switch Information used for network communications;
    基于迁移到所述新版虚拟交换机内的所述虚拟机信息以及预先从所述旧版虚拟交换机迁移到所述新版虚拟交换机内的网卡,将所述业务转发工作切换到所述新版虚拟交换机内执行。Based on the virtual machine information migrated to the new version virtual switch and the network card previously migrated from the old version virtual switch to the new version virtual switch, the service forwarding work is switched to the new version virtual switch for execution.
  2. 根据权利要求1所述的虚拟交换机升级方法,其中,在所述创建并初始化新版虚拟交换机之后,且在所述冻结所述旧版虚拟交换机的业务转发工作之前,还包括:The method for upgrading a virtual switch according to claim 1, wherein, after creating and initializing the new version of the virtual switch and before freezing the service forwarding work of the old version of the virtual switch, further comprising:
    将所述旧版虚拟交换机内网卡聚合组中的部分成员网卡迁移到所述新版虚拟交换机内;其中,所述预先从所述旧版虚拟交换机迁移到所述新版虚拟交换机内的网卡是指所述部分成员网卡;Migrate some member network cards in the NIC aggregation group in the old-version virtual switch to the new-version virtual switch; wherein, the network cards migrated from the old-version virtual switch to the new-version virtual switch in advance refer to the part member network card;
    所述基于迁移到所述新版虚拟交换机内的所述虚拟机信息以及预先从所述旧版虚拟交换机迁移到所述新版虚拟交换机内的网卡,将所述业务转发工作切换到所述新版虚拟交换机内执行之后,还包括:Switching the service forwarding work to the new version of the virtual switch based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance After execution, also include:
    将所述旧版虚拟交换机内所述网卡聚合组中除所述部分成员网卡外的其他成员网卡迁移到所述新版虚拟交换机内,且与所述部分成员网卡归属于所述新版虚拟交换机内的同一网卡聚合组。Migrate other member network cards in the network card aggregation group in the old version of the virtual switch except for the part of the member network cards to the new version of the virtual switch, and belong to the same member network card as the part of the member network cards in the new version of the virtual switch NIC aggregation group.
  3. 根据权利要求2所述的虚拟交换机升级方法,其中,所述将所述旧版虚拟交换机内网卡聚合组中的部分成员网卡迁移到所述新版虚拟交换机内,包括:The method for upgrading a virtual switch according to claim 2, wherein said migrating some member network cards in the network card aggregation group in the old version virtual switch to the new version virtual switch includes:
    将所述旧版虚拟交换机内网卡聚合组中的部分成员网卡释放,并将被所述旧版虚拟交换机释放的所述部分成员网卡添加到所述新版虚拟交换机内;releasing some of the member network cards in the network card aggregation group in the old version of the virtual switch, and adding the part of the member network cards released by the old version of the virtual switch to the new version of the virtual switch;
    将添加到所述新版虚拟交换机内的所述部分成员网卡与上联交换机端口建立连接,并将所述部分成员网卡和所述上联交换机端口设定为锁定状态;Establishing a connection between the part of the member network cards added to the new version of the virtual switch and the port of the uplink switch, and setting the part of the member network cards and the port of the uplink switch to a locked state;
    所述基于迁移到所述新版虚拟交换机内的所述虚拟机信息以及预先从所述旧版虚拟交换机迁移到所述新版虚拟交换机内的网卡,将所述业务转发工作切换到所述新版虚拟交换机内执行的步骤中,包括:将所述部分成员网卡和所述上联交换机端口的锁定状态解除。Switching the service forwarding work to the new version of the virtual switch based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance The executed steps include: releasing the locked state of the part of the member network cards and the port of the uplink switch.
  4. 根据权利要求3所述的虚拟交换机升级方法,其中,所述基于迁移到所述新版虚拟交换机内的所述虚拟机信息以及预先从所述旧版虚拟交换机迁移到所述新版虚拟交换机内的网卡,将所述业务转发工作切换到所述新版虚拟交换机内执行的步骤中,还包括:The method for upgrading a virtual switch according to claim 3, wherein, based on the virtual machine information migrated to the new version of the virtual switch and the network card migrated from the old version of the virtual switch to the new version of the virtual switch in advance, The step of switching the service forwarding work to the new version of the virtual switch also includes:
    根据所述虚拟机信息恢复虚拟机通信;其中,所述虚拟机通信的恢复包括所述虚拟机的报文收发队列的重建以及所述新版虚拟交换机与所述虚拟机之间的链路重连;Restoring the virtual machine communication according to the virtual machine information; wherein, the restoration of the virtual machine communication includes rebuilding the message sending and receiving queue of the virtual machine and reconnecting the link between the new version of the virtual switch and the virtual machine ;
    其中,所述部分成员网卡和所述上联交换机端口的锁定状态被解除后且所述虚拟机通信被恢复后,所述新版虚拟交换机执行所述业务转发工作。Wherein, after the locking states of the part of the member network cards and the ports of the uplink switch are released and the communication of the virtual machine is restored, the new version of the virtual switch performs the service forwarding work.
  5. 根据权利要求3所述的虚拟交换机升级方法,其中,所述将添加到所述新版虚拟交换机内的所述部分成员网卡与上联交换机端口建立连接,包括:The method for upgrading a virtual switch according to claim 3, wherein said establishing a connection between said part of the member network cards added to said new version of the virtual switch and an uplink switch port includes:
    将添加到所述新版虚拟交换机内的所述部分成员网卡的识别标识指定为:与所述部分成员网卡在所述旧版虚拟交换机中的识别标识相同;Specifying the identification marks of the part of the member network cards added to the new version of the virtual switch to be: the same as the identification marks of the part of the member network cards in the old version of the virtual switch;
    基于指定的所述识别标识,将所述新版虚拟交换机内的所述部分成员网卡与上联交换机端口建立连接。Based on the designated identification mark, the part of the member network cards in the new version of the virtual switch is connected to the port of the uplink switch.
  6. 根据权利要求2所述的虚拟交换机升级方法,其中,所述将所述旧版虚拟交换机内网卡聚合组中的部分成员网卡迁移到所述新版虚拟交换机内,包括:The method for upgrading a virtual switch according to claim 2, wherein said migrating some member network cards in the network card aggregation group in the old version virtual switch to the new version virtual switch includes:
    将所述旧版虚拟交换机内网卡聚合组中的一个成员网卡迁移到所述新版虚拟交换机内。Migrating a member network card in the network card aggregation group in the old version virtual switch to the new version virtual switch.
  7. 根据权利要求1所述的虚拟交换机升级方法,其中,在所述冻结所述旧版虚拟交换机的业务转发工作之后,且在所述基于迁移到所述新版虚拟交换机内的所述虚拟机信息以及预先从所述旧版虚拟交换机迁移到所述新版虚拟交换机内的网卡,将所述业务转发工作切换到所述新版虚拟交换机内执行之前,还包括:The method for upgrading a virtual switch according to claim 1, wherein after the freezing of the service forwarding work of the old version virtual switch, and after the virtual machine information migrated to the new version virtual switch and in advance Before migrating from the old version of the virtual switch to the network card in the new version of the virtual switch, before switching the business forwarding work to the new version of the virtual switch, it also includes:
    将所述旧版虚拟交换机内的网卡迁移到所述新版虚拟交换机内。Migrate the network card in the virtual switch of the old version to the virtual switch of the new version.
  8. 根据权利要求1所述的虚拟交换机升级方法,其中,所述冻结所述旧版虚拟交换机的业务转发工作,并将所述旧版虚拟交换机内的虚拟机信息迁移到所述新版虚拟交换机内,包括:The method for upgrading a virtual switch according to claim 1, wherein freezing the service forwarding work of the old version virtual switch and migrating the virtual machine information in the old version virtual switch to the new version virtual switch includes:
    冻结所述旧版虚拟交换机的业务转发工作后,所述旧版虚拟交换机将所述旧版虚拟交换机内的虚拟机信息写入预设的共享内存,所述新版虚拟交换机从所述共享内存读取所述虚拟机信息。After freezing the service forwarding work of the old-version virtual switch, the old-version virtual switch writes the virtual machine information in the old-version virtual switch into a preset shared memory, and the new-version virtual switch reads the Virtual machine information.
  9. 根据权利要求1所述的虚拟交换机升级方法,其中,所述在旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机,具体为:The method for upgrading a virtual switch according to claim 1, wherein said creating and initializing a new version of the virtual switch in the process of performing service forwarding work by the old version of the virtual switch is specifically:
    在旧版虚拟交换机执行业务转发工作的过程中,响应于虚拟交换机升级指令,创建并初始化新版虚拟交换机。In the process of performing service forwarding by the old-version virtual switch, a new-version virtual switch is created and initialized in response to a virtual switch upgrade instruction.
  10. 一种虚拟交换机升级设备,其中,所述虚拟交换机升级设备部署在物理机上,所述物理机上还部署有虚拟机、与所述虚拟机连接的旧版虚拟交换机;所述虚拟交换机升级设备包括:A virtual switch upgrade device, wherein the virtual switch upgrade device is deployed on a physical machine, and a virtual machine and an old version virtual switch connected to the virtual machine are also deployed on the physical machine; the virtual switch upgrade device includes:
    部署模块,设置为在所述旧版虚拟交换机执行业务转发工作的过程中,创建并初始化新版虚拟交换机;The deployment module is configured to create and initialize a new version of the virtual switch during the process of performing service forwarding by the old version of the virtual switch;
    网卡迁移模块,设置为将所述旧版虚拟交换机中的网卡迁移到所述新版虚拟交换机内;A network card migration module configured to migrate the network card in the old version of the virtual switch to the new version of the virtual switch;
    虚拟机信息迁移模块,设置为在所述新版虚拟交换机初始化完成后,冻结所述旧版虚拟交换机的业务转发工作,并将所述旧版虚拟交换机内的虚拟机信息迁移到所述新版虚拟交换机内;The virtual machine information migration module is configured to freeze the service forwarding work of the old version virtual switch after the initialization of the new version virtual switch is completed, and migrate the virtual machine information in the old version virtual switch to the new version virtual switch;
    切换模块,设置为基于迁移到所述新版虚拟交换机内的所述虚拟机信息以及预先从所述 旧版虚拟交换机迁移到所述新版虚拟交换机内的网卡,将所述业务转发工作切换到所述新版虚拟交换机内执行。A switching module, configured to switch the service forwarding work to the new version based on the virtual machine information migrated to the new version virtual switch and the network card migrated from the old version virtual switch to the new version virtual switch in advance Execute within the virtual switch.
  11. 一种电子设备,包括:An electronic device comprising:
    至少一处理器;以及at least one processor; and
    与所述至少一处理器通信连接的存储器;a memory communicatively coupled to the at least one processor;
    其中,所述至少一处理器用于运行虚拟机、与所述虚拟机连接的旧版虚拟交换机;所述存储器存储有可被所述至少一处理器执行的指令,所述指令被所述至少一处理器执行,以使所述至少一处理器能够执行如权利要求1至9中任一项所述的方法。Wherein, the at least one processor is used to run a virtual machine and a legacy virtual switch connected to the virtual machine; the memory stores instructions executable by the at least one processor, and the instructions are processed by the at least one executed by a processor, so that the at least one processor can execute the method according to any one of claims 1-9.
  12. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至9中任一项所述的方法。A computer-readable storage medium storing a computer program, wherein the computer program implements the method according to any one of claims 1 to 9 when executed by a processor.
PCT/CN2022/132687 2021-12-07 2022-11-17 Virtual switch upgrading method and device, electronic device and storage medium WO2023103741A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111486398.0A CN116319310A (en) 2021-12-07 2021-12-07 Virtual switch upgrading method, equipment, electronic equipment and storage medium
CN202111486398.0 2021-12-07

Publications (1)

Publication Number Publication Date
WO2023103741A1 true WO2023103741A1 (en) 2023-06-15

Family

ID=86729593

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/132687 WO2023103741A1 (en) 2021-12-07 2022-11-17 Virtual switch upgrading method and device, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN116319310A (en)
WO (1) WO2023103741A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103516802A (en) * 2013-09-30 2014-01-15 中国科学院计算技术研究所 Method and device for achieving seamless transference of across heterogeneous virtual switch
CN104780071A (en) * 2015-04-21 2015-07-15 杭州华三通信技术有限公司 Method and device for upgrading virtual switch
CN106293846A (en) * 2016-08-16 2017-01-04 腾讯科技(深圳)有限公司 The upgrade method of analog processor and device
CN109861839A (en) * 2017-11-30 2019-06-07 华为技术有限公司 The unbroken virtual switch upgrade method of business and relevant device
WO2020114292A1 (en) * 2018-12-07 2020-06-11 北京金山云网络技术有限公司 Virtual switch handover method and apparatus, and host machine and storage medium
US20210135985A1 (en) * 2018-07-10 2021-05-06 Telefonaktiebolaget Lm Ericsson (Publ) Mechanism for Hitless Resynchronization During SDN Controller Upgrades Between Incompatible Versions

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103516802A (en) * 2013-09-30 2014-01-15 中国科学院计算技术研究所 Method and device for achieving seamless transference of across heterogeneous virtual switch
CN104780071A (en) * 2015-04-21 2015-07-15 杭州华三通信技术有限公司 Method and device for upgrading virtual switch
CN106293846A (en) * 2016-08-16 2017-01-04 腾讯科技(深圳)有限公司 The upgrade method of analog processor and device
CN109861839A (en) * 2017-11-30 2019-06-07 华为技术有限公司 The unbroken virtual switch upgrade method of business and relevant device
US20210135985A1 (en) * 2018-07-10 2021-05-06 Telefonaktiebolaget Lm Ericsson (Publ) Mechanism for Hitless Resynchronization During SDN Controller Upgrades Between Incompatible Versions
WO2020114292A1 (en) * 2018-12-07 2020-06-11 北京金山云网络技术有限公司 Virtual switch handover method and apparatus, and host machine and storage medium

Also Published As

Publication number Publication date
CN116319310A (en) 2023-06-23

Similar Documents

Publication Publication Date Title
US9391877B2 (en) System and method for reducing information loss in an aggregated information handling system
US9378005B2 (en) Hitless software upgrades
US10671423B2 (en) Hot-plug hardware and software implementation
US9872205B2 (en) Method and system for sideband communication architecture for supporting manageability over wireless LAN (WLAN)
CN109861839B (en) Method for upgrading virtual switch without service interruption and related equipment
US10785317B2 (en) Keep-alive technique in a network device
US20110231833A1 (en) Upgrading system software in a chassis without traffic loss
EP3373518B1 (en) Service configuration method and device for network service
CN104935672A (en) High available realizing method and equipment of load balancing service
US11474880B2 (en) Network state synchronization for workload migrations in edge devices
WO2021093654A1 (en) Daughter card initialization method, electronic apparatus, and storage medium
US11924024B2 (en) Switching method and apparatus, device, and storage medium
WO2017125016A1 (en) Method, apparatus and system for modifying configuration information of virtual network card
WO2018161794A1 (en) Apparatus upgrade method and access apparatus
CN113472624A (en) Method for realizing virtual network data packet forwarding based on vDPA and application
CN105763442B (en) The unbroken PON system of masterslave switchover LACP aggregated links and method
US11804985B2 (en) Packet transmission method, apparatus, and system, and storage medium
WO2023103741A1 (en) Virtual switch upgrading method and device, electronic device and storage medium
CN110795209B (en) Control method and device
US11811900B2 (en) Packet processing method and first network device
CN110086657B (en) Configuration synchronization method and device
WO2016197798A1 (en) Method, virtual machine and standby machine for realizing configuration synchronization
CN111865834B (en) Message processing method and device
CN116455746A (en) Method for upgrading with flow of virtual switch in DPU
CN117675583A (en) Communication method, communication device and communication system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22903164

Country of ref document: EP

Kind code of ref document: A1