CN106982133B - Method, equipment and system for changing configuration information of virtual network card - Google Patents

Method, equipment and system for changing configuration information of virtual network card Download PDF

Info

Publication number
CN106982133B
CN106982133B CN201610032817.6A CN201610032817A CN106982133B CN 106982133 B CN106982133 B CN 106982133B CN 201610032817 A CN201610032817 A CN 201610032817A CN 106982133 B CN106982133 B CN 106982133B
Authority
CN
China
Prior art keywords
operating system
network card
virtual machine
virtual network
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610032817.6A
Other languages
Chinese (zh)
Other versions
CN106982133A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201610032817.6A priority Critical patent/CN106982133B/en
Priority to PCT/CN2017/071525 priority patent/WO2017125016A1/en
Publication of CN106982133A publication Critical patent/CN106982133A/en
Application granted granted Critical
Publication of CN106982133B publication Critical patent/CN106982133B/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

Landscapes

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

Abstract

The invention relates to the technical field of virtual machines, in particular to a method, equipment and a system for changing configuration information of a virtual network card, which are used for solving the technical problem that hardware is seriously relied on when the configuration information of a VF is changed. The method comprises the following steps: sending, by a first virtual machine running in an electronic device, a configuration request to a host operating system running in the electronic device; the configuration request is used for indicating the main operating system to change the configuration information of a first virtual network card of the first virtual machine; and changing the configuration information of the first virtual network card into the first configuration information carried in the configuration request through the main operating system.

Description

