CN114710408A - Method and device for realizing hot upgrade of virtual switch - Google Patents

Method and device for realizing hot upgrade of virtual switch Download PDF

Info

Publication number
CN114710408A
CN114710408A CN202210273026.8A CN202210273026A CN114710408A CN 114710408 A CN114710408 A CN 114710408A CN 202210273026 A CN202210273026 A CN 202210273026A CN 114710408 A CN114710408 A CN 114710408A
Authority
CN
China
Prior art keywords
virtual switch
virtual
network card
switch
version
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210273026.8A
Other languages
Chinese (zh)
Other versions
CN114710408B (en
Inventor
高海峰
胡宝海
陈子康
祝顺民
李星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Cloud Computing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Cloud Computing Ltd filed Critical Alibaba Cloud Computing Ltd
Priority to CN202210273026.8A priority Critical patent/CN114710408B/en
Priority claimed from CN202210273026.8A external-priority patent/CN114710408B/en
Publication of CN114710408A publication Critical patent/CN114710408A/en
Application granted granted Critical
Publication of CN114710408B publication Critical patent/CN114710408B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • 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
    • 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/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • 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/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0859Retrieval of network configuration; Tracking network configuration history by keeping history of different configuration generations or by rolling back to previous configuration versions

Landscapes

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

Abstract

The present specification provides a method and an apparatus for implementing hot upgrade of a virtual switch. The method comprises the following steps: deploying a corresponding new-version virtual switch aiming at the old-version virtual switch, and loading configuration information to be upgraded by the new-version virtual switch; the old version virtual switch is respectively connected with a physical network card and at least one virtual machine and is used for realizing flow forwarding between the physical network card and the at least one virtual machine; establishing a flow channel between the old version virtual switch and the new version virtual switch, so that the new version virtual switch realizes flow interaction with the physical network card through the old version virtual switch; and controlling the disconnection between the at least one virtual machine and the old version virtual switch, and establishing connection between the at least one virtual machine and the updated new version virtual switch.

Description

Method and device for realizing hot upgrade of virtual switch
Technical Field
One or more embodiments of the present disclosure relate to the field of internet technologies, and in particular, to a method and an apparatus for implementing hot upgrade of a virtual switch.
Background
With the continuous development of information technology, the virtual network gradually presents great development potential. The simplification of the entity server drives the virtualization of the machine room network in succession, network equipment such as a physical switch and the like which are originally visible anywhere in the machine room are also integrated to the virtual platform, components such as the virtual switch and the like are formed through a software simulation mode, and then network service is provided for the virtual machine. The virtual switch is essentially a switch which is logically integrated and physically connected through software, but when a new version of the virtual switch is released or bugs of the existing version of the virtual switch are repaired, the virtual switch needs to be updated.
In the related art, the virtual switch hot upgrade may be implemented in a dual process manner. The double-process mode is that an independent new-version virtual switch process is additionally created on the basis of the old-version virtual switch process, at the moment, a physical network card connected with the old-version virtual switch copies flow and simultaneously sends the flow to the new-version virtual switch process and the old-version virtual switch process, after the required setting is completed, the old-version virtual switch process is ended, the new-version virtual switch process provides corresponding service, and therefore the virtual switch hot upgrade without service interruption is achieved.
However, this dual-process hot upgrade method for copying the traffic of the physical network card requires that the physical network card has the capability of copying the traffic, and when the physical network card has hardware limitation but does not have the capability of copying the traffic, the above-mentioned virtual switch hot upgrade without service interruption cannot be realized.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a method and an apparatus for implementing a hot upgrade of a virtual switch.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, there is provided a method for implementing a virtual switch hot upgrade, the method comprising:
deploying a corresponding new-version virtual switch aiming at the old-version virtual switch, and loading configuration information to be upgraded by the new-version virtual switch; the old version virtual switch is respectively connected with a physical network card and at least one virtual machine and is used for realizing flow forwarding between the physical network card and the at least one virtual machine;
establishing a flow channel between the old version virtual switch and the new version virtual switch, so that the new version virtual switch realizes flow interaction with the physical network card through the old version virtual switch;
and controlling the disconnection between the at least one virtual machine and the old version virtual switch, and establishing connection between the at least one virtual machine and the updated new version virtual switch.
According to a second aspect of one or more embodiments of the present specification, there is provided an apparatus for implementing a virtual switch hot-upgrade, the apparatus comprising:
the deployment unit is used for deploying the corresponding new version virtual switch aiming at the old version virtual switch and loading the configuration information to be upgraded by the new version virtual switch; the old version virtual switch is respectively connected with a physical network card and at least one virtual machine and is used for realizing flow forwarding between the physical network card and the at least one virtual machine;
the establishing unit is used for establishing a flow channel between the old version virtual switch and the new version virtual switch so as to enable the new version virtual switch to realize flow interaction with the physical network card through the old version virtual switch;
and the control unit is used for controlling the disconnection between the at least one virtual machine and the old version virtual switch and establishing connection between the at least one virtual machine and the updated new version virtual switch.
According to a third aspect of one or more embodiments of the present description, a computer-readable storage medium is proposed, on which a computer program is stored, which program, when being executed by a processor, carries out the steps of the method of the first aspect.
According to a fourth aspect of one or more embodiments of the present description, an electronic device is proposed, which comprises a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of the first aspect when executing the program.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic architecture diagram of a virtual switch hot upgrade system according to an exemplary embodiment of the present specification;
FIG. 2 is a flow chart of a method for implementing a virtual switch hot upgrade as provided by an exemplary embodiment of the present description;
FIG. 3 is a schematic diagram of a hot upgrade to a virtual switch provided by an exemplary embodiment of the present description;
FIG. 4 is a schematic block diagram of an electronic device provided in an exemplary embodiment of the present description;
fig. 5 is a block diagram of an apparatus for implementing a hot upgrade of a virtual switch according to an exemplary embodiment of the present specification.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Fig. 1 is a schematic architecture diagram of a virtual switch hot upgrade system according to an exemplary embodiment of the present specification. As shown in fig. 1, the system architecture may include a control end 10 and a service end 11.
The control end 10 may be deployed in a physical server including an independent host, or the control end 10 may be deployed in a virtual server (e.g., a cloud server) carried by a host cluster, which is not limited in this specification. The control terminal 10 may be configured with the control logic for implementing the hot upgrade of the virtual switch described in this specification, so that the virtual switch 15 can implement the hot upgrade without the physical network card 16 having the capability of copying the flow, and service interruption of the virtual switch 15 in the upgrade process is avoided.
The server 11 may be a physical server comprising an independent host, or the server 11 may be a cluster of hosts. Although the control end 10 and the service end 11 are independent from each other in the embodiment shown in fig. 1, in some embodiments, the control end 10 may also be disposed at the service end 11, which is not limited in this specification. The physical network card 16 is configured on the server 11, and the server 11 can logically integrate at least one virtual machine (such as the virtual machine 12, the virtual machine 13, the virtual machine 14, and the like) and the virtual switch 15 by virtualizing processing resources. Further, the virtual switch 15 may be configured with two virtual interfaces: the virtual switch 15 logically establishes connection with the virtual machines 12 to 14 and the physical network card 16 through the virtual interfaces, so that the virtual switch 15 can forward the flows on the virtual machines 12 to 14 through the physical network card 16 based on the connection, and also can forward the flows of the physical network card 16 to the corresponding virtual machine 12 based on the connection, and meanwhile, interconnection and intercommunication among a plurality of virtual machines such as the virtual machine 12, the virtual machine 13 and the virtual machine 14 can also be realized through the virtual switch 15.
The present specification can implement a dual-process hot upgrade for the virtual switch 15 in the system architecture, and the hot upgrade can be smoothly completed no matter whether the physical network card 16 has a capacity of copying traffic, so that the hot upgrade of the virtual switch 15 gets rid of the hardware limitation of the physical network card 16.
Fig. 2 is a flowchart of a method for implementing a virtual switch hot upgrade provided by an exemplary embodiment, the method including the steps of:
step 201, deploying a corresponding new version virtual switch aiming at an old version virtual switch, and loading configuration information to be upgraded by the new version virtual switch; the old version virtual switch is respectively connected with a physical network card and at least one virtual machine and used for realizing flow forwarding between the physical network card and the at least one virtual machine.
In this specification, a virtual switch may refer to a virtual switch process in which a server virtualizes processing resources, thereby logically integrating the processing resources. The old version of the virtual switch may refer to a virtual switch process existing before the virtual switch starts to perform a hot upgrade, and correspondingly, the new version of the virtual switch may refer to another virtual switch process that replaces the old version of the virtual switch process when the virtual switch starts to perform the hot upgrade. In other words, the new version virtual switch and the old version virtual switch described in this specification are used to represent the context of the virtual switch during the hot upgrade, not the specific version. The hot upgrade of the virtual switch can be triggered according to the function requirement, namely the current version of the virtual switch cannot meet the function requirement, and the hot upgrade of the current version of the virtual switch is needed, so that the function expansion is realized. Certainly, the hot upgrade of the virtual switch can also be upgraded due to the version bug, and at this time, the hot upgrade of the virtual switch can be realized by two methods, namely, pushing out the new version virtual switch after the bug is repaired. And II, version rollback. It is understood that when the method is adopted, the new-version virtual switch is the virtual switch after the bug is repaired, and the old-version virtual switch is the virtual switch with the bug still existing. When the second method is adopted, namely when the version is returned, the new version virtual switch refers to the virtual switch of which the previous version has no bug, and correspondingly, the old version virtual switch refers to the virtual switch of which the current version still has the bug.
It should be noted that the new version virtual switch process and the old version virtual switch process are different processes independent from each other, and how to implement deployment of the new version virtual switch may refer to relevant contents in the related art, which is not described herein again.
For example, in the embodiment shown in fig. 1, the virtual switch 15 may be an old version virtual switch, the virtual machines 12 to 14 may be virtual machines connected to the old version virtual switch, the physical network card 16 may be a physical network card connected to the old version virtual switch, and the virtual switch 15 is configured to implement traffic forwarding between the physical network card 16 and the virtual machine 12, for example, traffic generated by the virtual machines 12 to 14 is forwarded outward through the physical network card 16, and traffic received by the physical network card 16 may also be forwarded to the virtual machines 12 to 14. For another example, the virtual machines 12 to 14 are configured with corresponding virtual network cards, and at this time, the connection between the old version virtual switch and at least one virtual machine may be regarded as the connection between the old version virtual switch 15 and the corresponding virtual network card configured by the virtual machines 12 to 14, so that the old version virtual switch may implement traffic forwarding according to the virtual network cards configured by the virtual machines 12 to 14.
In an embodiment, the new version virtual switch loads configuration information to be upgraded, where the configuration information to be upgraded may be configuration information that is added and/or deleted correspondingly according to a functional requirement, and may also be corresponding configuration information that is required when a bug existing in the old version virtual switch is repaired. It is understood that, when the virtual switch is upgraded to the version rollback in a hot manner, the configuration information to be upgraded at this time may be the configuration information corresponding to the previous version. In other words, the configuration information to be upgraded described in this specification can be flexibly adapted according to actual needs.
Step 202, a traffic channel is established between the old version virtual switch and the new version virtual switch, so that the new version virtual switch realizes traffic interaction with the physical network card through the old version virtual switch.
Through the traffic channel, the old version virtual switch can implement traffic forwarding between the new version virtual switch and the physical network card, for example, forwarding the traffic sent by the physical network card to the old version virtual switch to the new version virtual switch, and forwarding the traffic generated by the new version virtual switch to the physical network card. Then, since the physical network card only needs to normally forward the traffic to the old version virtual switch and forward the traffic to the new version virtual machine switch, the physical network card does not need to have the capacity of copying the traffic on hardware, and the new version virtual switch can be ensured to obtain the traffic sent by the physical network card, so that the hot upgrade of the virtual switch can be independent of the hardware capacity of the physical network card.
In an embodiment, the control end may configure a first virtual network card on the old version of the virtual switch, and configure a second virtual network card on the new version of the virtual switch, so that a virtual network card pair is formed between the first virtual network card and the second virtual network card, and the traffic channel is further formed. The flow channel described in this specification can implement flow sharing between the new and old version virtual switches, and does not need a physical network card to copy the flow and send it to the new version virtual switch, thereby avoiding that the hot upgrade of the virtual switch cannot be implemented due to hardware limitation. It should be noted that, the traffic channel described in this specification is not only realized by a virtual network card pair, and this specification does not limit this.
In an embodiment, the old version virtual switch may copy the traffic from the physical network card and send the traffic to the second virtual network card configured by the new version virtual switch through the first virtual network card, thereby implementing traffic sharing. It should be noted that, the old version virtual switch described in this specification may also directly send the traffic from the physical network card to the second virtual network card without copying, because the new version virtual switch may obtain the corresponding traffic through the traffic channel regardless of whether the traffic is copied or not, the copying operation may be selected according to actual needs, and this is not limited in this specification.
In an embodiment, after the old version virtual switch configures the first virtual network card, the old version virtual switch may continuously send the traffic from the physical network card to the second virtual network card; after the new-version virtual switch configures the second virtual network card, the second virtual network card may be polled to receive the traffic forwarded by the first virtual network card. For example, after the old version of virtual switch continuously sends the traffic from the physical network card to the second virtual network card, the new version of virtual switch may query every 300 milliseconds whether the second virtual network card receives the traffic forwarded by the first virtual network card.
Through the steps of continuous sending of the old version virtual switch and polling of the new version virtual switch, the new version virtual switch can be ensured to receive the flow forwarded by the first virtual network card in the first time, the flow forwarded by the first virtual network card is prevented from being missed, and meanwhile, the polling operation can also reduce the performance consumption caused by continuous query.
Step 203, controlling the connection between the at least one virtual machine and the old version virtual switch to be disconnected, and establishing connection between the at least one virtual machine and the updated new version virtual switch.
The virtual machine is reconnected to the new-version virtual switch from the old-version virtual switch through disconnection between the virtual machine and the old-version virtual switch and connection is established between the virtual machine and the new-version virtual switch, the new-version virtual switch can be at least indirectly communicated with the physical network card through the flow channel, and therefore the new-version virtual switch replaces the old-version virtual switch to achieve flow forwarding between the virtual machine and the physical network card.
In an embodiment, the control end may control all the virtual machines on the old version virtual switch to be disconnected simultaneously, and to be connected with the new version virtual switch simultaneously. It is clear that the above-described simultaneous disconnection and simultaneous establishment of all connections does not cause interruptions or does not cause excessively long interruptions when the number of virtual machines is at a lower scale.
In an embodiment, the at least one virtual machine may be divided into a plurality of groups, and at this time, the following may be performed on each group in sequence: and disconnecting the virtual machines of the corresponding group from the old version virtual switch, and establishing connection between the disconnected virtual machines and the upgraded new version virtual switch. Wherein each group comprises one or more virtual machines. Divide into a plurality of groups through all virtual machines that will establish connection with the virtual switch of old version to break in proper order according to the group and the old version between the virtual switch and establish in proper order with the virtual switch of new version between the connection, wherein: the virtual machines which are switched are served by the new version virtual switch, while the virtual machines which are not switched (namely are still connected with the old version virtual switch) are served by the old version virtual switch, so that the longer interruption time caused by simultaneous switching when the number of the virtual machines reaches a certain scale can be avoided, and the hot upgrade of the virtual switch can be guaranteed to be finished on the premise that a user does not sense the number of the virtual machines. It should be noted that the control end may control the number of the virtual machines in each group, and by controlling the number, the pressure caused by the number of the virtual machines is not increased beyond the system bearing range, service interruption or overlong service interruption is avoided, and the migration efficiency may be relatively improved. Moreover, the number of virtual machines in each group can be the same or different, and even can be dynamically adjusted according to the running state of the system, so that the dynamic balance between the system pressure and the migration efficiency is ensured. For example, the virtual machines connected to the old version virtual switch may be divided into A, B, C groups, where A, B and C groups each include 100 virtual switches, and then the above steps may be performed on A, B, C three groups in sequence, that is, the connection between the group a virtual machine and the old version virtual switch is broken, and the group a virtual machine and the updated new version virtual switch are connected. At this time, the group a virtual machines complete switching, and the virtual machines in the B, C two groups do not complete switching, the group a virtual machines are served by the new version virtual switch, thereby completing the corresponding traffic interaction, and the virtual machines in the B, C two groups are served by the old version virtual switch, thereby completing the corresponding traffic interaction. After the virtual machines in the group A are switched, the steps are sequentially executed on the group B, C, that is, the virtual machines in the group B are disconnected from the old version virtual switch, and the connection is established between the virtual machines in the group B and the new version virtual switch which is updated, at this time, the virtual machines in the group A and the virtual machines in the group B are served by the new version virtual switch, corresponding flow interaction is completed, the virtual machines in the group C are served by the old version virtual switch, and corresponding flow switching is completed. And finally, executing the steps on the group C virtual machines, namely disconnecting the virtual machines in the group C from the old version virtual switch, and establishing connection with the updated new version virtual switch, wherein at the moment, the A, B and the virtual machines in the group C are both served by the new version virtual switch, and the corresponding flow interaction is completed.
In an embodiment, after the traffic channel is established, the control end may send a first switching request to the old version of virtual switch and send a second switching request to the new version of virtual switch, respectively; the first switching request is used for instructing the old version virtual switch to disconnect from the at least one virtual machine, and the second switching request is used for instructing the new version virtual switch to establish connection with the at least one virtual machine. Under the action of the first and second switching requests, the new and old version virtual switches can be ensured to switch the virtual machines in order.
In an embodiment, when at least one virtual machine is connected to a new version virtual switch, the physical network card is controlled to be disconnected from the old version virtual switch and connected to the new version virtual switch, so that traffic forwarding is implemented between the new version virtual switch and the physical network card. After all the virtual machines are switched, namely all the virtual machines are disconnected with the old version virtual switch and are connected with the new version virtual switch, the control end can control the physical network card to be disconnected with the old version virtual switch and be connected to the new version virtual switch, and at the moment, the old version virtual switch does not need to send the flow from the physical network card to a second virtual network card configured on the new version virtual switch, but directly sends the flow to the new version virtual switch through the physical network card. After the physical network card is connected with the new-version virtual switch, the control end can be deactivated and the old-version virtual switch is ended, and the new-version virtual switch takes over the network service in full right. In fact, after all the virtual machines are switched, that is, all the virtual machines are connected to the new version of virtual switch, the old version of virtual switch cannot receive the traffic sent by the virtual machines any more, and the network service of the old version of virtual switch is fully taken over by the new version of virtual switch, and at this time, the old version of virtual switch is timely deactivated and ended, so that the resources occupied by the old version of virtual switch can be released, and the system pressure is reduced. However, it should be noted that the new version of virtual switch does not start to take over the network service after the physical network card is switched, the new version of virtual switch can provide the network service when the virtual machine is switched to the new version of virtual switch, that is, the old version of virtual switch and the new version of virtual switch both provide the corresponding network service during the process of switching the virtual machines, and the new version of virtual switch takes over the network service after the physical network card is switched, and the old version of virtual switch is deactivated.
In an embodiment, the control end determines the number of virtual machines connected to the old version virtual switch, which is counted in advance; determining that the at least one virtual machine has been connected to the new version virtual switch when the old version virtual switch is disconnected and the number of virtual machines establishing a connection with the new version virtual switch reaches a determined number. For example, the control end determines that 200 virtual machines exist on an old version virtual switch counted in advance, and after the 200 virtual machines are sequentially switched to a new version virtual switch, the control end may traverse and detect whether the 200 virtual machines complete the switching. When the control end determines that the 200 virtual machines are all connected to the new-version virtual switch, the control end can automatically switch the physical network card to the new-version virtual switch, and stop and end the old-version virtual switch, so that the new-version virtual switch can take over the network service in full authority, and the hot upgrade of the virtual switch without interrupting the service is realized.
The method for realizing the hot upgrade of the virtual switch realizes the hot upgrade of the virtual switch without interrupting service, does not need a physical network card to have the capacity of copying flow, so that the hot upgrade of the virtual switch gets rid of the limitation of the hardware of the physical network card, can simultaneously provide corresponding network service when an old version virtual switch and a new version virtual switch virtual machines, does not influence the normal use of users, protects the use experience of the users to the maximum extent, and realizes the hot upgrade of the virtual switch under the condition that the users do not sense.
For ease of understanding, how this specification implements virtual switch hot-upgrades is described below in conjunction with fig. 1 and 3. Fig. 3 is a schematic diagram of a hot upgrade of a virtual switch according to an exemplary embodiment of the present specification.
Assuming that a hot upgrade needs to be performed on the virtual switch 15 shown in fig. 1, the virtual switch 15 shown in fig. 1 can be considered to be an old version virtual switch at this time. For ease of understanding, the virtual switch 15 described above is labeled as an old version virtual switch 15 in fig. 3. An upper connection port of the old version virtual switch 15 forms a logical connection with the physical network card 16, and a lower connection port of the old version virtual switch 15 forms a logical connection with the virtual machine 12, the virtual machine 13 and the virtual machine 14, and the old version virtual switch 15 can realize flow interaction among the virtual machine 12, the virtual machine 13, the virtual machine 14 and the physical network card 16 through the two virtual interfaces. The control end 10 may deploy a new version of the virtual switch 17, and load the configuration information to be upgraded by the new version of the virtual switch 17. For example, if the old version of virtual switch 15 needs to be upgraded due to a system bug, the configuration information to be upgraded may be the configuration information corresponding to the system bug to be repaired, so as to ensure that the new version of virtual switch 17 no longer includes the system bug.
After the control end 10 finishes deploying the new version virtual switch 17, a first virtual network card 301 may be configured on the old version virtual switch, and at the same time, the control end 10 configures a second virtual network card 302 on the new version virtual switch 17, so that the first virtual network card 301 and the second virtual network card 302 form a virtual network card pair, and then a traffic channel is established based on the virtual network card pair. The old version virtual switch 15 continuously transmits the traffic from the physical network card 16 to the second virtual network card 302 configured on the new version virtual switch 17 through the first virtual network card 301, and the new version virtual switch 17 polls the second virtual network card 302 every 300 milliseconds, so that the new version virtual switch 17 receives the traffic transmitted by the old version virtual switch 15 through the first virtual network card 301. It should be noted that, at this time, the old version virtual switch 15 may not copy the traffic sent by the physical network card 16, but directly send the traffic to the second virtual network card 302 configured in the new version virtual switch 17, and of course, the old version virtual switch 15 may also copy the traffic and send the traffic to the second virtual network card 302 configured in the new version virtual switch 17, which is not limited in this specification.
After the new-version virtual switch 17 receives the traffic sent by the old-version virtual switch 15, the control end 10 sends a first switching request to the old-version virtual switch 15, and the control end 10 sends a second switching request to the new-version virtual switch 17, so that the old-version virtual switch 15 is ready to disconnect the virtual machine connected thereto, and the new-version virtual switch 17 is ready to establish a connection with the virtual machine. The control end 10 determines that the number of virtual machines connected to the old version virtual switch is 3, that is, there are 3 virtual machines connected to the old version virtual switch 15, namely, virtual machine 12, virtual machine 13 and virtual machine 14, because the number of virtual machines connected to the old version virtual switch 15 is 3, the virtual machines can be divided into A, B and C groups, where a group includes virtual machine 12, B group includes virtual machine 13 and C group includes virtual machine 14. Of course, as described above, the number of virtual machines is not perceived by the user as the interrupt time due to the simultaneous switching and the packet switching within a certain range, and therefore, the virtual machines 12, 13, and 14 may be switched at the same time.
The old version virtual switch 15 disconnects the connection with the group a virtual machine 12 based on the first switching request; the new version virtual switch 17 establishes a connection with the virtual machine 12 based on the second switching request, so that the switching operation of the virtual machine 12 is completed, at this time, the new version virtual switch 17 provides a corresponding network service for the virtual machine 12, that is, the new version virtual switch 17 realizes the message forwarding operation for the virtual machine 12, and at this time, the virtual machine 13 and the virtual machine 14 are still provided with a corresponding network service by the old version virtual switch 15. After the switching of the virtual machine 12 is completed, the switching of the group B virtual machine 13 is started, and the old version virtual switch 15 is disconnected from the virtual machine 13; the new version virtual switch 17 establishes a connection with the virtual machine 13. After the switching of the virtual machine 13 is completed, the switching of the C-group virtual machine 14 is started, the old version virtual switch 15 is disconnected from the virtual machine 14, and the new version virtual switch 17 establishes a connection with the virtual machine 14. So far, A, B and C have all completed switching among three sets of 3 virtual machines, namely virtual machine 12, virtual machine 13 and virtual machine 14, and the new version virtual switch 17 provides the corresponding network service. The control end 10 determines that the virtual machines 12, the virtual machines 13 and the virtual machines 14 are all connected to the new version virtual switch 17 according to the counted number of the virtual machines connected to the old version virtual switch 15, namely 3 virtual machines, and the control end 10 automatically disconnects the physical network card 16 from the old version virtual switch 15 and establishes the connection between the physical network card 16 and the new version virtual switch 17, so far, the new version virtual switch 17 takes over the network service in full authority and does not need a flow channel to receive the flow. After the physical network card 16 is switched to the new version virtual switch 17, the control end 10 deactivates and ends the old version virtual switch 15, and then completes the hot upgrade of the virtual switch.
As can be seen from the foregoing embodiments, no matter whether the physical network card 16 has the capability of copying traffic, the method for implementing hot upgrade of a virtual switch provided in this specification can be used to perform hot upgrade on the virtual switch 15, so that the hot upgrade of the virtual switch is free from the limitation of hardware of the physical network card, and the old version virtual switch 15 and the new version virtual switch 17 provide corresponding network services simultaneously in the process of sequentially switching virtual machines (the virtual machine 12, the virtual machine 13, and the virtual machine 14) in groups, so that the hot upgrade of the virtual switch can be implemented in the case that a user hardly perceives.
Embodiments of an apparatus are also provided in the present specification, corresponding to embodiments of the method described above.
Fig. 4 is a schematic block diagram of an electronic device according to an exemplary embodiment, and referring to fig. 4, the electronic device includes, at a hardware level, a processor 401, a network interface 402, a memory 403, a non-volatile memory 404, and an internal bus 405, but may also include hardware required for other functions. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
Fig. 5 is a block diagram of an apparatus for implementing a hot upgrade of a virtual switch according to an exemplary embodiment, where the apparatus includes:
a deployment unit 501, configured to deploy a corresponding new version virtual switch for an old version virtual switch, and load configuration information to be upgraded by the new version virtual switch; the old version virtual switch is respectively connected with a physical network card and at least one virtual machine and is used for realizing flow forwarding between the physical network card and the at least one virtual machine;
an establishing unit 502, configured to establish a traffic channel between the old version virtual switch and the new version virtual switch, so that the new version virtual switch realizes traffic interaction with the physical network card through the old version virtual switch;
a control unit 503, configured to control disconnection between the at least one virtual machine and the old version virtual switch, and establish connection between the at least one virtual machine and the new version virtual switch that has completed upgrading.
Optionally, the establishing unit 502 is specifically configured to:
configuring a first virtual network card on the old version virtual switch and configuring a second virtual network card on the new version virtual switch; the flow channel is established between the first virtual network card and the second virtual network card.
Optionally, the old version virtual switch is configured to continuously forward the traffic from the physical network card to a second virtual network card through the first virtual network card; and the new-version virtual switch is used for polling the second virtual network card so as to receive the flow forwarded by the first virtual network card.
Optionally, the control unit 503 is specifically configured to:
under the condition that the at least one virtual machine is divided into a plurality of groups, sequentially executing the following steps for each group: disconnecting the virtual machines of the corresponding group from the old version virtual switch, and establishing connection between the disconnected virtual machines and the upgraded new version virtual switch; wherein each group comprises one or more virtual machines.
Optionally, the control unit 503 is specifically configured to:
after the traffic channel is established, respectively sending a first switching request to the old version virtual switch and sending a second switching request to the new version virtual switch; the first switching request is used for instructing the old version virtual switch to disconnect from the at least one virtual machine, and the second switching request is used for instructing the new version virtual switch to establish connection with the at least one virtual machine.
Optionally, the apparatus further comprises:
a physical network card control unit 504, configured to control, when all the at least one virtual machine is connected to the new version virtual switch, the physical network card to be disconnected from the old version virtual switch and connected to the new version virtual switch, so as to implement traffic forwarding between the new version virtual switch and the physical network card.
Optionally, the apparatus further comprises:
a determining unit 505, configured to determine the number of virtual machines connected to the old version virtual switch counted in advance; determining that the at least one virtual machine has been connected to the new version virtual switch when the old version virtual switch is disconnected and the number of virtual machines establishing a connection with the new version virtual switch reaches a determined number.
With regard to the apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments of the related method, and will not be described in detail here.
As can be seen from the technical solutions provided in the foregoing description, the method for implementing hot upgrade of a virtual switch described in this description implements hot upgrade of a virtual switch without service interruption, and does not require that the physical network card has a capacity of replicating traffic, so that hot upgrade of a virtual switch gets rid of the limitation of hardware of the physical network card, and implements a universal hot upgrade method of a virtual switch.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description of specific embodiments has been presented for purposes of illustration and description. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (10)

1. A method for implementing a virtual switch hot-upgrade, the method comprising:
deploying a corresponding new-version virtual switch aiming at an old-version virtual switch, and loading configuration information to be upgraded by the new-version virtual switch; the old version virtual switch is respectively connected with a physical network card and at least one virtual machine and is used for realizing flow forwarding between the physical network card and the at least one virtual machine;
establishing a flow channel between the old version virtual switch and the new version virtual switch, so that the new version virtual switch realizes flow interaction with the physical network card through the old version virtual switch;
and controlling the disconnection between the at least one virtual machine and the old version virtual switch, and establishing connection between the at least one virtual machine and the updated new version virtual switch.
2. The method of claim 1, wherein establishing a traffic channel between the old version virtual switch and the new version virtual switch comprises:
configuring a first virtual network card on the old version virtual switch and configuring a second virtual network card on the new version virtual switch;
the flow channel is established between the first virtual network card and the second virtual network card.
3. The method of claim 2,
the old version virtual switch is used for continuously forwarding the flow from the physical network card to the second virtual network card through the first virtual network card;
and the new-version virtual switch is used for polling the second virtual network card so as to receive the flow forwarded by the first virtual network card.
4. The method of claim 1, wherein the controlling the disconnection between the at least one virtual machine and the old version virtual switch and the establishment of the connection between the at least one virtual machine and the new version virtual switch after the upgrade has been completed comprises:
when the at least one virtual machine is divided into a plurality of groups, sequentially executing the following steps for each group: disconnecting the virtual machines of the corresponding group from the old version virtual switch, and establishing connection between the disconnected virtual machines and the upgraded new version virtual switch;
wherein each group comprises one or more virtual machines.
5. The method of claim 1, wherein the controlling the disconnection between the at least one virtual machine and the old version virtual switch and the establishment of the connection between the at least one virtual machine and the new version virtual switch after the upgrade has been completed comprises:
after the traffic channel is established, respectively sending a first switching request to the old version virtual switch and sending a second switching request to the new version virtual switch;
the first switching request is used for instructing the old version virtual switch to disconnect from the at least one virtual machine, and the second switching request is used for instructing the new version virtual switch to establish connection with the at least one virtual machine.
6. The method of claim 1, further comprising:
and under the condition that the at least one virtual machine is connected to the new version virtual switch, the physical network card is controlled to be disconnected from the old version virtual switch and connected to the new version virtual switch, so that flow forwarding is realized between the new version virtual switch and the physical network card.
7. The method of claim 6, further comprising:
determining the number of virtual machines connected with the old version virtual switch counted in advance;
determining that the at least one virtual machine has been connected to the new version virtual switch when the old version virtual switch is disconnected and the number of virtual machines establishing a connection with the new version virtual switch reaches a determined number.
8. An apparatus for implementing a virtual switch hot upgrade, the apparatus comprising:
the deployment unit is used for deploying the corresponding new version virtual switch aiming at the old version virtual switch and loading the configuration information to be upgraded by the new version virtual switch; the old version virtual switch is respectively connected with a physical network card and at least one virtual machine and is used for realizing flow forwarding between the physical network card and the at least one virtual machine;
the establishing unit is used for establishing a flow channel between the old version virtual switch and the new version virtual switch so as to enable the new version virtual switch to realize flow interaction with the physical network card through the old version virtual switch;
and the control unit is used for controlling the disconnection between the at least one virtual machine and the old version virtual switch and establishing connection between the at least one virtual machine and the updated new version virtual switch.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 7 are implemented when the processor executes the program.
CN202210273026.8A 2022-03-18 Method and device for realizing hot upgrading of virtual switch Active CN114710408B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210273026.8A CN114710408B (en) 2022-03-18 Method and device for realizing hot upgrading of virtual switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210273026.8A CN114710408B (en) 2022-03-18 Method and device for realizing hot upgrading of virtual switch

Publications (2)

Publication Number Publication Date
CN114710408A true CN114710408A (en) 2022-07-05
CN114710408B CN114710408B (en) 2024-09-24

Family

ID=

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116233038A (en) * 2022-12-29 2023-06-06 天翼云科技有限公司 Method and device for hot upgrading of virtual switch
CN116455746A (en) * 2023-04-06 2023-07-18 中科驭数(北京)科技有限公司 Method for upgrading with flow of virtual switch in DPU

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102917055A (en) * 2012-10-18 2013-02-06 华为技术有限公司 Method and device of online migration of virtual machine, and terminal device
CN106301877A (en) * 2015-06-29 2017-01-04 中兴通讯股份有限公司 The upgrade method of a kind of Virtual NE and device
CN107493180A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 The upgrade method and device of a kind of virtual switch
US20180007162A1 (en) * 2016-06-29 2018-01-04 Nicira, Inc. Upgrading a proxy that decouples network connections from an application during application's downtime
CN108023756A (en) * 2016-10-28 2018-05-11 阿里巴巴集团控股有限公司 The upgrade method and device of a kind of virtual switch
CN108900441A (en) * 2018-07-04 2018-11-27 联想(北京)有限公司 Method for switching network, the first electronic equipment and readable storage medium storing program for executing
CN109450701A (en) * 2018-12-07 2019-03-08 北京金山云网络技术有限公司 A kind of virtual switch switching method, device, host and storage medium
CN109861839A (en) * 2017-11-30 2019-06-07 华为技术有限公司 The unbroken virtual switch upgrade method of business and relevant device
CN113162858A (en) * 2021-04-23 2021-07-23 中科云谷科技有限公司 Flow forwarding system, equipment and method and Internet of things system
US20210399966A1 (en) * 2020-06-23 2021-12-23 Citrix Systems, Inc. Upgrading user space networking stacks without disruptions to network traffic
CN114185578A (en) * 2021-12-17 2022-03-15 建信金融科技有限责任公司 Method, device and equipment for smoothly upgrading database and readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102917055A (en) * 2012-10-18 2013-02-06 华为技术有限公司 Method and device of online migration of virtual machine, and terminal device
CN106301877A (en) * 2015-06-29 2017-01-04 中兴通讯股份有限公司 The upgrade method of a kind of Virtual NE and device
CN107493180A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 The upgrade method and device of a kind of virtual switch
US20180007162A1 (en) * 2016-06-29 2018-01-04 Nicira, Inc. Upgrading a proxy that decouples network connections from an application during application's downtime
CN108023756A (en) * 2016-10-28 2018-05-11 阿里巴巴集团控股有限公司 The upgrade method and device of a kind of virtual switch
CN109861839A (en) * 2017-11-30 2019-06-07 华为技术有限公司 The unbroken virtual switch upgrade method of business and relevant device
CN108900441A (en) * 2018-07-04 2018-11-27 联想(北京)有限公司 Method for switching network, the first electronic equipment and readable storage medium storing program for executing
CN109450701A (en) * 2018-12-07 2019-03-08 北京金山云网络技术有限公司 A kind of virtual switch switching method, device, host and storage medium
US20210399966A1 (en) * 2020-06-23 2021-12-23 Citrix Systems, Inc. Upgrading user space networking stacks without disruptions to network traffic
CN113162858A (en) * 2021-04-23 2021-07-23 中科云谷科技有限公司 Flow forwarding system, equipment and method and Internet of things system
CN114185578A (en) * 2021-12-17 2022-03-15 建信金融科技有限责任公司 Method, device and equipment for smoothly upgrading database and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116233038A (en) * 2022-12-29 2023-06-06 天翼云科技有限公司 Method and device for hot upgrading of virtual switch
CN116455746A (en) * 2023-04-06 2023-07-18 中科驭数(北京)科技有限公司 Method for upgrading with flow of virtual switch in DPU

Similar Documents

Publication Publication Date Title
EP3026855B1 (en) Distributed virtual switch for virtualized computer systems
US7849168B2 (en) Network switching apparatus, server system and server migration method for server system
US9448899B2 (en) Method, apparatus and system for switching over virtual application two-node cluster in cloud environment
EP2659381B1 (en) Integrated software and hardware system that enables automated provisioning and configuration of a blade based on its physical location
CN102081540B (en) Distributed dual-master control network equipment software updating method and device
CN106302607B (en) Block storage system and method applied to cloud computing
CN109861839B (en) Method for upgrading virtual switch without service interruption and related equipment
CA2975071A1 (en) Management of network functions virtualization and orchestration apparatus, system, management method, and program
JP7116802B2 (en) Master/standby container system switching
CN108139924A (en) Hot plug hardware and Software implementations
CN104094229A (en) System and method for supporting live migration of virtual machines based on an extended host channel adaptor (HCA) model
CN110413213A (en) Seamless migration of the storage volume between storage array
CN106982133B (en) Method, equipment and system for changing configuration information of virtual network card
CN109391514B (en) High-availability-based equipment deployment method, server, storage medium and device
CN104572241A (en) Method and device for switching over application programs and system
CN109032754B (en) Method and apparatus for improving reliability of communication path
CN112491570A (en) Method, device and storage medium for setting link state of virtual network card
CN114710408A (en) Method and device for realizing hot upgrade of virtual switch
CN114710408B (en) Method and device for realizing hot upgrading of virtual switch
CN106803786A (en) A kind of network element update method, system based on network function virtualization
CN118175192A (en) Control method, device, equipment and storage medium for virtual machine thermal migration
CN113542019A (en) Upgrading method and system for transfer control separation distributed CP
CN113300878A (en) Method and device for realizing data smoothing
CN110795201A (en) Management method and device for server in cloud platform
CN104636125A (en) Information processing method and device

Legal Events

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