Method, equipment and system for changing configuration information of virtual network card
Technical Field
The present invention relates to the field of virtual machine technologies, and in particular, to a method, a device, and a system for changing configuration information of a virtual network card.
Background
In a Virtual Machine (VM) environment, a network card Device implements a plurality of Virtual network cards (VFs) by using single source input/output Virtualization (SR-IOV) or Virtual Machine Device Queue (VMDq) I/O Virtualization technologies, and each Virtual Machine allocates a certain number of VFs according to requirements.
In this case, if the Virtual machine needs to adjust its configuration information of the VF, for example, characteristics such as a Media Access Control (MAC) address or a Virtual Local Area Network (VLAN) identifier of a port of the VF need to be configured, at present, only a special configuration channel provided by each hardware vendor is relied on to perform operation, for example, only a message can be sent to a corresponding hardware component, and the configuration is completed by the hardware component.
It can be seen that, at present, when the configuration information of the VF is changed, the hardware is heavily dependent on, the system cost is high, and in some application scenarios, the types of messages provided by the hardware are limited, and if the hardware does not provide an operation for modifying the corresponding configuration information, the configuration information of the VF cannot be adjusted without modifying the hardware driver code.
Disclosure of Invention
The invention provides a method, equipment and a system for changing configuration information of a virtual network card, which are used for solving the technical problem that the configuration information of a VF is seriously dependent on hardware.
In a first aspect, a method for changing configuration information of a virtual network card is provided, including:
sending, by a first virtual machine running in an electronic device, a configuration request to a host operating system running in the electronic device; the configuration request is used for indicating the main operating system to change the configuration information of a first virtual network card of the first virtual machine;
and changing the configuration information of the first virtual network card into the first configuration information carried in the configuration request through the main operating system.
Optionally, before sending the configuration request to the host operating system running in the electronic device through the first virtual machine running in the electronic device, the method further includes:
establishing, by the primary operating system, a communication channel between the primary operating system and the first virtual machine.
Optionally, establishing, by the host operating system, a communication channel between the host operating system and the first virtual machine includes:
connecting the main operating system and the first virtual machine through an OVS bridge through the main operating system; or
And connecting the main operating system with the first virtual machine through a serial interface of a management plane through the main operating system.
Optionally, after changing the configuration information of the first virtual network card to the first configuration information carried in the configuration request through the main operating system, the method further includes:
sending a response message to the first virtual machine through the main operating system; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
Optionally, after sending the configuration request to the host operating system running in the electronic device through the first virtual machine running in the electronic device, the method further includes:
waiting for a response message sent by the main operating system through the first virtual machine; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully;
if the response message sent by the main operating system is not received when the timer of the first virtual machine is overtime, determining that the configuration information of the first virtual network card fails to be changed through the first virtual machine.
Optionally, the configuration information includes at least one of an MAC address of the first virtual network card, a VLAN where the first virtual network card is located, and a working mode of the first virtual network card; and the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
In a second aspect, a virtual machine system is provided, which includes a host operating system and a virtual machine; wherein the content of the first and second substances,
the virtual machine is provided with a first processing module used for sending a configuration request to the main operating system; the configuration request is used for indicating the main operating system to change the configuration information of a first virtual network card of the first virtual machine;
and the main operating system is provided with a second processing module which is used for receiving the configuration request and changing the configuration information of the first virtual network card into the first configuration information carried in the configuration request.
Optionally, the second processing module is further configured to:
establishing a communication channel between the host operating system and the virtual machine prior to receiving the configuration request.
Optionally, the second processing module is configured to:
connecting the host operating system with the virtual machine through an OVS network bridge; or
And connecting the main operating system with the virtual machine through a serial interface of a management plane.
Optionally, the second processing module is further configured to:
after the configuration information of the first virtual network card is changed into the first configuration information carried in the configuration request, sending a response message to the virtual machine; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
Optionally, the first processing module is further configured to:
after sending a configuration request to the main operating system, waiting for a response message sent by the main operating system; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully;
and if the response message sent by the main operating system is not received when the timer of the virtual machine is overtime, determining that the configuration information of the first virtual network card fails to be changed.
Optionally, the configuration information includes at least one of an MAC address of the first virtual network card, a VLAN where the first virtual network card is located, and a working mode of the first virtual network card; and the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
In a third aspect, an electronic device is provided, including:
the system comprises a first sending module, a second sending module and a control module, wherein the first sending module is used for sending a configuration request to a main operating system running in the electronic equipment through a first virtual machine running in the electronic equipment; the configuration request is used for indicating the main operating system to change the configuration information of a first virtual network card of the first virtual machine;
and the changing module is used for changing the configuration information of the first virtual network card into the first configuration information carried in the configuration request through the main operating system.
Optionally, the electronic device further includes an establishing module, configured to:
before the first sending module sends a configuration request to a main operating system running in the electronic equipment through a first virtual machine running in the electronic equipment, a communication channel between the main operating system and the first virtual machine is established through the main operating system.
Optionally, the establishing module is configured to:
connecting the main operating system and the first virtual machine through an OVS bridge through the main operating system; or
And connecting the main operating system with the first virtual machine through a serial interface of a management plane through the main operating system.
Optionally, the electronic device further includes a second sending module, configured to:
after the changing module changes the configuration information of the first virtual network card into the first configuration information carried in the configuration request through the main operating system, sending a response message to the first virtual machine through the main operating system; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
Optionally, the electronic device further includes a waiting module and a determining module;
the waiting module is configured to wait for a response message sent by a host operating system through a first virtual machine running in the electronic device after the first sending module sends a configuration request to the host operating system running in the electronic device through the first virtual machine; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully;
the determining module is configured to determine, by the first virtual machine, that the configuration information of the first virtual network card fails to be changed if a response message sent by the host operating system is not received when the timer of the first virtual machine times out.
Optionally, the configuration information includes at least one of an MAC address of the first virtual network card, a VLAN where the first virtual network card is located, and a working mode of the first virtual network card; and the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
One or two of the above technical solutions have at least the following technical effects:
when the configuration information of the first virtual network card of the first virtual machine needs to be changed, the first virtual machine can send a configuration request to the main operating system, the main operating system can change the configuration information of the first virtual network card, extra hardware components are not needed to participate, the system cost is saved, even if the hardware does not provide the operation of changing the corresponding configuration information, because the change of the configuration information does not depend on the hardware, the change of the configuration information is not influenced, the dependence degree of the hardware is reduced, even if the implementation modes of different network card manufacturers are inconsistent, different changes do not need to be made according to different hardware, the required operation is reduced, and the success rate of the change is improved.
Drawings
FIG. 1 is a schematic diagram of configuring VLAN identifications of virtual machines;
FIG. 2 is a flowchart of a method for changing configuration information of a virtual network card according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an embodiment of changing a MAC address of a virtual network card;
FIG. 4 is a flowchart illustrating changing the MAC address of the virtual network card according to an embodiment of the present invention;
fig. 5 is a schematic diagram of main/standby switching of a virtual network card in the embodiment of the present invention;
fig. 6 is a schematic diagram of changing a VLAN id of a virtual network card in an embodiment of the present invention;
FIG. 7 is a block diagram of a virtual machine system according to an embodiment of the present invention;
fig. 8 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Application scenarios of embodiments of the present invention are described below.
As shown in fig. 1, for example, one server is configured with two physical network cards, for example, a NIC 1108 and a NIC 2110, respectively, where the NIC 1108 configures a VF port through SR-IOV, for example, a VF of the NIC 1108 is a VF 1112, and the NIC 1110 also configures a VF port through SR-IOV, for example, a VF of the NIC 1112 is a VF 2114. Two virtual machines are started on the server, for example, VM 1100, VM 2102, VF 1112 is assigned to VM 1100, VLAN id of VF 1112 may be set to 10 when VM 1100 is started, VF 2114 may be assigned to VM 2102, and VLAN id of VF 2114 may be set to 20 when VM 2102 is started.
When the VM 1100 and the VM 2102 start to run, for example, the VM 1100 and the VM 2102 are required to communicate, the VM 1100 is required to set the VLAN id of the VF 1112 to be consistent with the VLAN id of the VF 2114. Under the existing mechanism, this operation can only be implemented by a Physical Function interface (PF) -VF mailbox (mailbox) message mechanism of hardware, for example, sending a message to the PF 1104 of the NIC 1108 through the VF 1112, so that the PF 1104 resets the VLAN id of the VF 1112.
It can be seen that, at present, when the configuration information (such as VLAN id) of the VF is changed, the hardware is heavily dependent, and the system cost is high.
The embodiment of the invention fully considers the problems, when the configuration information of the first virtual network card of the first virtual machine needs to be changed, the first virtual machine can send a configuration request to the main operating system, the main operating system can change the configuration information of the first virtual network card without the participation of additional hardware components, the system cost is saved, even if the hardware does not provide the operation of changing the corresponding configuration information, because the change of the configuration information does not depend on the hardware, the change of the configuration information is not influenced, the dependence degree of the hardware is reduced, even if the implementation modes of different network card manufacturers are inconsistent, different changes do not need to be made according to different hardware, the required operation is reduced, and the success rate of the change is improved.
Preferred embodiments of the present invention will be described below with reference to the accompanying drawings.
Referring to fig. 2, an embodiment of the present invention provides a method for changing configuration information of a virtual network card, and a flow of the method is described as follows.
Step 201: sending a configuration request to a main operating system running in the electronic equipment through a first virtual machine running in the electronic equipment; the configuration request is used for indicating the main operating system to change the configuration information of the first virtual network card of the first virtual machine;
step 202: and changing the configuration information of the first virtual network card into the first configuration information carried in the configuration request through the main operating system.
The electronic device may be, for example, a server, but may also be other types of electronic devices. One or more virtual machines run in the electronic device, for example, and the first virtual machine is any one of the virtual machines running in the electronic device.
The electronic device may have a Host operating system (Host OS) installed therein, where the Host operating system does not belong to any virtual machine, and a corresponding operating system may also run in a different virtual machine.
The physical network card of the electronic device provides virtual network card support for a virtual machine running in the electronic device through an IO virtualization technology (such as SR-IOV). Through the SR-IOV, one PF can be provided on a physical network card, and a plurality of VF interfaces can be provided at the same time. The PF is controlled by a main operating system in the electronic device and is mainly used for external communication requirements of a Host OS and configuration requirements of a physical network card and the like. The VF is controlled by a sub-operating system in the virtual machine.
Optionally, before sending the configuration request to the host operating system running in the electronic device through the first virtual machine running in the electronic device, the method further includes:
a communication channel between the host operating system and the first virtual machine is established through the host operating system.
That is, in order to implement communication between the host operating system and the first virtual machine, a communication channel between the host operating system and the first virtual machine needs to be established first. The communication channel between the main operating system and the first virtual machine may also be understood as a communication channel between the main operating system and the first sub-operating system.
Optionally, establishing, by the host operating system, a communication channel between the host operating system and the first virtual machine includes:
connecting a host operating system and a first virtual machine through an Open Virtual Switch (OVS) bridge by the host operating system; or
And connecting the main operating system with the first virtual machine through the serial interface of the management plane through the main operating system.
The embodiment of the invention does not limit how the communication channel is established between the main operating system and the first virtual machine.
For example, after the electronic device is powered on, the main operating system first completes initialization and configuration of the physical network card, and establishes a communication channel with the first virtual machine.
The first sub-operating system configures the characteristic of the first virtual network card according to the self requirement, and sends a configuration request to the main operating system through a communication channel between the first sub-operating system and the main operating system, wherein the configuration request can carry information of the first virtual network card used by the first sub-operating system and can carry configuration information of the first virtual network card by the first sub-operating system.
The destination MAC address of the configuration request may be a MAC address of a management port of the sub operating system, the source MAC may be a MAC address of the first virtual network card, the type of the configuration request may be a request message, and the configuration request may carry the requested content.
After receiving a configuration request sent by a first virtual machine, a main operating system sets corresponding configuration information of the first virtual network card according to the configuration information carried in the configuration request, and sends a configuration result to the first virtual machine through a response message, namely to a first sub-operating system, wherein the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
The destination MAC address of the response message may be a MAC address of the management port of the first sub-operating system, the type of the response message may be a response/notification message, and the response message carries the content of the response.
After the first sub-operating system sends the configuration request to the main operating system, the first sub-operating system may wait for a response message sent by the main operating system.
Optionally, after the first sub-operating system sends the configuration request to the main operating system, a timer may be started, and if the first sub-operating system receives the response message before the timer expires, the first sub-operating system parses the response message, so as to determine whether the configuration information of the first virtual network card is changed successfully or failed. And if the first sub-operating system does not receive the response message when the timer times out, the first sub-operating system can determine that the change of the configuration information of the first virtual network card fails, does not need to continue to wait, and can perform other work, so that the first sub-operating system is prevented from being in a waiting state all the time.
Optionally, the configuration information includes at least one of an MAC address of the first virtual network card, a VLAN in which the first virtual network card is located, and a working mode of the first virtual network card, and may also include any other possible configuration information of the first virtual network card; the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
The VLAN in which the first virtual network card is located includes, for example, an identifier (i.e., a VLAN identifier) of the VLAN in which the first virtual network card is located.
The following describes a method for changing the configuration information of the virtual network card according to an embodiment of the present invention by using several examples.
Example 1: and setting a scene of the MAC address of the first virtual network card for the first sub-operating system.
Referring to fig. 3, an electronic device is connected to an Ethernet Switch (Ethernet Switch) through two physical network cards. A virtual machine (for example, referred to as VM 110) is running in the electronic device, the VM 110 is connected to the host operating system through the OVS, and the configuration request may interact in the form of an ethernet message. The two physical network cards of the electronic device are named as NIC 1100 and NIC 2102, respectively, where the NIC 1100 configures a VF port through SR-IOV, for example, VF of NIC 1100 is VF 1104, and the NIC 2102 configures a VF port through SR-IOV, for example, VF of NIC 2102 is VF 2106. The VF 1104 is assigned to the VM 110, e.g., referred to as VNIC1, and the VF2106 is assigned to the VM 110, e.g., referred to as VNIC 2.
After the VM 110 is powered on, the MAC address of the VF used by the VM 110 needs to be reset according to the requirement of the VM 110 itself, and the processing steps in the flow part are shown in fig. 4.
FIG. 4 illustrates the interaction between the host operating system and the sub-operating system (e.g., referred to as the first sub-operating system) in VM 110.
1. After the electronic equipment is successfully started, the main operating system establishes a communication channel with the first sub-operating system through the OVS.
2. After the communication channel is successfully constructed, when the MAC address of the virtual network card needs to be set (for example, the MAC address of VNIC1 and the MAC address of VNIC2 need to be set), the first sub-operating system sends a configuration request to the main operating system through the established communication channel, where the configuration request carries the new MAC address of the VF.
After sending the configuration request, the first sub-operating system may start a timer and wait for a response message sent by the main operating system.
3. And the main operating system receives the configuration request through the communication channel, analyzes the configuration request and determines the content carried in the configuration request.
4. And the main operating system sends a response message to the first sub-operating system.
The main operating system judges the validity of the configuration request according to the configuration information of the main operating system, and if the parameters carried in the configuration request are wrong, the main operating system can send a response message to the first sub-operating system, wherein the response message is used for indicating that the configuration information is unsuccessfully changed. If the configuration request is correct, the host operating system may call the IOCTRL interface to issue MAC configuration information to the NIC 1100 and the NIC 2102, respectively, according to the message type of the configuration request (see the arrow in fig. 3), so as to complete the MAC address setting.
And the main operating system judges whether the configuration is successful or not through the received return result, constructs a response message sent to the first sub-operating system, and sends the response message to the first sub-operating system, wherein the response message is used for indicating the success or failure of the MAC address change.
After sending the configuration request, the first sub-operating system may start a timer to wait for a response message of the sub-operating system. If the first sub-operating system receives the response message sent by the main operating system before the timer is overtime, the first sub-operating system stops the timer and analyzes the content of the response message to determine whether the MAC address change is successful or failed.
If the MAC address is determined to be successfully changed, the first sub-operating system may end the process of the configuration setting. If the first sub-operating system does not receive the response message when the timer times out, or the received response message indicates that the MAC address change fails, indicating that an error occurs in the configuration process, VNIC1 and VNIC2 may not operate normally, and the first sub-operating system may close VNIC1 and VNIC2 configured this time, so as to prevent the error from spreading.
Example 2: the first sub-operation system initiates the main/standby switch of the virtual network card of the bond port.
Referring to fig. 5, an electronic device is connected to the ethernet switch through two physical network cards. Two virtual machines (for example, VM 1110 and VM 2120) are operated in the electronic device, VM 1110 and VM 2120 are connected to a host operating system through OVS, respectively, and configuration requests may interact in the form of ethernet messages. The two physical network cards of the electronic device are named as NIC 1100 and NIC 2102, respectively, where the NIC 1100 configures VF ports through SR-IOV, for example, VFs of the NIC 1100 are VF 1104 and VF 1105, and the NIC 2102 configures VF ports through SR-IOV, for example, VF of the NIC 2102 is VF2106 and VF 2107. VF 1104 and VF2106 are assigned to VM 1110, e.g., VNIC1 and VNIC2, respectively, and VF 1105 and VF 2107 are assigned to VM 2120, e.g., VNIC3 and VNIC4, respectively. Among them, VF 1104 and VF2106 are used as the primary and secondary bond of VM 1110, and VF 1105 and VF 2107 are used as the primary and secondary bond of VM 2120. For example, NIC 1100 is a primary physical network card and NIC 2102 is a backup physical network card.
For example, after VM 1110 is powered on, it is necessary to reset the master/slave bond information of VNIC1 and VNIC2 according to the requirement of VM 1110 itself.
After the electronic device is successfully started, the main operating system and the first sub-operating system (the operating system of the VM 1110) and the second sub-operating system (the operating system of the VM 2120) first establish communication channels by way of the control plane OVS, respectively.
After the communication channel is successfully constructed, the first sub-operating system needs to initiate main/standby switch of VNIC1 and VNIC2 according to its own requirements, and sends a configuration request to the main operating system, where the configuration request carries main/standby switch configuration information of VNIC1 and VNIC 2. After sending the configuration request, the first sub-operating system may start a timer, waiting for a reply message from the main operating system.
After receiving the configuration request, the host operating system sends a message to the NIC 1100 and the NIC 2102, respectively, to instruct to switch the host/standby bond states of the NIC 1100 and the NIC 2102.
The main operating system judges whether the main/standby bond switching between the NIC 1100 and the NIC 2102 is successful according to the received return result, and the main operating system constructs a response message to the first sub operating system according to the switching result.
If the main/standby bond of the NIC 1100 and the NIC 2102 is successfully switched, and at the same time, the main operating system finds that the VNIC3 and the VNIC4 are still on the NIC 1100 and the NIC 2102, so that the main operating system may send a notification message to the first sub-operating system and/or the second sub-operating system in addition to sending a response message to the first sub-operating system, for indicating that the main/standby switch of the NIC 1100 and the NIC 2102 occurs.
If the main/standby bond switching between the NIC 1100 and the NIC 2102 fails, the main operating system sends a response message indicating the switching failure to the first sub operating system.
If it is determined that the master/slave bond switching of VNIC1 and VNIC2 is successful, the first sub operating system may end the flow of the configuration setting.
In addition, if it is determined that the main/standby bond switching of VNIC1 and VNIC2 is successful, the second sub operating system may also receive a notification message sent by the main operating system, and the second sub operating system may set the main/standby states of VNIC3 and VNIC4 according to the notification message.
If the first sub-operating system has not received the response message when the timer times out, or the received response message indicates that the primary/standby bond switching of VNIC1 and VNIC2 fails, which indicates that an error occurs in the configuration process, VNIC1 and VNIC2 may not normally operate, and the first sub-operating system may close VNIC1 and VNIC2 configured this time, so as to prevent the error from spreading.
Example 3: the first sub-operating system initiates the setting of the VLAN identification.
For example, referring to fig. 6, 4 virtual machines (VM 1418 to VM 4424, respectively) are run on one electronic device, each virtual machine has its own VF connected to the physical network card NIC1, where the VM 1418 is used as a management node in the 4 virtual machines to manage configuration, statistics, and other information inside each virtual machine. The VMs 2420 to 4424 respectively have 1 VF (VF2 to VF4) connected to the physical network card NIC1, and serve as external network ports for the virtual machines. VMs 1418-4424 communicate with the host operating system through the OVS bridge.
After the VM 1418 is powered on, VLAN information of ports of the VFs used by the VMs 2 to 4 needs to be reset according to configuration requirements of users.
After the electronic device is successfully started, the main operating system and each sub operating system establish a communication channel in a control plane OVS mode. After the communication channel is successfully constructed, the operating system (for example, referred to as a first sub-operating system) of the VM 1418 serves as a management node, and the VLAN of each virtual machine needs to be set. The first sub-operating system sends a configuration request to the host operating system requesting configuration of the VLANs of VFs 2-4. After sending the configuration request, the first sub-operating system may start a timer, waiting for a reply message from the main operating system.
After receiving the configuration request sent by the first sub-operating system, the main operating system sends a message to the NIC1 for configuring the VLANs of the VFs 2 to VF4, and the main operating system determines whether the configuration is successful by receiving the returned result, and sends a response message to the first sub-operating system.
Before the timer is overtime, if the first sub-operating system receives the response message, the timer is stopped, the content of the response message is analyzed, and if the configuration is successful, the first sub-operating system can respectively send notification messages to the VMs 2420 to 4424 through the control surface, that is, the first sub-operating system respectively sends notification messages to the operating systems of the VMs 2420 to 4424, and the process of the configuration setting at this time is ended. And if the first sub-operating system does not receive the response message when the timer is overtime, or the response message is used for indicating that the configuration is failed, the first sub-operating system stops the VLAN setting process.
When the VM 2420 to VM 4424 receive the notification message from the first sub-operating system, the VLAN information of the locally stored port is updated according to the content of the notification message, and the configuration becomes effective.
The apparatus of the present invention will be described with reference to the accompanying drawings.
Referring to fig. 7, based on the same inventive concept, an embodiment of the present invention provides a virtual machine system, which may include a host operating system 701 and a virtual machine 702.
The virtual machine 702 may be provided with a first processing module 7021, configured to send a configuration request to the main operating system 701; the configuration request is used for instructing the host operating system 701 to change the configuration information of the first virtual network card of the virtual machine 702;
the main operating system 701 is provided with a second processing module 7011, configured to receive the configuration request, and change the configuration information of the first virtual network card into the first configuration information carried in the configuration request.
Optionally, the second processing module 7011 is further configured to:
before receiving the configuration request, a communication channel between the host operating system 701 and the virtual machine 702 is established.
Optionally, the second processing module 7011 is configured to:
connecting a host operating system 701 with a virtual machine 702 through an OVS bridge; or
The host operating system 701 and the virtual machine 702 are connected via a serial interface of the management plane.
Optionally, the second processing module 7011 is further configured to:
after changing the configuration information of the first virtual network card into the first configuration information carried in the configuration request, sending a response message to the virtual machine 702; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
Optionally, the first processing module 7021 is further configured to:
after sending the configuration request to the main operating system 701, waiting for a response message sent by the main operating system 701; the response message is used for indicating the success or failure of the change of the configuration information of the first virtual network card;
if the response message sent by the main operating system 701 has not been received when the timer of the virtual machine 702 times out, it is determined that the configuration information of the first virtual network card fails to be changed.
Optionally, the configuration information includes at least one of an MAC address of the first virtual network card, a VLAN in which the first virtual network card is located, and a working mode of the first virtual network card; the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
The second processing module 7011 may be the main operating system 701 itself, or may also be one of the functional modules in the main operating system 701, and the first processing module 7021 may be the virtual machine 702 itself, or may also be one of the functional modules in the virtual machine 702.
The virtual machine system may implement the method in fig. 2-6, for example, the virtual machine 702 may be the first virtual machine as described above, and for the functions that can be implemented by each module in the virtual machine system, reference may be made to the description of the method section.
Referring to fig. 8, based on the same inventive concept, an embodiment of the present invention provides an electronic device, which may include a first sending module 801 and a modification module 802.
A first sending module 801, configured to send a configuration request to a host operating system running in an electronic device through a first virtual machine running in the electronic device; the configuration request is used for indicating the main operating system to change the configuration information of the first virtual network card of the first virtual machine;
a changing module 802, configured to change, by the host operating system, the configuration information of the first virtual network card into the first configuration information carried in the configuration request.
Optionally, the electronic device further includes an establishing module, configured to:
before the first sending module 801 sends the configuration request to the host operating system running in the electronic device through the first virtual machine running in the electronic device, a communication channel between the host operating system and the first virtual machine is established through the host operating system.
Optionally, the establishing module is configured to:
connecting the main operating system and the first virtual machine through the OVS network bridge through the main operating system; or
And connecting the main operating system with the first virtual machine through the serial interface of the management plane through the main operating system.
Optionally, the electronic device further includes a second sending module, configured to:
after the changing module 802 changes the configuration information of the first virtual network card into the first configuration information carried in the configuration request through the main operating system, a response message is sent to the first virtual machine through the main operating system; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
Optionally, the electronic device further includes a waiting module and a determining module;
a waiting module, configured to wait for a response message sent by a host operating system through a first virtual machine after the first sending module 801 sends a configuration request to the host operating system through the first virtual machine running in the electronic device; the response message is used for indicating the success or failure of the change of the configuration information of the first virtual network card;
and the determining module is used for determining that the configuration information of the first virtual network card fails to be changed through the first virtual machine if the response message sent by the main operation is not received when the timer of the first virtual machine is overtime.
Optionally, the configuration information includes at least one of an MAC address of the first virtual network card, a VLAN in which the first virtual network card is located, and a working mode of the first virtual network card; the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
The electronic device may implement the method as in the foregoing fig. 2-6, and for the functions that can be implemented by each module in the electronic device, reference may be made to the description of the method portion.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units is merely used as an example, and in practical applications, the above function distribution may be performed by different functional units according to needs, that is, the internal structure of the device is divided into different functional units to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the described units or division of units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above embodiments are only used to describe the technical solutions of the present application in detail, but the above embodiments are only used to help understanding the method of the embodiments of the present invention, and should not be construed as limiting the embodiments of the present invention. Those skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present invention, and all such changes or substitutions are intended to be included within the scope of the embodiments of the present invention.

Claims (18)

1. A method for changing configuration information of a virtual network card is characterized by comprising the following steps:
after the electronic equipment is successfully started, a main operating system running in the electronic equipment establishes a communication channel with a first virtual machine running in the electronic equipment through a virtual switch OVS;
after the communication channel is successfully established, the first virtual machine configures the characteristics of a first virtual network card according to the self requirements, and sends a configuration request carrying first configuration information for changing the first virtual network card of the first virtual machine to the main operating system by using the communication channel;
and the main operating system changes the configuration information of the first virtual network card into the first configuration information carried in the configuration request according to the configuration information of the configuration request.
2. The method of claim 1, prior to sending a configuration request to a host operating system running in an electronic device through a first virtual machine running in the electronic device, further comprising:
establishing, by the primary operating system, a communication channel between the primary operating system and the first virtual machine.
3. The method of claim 2, wherein establishing, by the host operating system, a communication channel between the host operating system and the first virtual machine comprises:
connecting the main operating system and the first virtual machine through an OVS bridge through the main operating system; or
And connecting the main operating system with the first virtual machine through a serial interface of a management plane through the main operating system.
4. The method of claim 3, wherein after changing the configuration information of the first virtual network card to the first configuration information carried in the configuration request by the host operating system, further comprising:
sending a response message to the first virtual machine through the main operating system; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
5. The method of claim 3, after sending a configuration request to a host operating system running in an electronic device through a first virtual machine running in the electronic device, further comprising:
waiting for a response message sent by the main operating system through the first virtual machine; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully;
if the response message sent by the main operating system is not received when the timer of the first virtual machine is overtime, determining that the configuration information of the first virtual network card fails to be changed through the first virtual machine.
6. The method of claim 3, wherein the configuration information comprises at least one of a MAC address of the first virtual network card, a VLAN where the first virtual network card is located, and an operating mode of the first virtual network card; and the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
7. A virtual machine system is characterized by comprising a main operating system and a first virtual machine; wherein the content of the first and second substances,
the first virtual machine is provided with a first processing module which is used for configuring the characteristics of a first virtual network card according to the self requirement and sending a configuration request carrying first configuration information for changing the first virtual network card of the first virtual machine to the main operating system by utilizing a communication channel;
the main operating system is provided with a second processing module, which is used for establishing a communication channel with a first virtual machine running in the electronic equipment through a virtual switch OVS, receiving a configuration request sent by the first virtual machine through the communication channel, and changing the configuration information of the first virtual network card into first configuration information carried in the configuration request according to the configuration information of the configuration request.
8. The virtual machine system of claim 7, wherein the second processing module is further to:
establishing a communication channel between the host operating system and the virtual machine prior to receiving the configuration request.
9. The virtual machine system of claim 8, wherein the second processing module is to:
connecting the host operating system with the virtual machine through an OVS network bridge; or
And connecting the main operating system with the virtual machine through a serial interface of a management plane.
10. The virtual machine system of claim 9, wherein the second processing module is further to:
after the configuration information of the first virtual network card is changed into the first configuration information carried in the configuration request, sending a response message to the virtual machine; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
11. The virtual machine system of claim 9, wherein the first processing module is further to:
after sending a configuration request to the main operating system, waiting for a response message sent by the main operating system; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully;
and if the response message sent by the main operating system is not received when the timer of the virtual machine is overtime, determining that the configuration information of the first virtual network card fails to be changed.
12. The virtual machine system according to claim 9, wherein the configuration information includes at least one of a MAC address of the first virtual network card, a VLAN in which the first virtual network card is located, and an operating mode of the first virtual network card; and the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
13. An electronic device, comprising:
the first sending module is used for configuring the characteristics of a first virtual network card according to the self requirements through a first virtual machine running in the electronic equipment and sending a configuration request carrying first configuration information for changing the first virtual network card of the first virtual machine to a main operating system by utilizing a communication channel;
and the changing module is used for establishing a communication channel between the main operating system and a first virtual machine running in the electronic equipment through a virtual switch OVS, receiving the configuration request through the communication channel, and changing the configuration information of the first virtual network card into the first configuration information carried in the configuration request according to the configuration information of the configuration request.
14. The electronic device of claim 13, wherein the electronic device further comprises a setup module to:
before the first sending module sends a configuration request to a main operating system running in the electronic equipment through a first virtual machine running in the electronic equipment, a communication channel between the main operating system and the first virtual machine is established through the main operating system.
15. The electronic device of claim 14, wherein the setup module is to:
connecting the main operating system and the first virtual machine through an OVS bridge through the main operating system; or
And connecting the main operating system with the first virtual machine through a serial interface of a management plane through the main operating system.
16. The electronic device of claim 15, wherein the electronic device further comprises a second transmitting module to:
after the changing module changes the configuration information of the first virtual network card into the first configuration information carried in the configuration request through the main operating system, sending a response message to the first virtual machine through the main operating system; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully.
17. The electronic device of claim 15, wherein the electronic device further comprises a waiting module and a determining module;
the waiting module is configured to wait for a response message sent by a host operating system through a first virtual machine running in the electronic device after the first sending module sends a configuration request to the host operating system running in the electronic device through the first virtual machine; the response message is used for indicating that the configuration information of the first virtual network card is changed successfully or unsuccessfully;
the determining module is configured to determine, by the first virtual machine, that the configuration information of the first virtual network card fails to be changed if a response message sent by the host operating system is not received when the timer of the first virtual machine times out.
18. The electronic device of claim 15, wherein the configuration information includes at least one of a MAC address of the first virtual network card, a VLAN on which the first virtual network card is located, and an operating mode of the first virtual network card; and the working mode of the first virtual network card is used for indicating that the first virtual network card is a main virtual network card or a standby virtual network card of the first virtual machine.
CN201610032817.6A 2016-01-18 2016-01-18 Method, equipment and system for changing configuration information of virtual network card Active CN106982133B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610032817.6A CN106982133B (en) 2016-01-18 2016-01-18 Method, equipment and system for changing configuration information of virtual network card
PCT/CN2017/071525 WO2017125016A1 (en) 2016-01-18 2017-01-18 Method, apparatus and system for modifying configuration information of virtual network card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610032817.6A CN106982133B (en) 2016-01-18 2016-01-18 Method, equipment and system for changing configuration information of virtual network card

Publications (2)

Publication Number Publication Date
CN106982133A CN106982133A (en) 2017-07-25
CN106982133B true CN106982133B (en) 2020-12-29

Family

ID=59339888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610032817.6A Active CN106982133B (en) 2016-01-18 2016-01-18 Method, equipment and system for changing configuration information of virtual network card

Country Status (2)

Country Link
CN (1) CN106982133B (en)
WO (1) WO2017125016A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3693854A1 (en) * 2017-01-20 2020-08-12 Huawei Technologies Co. Ltd. Data packet forwarding method, network adapter, host device, and computer system
CN109245925A (en) * 2018-08-28 2019-01-18 郑州云海信息技术有限公司 A kind of method, apparatus and computer readable storage medium configuring vlan
CN111698141B (en) * 2019-03-13 2022-12-02 中兴通讯股份有限公司 Message forwarding method and device
CN113132200B (en) * 2019-12-30 2024-01-19 中兴通讯股份有限公司 Data forwarding method, repeater, system, server and storage medium
CN114844744B (en) * 2022-03-04 2023-07-21 阿里巴巴(中国)有限公司 Virtual private cloud network configuration method and device, electronic equipment and computer readable storage medium
CN115314380B (en) * 2022-06-30 2024-03-01 山东浪潮科学研究院有限公司 VF configuration method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7647589B1 (en) * 2005-02-07 2010-01-12 Parallels Software International, Inc. Methods and systems for safe execution of guest code in virtual machine context
US20070101323A1 (en) * 2005-10-28 2007-05-03 Microsoft Corporation Automatic virtual machine adjustments to network changes
US8032660B2 (en) * 2008-12-30 2011-10-04 Intel Corporation Apparatus and method for managing subscription requests for a network interface component
JP2012048546A (en) * 2010-08-27 2012-03-08 Hitachi Ltd Computing system, i/o device control method, and i/o drawer
US9934057B2 (en) * 2014-04-21 2018-04-03 Oracle International Corporation Shadow VNICs for the control and observability of IO virtual functions

Also Published As

Publication number Publication date
CN106982133A (en) 2017-07-25
WO2017125016A1 (en) 2017-07-27

Similar Documents

Publication Publication Date Title
CN106982133B (en) Method, equipment and system for changing configuration information of virtual network card
CN102291452B (en) Virtual machine management method, cloud management server and cloud system based on cloud strategy
CN103441867B (en) A kind of method updating virtual machine internal Network resource allocation
EP2204948A2 (en) Apparatus and method for managing subscription requests for configuring a network interface component
CN113312143B (en) Cloud computing system, command processing method and virtualization simulation device
CN109194589B (en) MDC (media data center) implementation method and device
CN109120444B (en) Cloud resource management method, processor and storage medium
EP3702915B1 (en) Data processing method and device, storage medium, processor, and system
US20180246772A1 (en) Method and apparatus for allocating a virtual resource in network functions virtualization network
CN107332814B (en) Request message transmission method and device
CN114070723A (en) Virtual network configuration method and system of bare metal server and intelligent network card
CN104572241A (en) Method and device for switching over application programs and system
CN113407307A (en) Port expansion method, device, equipment and computer readable storage medium
CN107948063B (en) Method for establishing aggregation link and access equipment
US20070155422A1 (en) Method for controlling mobile data connection through USB Ethernet management of mobile station
CN114710408A (en) Method and device for realizing hot upgrade of virtual switch
CN109032754B (en) Method and apparatus for improving reliability of communication path
CN105827496A (en) Method and apparatus for managing PE device
KR101644678B1 (en) Methods for supporting mobility of virtual machine in network input output virtualization environment and apparatus for performing the same
CN108234174B (en) Management method and device of virtual network function
CN112491570A (en) Method, device and storage medium for setting link state of virtual network card
WO2022206231A1 (en) Kubernetes cluster load balance handling method and apparatus, and storage medium
US11822952B2 (en) Managing downtime to networking managers during configuration updates in cloud computing environments
CN110874264A (en) Example hot migration method and device, storage medium and processor
CN110022310B (en) Authorization method and device based on cloud computing open network operating system

Legal Events

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