WO2014071637A1 - Method and device for performing network configuration on virtual machine - Google Patents

Method and device for performing network configuration on virtual machine Download PDF

Info

Publication number
WO2014071637A1
WO2014071637A1 PCT/CN2012/084477 CN2012084477W WO2014071637A1 WO 2014071637 A1 WO2014071637 A1 WO 2014071637A1 CN 2012084477 W CN2012084477 W CN 2012084477W WO 2014071637 A1 WO2014071637 A1 WO 2014071637A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
network
virtual
connection
request message
Prior art date
Application number
PCT/CN2012/084477
Other languages
French (fr)
Chinese (zh)
Inventor
余祥
李宁
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/084477 priority Critical patent/WO2014071637A1/en
Priority to CN201280002829.4A priority patent/CN104040950B/en
Publication of WO2014071637A1 publication Critical patent/WO2014071637A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Definitions

  • the present invention relates to the field of IT, and in particular, to a method and device for network configuration of a virtual machine.
  • the computing system and the network system need to cooperate with each other to allocate and establish network resources for the virtual machine.
  • the virtual machine management center and the network management center must interact with each other to be virtual.
  • the configuration of the network resources is such that the interaction between the virtual machine management center and the network management center is complicated and cumbersome, resulting in a large delay in the network establishment process information interaction during the virtual machine creation or migration process, which may result in Business interruption during virtual machine creation or migration.
  • Embodiments of the present invention provide a method and a device for network configuration of a virtual machine to reduce the delay of message interaction in a virtual machine network connection process.
  • the first aspect provides a method for network configuration of a virtual machine, including: creating a virtual machine; and receiving a network configuration trigger message of the information, so that the virtual switch establishes the virtual switch according to network connection information of the virtual machine. a connection with the virtual machine, where the network configuration trigger message is used for network configuration of a virtual machine created by the virtual machine management module; Receiving an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
  • the creating a virtual machine includes: receiving a create virtual machine request message sent by a virtual machine management center;
  • the network configuration trigger message of the information includes:
  • a network configuration request message is sent to the virtual switch, before the establishing the connection between the virtual machine and the virtual switch, the method also includes:
  • connection request message is sent to the virtual switch.
  • the creating a virtual machine includes:
  • the method further includes:
  • the method further includes: Sending a data migration request message to the virtual machine management center, so that the virtual machine management center migrates data of the source virtual machine to the destination virtual machine according to the data migration request message;
  • the data migration completion message sent by the virtual machine management center is received.
  • the second aspect provides a method for performing network configuration on a virtual machine, including: receiving a network configuration trigger message sent by a virtual machine management module, where the network configuration trigger message is used for a virtual machine created by the virtual machine management module Performing network configuration, including network connection information of the virtual machine;
  • the receiving the network configuration trigger message sent by the virtual machine management module includes: receiving a network configuration request message or a connection request message sent by the virtual machine management module, where The network configuration request message or the connection request message includes network connection information of the virtual machine.
  • the establishing, by the network connection information, the connection with the virtual machine includes:
  • the connection with the virtual machine is directly established; if it is determined that the virtual machine is not configured.
  • the virtual network corresponding to the connection information sends a network configuration information request message to the network management center, so that the network management center returns network configuration information according to the network configuration information request message; the virtual switch configures the virtual according to the network configuration information.
  • the network establishes a connection with the virtual machine.
  • a third possible implementation manner if the network configuration request message sent by the virtual machine management module is received, the virtual machine is established Before the connection, the method further includes: Sending a network configuration response message to the virtual machine management module;
  • connection request message sent by the virtual machine management module is received.
  • the method further includes:
  • the destination virtual switch notifies the virtual machine management center to use the data in the source virtual machine.
  • the destination virtual machine is connected to the destination virtual machine, and the destination virtual machine is connected to the destination virtual machine; the source virtual machine corresponds to the active virtual switch; and the destination virtual switch corresponding to the destination virtual machine
  • the method further includes:
  • the source virtual switch receives the disconnection sent by the virtual machine management center, and the source virtual switch disconnects the source virtual machine according to the connection disconnect message.
  • the third aspect provides a virtual machine management module, including: a processing unit, configured to create a virtual machine;
  • a processing unit configured to create a virtual machine
  • a sending unit configured to send, to the virtual switch corresponding to the virtual machine created by the processing unit, a network configuration trigger message including network connection information of the virtual machine, so that the virtual switch establishes according to network connection information of the virtual machine a connection between the virtual switch and the virtual machine, where the network configuration trigger message is used to perform network configuration for a virtual machine created by the virtual machine management module;
  • a receiving unit configured to receive an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
  • the receiving unit is specifically configured to receive a create virtual machine request message sent by a virtual machine management center;
  • the processing unit is specifically configured to: according to the create virtual machine request message received by the receiving unit, select a physical resource corresponding to the virtual machine, and create the virtual machine.
  • the sending unit is specifically configured to send a network configuration request message or a connection request message to the virtual switch, where the network configuration request message is Or the connection request message includes network connection information of the virtual machine.
  • the receiving unit is further configured to: receive a network configuration response message sent by the virtual switch, where the sending unit is further configured to: After the processing unit virtual machine is created and the receiving unit receives the configuration response message, the connection request message is sent to the virtual switch.
  • the receiving unit is configured to receive a virtual machine migration request message sent by a virtual machine management center
  • the processing unit is specifically configured to select a physical resource corresponding to the virtual machine according to a virtual machine migration request message received by the receiving unit, and create the virtual machine.
  • the sending unit is further configured to send a network configuration request message to the virtual switch, so that the virtual switch receives the network configuration After requesting the message, a network configuration information request message is sent to the network management center.
  • the sending unit is further configured to send a data migration request message to the virtual machine management center, so that the virtual The machine management center migrates the data of the source virtual machine to the destination virtual machine according to the data migration request message;
  • the receiving unit is further configured to: after the data migration is completed, receive a data migration complete message sent by the virtual machine management center.
  • the fourth aspect provides a switching device, including: a receiving unit, configured to receive, when the virtual machine management module creates a virtual machine, a network configuration sent by the virtual machine management module a triggering message, where the network configuration triggering message is used to perform network configuration for the virtual machine created by the virtual machine management module, including network connection information of the virtual machine, and a processing unit, configured to receive according to the receiving unit Network connection information establishes a connection with the virtual machine;
  • a sending unit configured to return, to the virtual machine management module, an acknowledgement message that the virtual machine and the switching device network connection have been established.
  • the receiving unit is specifically configured to: receive a network configuration request message or a connection request message sent by the virtual machine management module, where the network configuration request message or the connection request message includes Network connection information of the virtual machine.
  • the processing unit is specifically configured to: when the processing unit is configured to receive the network connection information Then, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the connection with the virtual machine is directly established; if it is determined that the virtual network corresponding to the network connection information of the virtual machine is not configured, Sending a network configuration information request message to the network management center, so that the network management center returns network configuration information according to the network configuration information request message; the processing unit configures a virtual network according to the network configuration information, and establishes a virtual network with the virtual machine Connection.
  • the sending unit is further configured to: before establishing a connection with the virtual machine, to the virtual The machine management module sends a network configuration response message;
  • the receiving unit is further configured to: after the virtual machine is created and the virtual machine management module receives the configuration response message, receive a connection request message sent by the virtual machine management module.
  • the sending unit is further configured to send a connection success message to the network management center, so that the network management When determining that there is a conflicting virtual machine, the center sends a disconnection message to the switching device corresponding to the conflicting virtual machine, so that the The switching device corresponding to the conflicting virtual machine disconnects the conflicting virtual machine according to the connection disconnection message, where the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine.
  • the receiving unit is further configured to receive a connection disconnection message sent by the virtual machine management center;
  • the processing unit is further configured to disconnect the connection with the source virtual machine according to the connection disconnection message received by the receiving unit.
  • a fifth aspect provides an apparatus for network configuration of a virtual machine, including a processor and a memory, wherein the memory stores a computer to execute an instruction, and the processor is connected to the memory through a communication bus;
  • the processor executes the computer-executed instructions stored by the memory when the apparatus is in operation, such that the apparatus performs the method of the first aspect described above.
  • a sixth aspect provides an apparatus for network configuration of a virtual machine, including a processor and a memory, wherein the memory stores a computer to execute an instruction, and the processor is connected to the memory through a communication bus;
  • the processor executes the computer-executed instructions stored by the memory when the apparatus is in operation, such that the apparatus performs the method of the second aspect.
  • a computer readable medium comprising computer executed instructions, wherein the computer executes the method of the first aspect or the second aspect when a central processor of a computer executes the computer to execute an instruction.
  • the virtual machine network configuration is realized by the direct interaction between the virtual machine management module and the virtual switch, which effectively reduces the flow and time of message interaction in the virtual machine network configuration process, and reduces the delay while ensuring The stability and continuity of the business.
  • FIG. 1 is a network system according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a method for network configuration of a virtual machine according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of another method for network configuration of a virtual machine according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a network configuration method for a virtual machine according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of another method for configuring a network for a virtual machine according to an embodiment of the present invention
  • FIG. 6 is a schematic flowchart of another method for configuring a network for a virtual machine according to an embodiment of the present disclosure
  • FIG. 7 is a schematic flowchart of another method for configuring a network for a virtual machine according to an embodiment of the present disclosure
  • FIG. 8 is a schematic structural diagram of a virtual machine management module according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of a switching apparatus according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a device for performing network configuration on a virtual machine according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of another apparatus for network configuration of a virtual machine according to an embodiment of the present invention.
  • the technical solution provided by the embodiments of the present invention can be applied to a network for a virtual machine.
  • the network configuration system as shown in Figure 1, the system includes:
  • the virtual machine management module is a management module running on each host.
  • the virtual machine management center performs management functions on each host through it. In the following embodiments, it is used to receive and forward virtual switches from the virtual machine management center. The message and the state of the reported virtual machine.
  • the virtual machine management center is a virtual machine management system presented to the system administrator. It is responsible for the management and control of the virtual machine, including monitoring and modifying the attributes and status of the virtual machine, creating, migrating, up and down the virtual machine. Wait for the operation.
  • the network management center is a network management system presented to network administrators. It manages and controls physical network devices and virtual network devices at the same time, including the management and configuration of physical switches and their ports, and the management and control of virtual machines and their ports. , IP address management, and network connection status management, traffic monitoring, and other functions between virtual machines.
  • the virtual switch may be a device and a module running on a host, implemented by software, or a switch device and a module implemented by hardware on a physical network card.
  • the virtual switch may be a common virtual switch. It can be a distributed virtual switch.
  • the network management center can configure various network information such as VLAN, ACL, and QoS, and it also cooperates with the virtual machine management module to complete the disconnection and connection of the virtual machine and the network.
  • the embodiment of the present invention provides a method for configuring a virtual machine.
  • the execution entity of the embodiment is a virtual machine management module, and includes:
  • the virtual machine management module creates a virtual machine.
  • a virtual network and a virtual network port are configured in the network management center.
  • the virtual machine management module receives the create virtual machine request message sent by the virtual machine management center, and selects a physical resource corresponding to the virtual machine according to the create virtual machine request message, and creates the virtual machine.
  • the virtual machine management module sends a network configuration trigger message including the network connection information of the virtual machine to the virtual switch corresponding to the virtual machine, so that the virtual switch establishes the virtual switch and the virtual according to the network connection information of the virtual machine.
  • the network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module.
  • the virtual machine management module receives an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
  • the virtual machine management module sends a network configuration request message or a connection request message to the virtual switch.
  • the network configuration request message or the connection request message includes network connection information of the virtual machine.
  • the virtual machine management module sends a network configuration request message to the virtual switch
  • the virtual machine management module After establishing the connection between the virtual machine and the virtual switch, the virtual machine management module receives an acknowledgement message sent by the virtual switch.
  • the virtual machine management module sends a connection request message to the virtual switch, after the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message, the virtual machine management module receives the confirmation sent by the virtual switch. 3 ⁇ 4.
  • the virtual switch If the virtual machine management module sends a network configuration request message to the virtual switch, the virtual switch first performs network configuration according to the network configuration request message. After the virtual machine is created and the network response message sent by the virtual switch is received, the virtual machine is configured. The management module sends a connection request to the virtual switch, so that the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message; that is, the virtual machine management module first instructs the virtual switch to perform network configuration. After the network configuration is completed, instruct the virtual switch to establish a connection with the virtual machine.
  • the virtual switch performs network configuration according to the connection request message, and establishes a connection with the virtual machine according to the network connection information in the connection request message, that is, virtual Switch After receiving the connection request message, perform network configuration and establish a connection with the virtual machine.
  • the foregoing virtual machine management module sends a network configuration request to the virtual switch, and the connection request message is only a difference in implementation manner.
  • the embodiment of the present invention is not limited thereto, but no matter which method is adopted, it should fall into the present embodiment. Within the scope of protection of the invention.
  • the foregoing network configuration may be configured for a VLAN (Virtual Local Area Network), an ACL (Access Control List), a QoS (Quality of Service), and the like.
  • VLAN Virtual Local Area Network
  • ACL Access Control List
  • QoS Quality of Service
  • the embodiment of the present invention may be applied to a scenario in which a virtual machine data is migrated.
  • the destination virtual switch notifies the virtual machine management center to migrate data in the source virtual machine to the destination virtual machine, where the destination virtual machine corresponds.
  • the destination virtual switch establishes a connection with the destination virtual machine; the source virtual machine corresponds to an active virtual switch;
  • the virtual machine management module in this embodiment may include a destination virtual machine management module, and the foregoing step S201 may be: the destination virtual machine management module receives the virtual machine migration request message sent by the virtual machine management center, and migrates according to the virtual machine.
  • the request message selects the physical resource corresponding to the virtual machine and creates the virtual machine.
  • the virtual machine can be the target virtual machine.
  • the destination virtual machine management module sends a data migration request message to the virtual machine management center, so that the virtual machine management center migrates the data of the source virtual machine to the destination virtuality according to the data migration request message.
  • the target virtual machine management module receives the data migration completion message sent by the virtual machine management center.
  • the embodiment of the present invention further includes the following two implementation manners:
  • the destination virtual machine management module sends a network configuration completion message and a data migration completion notification message to the virtual machine management center, so that the virtual machine management center sends a connection disconnection request message to the source virtual machine management module, the source virtual machine
  • the management module sends a disconnection message to the source virtual switch, so that the source virtual switch disconnects the source virtual machine according to the disconnection request message;
  • the destination virtual machine management module After receiving the connection request notification message sent by the virtual machine management center, the destination virtual machine management module sends a connection request message to the destination virtual switch, so that the destination virtual switch establishes a connection with the destination virtual machine.
  • Manner 2 The virtual machine management module sends a connection request message to the destination virtual switch, so that the destination virtual switch establishes a connection with the target virtual machine.
  • the target virtual machine management module After the connection establishment is completed, the target virtual machine management module receives the acknowledgement message sent by the destination virtual switch, and sends a data migration complete message to the virtual machine management center.
  • the network management center also receives the connection success message sent by the destination virtual switch, and sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine when the conflicting virtual machine is determined, where the conflicting virtual machine is a network address and The virtual machine of the virtual machine has the same network address, so that the virtual switch corresponding to the conflicting virtual machine disconnects from the conflicting virtual machine according to the connection disconnection message;
  • the source virtual machine is connected, and the conflicting virtual machine includes the source virtual machine.
  • the network address may be a MAC address.
  • the first mode is that the source virtual switch first disconnects from the source virtual machine, and the destination virtual machine management module sends a connection request message to the destination virtual switch, so that the destination virtual switch establishes a connection with the destination virtual machine;
  • the network management center In the second mode, after the destination virtual switch establishes a connection with the destination virtual machine, the network management center initiates a disconnection when determining that there is a conflicting virtual machine. If the source virtual switch does not disconnect the source virtual machine, the conflict occurs.
  • the virtual machine includes the source virtual machine, and the network management center sends a disconnection request cancellation to the source virtual switch, so that the source virtual switch disconnects from the source virtual machine.
  • the network management center may also receive the connection success message sent by the destination virtual switch, and confirm whether there is a conflicting virtual machine, and if yes, indicate the conflict virtual The virtual switch corresponding to the machine disconnects from the conflicting virtual machine.
  • the above-mentioned execution entity is a virtual machine management module, and the virtual machine network configuration is realized through direct interaction between the virtual machine management module and the virtual switch, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process. Reduce the delay while ensuring the stability and continuity of the business.
  • An embodiment of the present invention provides a method for performing network configuration on a virtual machine. As shown in FIG. 3, the execution body of the method is a virtual switch, and the method includes:
  • the virtual switch receives the network configuration trigger message sent by the virtual machine management module.
  • the network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module, including network connection information of the virtual machine.
  • a virtual network and a virtual network port are configured in the network management center. Further, the virtual switch receives the network configuration request message or the connection request message sent by the virtual machine management module, where the network configuration request message or the connection request message includes network connection information of the virtual machine, that is, the network configuration trigger message includes network configuration. Request message or connection request message.
  • the virtual switch receives the network configuration request message sent by the virtual machine management module, the virtual switch first performs network configuration according to the network configuration request message, and completes the creation of the virtual machine and receives the network configuration response sent by the virtual switch. After the message, the virtual machine management module sends a connection request message to the virtual switch, so that the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message; that is, the virtual machine management module first indicates The virtual switch performs network configuration, and after the network configuration is completed, instructs the virtual switch to establish a connection with the virtual machine.
  • the virtual switch If the virtual switch receives the connection request message sent by the virtual machine management module, the virtual switch performs network configuration according to the connection request message, and establishes a connection with the virtual machine according to the network connection information in the connection request message, that is, After the virtual switch receives the connection request message, it performs network configuration and establishes a connection with the virtual machine.
  • the network switch request message or the connection request message sent by the virtual switch is not limited to the implementation manner of the present invention. Within the scope of protection.
  • the virtual switch establishes a connection with the virtual machine according to the network connection information.
  • the virtual switch returns, to the virtual machine management module, an acknowledgement message that the virtual machine and the virtual switch network connection have been established.
  • the virtual switch After receiving the network connection information, if the virtual switch determines that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual switch directly establishes a connection with the virtual machine, thereby accessing the virtual machine to the virtual machine.
  • the internet The internet.
  • the virtual switch acquires a virtual network port from the network management center, and accesses the virtual machine to the virtual network through the virtual network port.
  • the network configuration information request message is sent to the network management center, so that the network management center returns the network configuration information according to the network configuration information request message;
  • the network configuration information configures the virtual network and establishes a connection with the virtual machine, thereby accessing the virtual machine to the virtual network.
  • the virtual switch acquires a virtual network port from the network management center, and accesses the virtual machine to the virtual network through the virtual network port.
  • the foregoing network configuration may be configured for a VLAN, an ACL, a QoS, etc., which is not limited by the present invention.
  • the embodiment of the present invention may be applied to a scenario in which a virtual machine data is migrated.
  • the destination virtual switch notifies the virtual machine management center to migrate data in the source virtual machine to the destination virtual machine, where the destination virtual machine corresponds.
  • the destination virtual switch establishes a connection with the destination virtual machine; the source virtual machine corresponds to an active virtual switch.
  • the virtual switch may include a destination virtual switch.
  • the destination virtual switch receives the network configuration trigger message sent by the destination virtual machine management module, where the network configuration trigger message includes network connection information, and the destination virtual switch according to the The network connection information establishes a network connection with the destination virtual machine, and manages the virtual machine
  • the module returns an acknowledgment message that the virtual machine is connected to the virtual switch network.
  • the destination virtual machine management module sends a data migration request message to the virtual machine management center, so that the virtual machine management center migrates the data of the source virtual machine to the destination virtual machine according to the data migration request message; After the data migration is completed, the destination virtual machine management module receives the data migration completion message sent by the virtual machine management center.
  • the embodiment of the present invention further includes the following two implementation manners:
  • Manner 1 The source virtual switch disconnects from the source virtual machine, and the destination virtual switch receives the connection request message sent by the destination virtual machine management module; the connection request message includes network connection information, and the destination virtual switch establishes and aims according to the network connection message. The connection of the virtual machine.
  • the destination virtual switch receives the connection request message sent by the destination virtual machine management module.
  • the connection request message includes network connection information, and the destination virtual switch establishes a connection with the destination virtual machine according to the network connection information, and the network management center also
  • the connection success message sent by the destination virtual switch is received, and when it is determined that the conflicting virtual machine exists, a disconnection message is sent to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is disconnected according to the connection.
  • the open message is disconnected from the conflicting virtual machine, where the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine, and it should be noted that if the source virtual switch is not disconnected from the source virtual machine Connect, then the conflicting virtual machine includes the source virtual machine.
  • the network address may be a MAC address.
  • the first method is that the source virtual switch first disconnects from the source virtual machine, and the destination virtual machine management module sends a connection request message to the destination virtual switch, so that the destination virtual switch establishes a connection with the destination virtual machine.
  • the network management center In the second mode, after the destination virtual switch establishes a connection with the destination virtual machine, the network management center initiates a disconnection when determining that there is a conflicting virtual machine. If the source virtual switch does not disconnect the source virtual machine, the conflict occurs. The virtual machine includes the source virtual machine, Then, the network management center sends a connection disconnect request cancellation to the source virtual switch, so that the source virtual switch disconnects from the source virtual machine.
  • the network management center may also receive the connection success message sent by the destination virtual switch, and confirm whether there is a conflicting virtual machine, and if yes, indicate the conflict virtual The virtual switch corresponding to the machine disconnects from the conflicting virtual machine.
  • the virtual switch can also serve as a source virtual switch, and the source virtual switch receives the disconnection message sent by the virtual machine management center before the destination virtual switch corresponding to the destination virtual machine establishes a connection with the destination virtual machine, and The connection to the source virtual machine is broken according to the connection disconnect message.
  • the above-mentioned execution entity is a virtual switch, and the virtual machine network configuration is realized through direct interaction between the virtual machine management module and the virtual switch, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process. At the same time, the stability and continuity of the business are guaranteed.
  • the embodiment of the invention provides a method for network configuration of a virtual machine. As shown in FIG. 4, the method embodiment is based on that a network management center has been configured with a virtual network and a virtual network port, and the method includes:
  • the virtual machine management center sends a create virtual machine request message to the virtual machine management module.
  • the virtual machine management module selects a physical resource corresponding to the virtual machine according to the create virtual machine request message and creates the virtual machine.
  • the virtual machine management module sends a network configuration request message to the virtual switch corresponding to the virtual machine.
  • the virtual switch After receiving the network configuration request message, if the virtual switch determines that the virtual network corresponding to the network connection information of the virtual machine is not configured, the virtual switch sends the network configuration information request information to the network management center. Further, the virtual switch also obtains a virtual network port from the network management center. It should be noted that, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual network port is obtained only from the network management center, and the network configuration response message is sent to the virtual machine management module, and step S407 is performed. S41 1.
  • the network management center returns network configuration information according to the network configuration information request message.
  • the network management center also sends the configuration information to the physical switch.
  • the virtual switch configures the virtual network according to the network configuration information, and sends a network configuration response message to the virtual machine management module.
  • the configuration of the virtual network may be configured for a VLAN, an ACL, a Qo S, or the like, which is not limited by the present invention.
  • the physical switch if the physical switch also receives the network configuration information sent by the network management center, the physical switch sends a network configuration response message to the virtual machine management module after completing the virtual network configuration.
  • the virtual machine management module After the virtual machine management module completes the creation of the virtual machine and receives the network configuration response message, the virtual machine management module sends a connection request message to the virtual switch.
  • the connection request message includes network connection information.
  • the virtual switch establishes a connection with the virtual machine according to the network connection information, and returns a confirmation message that the virtual machine and the virtual switch network connection have been established to the virtual machine management module after the connection is established.
  • the virtual machine management module After receiving the confirmation message, the virtual machine management module sends a virtual machine creation completion message to the virtual machine management center.
  • the virtual switch After the virtual switch establishes a connection with the virtual machine, the virtual switch sends a connection success message to the network management center.
  • the network switch After the network management center receives the connection success message, if it is determined that there is a conflicting virtual machine, the network switch sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is configured according to the The disconnect message disconnects the connection to the conflicting virtual machine.
  • the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine; the network address may be a MAC address. It should be noted that the foregoing virtual machine management module and the virtual switch may be combined in the same host.
  • the virtual machine network configuration is realized by the direct interaction between the virtual machine management module and the virtual switch during the virtual machine creation process, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process. , while reducing the delay, ensuring the stability and continuity of the business.
  • An embodiment of the present invention provides a method for network configuration of a virtual machine. As shown in FIG. 5, the method is implemented based on a network management center configured with a virtual network and a virtual network port, and the method includes:
  • the virtual machine management center sends a create virtual machine request message to the virtual machine management module.
  • the virtual machine management module selects a physical resource corresponding to the virtual machine according to the create virtual machine request message and creates the virtual machine.
  • the virtual machine management module sends a connection request message to the virtual switch corresponding to the virtual machine.
  • the connection request message includes network connection information.
  • the virtual switch After receiving the connection request message, the virtual switch sends the network configuration information request information to the network management center if it determines that the virtual network corresponding to the network connection information of the virtual machine is not configured.
  • the virtual switch also obtains a virtual network port from the network management center. It should be noted that if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual network port is obtained only from the network management center, and is virtualized.
  • the machine management module sends a network configuration response message, and proceeds to steps S507 to S510.
  • the network management center returns network configuration information according to the network configuration information request message.
  • the network management center also sends the configuration information to the physical switch.
  • the virtual switch configures the virtual network according to the network configuration information.
  • the configuration of the virtual network may be configured for a VLAN, an ACL, a Qo S, or the like, which is not limited by the present invention.
  • the physical switch configures the virtual network according to the network configuration information.
  • the virtual switch After the virtual switch is configured, the virtual switch establishes a connection with the virtual machine according to the network connection information, and after establishing the connection, returns a confirmation message that the virtual machine and the virtual switch network connection have been established to the virtual machine management module.
  • the virtual machine management module After the virtual machine management module receives the confirmation message and completes the creation of the virtual machine, the virtual machine management module sends a virtual machine creation completion message to the virtual machine management center.
  • the virtual switch After establishing a connection with the virtual machine, the virtual switch sends a connection success message to the network management center.
  • the network management center After the network management center receives the connection success message, if it is determined that there is a conflicting virtual machine, the network switch sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is The disconnect message disconnects the connection to the conflicting virtual machine.
  • the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine; the network address may be a MAC address.
  • the virtual machine network configuration is realized by the direct interaction between the virtual machine management module and the virtual switch during the virtual machine creation process, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process. , while reducing the delay, ensuring the stability and continuity of the business.
  • the embodiment of the present invention provides a method for configuring a virtual machine. As shown in FIG. 6 , the method embodiment is applied to a virtual machine data migration scenario. In this embodiment, the method embodiment is completed after the source virtual machine is created. The method of the source virtual machine may be referred to the embodiment shown in FIG. 4 or FIG. 5, and is not described here. The method includes:
  • the virtual machine management center sends a virtual machine migration request message to the destination virtual machine management module.
  • the target virtual machine management module selects a physical resource corresponding to the virtual machine according to the virtual machine migration request message and creates a target virtual machine.
  • the data migration request message is sent to the virtual machine management center.
  • the virtual machine management center migrates the data in the source virtual machine to the destination virtual machine according to the data migration request message, and sends a data migration completion message to the destination virtual machine management module after the data migration is completed.
  • the target virtual machine management module sends a network configuration request message to the destination virtual switch when creating the target virtual machine.
  • the destination virtual switch After receiving the network configuration request message, the destination virtual switch sends the network configuration information request information to the network management center if it determines that the virtual network corresponding to the network connection information of the virtual machine is not configured.
  • the virtual switch also obtains a virtual network port from the network management center. It should be noted that, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual network port is obtained only from the network management center, and the network configuration response message is sent to the virtual machine management module, and step S 608 is performed. To S 620. S 607. The network management center returns network configuration information according to the network configuration information request message.
  • the network management center also sends the network configuration information to the destination physical switch.
  • the destination virtual switch configures the virtual network according to the network configuration message, and sends a network configuration response message to the target virtual machine management module.
  • the configuration of the virtual network may be performed for a VLAN, an ACL, a Qo S, etc., which is not limited by the present invention.
  • the destination physical switch also receives the network configuration information sent by the network management center, after the target physical switch completes the virtual network configuration, the network configuration response message is also sent to the target virtual machine management module.
  • the target virtual machine management module After receiving the network configuration response message, the target virtual machine management module sends a network configuration completion message to the virtual machine management center.
  • the virtual machine management center After receiving the network configuration complete message and the data migration is completed, the virtual machine management center sends a connection disconnection request message to the source virtual machine management module.
  • the source virtual machine management module sends a disconnection message to the source virtual switch.
  • the source virtual switch disconnects from the source virtual machine according to the connection disconnect message.
  • the source virtual switch sends a disconnection response message to the source virtual machine management module.
  • the source virtual machine management module After receiving the connection disconnection response message, the source virtual machine management module sends a connection disconnection notification message to the virtual machine management center.
  • the virtual machine management center After receiving the connection disconnection notification message, the virtual machine management center sends a connection request notification to the target virtual machine management module, 3 ⁇ 4.
  • the destination virtual machine management module After the virtual machine management module receives the connection request notification message, the destination virtual machine management module sends a connection request message to the destination virtual switch.
  • the destination virtual switch establishes a connection with the destination virtual machine according to the connection request message.
  • the destination virtual switch After the destination virtual switch establishes a connection with the destination virtual machine, The destination virtual switch sends an acknowledgement message for connection establishment to the destination virtual machine management module.
  • the target virtual machine management module After receiving the confirmation message, the target virtual machine management module sends a virtual machine migration complete message to the virtual machine management center.
  • the destination virtual switch After the destination virtual switch establishes a connection with the target virtual machine, the destination virtual switch sends a connection success message to the network management center.
  • the network management center receives the connection success message, and if it is determined that there is a conflicting virtual machine, sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is based on the connection.
  • the disconnect message disconnects from the conflicting virtual machine.
  • the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine; the network address may be a MAC address.
  • source virtual machine management module and the source virtual switch may be integrated in the source host, and the target virtual machine management module and the destination virtual switch may be integrated in the destination host.
  • the virtual machine network configuration is realized by the direct interaction between the destination virtual machine management module and the destination virtual switch during the virtual machine data migration process, thereby effectively reducing the message interaction during the virtual machine network configuration process.
  • Process and time while reducing latency, ensure the stability and continuity of the business.
  • the embodiment of the present invention provides a method for network configuration of a virtual machine. As shown in FIG. 7 , the method embodiment is applied to a virtual machine data migration scenario. In this embodiment, the method is implemented in the source virtual machine. On the basis of the implementation of the source virtual machine, reference may be made to the embodiment shown in FIG. 4 or FIG. 5 above, and details are not described herein again.
  • the method includes:
  • the virtual machine management center sends a virtual machine migration request message to the destination virtual machine management module.
  • the target virtual machine management module selects a physical resource corresponding to the virtual machine according to the virtual machine migration request message and creates a target virtual machine.
  • the virtual machine management module After the virtual machine management module completes the creation of the target virtual machine, the virtual machine management module sends a data migration request message to the virtual machine management center.
  • the virtual machine management center migrates the data in the source virtual machine to the destination virtual machine according to the data migration request message, and sends a data migration complete message to the target virtual machine management module after the data migration is completed.
  • the target virtual machine management module sends a network configuration request message to the destination virtual switch when creating the target virtual machine.
  • the destination virtual switch After receiving the network configuration request message, the destination virtual switch sends a network configuration information request message to the network management center if it is determined that the virtual network corresponding to the network connection information of the virtual machine is not configured.
  • the virtual switch also obtains a virtual network port from the network management center. It should be noted that, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual network port is obtained only from the network management center, and the network configuration response message is sent to the virtual machine management module, and step S709 is performed. S7 14.
  • the network management center returns the network configuration information according to the network configuration information request message.
  • the network management center also sends the configuration information to the destination physical switch.
  • the destination virtual switch configures the virtual network according to the network configuration message, and sends a network configuration response message to the target virtual machine management module.
  • the configuration of the virtual network may be performed for a VLAN, an ACL, a Qo S, etc., which is not limited by the present invention.
  • the destination physical switch also receives the network configuration information sent by the network management center, after the destination physical switch completes the virtual network configuration, the destination physical switch also sends a network configuration response message to the destination virtual machine management module.
  • the destination virtual machine management module After receiving the network configuration response message, the destination virtual machine management module sends a connection request message to the destination virtual switch.
  • the destination virtual switch establishes a connection with the destination virtual machine according to the connection request message.
  • the destination virtual switch After the connection is established, the destination virtual switch sends a confirmation message of connection establishment to the destination virtual machine management module.
  • the target virtual machine management module After receiving the confirmation message, the target virtual machine management module sends a virtual machine migration complete message to the virtual machine management center.
  • the destination virtual switch After the connection is established, the destination virtual switch sends a connection success message to the network management center.
  • the network management center After the network management center receives the connection success message, if it is determined that there is a conflicting virtual machine, the network switch sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is based on the connection.
  • the disconnect message disconnects from the conflicting virtual machine.
  • the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine; the network address may be a MAC address.
  • the conflicting virtual machine includes the source virtual machine, and the network management center sends a connection disconnection request message to the source virtual switch, so that The source virtual switch disconnects from the source virtual machine.
  • the network management center If the source physical switch and the destination physical switch exist in the network controlled by the network management center, the network management center notifies the source physical switch to delete the network configuration information.
  • source virtual machine management module and the source virtual switch may be integrated in the source host, and the target virtual machine management module and the destination virtual switch may be integrated in the destination host.
  • the virtual machine network configuration is realized by the direct interaction between the destination virtual machine management module and the destination virtual switch during the virtual machine data migration process, thereby effectively reducing the message interaction during the virtual machine network configuration process.
  • Process and time, while reducing latency, ensure the stability and continuity of the business.
  • the embodiment of the present invention provides a virtual machine management module 800, as shown in FIG. 8, which includes:
  • the processing unit 80 1 is configured to create a virtual machine.
  • the sending unit 802 is configured to send, to the virtual switch corresponding to the virtual machine created by the processing unit 80 1 , a network configuration trigger message including network connection information of the virtual machine, so that the virtual switch establishes the network connection information according to the virtual machine.
  • the virtual switch is connected to the virtual machine.
  • the network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module.
  • the receiving unit 803 is configured to receive an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
  • the receiving unit 803 is specifically configured to receive a create virtual machine request message sent by the virtual machine management center;
  • the processing unit 80 is specifically configured to select a virtual machine corresponding to the virtual machine according to the create virtual machine request message received by the receiving unit 803, and create the virtual machine.
  • the sending unit 802 is specifically configured to send a network configuration request message or a connection request message to the virtual switch, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
  • the network configuration request message is sent, after receiving the network configuration request message, the network configuration response message sent by the virtual switch is received; and after the virtual machine is created and the configuration response message is received, the virtual machine is sent to the virtual machine.
  • Connection request cancellation Interest After establishing the connection between the virtual machine and the virtual switch, receiving an acknowledgement message sent by the virtual switch.
  • connection request message is sent, after the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message, the acknowledgment message sent by the virtual switch is received.
  • the virtual switch If the network configuration request message is sent to the virtual switch, the virtual switch first performs network configuration according to the network configuration request message. After the virtual machine is created and the network response message sent by the virtual switch is received, the virtual switch sends a connection to the virtual switch. Requesting a message, so that the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message; that is, first instructing the virtual switch to perform network configuration, and after the network configuration is completed, instructing the virtual switch to establish and virtualize the virtual machine Connection.
  • connection request message is sent to the virtual switch
  • the virtual switch performs network configuration according to the connection request message, and establishes a connection with the virtual machine according to the network connection information in the connection request message, that is, the virtual switch receives the connection. After requesting the message, perform network configuration and establish a connection to the virtual machine.
  • the sending unit 802 sends a network configuration request message to the virtual switch
  • the receiving unit 803 is further configured to receive a network configuration response message sent by the virtual switch.
  • the sending unit 802 is further configured to: after the processing unit 80 1 virtual machine is created and the receiving unit receives the configuration response message, send a connection request message to the virtual switch.
  • the receiving unit is specifically configured to receive a virtual machine migration request message sent by the virtual machine management center.
  • the processing unit 80 is specifically configured to select a physical resource corresponding to the virtual machine according to the virtual machine migration request message received by the receiving unit 803 and create the virtual machine.
  • the sending unit 802 is further configured to send a network configuration to the virtual switch.
  • the request message is sent, so that the virtual switch sends a network configuration information request message to the network management center after receiving the network configuration request message.
  • the sending unit 802 is further configured to send a data migration request message to the virtual machine management center, so that the virtual machine management center migrates data of the source virtual machine to the destination virtual machine according to the data migration request message.
  • the receiving unit 803 is further configured to: after the data migration is completed, receive a data migration complete message sent by the virtual machine management center.
  • the virtual machine network configuration is realized through the direct interaction between the virtual machine management module and the virtual switch, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process, and reducing the delay. At the same time, the stability and continuity of the business are guaranteed.
  • the embodiment of the present invention provides a switching device 900, which is used for network switching of a virtual machine. As shown in FIG. 9, the method includes:
  • the receiving unit 901 is configured to receive a network configuration trigger message sent by the virtual machine management module.
  • the network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module, including network connection information of the virtual machine.
  • the processing unit 902 is configured to establish a connection with the virtual machine according to the network connection information received by the receiving unit 901.
  • the sending unit 903 is configured to return, to the virtual machine management module, an acknowledgement message that the virtual machine and the switching device network connection have been established.
  • the receiving unit 901 is specifically configured to: receive a network configuration request message or a connection request message sent by the virtual machine management module, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
  • the network configuration request message sent by the virtual machine management module is received, First, the network configuration is performed according to the network configuration request message. After the virtual machine is created and the network configuration response message sent by the switching device is received, the connection request message sent by the virtual machine management module is received, and the connection request is received according to the connection request.
  • the network connection information in the message establishes a connection with the virtual machine; that is, the virtual machine management module first instructs the switching device to perform network configuration, and after the network configuration is completed, instructs the switching device to establish a connection with the virtual machine.
  • H 'J Receiving a connection request message sent by the virtual machine management module; H 'J performs network configuration according to the connection request message, and establishes a connection with the virtual machine according to the network connection information in the connection request message, that is, after receiving After connecting the request message, perform network configuration and establish a connection with the virtual machine.
  • the network configuration request message or the connection request message sent by the receiving virtual machine management module is only a difference in implementation manner, and the embodiment of the present invention is not limited thereto, but it should fall within the protection scope of the present invention. Inside.
  • processing unit 902 is specifically configured to: after the receiving unit 901 receives the network connection information, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the connection with the virtual machine is directly established.
  • the network configuration information request message is sent to the network management center, so that the network management center returns the network configuration information according to the network configuration information request message; the processing unit 902
  • the virtual network is configured according to the network configuration information and a connection with the virtual machine is established.
  • the sending unit 903 is further configured to: send a network configuration response message to the virtual machine management module before establishing a connection with the virtual machine;
  • the receiving unit 901 is further configured to: after the virtual machine is created and the virtual machine management module receives the configuration response message, receive a connection request message sent by the virtual machine management module.
  • the foregoing network configuration may be configured for a VLAN, an ACL, a QoS, etc., which is not limited by the present invention.
  • the sending unit 903 is further configured to send a connection success message to the network management center, so that the network management center detects the presence of the conflicting virtual machine.
  • the switching device corresponding to the virtual machine sends a connection disconnect message, so that the switching device corresponding to the conflicting virtual machine disconnects the conflicting virtual machine according to the connection disconnect message.
  • the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine.
  • the switching device may include a source switching device, and the receiving unit 901 is further configured to receive a disconnection message sent by the virtual machine management center.
  • the processing unit 902 is further configured to disconnect the connection with the source virtual machine according to the connection disconnection message received by the receiving unit 901.
  • the network configuration of the virtual machine is realized through direct interaction between the virtual machine management module and the switching device, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process, while reducing the delay, Guarantee the stability and continuity of the business.
  • the virtual machine management module and the switching device may be co-located in the same host, and for the virtual machine data migration scenario, the source virtual machine management module and the source switching device may be combined in the source host, and the destination virtual The machine management module and the destination switching device can be integrated in the destination host.
  • FIG. 10 is a schematic structural diagram of an apparatus for performing network configuration on a virtual machine according to the present invention. As shown in FIG. 10, the apparatus 100 includes:
  • processor 101 a processor 101, a communication interface 102, a memory 103, and a communication bus 104; wherein the processor 101, the communication interface 102, and the memory 103 are completed by the communication bus 104 Communication with each other.
  • the processor 101 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • the memory 103 is used to store program code, and the program code includes computer operation Instruction.
  • the memory 103 may include a high speed RAM memory, and may also include a non-volatile memory, for example: at least one disk memory device.
  • the communication interface 102 is configured to output a compressed code stream of an image.
  • the processor 101 executes program code, and creates a virtual machine, and sends a network configuration trigger message including network connection information of the virtual machine to the virtual switch corresponding to the created virtual machine, so that the virtual switch is configured according to the virtual machine.
  • the network connection information establishes a connection between the virtual switch and the virtual machine, and receives an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
  • the network configuration trigger message includes a network connection message.
  • the processor 101 is further configured to receive a create virtual machine request message sent by the virtual machine management center, and select a virtual machine corresponding to the virtual machine according to the create virtual machine request message and create the virtual machine.
  • the processor 101 is further configured to send a network configuration request message or a connection request message to the virtual switch, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
  • the processor 101 is further configured to receive a network configuration response message sent by the virtual switch, and send a connection request message to the virtual switch after the virtual machine is created and the configuration response message is received.
  • the processor 101 is further configured to receive a virtual machine migration request message sent by the virtual machine management center, and select the physical resource corresponding to the virtual machine according to the virtual machine migration request message and create the virtual machine.
  • the processor 101 is further configured to send a network configuration request message to the virtual switch, so that the virtual switch sends a network configuration information request message to the network management center after receiving the network configuration request message.
  • FIG. 11 is a schematic structural diagram of an apparatus for performing network configuration on a virtual machine according to the present invention. As shown in FIG. 11, the apparatus 110 includes:
  • processor 111 a processor 111, a communication interface 112, a memory 113, and a communication bus 114; wherein the processor 111, the communication interface 112, and the memory 113 are completed by the communication bus 114 Communication with each other.
  • the processor 111 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • the memory 113 is for storing program code, and the program code includes computer operation instructions.
  • the memory 113 may include a high speed RAM memory, and may also include a non-volatile memory, for example, at least one disk memory.
  • the communication interface 112 is configured to output a compressed code stream of an image.
  • the processor 111 is configured to receive a network configuration trigger message sent by the virtual machine management module, where the network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module, including the Network connection information of the virtual machine, and establishing a connection with the virtual machine according to the network connection information, and returning an acknowledgement message that the virtual machine and the virtual switch network connection have been established to the virtual machine management module.
  • the processor 111 is further configured to receive a network configuration request message or a connection request message sent by the virtual machine management module, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
  • the processor 111 is further configured to: after receiving the network connection information, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, directly establish a connection with the virtual machine; If it is determined that the virtual network corresponding to the network connection information of the virtual machine is not configured, the network configuration information request message is sent to the network management center, so that the network management center returns the network configuration information according to the network configuration information request message; The virtual switch configures the virtual network according to the network configuration information and establishes a connection with the virtual machine.
  • the processor 112 is further configured to: if receiving the network configuration request message sent by the virtual machine management module, send a network configuration to the virtual machine management module before establishing a connection with the virtual machine. a response message; after the virtual machine is created and the virtual machine management module receives the configuration response message, receiving a connection request message sent by the virtual machine management module.
  • the processor 1 1 1 is further configured to send a connection success message to the network management center, so that the network management center sends a connection to the virtual switch corresponding to the conflicting virtual machine when determining that there is a conflicting virtual machine. Disconnecting the message, so that the virtual switch corresponding to the conflicting virtual machine disconnects from the conflicting virtual machine according to the connection disconnection message, where the conflicting virtual machine is a network address and a network of the virtual machine A virtual machine with the same address.
  • the processor 1 1 1 is further configured to receive a connection disconnection message sent by the virtual machine management center in a virtual machine data migration scenario, and disconnect the source virtual machine according to the connection disconnection message.
  • An embodiment of the present invention provides a computer readable medium, comprising computer executed instructions, when the central processor of a computer executes the computer execution instructions, the computer is configured to execute the processor 101 of the apparatus described in FIG.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided are a method and device for performing network configuration on a virtual machine, which relate to the field of communications, so as to reduce the time delay of message interaction in a network connection process of the virtual machine. The method comprises: creating a virtual machine; sending to a virtual switch corresponding to the virtual machine a network configuration trigger message comprising information about the network connection of the virtual machine, so that the virtual switch establishes a connection between the virtual switch and the virtual machine according to the information about the network connection of the virtual machine; and receiving a confirmation message that a connection between the virtual machine and the virtual switch has been established. The embodiments of the present invention are used for performing network configuration on a virtual machine.

Description

一种对虚拟机进行网络配置的方法和设备 技术领域  Method and device for network configuration of virtual machine
本发明涉及 IT领域,尤其涉及一种对虚拟机进行网络配置的方 法和设备。  The present invention relates to the field of IT, and in particular, to a method and device for network configuration of a virtual machine.
背景技术 Background technique
随着数据中心的广泛部署和虚拟机技术的广泛应用, 管理人员 面临服务器数量与 日倶增、 数据量日益庞大、 管理维护困难等诸多 挑战, 当前常见的数据中心部署, 包括虚拟机管理中心和网络管理 中心, 二者分别管理计算资源和网络资源。  With the widespread deployment of data centers and the widespread use of virtual machine technology, managers face many challenges such as increasing number of servers, increasing data volume, and difficult management and maintenance. Currently, common data center deployments include virtual machine management centers and Network management center, which manages computing resources and network resources separately.
现有技术中, 当虚拟机创建或迁移时, 需要计算系统和网络系 统互相配合, 才能为虚拟机分配和建立网络资源, 例如, 必须通过 虚拟机管理中心和网络管理中心的互相交互才能为虚拟机配置网络 资源, 这样, 使得虚拟机管理中心和网络管理中心之间的交互流程 复杂且繁瑣, 导致虚拟机创建或迁移的过程中的网络建立过程信息 交互的时延较大, 从而有可能造成虚拟机创建或迁移的过程中业务 的中断。  In the prior art, when a virtual machine is created or migrated, the computing system and the network system need to cooperate with each other to allocate and establish network resources for the virtual machine. For example, the virtual machine management center and the network management center must interact with each other to be virtual. The configuration of the network resources is such that the interaction between the virtual machine management center and the network management center is complicated and cumbersome, resulting in a large delay in the network establishment process information interaction during the virtual machine creation or migration process, which may result in Business interruption during virtual machine creation or migration.
发明内容 Summary of the invention
本发明的实施例提供一种对虚拟机进行网络配置的方法和设 备, 以降低虚拟机网络连接过程中消息交互的时延。  Embodiments of the present invention provide a method and a device for network configuration of a virtual machine to reduce the delay of message interaction in a virtual machine network connection process.
为达到上述目 的, 本发明的实施例采用如下技术方案:  In order to achieve the above objectives, embodiments of the present invention adopt the following technical solutions:
第一方面, 提供一种对虚拟机进行网络配置的方法, 包括: 创建虚拟机; 接信息的网络配置触发消息, 以使得所述虚拟交换机根据所述虚拟 机的网络连接信息建立所述虚拟交换机与所述虚拟机的连接, 其中, 所述网络配置触发消息用于为所述虚拟机管理模块所创建的虚拟机 进行网络配置; 接收所述虚拟机与所述虚拟交换机建立连接的确认消息。 The first aspect provides a method for network configuration of a virtual machine, including: creating a virtual machine; and receiving a network configuration trigger message of the information, so that the virtual switch establishes the virtual switch according to network connection information of the virtual machine. a connection with the virtual machine, where the network configuration trigger message is used for network configuration of a virtual machine created by the virtual machine management module; Receiving an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
在第一方面第一种可能的实现方式中, 所述创建虚拟机包括: 接收虚拟机管理中心发送的创建虚拟机请求消息;  In a first possible implementation manner of the first aspect, the creating a virtual machine includes: receiving a create virtual machine request message sent by a virtual machine management center;
根据所述创建虚拟机请求消息, 选择所述虚拟机对应的物理资 源并创建所述虚拟机。  And according to the create virtual machine request message, select a physical resource corresponding to the virtual machine and create the virtual machine.
结合第一种可能的实现方式, 在第二种可能的实现方式中, 所 信息的网络配置触发消息, 包括:  In conjunction with the first possible implementation manner, in a second possible implementation manner, the network configuration trigger message of the information includes:
向所述虚拟交换机发送网络配置请求消息或者连接请求消息, 所述网络配置请求消息或者连接请求消息包括所述虚拟机的网络连 接信息。  Sending a network configuration request message or a connection request message to the virtual switch, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
结合第二种可能的实现方式, 在第三种可能的实现方式中, 若 向所述虚拟交换机发送网络配置请求消息, 在所述建立所述虚拟机 与所述虚拟交换机的连接之前, 所述方法还包括:  In conjunction with the second possible implementation, in a third possible implementation, if a network configuration request message is sent to the virtual switch, before the establishing the connection between the virtual machine and the virtual switch, The method also includes:
接收所述虚拟交换机发送的网络配置响应消息;  Receiving a network configuration response message sent by the virtual switch;
在所述虚拟机创建完成且接收到所述配置响应消息后, 向所述 虚拟交换机发送连接请求消息。  After the virtual machine is created and the configuration response message is received, a connection request message is sent to the virtual switch.
结合第一方面, 在第四种可能的实现方式中, 所述创建虚拟机 包括:  With reference to the first aspect, in a fourth possible implementation, the creating a virtual machine includes:
接收虚拟机管理中心发送的虚拟机迁移请求消息;  Receiving a virtual machine migration request message sent by the virtual machine management center;
根据所述虚拟机迁移请求消息选择所述虚拟机对应的物理资源 并创建所述虚拟机。  Selecting a physical resource corresponding to the virtual machine according to the virtual machine migration request message and creating the virtual machine.
结合第四种可能的实现方式, 在第五种可能的实现方式中, 所 述方法还包括:  In conjunction with the fourth possible implementation, in a fifth possible implementation, the method further includes:
向所述虚拟交换机发送网络配置请求消息, 以便所述虚拟交换 机在接收到所述网络配置请求消息后, 向所述网络管理中心发送网 络配置信息请求消息。  Sending a network configuration request message to the virtual switch, so that the virtual switch sends a network configuration information request message to the network management center after receiving the network configuration request message.
结合第四种可能的实现方式或第五种可能的实现方式, 在第六 种可能的实现方式中, 所述方法还包括: 向虚拟机管理中心发送数据迁移请求消息, 以便所述虚拟机管 理中心根据所述数据迁移请求消息将源虚拟机的数据迁移至目 的虚 拟机; With reference to the fourth possible implementation manner or the fifth possible implementation manner, in a sixth possible implementation manner, the method further includes: Sending a data migration request message to the virtual machine management center, so that the virtual machine management center migrates data of the source virtual machine to the destination virtual machine according to the data migration request message;
在所述数据迁移完成后, 接收所述虚拟机管理中心发送的数据 迁移完成消息。  After the data migration is completed, the data migration completion message sent by the virtual machine management center is received.
第二方面, 提供一种对虚拟机进行网络配置的方法, 包括: 接收虚拟机管理模块发送的网络配置触发消息, 所述网络配置 触发消息用于为所述虚拟机管理模块所创建的虚拟机进行网络配 置, 包括所述虚拟机的网络连接信息;  The second aspect provides a method for performing network configuration on a virtual machine, including: receiving a network configuration trigger message sent by a virtual machine management module, where the network configuration trigger message is used for a virtual machine created by the virtual machine management module Performing network configuration, including network connection information of the virtual machine;
根据所述网络连接信息建立与所述虚拟机的连接; 连接已建立的确认消息。  Establishing a connection with the virtual machine according to the network connection information; and connecting an established acknowledgement message.
在第二方面第一种可能的实现方式中, 所述接收所述虚拟机管 理模块发送的网络配置触发消息包括: 接收所述虚拟机管理模块发 送的网络配置请求消息或者连接请求消息, 所述网络配置请求消息 或者连接请求消息包括所述虚拟机的网络连接信息。  In a first possible implementation manner of the second aspect, the receiving the network configuration trigger message sent by the virtual machine management module includes: receiving a network configuration request message or a connection request message sent by the virtual machine management module, where The network configuration request message or the connection request message includes network connection information of the virtual machine.
结合第一方面或第一方面第一种可能的实现方式, 在第二种可 能的实现方式中, 所述根据所述网络连接信息建立与所述虚拟机的 连接, 包括:  With the first aspect or the first possible implementation of the first aspect, in a second possible implementation, the establishing, by the network connection information, the connection with the virtual machine includes:
在接收到所述网络连接信息后, 若确定自身已配置所述虚拟机 的网络连接信息对应的虚拟网络, 则直接建立与所述虚拟机的连接; 若确定自身未配置所述虚拟机的网络连接信息对应的虚拟网 络, 则向网络管理中心发送网络配置信息请求消息, 以便所述网络 管理中心根据所述网络配置信息请求消息返回网络配置信息; 所述 虚拟交换机根据所述网络配置信息配置虚拟网络并建立与所述虚拟 机的连接。  After receiving the network connection information, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the connection with the virtual machine is directly established; if it is determined that the virtual machine is not configured The virtual network corresponding to the connection information sends a network configuration information request message to the network management center, so that the network management center returns network configuration information according to the network configuration information request message; the virtual switch configures the virtual according to the network configuration information. The network establishes a connection with the virtual machine.
结合第一种可能的实现方式或第二种可能的实现方式, 在第三 种可能的实现方式中, 若接收到所述虚拟机管理模块发送的网络配 置请求消息, 在建立与所述虚拟机的连接之前, 所述方法还包括: 向所述虚拟机管理模块发送网络配置响应消息; In combination with the first possible implementation manner or the second possible implementation manner, in a third possible implementation manner, if the network configuration request message sent by the virtual machine management module is received, the virtual machine is established Before the connection, the method further includes: Sending a network configuration response message to the virtual machine management module;
在所述虚拟机创建完成且所述虚拟机管理模块接收到所述配置 响应消息后, 接收所述虚拟机管理模块发送的连接请求消息。  After the virtual machine is created and the virtual machine management module receives the configuration response message, the connection request message sent by the virtual machine management module is received.
结合第二方面至第二方面第三种可能的实现方式中的任一项, 在第四种可能的实现方式中, 所述方法还包括:  With reference to any one of the second aspect to the third possible implementation manner of the second aspect, in a fourth possible implementation, the method further includes:
向所述网络管理中心发送连接成功消息, 以便所述网络管理中 心在确定存在冲突虚拟机时, 向所述冲突虚拟机对应的虚拟交换机 发送连接断开消息, 以使得所述冲突虚拟机对应的虚拟交换机根据 所述连接断开消息断开与所述冲突虚拟机的连接, 其中, 所述冲突 虚拟机为网络地址与所述虚拟机的网络地址相同的虚拟机。  Sending a connection success message to the network management center, so that the network management center sends a connection disconnection message to the virtual switch corresponding to the conflicting virtual machine when the conflicting virtual machine is determined, so that the conflicting virtual machine corresponds to The virtual switch disconnects the conflicting virtual machine according to the connection disconnection message, where the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine.
结合第三种可能的实现方式或第四种可能的实现方式, 在第五 种可能的实现方式中, 在虚拟机数据迁移场景下, 目 的虚拟交换机 通知虚拟机管理中心将源虚拟机中的数据迁移至目 的虚拟机, 所述 目 的虚拟机对应的目 的虚拟交换机建立与所述目 的虚拟机的连接; 所述源虚拟机对应有源虚拟交换机; 所述在所述目 的虚拟机对应的 目的虚拟交换机建立与所述目 的虚拟机的连接之前还包括:  In combination with the third possible implementation manner or the fourth possible implementation manner, in the fifth possible implementation manner, in the virtual machine data migration scenario, the destination virtual switch notifies the virtual machine management center to use the data in the source virtual machine. The destination virtual machine is connected to the destination virtual machine, and the destination virtual machine is connected to the destination virtual machine; the source virtual machine corresponds to the active virtual switch; and the destination virtual switch corresponding to the destination virtual machine Before establishing a connection with the destination virtual machine, the method further includes:
源虚拟交换机接收虚拟机管理中心发送的连接断开消 , ¾; 源虚拟交换机根据所述连接断开消息断开与所述源虚拟机的连 接。  The source virtual switch receives the disconnection sent by the virtual machine management center, and the source virtual switch disconnects the source virtual machine according to the connection disconnect message.
第三方面, 提供一种虚拟机管理模块, 包括: 处理单元, 用于 创建虚拟机;  The third aspect provides a virtual machine management module, including: a processing unit, configured to create a virtual machine;
处理单元, 用于创建虚拟机;  a processing unit, configured to create a virtual machine;
发送单元, 用于向所述处理单元创建的虚拟机对应的虚拟交换 机发送包括所述虚拟机的网络连接信息的网络配置触发消息, 以使 得所述虚拟交换机根据所述虚拟机的网络连接信息建立所述虚拟交 换机与所述虚拟机的连接, 其中, 所述网络配置触发消息用于为所 述虚拟机管理模块所创建的虚拟机进行网络配置;  a sending unit, configured to send, to the virtual switch corresponding to the virtual machine created by the processing unit, a network configuration trigger message including network connection information of the virtual machine, so that the virtual switch establishes according to network connection information of the virtual machine a connection between the virtual switch and the virtual machine, where the network configuration trigger message is used to perform network configuration for a virtual machine created by the virtual machine management module;
接收单元, 用于接收所述虚拟机与所述虚拟交换机建立连接的 确认消息。 在第三方面第一种可能的实现方式中, 所述接收单元具体用于 接收虚拟机管理中心发送的创建虚拟机请求消息; And a receiving unit, configured to receive an acknowledgement message that the virtual machine establishes a connection with the virtual switch. In a first possible implementation manner of the third aspect, the receiving unit is specifically configured to receive a create virtual machine request message sent by a virtual machine management center;
所述处理单元具体用于根据所述接收单元接收的创建虚拟机请 求消息, 选择所述虚拟机对应的物理资源并创建所述虚拟机。  The processing unit is specifically configured to: according to the create virtual machine request message received by the receiving unit, select a physical resource corresponding to the virtual machine, and create the virtual machine.
结合第三方面第一种可能的实现方式, 在第二种可能的实现方 式中, 所述发送单元具体用于向所述虚拟交换机发送网络配置请求 消息或者连接请求消息, 所述网络配置请求消息或者连接请求消息 包括所述虚拟机的网络连接信息。  With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner, the sending unit is specifically configured to send a network configuration request message or a connection request message to the virtual switch, where the network configuration request message is Or the connection request message includes network connection information of the virtual machine.
结合第二种可能的实现方式, 在第三种可能的实现方式中, 所 述接收单元还用于, 接收所述虚拟交换机发送的网络配置响应消息; 所述发送单元还用于, 在所述处理单元虚拟机创建完成且所述 接收单元接收到所述配置响应消息后, 向所述虚拟交换机发送连接 请求消息。  With reference to the second possible implementation manner, in a third possible implementation, the receiving unit is further configured to: receive a network configuration response message sent by the virtual switch, where the sending unit is further configured to: After the processing unit virtual machine is created and the receiving unit receives the configuration response message, the connection request message is sent to the virtual switch.
结合第三方面, 在第四种可能的实现方式中, 所述接收单元具 体用于接收虚拟机管理中心发送的虚拟机迁移请求消息;  With reference to the third aspect, in a fourth possible implementation, the receiving unit is configured to receive a virtual machine migration request message sent by a virtual machine management center;
所述处理单元具体用于根据所述接收单元接收的虚拟机迁移请 求消息选择所述虚拟机对应的物理资源并创建所述虚拟机。  The processing unit is specifically configured to select a physical resource corresponding to the virtual machine according to a virtual machine migration request message received by the receiving unit, and create the virtual machine.
结合第四种可能的实现方式, 在第五种可能的实现方式中, 所 述发送单元还用于, 向所述虚拟交换机发送网络配置请求消息, 以 便所述虚拟交换机在接收到所述网络配置请求消息后, 向所述网络 管理中心发送网络配置信息请求消息。  With reference to the fourth possible implementation, in a fifth possible implementation, the sending unit is further configured to send a network configuration request message to the virtual switch, so that the virtual switch receives the network configuration After requesting the message, a network configuration information request message is sent to the network management center.
结合第四种可能的实现方式或第五种可能的实现方式, 在第六 种可能的实现方式中, 所述发送单元还用于, 向虚拟机管理中心发 送数据迁移请求消息, 以便所述虚拟机管理中心根据所述数据迁移 请求消息将源虚拟机的数据迁移至目 的虚拟机;  In combination with the fourth possible implementation manner or the fifth possible implementation manner, in a sixth possible implementation manner, the sending unit is further configured to send a data migration request message to the virtual machine management center, so that the virtual The machine management center migrates the data of the source virtual machine to the destination virtual machine according to the data migration request message;
所述接收单元还用于, 在所述数据迁移完成后, 接收所述虚拟 机管理中心发送的数据迁移完成消息。  The receiving unit is further configured to: after the data migration is completed, receive a data migration complete message sent by the virtual machine management center.
第四方面, 提供一种交换装置, 包括: 接收单元, 用于在虚拟 机管理模块创建虚拟机时, 接收所述虚拟机管理模块发送的网络配 置触发消息, 所述网络配置触发消息用于为所述虚拟机管理模块所 创建的虚拟机进行网络配置, 包括所述虚拟机的网络连接信息; 处理单元, 用于根据所述接收单元接收的网络连接信息建立与 所述虚拟机的连接; The fourth aspect provides a switching device, including: a receiving unit, configured to receive, when the virtual machine management module creates a virtual machine, a network configuration sent by the virtual machine management module a triggering message, where the network configuration triggering message is used to perform network configuration for the virtual machine created by the virtual machine management module, including network connection information of the virtual machine, and a processing unit, configured to receive according to the receiving unit Network connection information establishes a connection with the virtual machine;
发送单元, 用于向所述虚拟机管理模块返回所述虚拟机与所述 交换装置网络连接已建立的确认消息。  And a sending unit, configured to return, to the virtual machine management module, an acknowledgement message that the virtual machine and the switching device network connection have been established.
在第四方面第一种可能的实现方式中,所述接收单元具体用于, 接收所述虚拟机管理模块发送的网络配置请求消息或者连接请求消 息, 所述网络配置请求消息或者连接请求消息包括所述虚拟机的网 络连接信息。  In a first possible implementation manner of the fourth aspect, the receiving unit is specifically configured to: receive a network configuration request message or a connection request message sent by the virtual machine management module, where the network configuration request message or the connection request message includes Network connection information of the virtual machine.
结合第四方面或第四方面第一种可能的实现方式, 在第二种可 能的实现方式中, 所述处理单元具体用于, 所述处理单元具体用于, 在接收到所述网络连接信息后, 若确定自身已配置所述虚拟机的网 络连接信息对应的虚拟网络, 则直接建立与所述虚拟机的连接; 若确定自身未配置所述虚拟机的网络连接信息对应的虚拟网 络, 则向网络管理中心发送网络配置信息请求消息, 以便所述网络 管理中心根据所述网络配置信息请求消息返回网络配置信息; 所述 处理单元根据所述网络配置信息配置虚拟网络并建立与所述虚拟机 的连接。  With reference to the fourth aspect, or the first possible implementation manner of the fourth aspect, in a second possible implementation manner, the processing unit is specifically configured to: when the processing unit is configured to receive the network connection information Then, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the connection with the virtual machine is directly established; if it is determined that the virtual network corresponding to the network connection information of the virtual machine is not configured, Sending a network configuration information request message to the network management center, so that the network management center returns network configuration information according to the network configuration information request message; the processing unit configures a virtual network according to the network configuration information, and establishes a virtual network with the virtual machine Connection.
结合第一种可能的实现方式或第二种可能的实现方式, 在第三 种可能的实现方式中, 所述发送单元还用于, 在建立与所述虚拟机 的连接之前, 向所述虚拟机管理模块发送网络配置响应消息;  In combination with the first possible implementation or the second possible implementation, in a third possible implementation, the sending unit is further configured to: before establishing a connection with the virtual machine, to the virtual The machine management module sends a network configuration response message;
所述接收单元还用于, 在所述虚拟机创建完成且所述虚拟机管 理模块接收到所述配置响应消息后, 接收所述虚拟机管理模块发送 的连接请求消息。  The receiving unit is further configured to: after the virtual machine is created and the virtual machine management module receives the configuration response message, receive a connection request message sent by the virtual machine management module.
结合第四方面至第四方面第三种可能的实现方式, 在第四种可 能的实现方式中, 所述发送单元还用于, 向所述网络管理中心发送 连接成功消息, 以便所述网络管理中心在确定存在冲突虚拟机时, 向所述冲突虚拟机对应的交换装置发送连接断开消息, 以使得所述 冲突虚拟机对应的交换装置根据所述连接断开消息断开与所述冲突 虚拟机的连接, 其中, 所述冲突虚拟机为网络地址与所述虚拟机的 网络地址相同的虚拟机。 With reference to the third aspect to the third possible implementation manner of the fourth aspect, in a fourth possible implementation, the sending unit is further configured to send a connection success message to the network management center, so that the network management When determining that there is a conflicting virtual machine, the center sends a disconnection message to the switching device corresponding to the conflicting virtual machine, so that the The switching device corresponding to the conflicting virtual machine disconnects the conflicting virtual machine according to the connection disconnection message, where the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine.
结合第三种可能的实现方式或第四种可能的实现方式, 在第五 种可能的实现方式中, 所述接收单元还用于, 接收虚拟机管理中心 发送的连接断开消息;  In combination with the third possible implementation manner or the fourth possible implementation manner, in a fifth possible implementation manner, the receiving unit is further configured to receive a connection disconnection message sent by the virtual machine management center;
所述处理单元, 还用于根据所述接收单元接收的连接断开消息 断开与所述源虚拟机的连接。  The processing unit is further configured to disconnect the connection with the source virtual machine according to the connection disconnection message received by the receiving unit.
第五方面, 提供一种对虚拟机进行网络配置的装置, 包括处理 器和存储器, 所述存储器存储计算机执行指令, 所述处理器与所述 存储器通过通信总线连接;  A fifth aspect provides an apparatus for network configuration of a virtual machine, including a processor and a memory, wherein the memory stores a computer to execute an instruction, and the processor is connected to the memory through a communication bus;
当所述装置运行时, 所述处理器执行所述存储器存储的所述计 算机执行指令, 使得所述装置执行上述第一方面所述的方法。  The processor executes the computer-executed instructions stored by the memory when the apparatus is in operation, such that the apparatus performs the method of the first aspect described above.
第六方面, 提供一种对虚拟机进行网络配置的装置, 包括处理 器和存储器, 所述存储器存储计算机执行指令, 所述处理器与所述 存储器通过通信总线连接;  A sixth aspect provides an apparatus for network configuration of a virtual machine, including a processor and a memory, wherein the memory stores a computer to execute an instruction, and the processor is connected to the memory through a communication bus;
当所述装置运行时, 所述处理器执行所述存储器存储的所述计 算机执行指令, 使得所述装置执行第二方面所述的方法。  The processor executes the computer-executed instructions stored by the memory when the apparatus is in operation, such that the apparatus performs the method of the second aspect.
第七方面, 提供一种计算机可读介质, 包含计算机执行指令, 当计算机的中央处理器执行所述计算机执行指令时, 所述计算机执 行上述第一方面或者第二方面所述的方法。  In a seventh aspect, a computer readable medium is provided, comprising computer executed instructions, wherein the computer executes the method of the first aspect or the second aspect when a central processor of a computer executes the computer to execute an instruction.
通过采用上述方案, 通过虚拟机管理模块和虚拟交换机的直接 交互实现对虚拟机的网络配置, 有效地减少了对虚拟机网络配置过 程中消息交互的流程和时间, 在降低时延的同时, 保证了业务的稳 定性和持续性。  By adopting the above solution, the virtual machine network configuration is realized by the direct interaction between the virtual machine management module and the virtual switch, which effectively reduces the flow and time of message interaction in the virtual machine network configuration process, and reduces the delay while ensuring The stability and continuity of the business.
附图说明 DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下 面将对实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 根据这些附图获得其他的附图。 In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only Is some embodiments of the invention, for Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图 1 为本发明实施例提供的一种网络系统;  FIG. 1 is a network system according to an embodiment of the present invention;
图 2为本发明实施例提供的一种对虚拟机进行网络配置的方法 示意图;  2 is a schematic diagram of a method for network configuration of a virtual machine according to an embodiment of the present invention;
图 3 为本发明实施例提供的另一种对虚拟机进行网络配置的方 法示意图;  FIG. 3 is a schematic diagram of another method for network configuration of a virtual machine according to an embodiment of the present invention; FIG.
图 4为本发明实施例提供的一种对虚拟机进行网络配置方法的 流程示意图;  4 is a schematic flowchart of a network configuration method for a virtual machine according to an embodiment of the present invention;
图 5 为本发明实施例提供的另一种对虚拟机进行网络配置方法 的流程示意图;  FIG. 5 is a schematic flowchart of another method for configuring a network for a virtual machine according to an embodiment of the present invention;
图 6为本发明实施例提供的另一种对虚拟机进行网络配置方法 的流程示意图;  FIG. 6 is a schematic flowchart of another method for configuring a network for a virtual machine according to an embodiment of the present disclosure;
图 7为本发明实施例提供的另一种对虚拟机进行网络配置方法 的流程示意图;  FIG. 7 is a schematic flowchart of another method for configuring a network for a virtual machine according to an embodiment of the present disclosure;
图 8 为本发明实施例提供的一种虚拟机管理模块的结构示意 图;  FIG. 8 is a schematic structural diagram of a virtual machine management module according to an embodiment of the present disclosure;
图 9为本发明实施例提供的一种交换装置的结构示意图; 图 10 为本发明实施例提供的一种对虚拟机进行网络配置的装 置示意图;  FIG. 9 is a schematic structural diagram of a switching apparatus according to an embodiment of the present invention; FIG. 10 is a schematic diagram of a device for performing network configuration on a virtual machine according to an embodiment of the present invention;
图 1 1 为为本发明实施例提供的另一种对虚拟机进行网络配置 的装置示意图。  FIG. 11 is a schematic diagram of another apparatus for network configuration of a virtual machine according to an embodiment of the present invention.
具体实施方式 detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术 方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明 一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本 领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他 实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明各实施例提供的技术方案可应用于一种对虚拟机进行网 络配置的系统, 如图 1所示, 该系统包括: The technical solution provided by the embodiments of the present invention can be applied to a network for a virtual machine. The network configuration system, as shown in Figure 1, the system includes:
虚拟机管理模块, 是运行在每台主机上的管理模块, 虚拟机管 理中心通过它执行每台主机上的管理功能, 以下个实施例中, 用于 接收和转发来自虚拟机管理中心的虚拟交换机的消息以及上报虚拟 机的 态。  The virtual machine management module is a management module running on each host. The virtual machine management center performs management functions on each host through it. In the following embodiments, it is used to receive and forward virtual switches from the virtual machine management center. The message and the state of the reported virtual machine.
虚拟机管理中心, 是对系统管理员呈现的虚拟机管理系统, 负 责虚拟机的管理和控制, 包括完成虚拟机的属性和状态的监控和修 改, 虚拟机的创建、 迁移、 上点和下点等操作。  The virtual machine management center is a virtual machine management system presented to the system administrator. It is responsible for the management and control of the virtual machine, including monitoring and modifying the attributes and status of the virtual machine, creating, migrating, up and down the virtual machine. Wait for the operation.
网络管理中心, 是对网络管理员呈现的网络管理系统, 他同时 管理和控制着物理网络设备和虚拟网络设备, 包括完成物理交换机 及其端口的管理和配置, 虚拟机及其端口的管理和控制、 IP地址管 理以及虚拟机之间的网络连接状态管理、 流量监控等功能。  The network management center is a network management system presented to network administrators. It manages and controls physical network devices and virtual network devices at the same time, including the management and configuration of physical switches and their ports, and the management and control of virtual machines and their ports. , IP address management, and network connection status management, traffic monitoring, and other functions between virtual machines.
虚拟交换机, 可以是运行在主机上的, 通过软件实现的具有交 换功能的设备和模块, 也可以是在物理网卡上通过硬件实现的交换 设备和模块 该虚拟更换机可以是普通的虚拟交换机, 也可以是分 布式的虚拟交换机。 网络管理中心在其上可以进行 VLAN , ACL , QoS 等各种网络信息的配置, 同时它还与虚拟机管理模块配合完成 虚拟机与网络的断开与连接等操作。  The virtual switch may be a device and a module running on a host, implemented by software, or a switch device and a module implemented by hardware on a physical network card. The virtual switch may be a common virtual switch. It can be a distributed virtual switch. The network management center can configure various network information such as VLAN, ACL, and QoS, and it also cooperates with the virtual machine management module to complete the disconnection and connection of the virtual machine and the network.
本发明实施例提供一种虚拟机配置的方法, 如图 2所示, 该实 施例的执行主体为虚拟机管理模块, 包括:  The embodiment of the present invention provides a method for configuring a virtual machine. As shown in FIG. 2, the execution entity of the embodiment is a virtual machine management module, and includes:
S201、 虚拟机管理模块创建虚拟机。  S201. The virtual machine management module creates a virtual machine.
其中, 在网络管理中心中配置有虚拟网络和虚拟网络端口。 具体地, 虚拟机管理模块接收虚拟机管理中心发送的创建虚拟 机请求消息, 并根据该创建虚拟机请求消息, 选择该虚拟机对应的 物理资源并创建该虚拟机。  Among them, a virtual network and a virtual network port are configured in the network management center. Specifically, the virtual machine management module receives the create virtual machine request message sent by the virtual machine management center, and selects a physical resource corresponding to the virtual machine according to the create virtual machine request message, and creates the virtual machine.
S 202、 虚拟机管理模块向该虚拟机对应的虚拟交换机发送包括 该虚拟机的网络连接信息的网络配置触发消息, 以使得该虚拟交换 机根据该虚拟机的网络连接信息建立该虚拟交换机与该虚拟机的连 接。 其中, 该网络配置触发消息用于为该虚拟机管理模块所创建的 虚拟机进行网络配置。 S202. The virtual machine management module sends a network configuration trigger message including the network connection information of the virtual machine to the virtual switch corresponding to the virtual machine, so that the virtual switch establishes the virtual switch and the virtual according to the network connection information of the virtual machine. Machine connection. The network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module.
S203、 虚拟机管理模块接收该虚拟机与虚拟交换机建立连接的 确认消息。  S203. The virtual machine management module receives an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
进一步地, 虚拟机管理模块向该虚拟交换机发送网络配置请求 消息或者连接请求消息。  Further, the virtual machine management module sends a network configuration request message or a connection request message to the virtual switch.
该网络配置请求消息或者连接请求消息包括该虚拟机的网络连 接信息。  The network configuration request message or the connection request message includes network connection information of the virtual machine.
具体地, 若虚拟机管理模块向虚拟交换机发送网络配置请求消 息, 则该虚拟机管理模块在发送网络配置请求消息之后, 接收该虚 拟交换机发送的网络配置响应消息; 并在虚拟机创建完成且接收到 该配置响应消息后, 向该虚拟机发送连接请求消息。 在建立该虚拟 机与该虚拟交换机的连接后, 虚拟机管理模块接收该虚拟交换机发 送的确认消息。  Specifically, if the virtual machine management module sends a network configuration request message to the virtual switch, the virtual machine management module receives the network configuration response message sent by the virtual switch after sending the network configuration request message; and after the virtual machine is created and received After the configuration response message, a connection request message is sent to the virtual machine. After establishing the connection between the virtual machine and the virtual switch, the virtual machine management module receives an acknowledgement message sent by the virtual switch.
若虚拟机管理模块向虚拟交换机发送连接请求消息, 则在该虚 拟交换机根据该连接请求消息中的网络连接信息建立与该虚拟机的 连接后, 虚拟机管理模块接收该虚拟交换机发送的确认消 , ¾。  If the virtual machine management module sends a connection request message to the virtual switch, after the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message, the virtual machine management module receives the confirmation sent by the virtual switch. 3⁄4.
需要说明的是, 上述虚拟机管理模块向该虚拟交换机发送网络 配置请求消息或者连接请求消息的区别在于:  It should be noted that the difference between the foregoing virtual machine management module sending a network configuration request message or a connection request message to the virtual switch is:
若虚拟机管理模块向虚拟交换机发送网络配置请求消息, 则虚 拟交换机先根据该网络配置请求消息进行网络配置, 当完成该虚拟 机的创建且接收到虚拟交换机发送的网络响应消息后, 该虚拟机管 理模块才向该虚拟交换机发送连接请求消 , , 以便该虚拟交换机根 据该连接请求消息中的网络连接信息建立与该虚拟机的连接; 也就 是说, 虚拟机管理模块首先指示虚拟交换机进行网络配置, 在网络 配置完成后, 指示虚拟交换机建立与虚拟机的连接。  If the virtual machine management module sends a network configuration request message to the virtual switch, the virtual switch first performs network configuration according to the network configuration request message. After the virtual machine is created and the network response message sent by the virtual switch is received, the virtual machine is configured. The management module sends a connection request to the virtual switch, so that the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message; that is, the virtual machine management module first instructs the virtual switch to perform network configuration. After the network configuration is completed, instruct the virtual switch to establish a connection with the virtual machine.
若虚拟机管理模块向虚拟交换机发送连接请求消息; 则该虚拟 交换机根据该连接请求消息进行网络配置, 并根据该连接请求消息 中的网络连接信息建立与该虚拟机的连接, 也就是说, 虚拟交换机 接收到连接请求消息后, 进行网络配置并建立与虚拟机的连接。 If the virtual machine management module sends a connection request message to the virtual switch, the virtual switch performs network configuration according to the connection request message, and establishes a connection with the virtual machine according to the network connection information in the connection request message, that is, virtual Switch After receiving the connection request message, perform network configuration and establish a connection with the virtual machine.
上述的虚拟机管理模块向该虚拟交换机发送网络配置请求消 , ¾ 或者连接请求消息只是实现方式上的区别, 本发明实施例并不局限 于此, 但无论采用哪种方式, 都应落入本发明的保护范围内。  The foregoing virtual machine management module sends a network configuration request to the virtual switch, and the connection request message is only a difference in implementation manner. The embodiment of the present invention is not limited thereto, but no matter which method is adopted, it should fall into the present embodiment. Within the scope of protection of the invention.
需要说明的是, 上述网络配置可以针对 VLAN ( Virtual Local Area Network , 虚拟局 i或网 )、 ACL ( Access Control List , 访问控制 列表)、 QoS ( Quality of Service , 服务质量) 等进行的配置, 本发 明对此不作限定。  It should be noted that the foregoing network configuration may be configured for a VLAN (Virtual Local Area Network), an ACL (Access Control List), a QoS (Quality of Service), and the like. The invention is not limited thereto.
进一步地,本发明实施例还可以应用于虚拟机数据迁移的场景, 在该场景下, 目 的虚拟交换机通知虚拟机管理中心将源虚拟机中的 数据迁移至目 的虚拟机, 该目 的虚拟机对应的目 的虚拟交换机建立 与该目的虚拟机的连接; 该源虚拟机对应有源虚拟交换机;  Further, the embodiment of the present invention may be applied to a scenario in which a virtual machine data is migrated. In this scenario, the destination virtual switch notifies the virtual machine management center to migrate data in the source virtual machine to the destination virtual machine, where the destination virtual machine corresponds. The destination virtual switch establishes a connection with the destination virtual machine; the source virtual machine corresponds to an active virtual switch;
此时, 本实施例中的虚拟机管理模块可以包括目 的虚拟机管理 模块, 上述步骤 S201可以为: 目的虚拟机管理模块接收虚拟机管理 中心发送的虚拟机迁移请求消息, 并根据该虚拟机迁移请求消息选 择该虚拟机对应的物理资源并创建该虚拟机。 其中, 该虚拟机可以 为 目 的虚拟机。  In this case, the virtual machine management module in this embodiment may include a destination virtual machine management module, and the foregoing step S201 may be: the destination virtual machine management module receives the virtual machine migration request message sent by the virtual machine management center, and migrates according to the virtual machine. The request message selects the physical resource corresponding to the virtual machine and creates the virtual machine. The virtual machine can be the target virtual machine.
进一步地, 在该目的虚拟机创建完成后, 目 的虚拟机管理模块 向虚拟机管理中心发送数据迁移请求消息, 以便该虚拟机管理中心 根据该数据迁移请求消息将源虚拟机的数据迁移至目 的虚拟机;  Further, after the creation of the destination virtual machine is completed, the destination virtual machine management module sends a data migration request message to the virtual machine management center, so that the virtual machine management center migrates the data of the source virtual machine to the destination virtuality according to the data migration request message. Machine
在该数据迁移完成后, 目 的虚拟机管理模块接收该虚拟机管理 中心发送的数据迁移完成消息。  After the data migration is completed, the target virtual machine management module receives the data migration completion message sent by the virtual machine management center.
在目 的虚拟机管理模块接收到该数据迁移完成消息后, 本发明 实施例还包括以下两种实施方式:  After the target virtual machine management module receives the data migration completion message, the embodiment of the present invention further includes the following two implementation manners:
方式一: 目 的虚拟机管理模块向该虚拟机管理中心发送网络配 置完成消息和数据迁移完成通知消息, 以便该虚拟机管理中心向源 虚拟机管理模块发送连接断开请求消息后, 该源虚拟机管理模块向 源虚拟交换机发送连接断开消息, 以使得该源虚拟交换机根据该断 开连接请求消息断开与源虚拟机的连接; 目 的虚拟机管理模块在接收到该虚拟机管理中心发送的连接请 求通知消息后, 向目 的虚拟交换机发送连接请求消息, 以便该目 的 虚拟交换机建立与 目 的虚拟机的连接。 Manner 1: The destination virtual machine management module sends a network configuration completion message and a data migration completion notification message to the virtual machine management center, so that the virtual machine management center sends a connection disconnection request message to the source virtual machine management module, the source virtual machine The management module sends a disconnection message to the source virtual switch, so that the source virtual switch disconnects the source virtual machine according to the disconnection request message; After receiving the connection request notification message sent by the virtual machine management center, the destination virtual machine management module sends a connection request message to the destination virtual switch, so that the destination virtual switch establishes a connection with the destination virtual machine.
方式二: 目 的虚拟机管理模块向该目 的虚拟交换机发送连接请 求消息, 以便该目 的虚拟交换机建立与目 的虚拟机的连接;  Manner 2: The virtual machine management module sends a connection request message to the destination virtual switch, so that the destination virtual switch establishes a connection with the target virtual machine.
在连接建立完成后, 目 的虚拟机管理模块接收该目的虚拟交换 机发送的确认消息, 并向该虚拟机管理中心发送数据迁移完成消息。  After the connection establishment is completed, the target virtual machine management module receives the acknowledgement message sent by the destination virtual switch, and sends a data migration complete message to the virtual machine management center.
网络管理中心也会接收到 目 的虚拟交换机发送的连接成功消 息, 并在确定存在冲突虚拟机时, 向该冲突虚拟机对应的虚拟交换 机发送连接断开消息, 其中, 该冲突虚拟机为网络地址与该虚拟机 的网络地址相同的虚拟机, 以使得该冲突虚拟机对应的虚拟交换机 根据该连接断开消息断开与该冲突虚拟机的连接; 需要说明的是, 若源虚拟交换机未断开与源虚拟机的连接, 则该冲突虚拟机包括该 源虚拟机。  The network management center also receives the connection success message sent by the destination virtual switch, and sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine when the conflicting virtual machine is determined, where the conflicting virtual machine is a network address and The virtual machine of the virtual machine has the same network address, so that the virtual switch corresponding to the conflicting virtual machine disconnects from the conflicting virtual machine according to the connection disconnection message; The source virtual machine is connected, and the conflicting virtual machine includes the source virtual machine.
其中, 该网络地址可以是 MAC地址。  The network address may be a MAC address.
由上述可知, 方式一与方式二的区别在于:  It can be seen from the above that the difference between mode one and mode two is:
方式一是源虚拟交换机首先断开与源虚拟机的连接, 目 的虚拟 机管理模块才向目 的虚拟交换机发送连接请求消息, 以便该目 的虚 拟交换机建立与 目的虚拟机的连接;  The first mode is that the source virtual switch first disconnects from the source virtual machine, and the destination virtual machine management module sends a connection request message to the destination virtual switch, so that the destination virtual switch establishes a connection with the destination virtual machine;
方式二则是在目 的虚拟交换机建立与 目 的虚拟机的连接后, 网 络管理中心在确定存在冲突虚拟机时, 发起连接断开, 若源虚拟交 换机未断开与源虚拟机的连接, 则该冲突虚拟机包括该源虚拟机, 则网络管理中心向该源虚拟交换机发送连接断开请求消 , , 以使得 该源虚拟交换机断开与该源虚拟机的连接。  In the second mode, after the destination virtual switch establishes a connection with the destination virtual machine, the network management center initiates a disconnection when determining that there is a conflicting virtual machine. If the source virtual switch does not disconnect the source virtual machine, the conflict occurs. The virtual machine includes the source virtual machine, and the network management center sends a disconnection request cancellation to the source virtual switch, so that the source virtual switch disconnects from the source virtual machine.
当然, 方式一中, 该目 的虚拟交换机建立与 目 的虚拟机的连接 后, 网络管理中心也可以接收目 的虚拟交换机发送的连接成功消息, 并确认是否存在冲突虚拟机, 若存在, 则指示该冲突虚拟机对应的 虚拟交换机断开与该冲突虚拟机的连接。  Of course, in the first mode, after the destination virtual switch establishes a connection with the destination virtual machine, the network management center may also receive the connection success message sent by the destination virtual switch, and confirm whether there is a conflicting virtual machine, and if yes, indicate the conflict virtual The virtual switch corresponding to the machine disconnects from the conflicting virtual machine.
需要说明的是, 本发明实施例并不局限于上述的任一种方式, 但无论采用哪种方式, 都应落入本发明的保护范围内。 It should be noted that the embodiment of the present invention is not limited to any of the above manners. However, no matter which method is adopted, it should fall within the protection scope of the present invention.
采用上述执行主体为虚拟机管理模块的方法, 通过虚拟机管理 模块和虚拟交换机的直接交互实现对虚拟机的网络配置, 有效地减 少了对虚拟机网络配置过程中消息交互的流程和时间, 在降低时延 的同时, 保证了业务的稳定性和持续性。 本发明实施例提供一种对虚拟机进行网络配置的方法, 如图 3 所示, 该方法的执行主体为虚拟交换机, 该方法包括:  The above-mentioned execution entity is a virtual machine management module, and the virtual machine network configuration is realized through direct interaction between the virtual machine management module and the virtual switch, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process. Reduce the delay while ensuring the stability and continuity of the business. An embodiment of the present invention provides a method for performing network configuration on a virtual machine. As shown in FIG. 3, the execution body of the method is a virtual switch, and the method includes:
S 30 1、 在虚拟机管理模块创建虚拟机时, 虚拟交换机接收该虚 拟机管理模块发送的网络配置触发消息。  S 30 1. When the virtual machine management module creates a virtual machine, the virtual switch receives the network configuration trigger message sent by the virtual machine management module.
该网络配置触发消息用于为该虚拟机管理模块所创建的虚拟机 进行网络配置, 包括该虚拟机的网络连接信息。  The network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module, including network connection information of the virtual machine.
其中, 在网络管理中心中配置有虚拟网络和虚拟网络端口。 进一步地, 虚拟交换机接收该虚拟机管理模块发送的网络配置 请求消息或者连接请求消息, 该网络配置请求消息或者连接请求消 息包括该虚拟机的网络连接信息, 即上述的网络配置触发消息包括 网络配置请求消息或者连接请求消息。  Among them, a virtual network and a virtual network port are configured in the network management center. Further, the virtual switch receives the network configuration request message or the connection request message sent by the virtual machine management module, where the network configuration request message or the connection request message includes network connection information of the virtual machine, that is, the network configuration trigger message includes network configuration. Request message or connection request message.
具体地, 若虚拟交换机接收该虚拟机管理模块发送的网络配置 请求消息, 则虚拟交换机先根据该网络配置请求消息进行网络配置, 当完成该虚拟机的创建且接收到虚拟交换机发送的网络配置响应消 息后, 该虚拟机管理模块才向该虚拟交换机发送连接请求消息, 以 便该虚拟交换机根据该连接请求消息中的网络连接信息建立与该虚 拟机的连接; 也就是说, 虚拟机管理模块首先指示虚拟交换机进行 网络配置, 在网络配置完成后, 指示虚拟交换机建立与虚拟机的连 接。  Specifically, if the virtual switch receives the network configuration request message sent by the virtual machine management module, the virtual switch first performs network configuration according to the network configuration request message, and completes the creation of the virtual machine and receives the network configuration response sent by the virtual switch. After the message, the virtual machine management module sends a connection request message to the virtual switch, so that the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message; that is, the virtual machine management module first indicates The virtual switch performs network configuration, and after the network configuration is completed, instructs the virtual switch to establish a connection with the virtual machine.
若虚拟交换机接收虚拟机管理模块发送的连接请求消息; 贝 'J该 虚拟交换机根据该连接请求消息进行网络配置, 并根据该连接请求 消息中的网络连接信息建立与该虚拟机的连接, 也就是说, 虚拟交 换机接收到连接请求消息后, 进行网络配置并建立与虚拟机的连接。 上述的虚拟交换机接收虚拟机管理模块发送的网络配置请求消 息或者连接请求消息只是实现方式上的区别, 本发明实施例并不局 限于此, 但无论采用哪种方式, 都应落入本发明的保护范围内。 If the virtual switch receives the connection request message sent by the virtual machine management module, the virtual switch performs network configuration according to the connection request message, and establishes a connection with the virtual machine according to the network connection information in the connection request message, that is, After the virtual switch receives the connection request message, it performs network configuration and establishes a connection with the virtual machine. The network switch request message or the connection request message sent by the virtual switch is not limited to the implementation manner of the present invention. Within the scope of protection.
S 302、虚拟交换机根据该网络连接信息建立与该虚拟机的连接。 S302. The virtual switch establishes a connection with the virtual machine according to the network connection information.
S 303、 虚拟交换机向该虚拟机管理模块返回该虚拟机与该虚拟 交换机网络连接已建立的确认消息。 S303. The virtual switch returns, to the virtual machine management module, an acknowledgement message that the virtual machine and the virtual switch network connection have been established.
进一步地, 在接收到该网络连接信息后, 虚拟交换机若确定自 身已配置该虚拟机的网络连接信息对应的虚拟网络, 则直接建立与 该虚拟机的连接, 从而将该虚拟机接入该虚拟网络。  Further, after receiving the network connection information, if the virtual switch determines that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual switch directly establishes a connection with the virtual machine, thereby accessing the virtual machine to the virtual machine. The internet.
具体地, 虚拟交换机会向网络管理中心获取虚拟网络端口, 并 通过该虚拟网络端口将该虚拟机接入该虚拟网络。  Specifically, the virtual switch acquires a virtual network port from the network management center, and accesses the virtual machine to the virtual network through the virtual network port.
若确定自身未配置该虚拟机的网络连接信息对应的虚拟网络, 则向网络管理中心发送网络配置信息请求消息, 以便该网络管理中 心根据该网络配置信息请求消息返回网络配置信息; 该虚拟交换机 根据该网络配置信息配置虚拟网络并建立与该虚拟机的连接, 从而 将该虚拟机接入该虚拟网络。  If it is determined that the virtual network corresponding to the network connection information of the virtual machine is not configured, the network configuration information request message is sent to the network management center, so that the network management center returns the network configuration information according to the network configuration information request message; The network configuration information configures the virtual network and establishes a connection with the virtual machine, thereby accessing the virtual machine to the virtual network.
具体地, 虚拟交换机会向网络管理中心获取虚拟网络端口, 并 通过该虚拟网络端口将该虚拟机接入该虚拟网络。  Specifically, the virtual switch acquires a virtual network port from the network management center, and accesses the virtual machine to the virtual network through the virtual network port.
需要说明的是, 上述网络配置可以针对 VLAN、 ACL、 QoS 等 进行的配置, 本发明对此不作限定。  It should be noted that the foregoing network configuration may be configured for a VLAN, an ACL, a QoS, etc., which is not limited by the present invention.
进一步地,本发明实施例还可以应用于虚拟机数据迁移的场景, 在该场景下, 目 的虚拟交换机通知虚拟机管理中心将源虚拟机中的 数据迁移至目 的虚拟机, 该目 的虚拟机对应的目 的虚拟交换机建立 与该目的虚拟机的连接; 该源虚拟机对应有源虚拟交换机。  Further, the embodiment of the present invention may be applied to a scenario in which a virtual machine data is migrated. In this scenario, the destination virtual switch notifies the virtual machine management center to migrate data in the source virtual machine to the destination virtual machine, where the destination virtual machine corresponds. The destination virtual switch establishes a connection with the destination virtual machine; the source virtual machine corresponds to an active virtual switch.
在本实施例中, 该虚拟交换机可以包括目的虚拟交换机。  In this embodiment, the virtual switch may include a destination virtual switch.
具体地, 在目 的虚拟机管理模块创建目 的虚拟机时, 目 的虚拟 交换机接收该目的虚拟机管理模块发送的网络配置触发消息, 其中, 该网络配置触发消息包括网络连接信息, 该目 的虚拟交换机根据该 网络连接信息建立与该目 的虚拟机的网络连接, 并向该虚拟机管理 模块返回该虚拟机与该虚拟交换机网络连接已建立的确认消息。 在 该目 的虚拟机创建完成后, 目 的虚拟机管理模块向虚拟机管理中心 发送数据迁移请求消息, 以便该虚拟机管理中心根据该数据迁移请 求消息将源虚拟机的数据迁移至目 的虚拟机; 在该数据迁移完成后, 目 的虚拟机管理模块接收该虚拟机管理中心发送的数据迁移完成消 息。 Specifically, when the destination virtual machine management module creates the destination virtual machine, the destination virtual switch receives the network configuration trigger message sent by the destination virtual machine management module, where the network configuration trigger message includes network connection information, and the destination virtual switch according to the The network connection information establishes a network connection with the destination virtual machine, and manages the virtual machine The module returns an acknowledgment message that the virtual machine is connected to the virtual switch network. After the virtual machine is created, the destination virtual machine management module sends a data migration request message to the virtual machine management center, so that the virtual machine management center migrates the data of the source virtual machine to the destination virtual machine according to the data migration request message; After the data migration is completed, the destination virtual machine management module receives the data migration completion message sent by the virtual machine management center.
在目 的虚拟机管理模块接收到该虚拟机管理中心发送的数据迁 移完成消息后, 本发明实施例还包括以下两种实施方式:  After the target virtual machine management module receives the data migration completion message sent by the virtual machine management center, the embodiment of the present invention further includes the following two implementation manners:
方式一: 源虚拟交换机断开与源虚拟机的连接, 目的虚拟交换 机接收目 的虚拟机管理模块发送的连接请求消息; 该连接请求消息 包括网络连接信息, 目 的虚拟交换机根据该网络连接消息建立与 目 的虚拟机的连接。  Manner 1: The source virtual switch disconnects from the source virtual machine, and the destination virtual switch receives the connection request message sent by the destination virtual machine management module; the connection request message includes network connection information, and the destination virtual switch establishes and aims according to the network connection message. The connection of the virtual machine.
方式二: 目 的虚拟交换机接收该目 的虚拟机管理模块发送的连 接请求消息; 其中, 该连接请求消息包括网络连接信息, 目 的虚拟 交换机根据该网络连接信息建立与 目 的虚拟机的连接, 网络管理中 心也会接收到目 的虚拟交换机发送的连接成功消息, 并在确定存在 冲突虚拟机时, 向该冲突虚拟机对应的虚拟交换机发送连接断开消 息, 以使得该冲突虚拟机对应的虚拟交换机根据该连接断开消息断 开与该冲突虚拟机的连接, 其中, 该冲突虚拟机为网络地址与该虚 拟机的网络地址相同的虚拟机, 需要说明的是, 若源虚拟交换机未 断开与源虚拟机的连接, 则该冲突虚拟机包括该源虚拟机。  Manner 2: The destination virtual switch receives the connection request message sent by the destination virtual machine management module. The connection request message includes network connection information, and the destination virtual switch establishes a connection with the destination virtual machine according to the network connection information, and the network management center also The connection success message sent by the destination virtual switch is received, and when it is determined that the conflicting virtual machine exists, a disconnection message is sent to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is disconnected according to the connection. The open message is disconnected from the conflicting virtual machine, where the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine, and it should be noted that if the source virtual switch is not disconnected from the source virtual machine Connect, then the conflicting virtual machine includes the source virtual machine.
其中, 该网络地址可以是 MAC地址。  The network address may be a MAC address.
由上述可知, 方式一与方式二的区别在于:  It can be seen from the above that the difference between mode one and mode two is:
方式一是源虚拟交换机首先断开与源虚拟机的连接, 目 的虚拟 机管理模块才向目 的虚拟交换机发送连接请求消息, 以便该目 的虚 拟交换机建立与 目的虚拟机的连接。  The first method is that the source virtual switch first disconnects from the source virtual machine, and the destination virtual machine management module sends a connection request message to the destination virtual switch, so that the destination virtual switch establishes a connection with the destination virtual machine.
方式二则是在目 的虚拟交换机建立与 目 的虚拟机的连接后, 网 络管理中心在确定存在冲突虚拟机时, 发起连接断开, 若源虚拟交 换机未断开与源虚拟机的连接, 则该冲突虚拟机包括该源虚拟机, 则网络管理中心向该源虚拟交换机发送连接断开请求消 , ^ , 以使得 该源虚拟交换机断开与该源虚拟机的连接。 In the second mode, after the destination virtual switch establishes a connection with the destination virtual machine, the network management center initiates a disconnection when determining that there is a conflicting virtual machine. If the source virtual switch does not disconnect the source virtual machine, the conflict occurs. The virtual machine includes the source virtual machine, Then, the network management center sends a connection disconnect request cancellation to the source virtual switch, so that the source virtual switch disconnects from the source virtual machine.
当然, 方式一中, 该目 的虚拟交换机建立与 目 的虚拟机的连接 后, 网络管理中心也可以接收目 的虚拟交换机发送的连接成功消息, 并确认是否存在冲突虚拟机, 若存在, 则指示该冲突虚拟机对应的 虚拟交换机断开与该冲突虚拟机的连接。  Of course, in the first mode, after the destination virtual switch establishes a connection with the destination virtual machine, the network management center may also receive the connection success message sent by the destination virtual switch, and confirm whether there is a conflicting virtual machine, and if yes, indicate the conflict virtual The virtual switch corresponding to the machine disconnects from the conflicting virtual machine.
需要说明的是, 本发明实施例并不局限于上述的任一种方式, 但无论采用哪种方式, 都应落入本发明的保护范围内。  It should be noted that the embodiment of the present invention is not limited to any of the above manners, but it should fall within the protection scope of the present invention.
进一步地, 该虚拟交换机还可以作为源虚拟交换机, 在该目的 虚拟机对应的目 的虚拟交换机建立与该目 的虚拟机的连接之前, 该 源虚拟交换机接收虚拟机管理中心发送的连接断开消息, 并根据该 连接断开消息断开与该源虚拟机的连接。  Further, the virtual switch can also serve as a source virtual switch, and the source virtual switch receives the disconnection message sent by the virtual machine management center before the destination virtual switch corresponding to the destination virtual machine establishes a connection with the destination virtual machine, and The connection to the source virtual machine is broken according to the connection disconnect message.
采用上述执行主体为虚拟交换机的方法, 通过虚拟机管理模块 和虚拟交换机的直接交互实现对虚拟机的网络配置, 有效地减少了 对虚拟机网络配置过程中消息交互的流程和时间, 在降低时延的同 时, 保证了业务的稳定性和持续性。 本发明实施例提供一种对虚拟机进行网络配置的方法, 如图 4 所示, 该方法实施例是以网络管理中心已经配置有虚拟网络和虚拟 网络端口为基础进行的, 该方法包括:  The above-mentioned execution entity is a virtual switch, and the virtual machine network configuration is realized through direct interaction between the virtual machine management module and the virtual switch, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process. At the same time, the stability and continuity of the business are guaranteed. The embodiment of the invention provides a method for network configuration of a virtual machine. As shown in FIG. 4, the method embodiment is based on that a network management center has been configured with a virtual network and a virtual network port, and the method includes:
S40 1、 虚拟机管理中心向虚拟机管理模块发送创建虚拟机请求 消息。  S40 1. The virtual machine management center sends a create virtual machine request message to the virtual machine management module.
S402、 虚拟机管理模块根据该创建虚拟机请求消息选择该虚拟 机对应的物理资源并创建该虚拟机。  S402. The virtual machine management module selects a physical resource corresponding to the virtual machine according to the create virtual machine request message and creates the virtual machine.
S 403、 虚拟机管理模块向该虚拟机对应的虚拟交换机发送网络 配置请求消息。  S 403. The virtual machine management module sends a network configuration request message to the virtual switch corresponding to the virtual machine.
S404、 虚拟交换机在接收到该网络配置请求消息后, 若确定自 身未配置该虚拟机的网络连接信息对应的虚拟网络, 向网络管理中 心发送网络配置信息请求信息。 进一步地,虚拟交换机还会向网络管理中心获取虚拟网络端口。 需要说明的是, 若确定自身已配置该虚拟机的网络连接信息对 应的虚拟网络, 则只向网络管理中心获取虚拟网络端口, 并向虚拟 机管理模块发送网络配置响应消息, 并进行步骤 S407至 S41 1。 S404. After receiving the network configuration request message, if the virtual switch determines that the virtual network corresponding to the network connection information of the virtual machine is not configured, the virtual switch sends the network configuration information request information to the network management center. Further, the virtual switch also obtains a virtual network port from the network management center. It should be noted that, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual network port is obtained only from the network management center, and the network configuration response message is sent to the virtual machine management module, and step S407 is performed. S41 1.
S405、 网络管理中心根据该网络配置信息请求消息返回网络配 置信息。  S405. The network management center returns network configuration information according to the network configuration information request message.
可选地, 网络管理中心还将该配置信息发送至物理交换机。 Optionally, the network management center also sends the configuration information to the physical switch.
S406、 虚拟交换机根据网络配置信息配置虚拟网络, 并向虚拟 机管理模块发送网络配置响应消息。 S406. The virtual switch configures the virtual network according to the network configuration information, and sends a network configuration response message to the virtual machine management module.
其中, 上述配置虚拟网络可以是针对 VLAN、 ACL、 Qo S 等进 行的配置, 本发明对此不作限定。  The configuration of the virtual network may be configured for a VLAN, an ACL, a Qo S, or the like, which is not limited by the present invention.
可选地, 若物理交换机也接收到网络管理中心发送的网络配置 信息, 则物理交换机完成虚拟网络配置后, 也向虚拟机管理模块发 送网络配置响应消息。  Optionally, if the physical switch also receives the network configuration information sent by the network management center, the physical switch sends a network configuration response message to the virtual machine management module after completing the virtual network configuration.
S 407、 在虚拟机管理模块完成虚拟机的创建且接收到该网络配 置响应消息后, 虚拟机管理模块向虚拟交换机发送连接请求消息。  S 407. After the virtual machine management module completes the creation of the virtual machine and receives the network configuration response message, the virtual machine management module sends a connection request message to the virtual switch.
其中, 该连接请求消息包括网络连接信息。  The connection request message includes network connection information.
S408、 虚拟交换机根据该网络连接信息建立与虚拟机的连接, 并在建立连接后, 向虚拟机管理模块返回该虚拟机与该虚拟交换机 网络连接已建立的确认消息。  S408. The virtual switch establishes a connection with the virtual machine according to the network connection information, and returns a confirmation message that the virtual machine and the virtual switch network connection have been established to the virtual machine management module after the connection is established.
5409、 虚拟机管理模块在接收到该确认消息后, 向虚拟机管理 中心发送虚拟机创建完成消息。  After receiving the confirmation message, the virtual machine management module sends a virtual machine creation completion message to the virtual machine management center.
5410、 虚拟交换机与虚拟机建立连接完成后, 虚拟交换机向网 络管理中心发送连接成功消息。  5410. After the virtual switch establishes a connection with the virtual machine, the virtual switch sends a connection success message to the network management center.
541 1、 该网络管理中心在接收到该连接成功消息后, 若确定存 在冲突虚拟机, 向该冲突虚拟机对应的虚拟交换机发送连接断开消 息, 以使得该冲突虚拟机对应的虚拟交换机根据该连接断开消息断 开与该冲突虚拟机的连接。 其中, 该冲突虚拟机为网络地址与该虚 拟机的网络地址相同的虚拟机; 该网络地址可以是 MAC地址。 需要说明的是, 上述的虚拟机管理模块和虚拟交换机可以合设 在同一主机中。 After the network management center receives the connection success message, if it is determined that there is a conflicting virtual machine, the network switch sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is configured according to the The disconnect message disconnects the connection to the conflicting virtual machine. The conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine; the network address may be a MAC address. It should be noted that the foregoing virtual machine management module and the virtual switch may be combined in the same host.
另外, 对于上述的方法实施例, 为了简单描述, 故将其都表述 为一系列的动作组合, 但是本领域技术人员应该知悉, 本发明并不 受所描述的动作顺序的限制, 因为依据本发明, 某些步骤可以采用 其他顺序或者同时进行。 其次, 本领域技术人员也应该知悉, 说明 书中所描述的实施例均属于优选实施例, 所涉及的动作和模块并不 一定是本发明所必须的。  In addition, the above method embodiments are described as a series of action combinations for the sake of brevity, but those skilled in the art should understand that the present invention is not limited by the described action sequence, because according to the present invention. , some steps can be performed in other orders or at the same time. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
通过采用上述方法, 实现了在虚拟机创建过程中, 通过虚拟机 管理模块和虚拟交换机的直接交互实现对虚拟机的网络配置, 有效 地减少了对虚拟机网络配置过程中消息交互的流程和时间, 在降低 时延的同时, 保证了业务的稳定性和持续性。 本发明实施例提供一种对虚拟机进行网络配置的方法, 如图 5 所示, 该方法实施例是以网络管理中心已经配置有虚拟网络和虚拟 网络端口为基础进行的, 该方法包括:  By adopting the above method, the virtual machine network configuration is realized by the direct interaction between the virtual machine management module and the virtual switch during the virtual machine creation process, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process. , while reducing the delay, ensuring the stability and continuity of the business. An embodiment of the present invention provides a method for network configuration of a virtual machine. As shown in FIG. 5, the method is implemented based on a network management center configured with a virtual network and a virtual network port, and the method includes:
5501、 虚拟机管理中心向虚拟机管理模块发送创建虚拟机请求 消息。  5501. The virtual machine management center sends a create virtual machine request message to the virtual machine management module.
5502、 虚拟机管理模块根据该创建虚拟机请求消息选择该虚拟 机对应的物理资源并创建该虚拟机。  S502. The virtual machine management module selects a physical resource corresponding to the virtual machine according to the create virtual machine request message and creates the virtual machine.
5503、 虚拟机管理模块向该虚拟机对应的虚拟交换机发送连接 请求消息。  S503. The virtual machine management module sends a connection request message to the virtual switch corresponding to the virtual machine.
其中, 该连接请求消息包括网络连接信息。  The connection request message includes network connection information.
5504、 虚拟交换机在接收到该连接请求消息后, 若确定自身未 配置该虚拟机的网络连接信息对应的虚拟网络, 向网络管理中心发 送网络配置信息请求信息。  After receiving the connection request message, the virtual switch sends the network configuration information request information to the network management center if it determines that the virtual network corresponding to the network connection information of the virtual machine is not configured.
进一步地,虚拟交换机还会向网络管理中心获取虚拟网络端口。 需要说明的是, 若确定自身已配置该虚拟机的网络连接信息对 应的虚拟网络, 则只向网络管理中心获取虚拟网络端口, 并向虚拟 机管理模块发送网络配置响应消息, 并进行步骤 S507至 S5 10。Further, the virtual switch also obtains a virtual network port from the network management center. It should be noted that if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual network port is obtained only from the network management center, and is virtualized. The machine management module sends a network configuration response message, and proceeds to steps S507 to S510.
S 505、 网络管理中心根据该网络配置信息请求消息返回网络配 置信息。 S 505. The network management center returns network configuration information according to the network configuration information request message.
可选地, 网络管理中心还将该配置信息发送至物理交换机。 Optionally, the network management center also sends the configuration information to the physical switch.
5506、 虚拟交换机根据网络配置信息配置虚拟网络。 5506. The virtual switch configures the virtual network according to the network configuration information.
其中, 上述配置虚拟网络可以是针对 VLAN、 ACL、 Qo S 等进 行的配置, 本发明对此不作限定。  The configuration of the virtual network may be configured for a VLAN, an ACL, a Qo S, or the like, which is not limited by the present invention.
可选地, 若物理交换机也接收到网络管理中心发送的网络配置 信息, 物理交换机也会根据该网络配置信息配置虚拟网络。  Optionally, if the physical switch also receives the network configuration information sent by the network management center, the physical switch configures the virtual network according to the network configuration information.
5507、 虚拟交换机在配置虚拟网络后, 根据网络连接信息建立 与虚拟机的连接, 并在建立连接后, 向虚拟机管理模块返回该虚拟 机与该虚拟交换机网络连接已建立的确认消息。  After the virtual switch is configured, the virtual switch establishes a connection with the virtual machine according to the network connection information, and after establishing the connection, returns a confirmation message that the virtual machine and the virtual switch network connection have been established to the virtual machine management module.
5508、 虚拟机管理模块在接收到该确认消息且完成虚拟机的创 建后, 向虚拟机管理中心发送虚拟机创建完成消息。  After the virtual machine management module receives the confirmation message and completes the creation of the virtual machine, the virtual machine management module sends a virtual machine creation completion message to the virtual machine management center.
5509、 虚拟交换机在建立与虚拟机的连接完成后, 向网络管理 中心发送连接成功消息。  5509. After establishing a connection with the virtual machine, the virtual switch sends a connection success message to the network management center.
55 10、 该网络管理中心在接收到该连接成功消息后, 若确定存 在冲突虚拟机, 向该冲突虚拟机对应的虚拟交换机发送连接断开消 息, 以使得该冲突虚拟机对应的虚拟交换机根据该连接断开消息断 开与该冲突虚拟机的连接。  After the network management center receives the connection success message, if it is determined that there is a conflicting virtual machine, the network switch sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is The disconnect message disconnects the connection to the conflicting virtual machine.
其中, 该冲突虚拟机为网络地址与该虚拟机的网络地址相同的 虚拟机; 该网络地址可以是 MAC地址。  The conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine; the network address may be a MAC address.
需要说明的是, 上述的虚拟机管理模块和虚拟交换机可以合设 在同一主机中。  It should be noted that the foregoing virtual machine management module and the virtual switch may be combined in the same host.
另外, 对于上述的方法实施例, 为了简单描述, 故将其都表述 为一系列的动作组合, 但是本领域技术人员应该知悉, 本发明并不 受所描述的动作顺序的限制, 因为依据本发明, 某些步骤可以采用 其他顺序或者同时进行。 其次, 本领域技术人员也应该知悉, 说明 书中所描述的实施例均属于优选实施例, 所涉及的动作和模块并不 一定是本发明所必须的。 In addition, the above method embodiments are described as a series of action combinations for the sake of brevity, but those skilled in the art should understand that the present invention is not limited by the described action sequence, because according to the present invention. , some steps can be performed in other orders or at the same time. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to the preferred embodiment, and the actions and modules involved are not It must be necessary for the present invention.
通过采用上述方法, 实现了在虚拟机创建过程中, 通过虚拟机 管理模块和虚拟交换机的直接交互实现对虚拟机的网络配置, 有效 地减少了对虚拟机网络配置过程中消息交互的流程和时间, 在降低 时延的同时, 保证了业务的稳定性和持续性。 本发明实施例提供一种对虚拟机进行配置的方法,如图 6所示, 该方法实施例应用于虚拟机数据迁移场景, 本实施例中, 该方法实 施例是在源虚拟机创建完成的基础上进行的, 其中, 源虚拟机的创 建可以参考上述图 4或图 5 所示的实施例, 在此不再贅述了, 该方 法包括:  By adopting the above method, the virtual machine network configuration is realized by the direct interaction between the virtual machine management module and the virtual switch during the virtual machine creation process, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process. , while reducing the delay, ensuring the stability and continuity of the business. The embodiment of the present invention provides a method for configuring a virtual machine. As shown in FIG. 6 , the method embodiment is applied to a virtual machine data migration scenario. In this embodiment, the method embodiment is completed after the source virtual machine is created. The method of the source virtual machine may be referred to the embodiment shown in FIG. 4 or FIG. 5, and is not described here. The method includes:
560 1、 虚拟机管理中心向目的虚拟机管理模块发送虚拟机迁移 请求消息。  560 1. The virtual machine management center sends a virtual machine migration request message to the destination virtual machine management module.
5602、 目 的虚拟机管理模块根据该虚拟机迁移请求消息选择虚 拟机对应的物理资源并创建目 的虚拟机。  5602. The target virtual machine management module selects a physical resource corresponding to the virtual machine according to the virtual machine migration request message and creates a target virtual machine.
5603、 目 的虚拟机管理模块在完成目 的虚拟机的创建后, 向虚 拟机管理中心发送数据迁移请求消息。  5603. After the virtual machine management module completes the creation of the target virtual machine, the data migration request message is sent to the virtual machine management center.
S 604、 虚拟机管理中心根据该数据迁移请求消息将源虚拟机中 的数据迁移至目 的虚拟机, 并在数据迁移完成后, 向目 的虚拟机管 理模块发送数据迁移完成消息。  S 604. The virtual machine management center migrates the data in the source virtual machine to the destination virtual machine according to the data migration request message, and sends a data migration completion message to the destination virtual machine management module after the data migration is completed.
5605、 目 的虚拟机管理模块在创建目 的虚拟机时, 向目的虚拟 交换机发送网络配置请求消息。  5605. The target virtual machine management module sends a network configuration request message to the destination virtual switch when creating the target virtual machine.
5606、 目 的虚拟交换机在接收到该网络配置请求消息后, 若确 定自身未配置该虚拟机的网络连接信息对应的虚拟网络, 向网络管 理中心发送网络配置信息请求信息。  After receiving the network configuration request message, the destination virtual switch sends the network configuration information request information to the network management center if it determines that the virtual network corresponding to the network connection information of the virtual machine is not configured.
进一步地,虚拟交换机还会向网络管理中心获取虚拟网络端口。 需要说明的是, 若确定自身已配置该虚拟机的网络连接信息对 应的虚拟网络, 则只向网络管理中心获取虚拟网络端口, 并向虚拟 机管理模块发送网络配置响应消息, 并进行步骤 S 608至 S 620。 S 607、 网络管理中心根据该网络配置信息请求消息返回网络配 置信息。 Further, the virtual switch also obtains a virtual network port from the network management center. It should be noted that, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual network port is obtained only from the network management center, and the network configuration response message is sent to the virtual machine management module, and step S 608 is performed. To S 620. S 607. The network management center returns network configuration information according to the network configuration information request message.
可选地, 网络管理中心还将该网络配置信息发送至目 的物理交 换机。  Optionally, the network management center also sends the network configuration information to the destination physical switch.
5608、 目 的虚拟交换机根据该网络配置消息配置虚拟网络, 并 向目 的虚拟机管理模块发送网络配置响应消息。  5608. The destination virtual switch configures the virtual network according to the network configuration message, and sends a network configuration response message to the target virtual machine management module.
其中, 上述配置虚拟网络可以是针对 VLAN、 ACL、 Qo S 等进 行的配置, 本发明对此不作限定  The configuration of the virtual network may be performed for a VLAN, an ACL, a Qo S, etc., which is not limited by the present invention.
可选地, 若目 的物理交换机也接收到网络管理中心发送的网络 配置信息, 则 目 的物理交换机完成虚拟网络配置后, 也向目 的虚拟 机管理模块发送网络配置响应消息。  Optionally, if the destination physical switch also receives the network configuration information sent by the network management center, after the target physical switch completes the virtual network configuration, the network configuration response message is also sent to the target virtual machine management module.
5609、 目 的虚拟机管理模块在接收到该网络配置响应消息后, 向虚拟机管理中心发送网络配置完成消息。  5609. After receiving the network configuration response message, the target virtual machine management module sends a network configuration completion message to the virtual machine management center.
5610、 虚拟机管理中心在接收到该网络配置完成消息且数据迁 移完成后, 向源虚拟机管理模块发送连接断开请求消息。  After receiving the network configuration complete message and the data migration is completed, the virtual machine management center sends a connection disconnection request message to the source virtual machine management module.
S 61 1、 源虚拟机管理模块向源虚拟交换机发送连接断开消息。 S 61 1. The source virtual machine management module sends a disconnection message to the source virtual switch.
5612、 源虚拟交换机根据该连接断开消息断开与源虚拟机的连 接。 5612. The source virtual switch disconnects from the source virtual machine according to the connection disconnect message.
5613、 源虚拟交换机向源虚拟机管理模块发送连接断开响应消 息。  5613. The source virtual switch sends a disconnection response message to the source virtual machine management module.
5614、 源虚拟机管理模块在接收到该连接断开响应消息后, 向 虚拟机管理中心发送连接断开通知消息。  After receiving the connection disconnection response message, the source virtual machine management module sends a connection disconnection notification message to the virtual machine management center.
5615、 虚拟机管理中心在接收到该连接断开通知消息后, 向目 的虚拟机管理模块发送连接请求通知消 , ¾。  5615. After receiving the connection disconnection notification message, the virtual machine management center sends a connection request notification to the target virtual machine management module, 3⁄4.
5616、 目 的虚拟机管理模块在接收到该连接请求通知消息后, 向目 的虚拟交换机发送连接请求消息。  After the virtual machine management module receives the connection request notification message, the destination virtual machine management module sends a connection request message to the destination virtual switch.
S 617、 目 的虚拟交换机根据该连接请求消息建立与 目的虚拟机 的连接。  S617. The destination virtual switch establishes a connection with the destination virtual machine according to the connection request message.
S 61 8、 在目 的虚拟交换机建立与该目 的虚拟机的连接完成后, 目的虚拟交换机向目 的虚拟机管理模块发送连接建立的确认消息。S 61 8. After the destination virtual switch establishes a connection with the destination virtual machine, The destination virtual switch sends an acknowledgement message for connection establishment to the destination virtual machine management module.
S 619、 目 的虚拟机管理模块在接收到该确认消息后, 向虚拟机 管理中心发送虚拟机迁移完成消息。 S 619. After receiving the confirmation message, the target virtual machine management module sends a virtual machine migration complete message to the virtual machine management center.
5620、 在目 的虚拟交换机建立与该目 的虚拟机的连接完成后, 目 的虚拟交换机向网络管理中心发送连接成功消息。  5620. After the destination virtual switch establishes a connection with the target virtual machine, the destination virtual switch sends a connection success message to the network management center.
5621、 该网络管理中心在接收到该连接成功消息户, 若确定存 在冲突虚拟机, 向该冲突虚拟机对应的虚拟交换机发送连接断开消 息, 以使得该冲突虚拟机对应的虚拟交换机根据该连接断开消息断 开与该冲突虚拟机的连接。  S621, the network management center receives the connection success message, and if it is determined that there is a conflicting virtual machine, sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is based on the connection. The disconnect message disconnects from the conflicting virtual machine.
其中, 该冲突虚拟机为网络地址与该虚拟机的网络地址相同的 虚拟机; 该网络地址可以是 MAC地址。  The conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine; the network address may be a MAC address.
需要说明的是, 上述源虚拟机管理模块和源虚拟交换机可以合 设在源主机中, 上述目 的虚拟机管理模块和目 的虚拟交换机可以合 设在目的主机中。  It should be noted that the source virtual machine management module and the source virtual switch may be integrated in the source host, and the target virtual machine management module and the destination virtual switch may be integrated in the destination host.
另外, 对于上述的方法实施例, 为了简单描述, 故将其都表述 为一系列的动作组合, 但是本领域技术人员应该知悉, 本发明并不 受所描述的动作顺序的限制, 因为依据本发明, 某些步骤可以采用 其他顺序或者同时进行。 其次, 本领域技术人员也应该知悉, 说明 书中所描述的实施例均属于优选实施例, 所涉及的动作和模块并不 一定是本发明所必须的。  In addition, the above method embodiments are described as a series of action combinations for the sake of brevity, but those skilled in the art should understand that the present invention is not limited by the described action sequence, because according to the present invention. , some steps can be performed in other orders or at the same time. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
通过采用上述方法, 实现了在虚拟机数据迁移过程中, 通过目 的虚拟机管理模块和目 的虚拟交换机的直接交互实现对虚拟机的网 络配置, 有效地减少了对虚拟机网络配置过程中消息交互的流程和 时间, 在降低时延的同时, 保证了业务的稳定性和持续性。 本发明实施例提供一种对虚拟机进行网络配置的方法, 如图 7 所示, 该方法实施例应用于虚拟机数据迁移场景, 本实施例中, 该 方法实施例是在源虚拟机创建完成的基础上进行的, 其中, 源虚拟 机的创建可以参考上述图 4或图 5所示的实施例, 在此不再贅述了, 该方法包括: By adopting the above method, the virtual machine network configuration is realized by the direct interaction between the destination virtual machine management module and the destination virtual switch during the virtual machine data migration process, thereby effectively reducing the message interaction during the virtual machine network configuration process. Process and time, while reducing latency, ensure the stability and continuity of the business. The embodiment of the present invention provides a method for network configuration of a virtual machine. As shown in FIG. 7 , the method embodiment is applied to a virtual machine data migration scenario. In this embodiment, the method is implemented in the source virtual machine. On the basis of the implementation of the source virtual machine, reference may be made to the embodiment shown in FIG. 4 or FIG. 5 above, and details are not described herein again. The method includes:
5701、 虚拟机管理中心向目的虚拟机管理模块发送虚拟机迁移 请求消息。  5701. The virtual machine management center sends a virtual machine migration request message to the destination virtual machine management module.
5702、 目 的虚拟机管理模块根据该虚拟机迁移请求消息选择虚 拟机对应的物理资源并创建目 的虚拟机。  5702. The target virtual machine management module selects a physical resource corresponding to the virtual machine according to the virtual machine migration request message and creates a target virtual machine.
5703、 目 的虚拟机管理模块在完成目 的虚拟机的创建后, 向虚 拟机管理中心发送数据迁移请求消息。  After the virtual machine management module completes the creation of the target virtual machine, the virtual machine management module sends a data migration request message to the virtual machine management center.
S 704、 虚拟机管理中心根据该数据迁移请求消息将源虚拟机中 的数据迁移至目 的虚拟机, 并在数据迁移完成后, 向目 的虚拟机管 理模块发送数据迁移完成消息。  S704: The virtual machine management center migrates the data in the source virtual machine to the destination virtual machine according to the data migration request message, and sends a data migration complete message to the target virtual machine management module after the data migration is completed.
5705、 目 的虚拟机管理模块在创建目 的虚拟机时, 向目 的虚拟 交换机发送网络配置请求消息。  5705. The target virtual machine management module sends a network configuration request message to the destination virtual switch when creating the target virtual machine.
5706 , 目 的虚拟交换机在接收到该网络配置请求消息后, 若确 定自身未配置该虚拟机的网络连接信息对应的虚拟网络, 向网络管 理中心发送网络配置信息请求消息。  5706. After receiving the network configuration request message, the destination virtual switch sends a network configuration information request message to the network management center if it is determined that the virtual network corresponding to the network connection information of the virtual machine is not configured.
进一步地,虚拟交换机还会向网络管理中心获取虚拟网络端口。 需要说明的是, 若确定自身已配置该虚拟机的网络连接信息对 应的虚拟网络, 则只向网络管理中心获取虚拟网络端口, 并向虚拟 机管理模块发送网络配置响应消息, 并进行步骤 S709至 S7 14。  Further, the virtual switch also obtains a virtual network port from the network management center. It should be noted that, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the virtual network port is obtained only from the network management center, and the network configuration response message is sent to the virtual machine management module, and step S709 is performed. S7 14.
S707、 网络管理中心根据该网络配置信息请求消息返回网络配 置信息。  S707. The network management center returns the network configuration information according to the network configuration information request message.
可选地,网络管理中心还将该配置信息发送至目 的物理交换机。 Optionally, the network management center also sends the configuration information to the destination physical switch.
S708、 目 的虚拟交换机根据该网络配置消息配置虚拟网络, 并 向目 的虚拟机管理模块发送网络配置响应消息。 S708. The destination virtual switch configures the virtual network according to the network configuration message, and sends a network configuration response message to the target virtual machine management module.
其中, 上述配置虚拟网络可以是针对 VLAN、 ACL、 Qo S 等进 行的配置, 本发明对此不作限定  The configuration of the virtual network may be performed for a VLAN, an ACL, a Qo S, etc., which is not limited by the present invention.
可选地, 若目 的物理交换机也接收到网络管理中心发送的网络 配置信息, 则 目 的物理交换机完成虚拟网络配置后, 也向目 的虚拟 机管理模块发送网络配置响应消息。 5709、 目 的虚拟机管理模块在接收到该网络配置响应消息后, 向目 的虚拟交换机发送连接请求消息。 Optionally, if the destination physical switch also receives the network configuration information sent by the network management center, after the destination physical switch completes the virtual network configuration, the destination physical switch also sends a network configuration response message to the destination virtual machine management module. S709: After receiving the network configuration response message, the destination virtual machine management module sends a connection request message to the destination virtual switch.
5710、 目 的虚拟交换机根据该连接请求消息建立与 目 的虚拟机 的连接。  5710. The destination virtual switch establishes a connection with the destination virtual machine according to the connection request message.
571 1、 目 的虚拟交换机在连接建立完成后, 向目 的虚拟机管理 模块发送连接建立的确认消息。  571 1. After the connection is established, the destination virtual switch sends a confirmation message of connection establishment to the destination virtual machine management module.
5712、 目 的虚拟机管理模块在接收到该确认消息后, 向虚拟机 管理中心发送虚拟机迁移完成消息。  5712. After receiving the confirmation message, the target virtual machine management module sends a virtual machine migration complete message to the virtual machine management center.
5713、 目 的虚拟交换机在连接建立完成后, 向网络管理中心发 送连接成功消息。  5713. After the connection is established, the destination virtual switch sends a connection success message to the network management center.
5714、 该网络管理中心在接收到该连接成功消息后, 若确定存 在冲突虚拟机, 向该冲突虚拟机对应的虚拟交换机发送连接断开消 息, 以使得该冲突虚拟机对应的虚拟交换机根据该连接断开消息断 开与该冲突虚拟机的连接。  After the network management center receives the connection success message, if it is determined that there is a conflicting virtual machine, the network switch sends a disconnection message to the virtual switch corresponding to the conflicting virtual machine, so that the virtual switch corresponding to the conflicting virtual machine is based on the connection. The disconnect message disconnects from the conflicting virtual machine.
其中, 该冲突虚拟机为网络地址与该虚拟机的网络地址相同的 虚拟机; 该网络地址可以是 MAC地址。  The conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine; the network address may be a MAC address.
需要说明的是, 此时, 源虚拟交换机未断开与源虚拟机的连接, 则该冲突虚拟机包括该源虚拟机, 则网络管理中心向该源虚拟交换 机发送连接断开请求消息, 以使得该源虚拟交换机断开与该源虚拟 机的连接。  It should be noted that, at this time, if the source virtual switch does not disconnect from the source virtual machine, the conflicting virtual machine includes the source virtual machine, and the network management center sends a connection disconnection request message to the source virtual switch, so that The source virtual switch disconnects from the source virtual machine.
其中, 若该网络管理中心控制的网络中存在源物理交换机和目 的物理交换机, 网络管理中心通知该源物理交换机删除网络配置信 息。  If the source physical switch and the destination physical switch exist in the network controlled by the network management center, the network management center notifies the source physical switch to delete the network configuration information.
需要说明的是, 上述源虚拟机管理模块和源虚拟交换机可以合 设在源主机中, 上述目 的虚拟机管理模块和目 的虚拟交换机可以合 设在目的主机中。  It should be noted that the source virtual machine management module and the source virtual switch may be integrated in the source host, and the target virtual machine management module and the destination virtual switch may be integrated in the destination host.
另外, 对于上述的方法实施例, 为了简单描述, 故将其都表述 为一系列的动作组合, 但是本领域技术人员应该知悉, 本发明并不 受所描述的动作顺序的限制, 因为依据本发明, 某些步骤可以采用 其他顺序或者同时进行。 其次, 本领域技术人员也应该知悉, 说明 书中所描述的实施例均属于优选实施例, 所涉及的动作和模块并不 一定是本发明所必须的。 In addition, the above method embodiments are described as a series of action combinations for the sake of brevity, but those skilled in the art should understand that the present invention is not limited by the described action sequence, because according to the present invention. , some steps can be taken Other sequences are performed simultaneously or simultaneously. In addition, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
通过采用上述方法, 实现了在虚拟机数据迁移过程中, 通过目 的虚拟机管理模块和目 的虚拟交换机的直接交互实现对虚拟机的网 络配置, 有效地减少了对虚拟机网络配置过程中消息交互的流程和 时间, 在降低时延的同时, 保证了业务的稳定性和持续性。 本发明实施例提供一种虚拟机管理模块 800 , 如图 8 所示, 包 括:  By adopting the above method, the virtual machine network configuration is realized by the direct interaction between the destination virtual machine management module and the destination virtual switch during the virtual machine data migration process, thereby effectively reducing the message interaction during the virtual machine network configuration process. Process and time, while reducing latency, ensure the stability and continuity of the business. The embodiment of the present invention provides a virtual machine management module 800, as shown in FIG. 8, which includes:
处理单元 80 1 , 用于创建虚拟机。  The processing unit 80 1 is configured to create a virtual machine.
发送单元 802 , 用于向该处理单元 80 1 创建的虚拟机对应的虚 拟交换机发送包括该虚拟机的网络连接信息的网络配置触发消息, 以使得该虚拟交换机根据该虚拟机的网络连接信息建立该虚拟交换 机与该虚拟机的连接。  The sending unit 802 is configured to send, to the virtual switch corresponding to the virtual machine created by the processing unit 80 1 , a network configuration trigger message including network connection information of the virtual machine, so that the virtual switch establishes the network connection information according to the virtual machine. The virtual switch is connected to the virtual machine.
其中, 该网络配置触发消息用于为该虚拟机管理模块所创建的 虚拟机进行网络配置。  The network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module.
接收单元 803 , 用于接收该虚拟机与该虚拟交换机建立连接的 确认消息。  The receiving unit 803 is configured to receive an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
可选地, 该接收单元 803 具体用于接收虚拟机管理中心发送的 创建虚拟机请求消息;  Optionally, the receiving unit 803 is specifically configured to receive a create virtual machine request message sent by the virtual machine management center;
该处理单元 80 1 具体用于根据该接收单元 803接收的创建虚拟 机请求消息, 选择该虚拟机对应的物理资源并创建该虚拟机。  The processing unit 80 is specifically configured to select a virtual machine corresponding to the virtual machine according to the create virtual machine request message received by the receiving unit 803, and create the virtual machine.
可选地, 该发送单元 802具体用于向该虚拟交换机发送网络配 置请求消息或者连接请求消息, 该网络配置请求消息或者连接请求 消息包括该虚拟机的网络连接信息。  Optionally, the sending unit 802 is specifically configured to send a network configuration request message or a connection request message to the virtual switch, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
具体地, 若发送网络配置请求消息, 则在发送网络配置请求消 息之后, 接收该虚拟交换机发送的网络配置响应消息; 并在虚拟机 创建完成且接收到该配置响应消息后, 向该虚拟机发送连接请求消 息。 在建立该虚拟机与该虚拟交换机的连接后, 接收该虚拟交换机 发送的确认消息。 Specifically, if the network configuration request message is sent, after receiving the network configuration request message, the network configuration response message sent by the virtual switch is received; and after the virtual machine is created and the configuration response message is received, the virtual machine is sent to the virtual machine. Connection request cancellation Interest. After establishing the connection between the virtual machine and the virtual switch, receiving an acknowledgement message sent by the virtual switch.
若发送连接请求消息, 则在该虚拟交换机根据该连接请求消息 中的网络连接信息建立与该虚拟机的连接后, 接收该虚拟交换机发 送的确认消息。  If the connection request message is sent, after the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message, the acknowledgment message sent by the virtual switch is received.
需要说明的是, 上述向该虚拟交换机发送网络配置请求消息或 者连接请求消息的区别在于:  It should be noted that the difference between sending the network configuration request message or the connection request message to the virtual switch is as follows:
若向虚拟交换机发送网络配置请求消息, 则虚拟交换机先根据 该网络配置请求消息进行网络配置, 当完成该虚拟机的创建且接收 到虚拟交换机发送的网络响应消息后, 才向该虚拟交换机发送连接 请求消息, 以便该虚拟交换机根据该连接请求消息中的网络连接信 息建立与该虚拟机的连接; 也就是说, 首先指示虚拟交换机进行网 络配置, 在网络配置完成后, 指示虚拟交换机建立与虚拟机的连接。  If the network configuration request message is sent to the virtual switch, the virtual switch first performs network configuration according to the network configuration request message. After the virtual machine is created and the network response message sent by the virtual switch is received, the virtual switch sends a connection to the virtual switch. Requesting a message, so that the virtual switch establishes a connection with the virtual machine according to the network connection information in the connection request message; that is, first instructing the virtual switch to perform network configuration, and after the network configuration is completed, instructing the virtual switch to establish and virtualize the virtual machine Connection.
若向虚拟交换机发送连接请求消息; 则该虚拟交换机根据该连 接请求消息进行网络配置, 并根据该连接请求消息中的网络连接信 息建立与该虚拟机的连接, 也就是说, 虚拟交换机接收到连接请求 消息后, 进行网络配置并建立与虚拟机的连接。  If the connection request message is sent to the virtual switch, the virtual switch performs network configuration according to the connection request message, and establishes a connection with the virtual machine according to the network connection information in the connection request message, that is, the virtual switch receives the connection. After requesting the message, perform network configuration and establish a connection to the virtual machine.
进一步地, 若发送单元 802向向虚拟交换机发送网络配置请求 消息, 该接收单元 803 还用于, 接收该虚拟交换机发送的网络配置 响应消息;  Further, if the sending unit 802 sends a network configuration request message to the virtual switch, the receiving unit 803 is further configured to receive a network configuration response message sent by the virtual switch.
该发送单元 802还用于, 在该处理单元 80 1虚拟机创建完成且 该接收单元接收到该配置响应消息后, 向该虚拟交换机发送连接请 求消息。  The sending unit 802 is further configured to: after the processing unit 80 1 virtual machine is created and the receiving unit receives the configuration response message, send a connection request message to the virtual switch.
进一步地,在该虚拟机管理模块用于虚拟机数据迁移场景下时, 该接收单元具体用于接收虚拟机管理中心发送的虚拟机迁移请求消 息。  Further, when the virtual machine management module is used in a virtual machine data migration scenario, the receiving unit is specifically configured to receive a virtual machine migration request message sent by the virtual machine management center.
该处理单元 80 1 具体用于根据该接收单元 803接收的虚拟机迁 移请求消息选择该虚拟机对应的物理资源并创建该虚拟机。  The processing unit 80 is specifically configured to select a physical resource corresponding to the virtual machine according to the virtual machine migration request message received by the receiving unit 803 and create the virtual machine.
可选地, 该发送单元 802还用于, 向该虚拟交换机发送网络配 置请求消息, 以便该虚拟交换机在接收到该网络配置请求消息后, 向该网络管理中心发送网络配置信息请求消息。 Optionally, the sending unit 802 is further configured to send a network configuration to the virtual switch. The request message is sent, so that the virtual switch sends a network configuration information request message to the network management center after receiving the network configuration request message.
可选地, 该发送单元 802还用于, 向虚拟机管理中心发送数据 迁移请求消息, 以便该虚拟机管理中心根据该数据迁移请求消息将 源虚拟机的数据迁移至目 的虚拟机。  Optionally, the sending unit 802 is further configured to send a data migration request message to the virtual machine management center, so that the virtual machine management center migrates data of the source virtual machine to the destination virtual machine according to the data migration request message.
该接收单元 803还用于, 在该数据迁移完成后, 接收该虚拟机 管理中心发送的数据迁移完成消息。  The receiving unit 803 is further configured to: after the data migration is completed, receive a data migration complete message sent by the virtual machine management center.
需要说明的是, 所属本领域的技术人员可以清楚地了解到, 为 描述的方便和简洁, 上述描述的虚拟机管理模块的具体工作过程及 描述, 可以参考前述方法实施例中的对应过程, 在此不再贅述。  It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process and description of the virtual machine management module described above may refer to the corresponding process in the foregoing method embodiments. This will not be repeated here.
通过采用上述虚拟机管理模块, 通过虚拟机管理模块和虚拟交 换机的直接交互实现对虚拟机的网络配置, 有效地减少了对虚拟机 网络配置过程中消息交互的流程和时间, 在降低时延的同时, 保证 了业务的稳定性和持续性。 本发明实施例提供一种交换装置 900 , 用于虚拟机的网络交换, 如图 9所示, 包括:  By adopting the above-mentioned virtual machine management module, the virtual machine network configuration is realized through the direct interaction between the virtual machine management module and the virtual switch, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process, and reducing the delay. At the same time, the stability and continuity of the business are guaranteed. The embodiment of the present invention provides a switching device 900, which is used for network switching of a virtual machine. As shown in FIG. 9, the method includes:
接收单元 901 , 用于接收该虚拟机管理模块发送的网络配置触 发消息。  The receiving unit 901 is configured to receive a network configuration trigger message sent by the virtual machine management module.
其中, 该网络配置触发消息用于为该虚拟机管理模块所创建的 虚拟机进行网络配置, 包括该虚拟机的网络连接信息。  The network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module, including network connection information of the virtual machine.
处理单元 902 , 用于根据接收单元 901 接收的网络连接信息建 立与该虚拟机的连接。  The processing unit 902 is configured to establish a connection with the virtual machine according to the network connection information received by the receiving unit 901.
发送单元 903 , 用于向该虚拟机管理模块返回该虚拟机与该交 换装置网络连接已建立的确认消息。  The sending unit 903 is configured to return, to the virtual machine management module, an acknowledgement message that the virtual machine and the switching device network connection have been established.
可选地, 该接收单元 901 具体用于, 接收该虚拟机管理模块发 送的网络配置请求消息或者连接请求消息, 该网络配置请求消息或 者连接请求消息包括该虚拟机的网络连接信息。  Optionally, the receiving unit 901 is specifically configured to: receive a network configuration request message or a connection request message sent by the virtual machine management module, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
具体地, 若接收该虚拟机管理模块发送的网络配置请求消息, 则先根据该网络配置请求消息进行网络配置, 当完成该虚拟机的创 建且接收到交换装置发送的网络配置响应消息后, 才接收该虚拟机 管理模块发送的连接请求消息, 并根据该连接请求消息中的网络连 接信息建立与该虚拟机的连接; 也就是说, 虚拟机管理模块首先指 示交换装置进行网络配置, 在网络配置完成后, 指示交换装置建立 与虚拟机的连接。 Specifically, if the network configuration request message sent by the virtual machine management module is received, First, the network configuration is performed according to the network configuration request message. After the virtual machine is created and the network configuration response message sent by the switching device is received, the connection request message sent by the virtual machine management module is received, and the connection request is received according to the connection request. The network connection information in the message establishes a connection with the virtual machine; that is, the virtual machine management module first instructs the switching device to perform network configuration, and after the network configuration is completed, instructs the switching device to establish a connection with the virtual machine.
若接收虚拟机管理模块发送的连接请求消息; H 'J根据该连接请 求消息进行网络配置, 并根据该连接请求消息中的网络连接信息建 立与该虚拟机的连接, 也就是说, 在接收到连接请求消息后, 进行 网络配置并建立与虚拟机的连接。  Receiving a connection request message sent by the virtual machine management module; H 'J performs network configuration according to the connection request message, and establishes a connection with the virtual machine according to the network connection information in the connection request message, that is, after receiving After connecting the request message, perform network configuration and establish a connection with the virtual machine.
上述的接收虚拟机管理模块发送的网络配置请求消息或者连接 请求消息只是实现方式上的区别, 本发明实施例并不局限于此, 但 无论采用哪种方式, 都应落入本发明的保护范围内。  The network configuration request message or the connection request message sent by the receiving virtual machine management module is only a difference in implementation manner, and the embodiment of the present invention is not limited thereto, but it should fall within the protection scope of the present invention. Inside.
进一步地, 该处理单元 902具体用于, 在接收单元 901接收到 该网络连接信息后, 若确定自身已配置该虚拟机的网络连接信息对 应的虚拟网络, 则直接建立与该虚拟机的连接。  Further, the processing unit 902 is specifically configured to: after the receiving unit 901 receives the network connection information, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, the connection with the virtual machine is directly established.
若确定自身未配置该虚拟机的网络连接信息对应的虚拟网络, 则向网络管理中心发送网络配置信息请求消息, 以便该网络管理中 心根据该网络配置信息请求消息返回网络配置信息;该处理单元 902 根据该网络配置信息配置虚拟网络并建立与该虚拟机的连接。  If it is determined that the virtual network corresponding to the network connection information of the virtual machine is not configured, the network configuration information request message is sent to the network management center, so that the network management center returns the network configuration information according to the network configuration information request message; the processing unit 902 The virtual network is configured according to the network configuration information and a connection with the virtual machine is established.
进一步地, 该发送单元 903还用于, 在建立与该虚拟机的连接 之前, 向该虚拟机管理模块发送网络配置响应消息;  Further, the sending unit 903 is further configured to: send a network configuration response message to the virtual machine management module before establishing a connection with the virtual machine;
该接收单元 901还用于, 在该虚拟机创建完成且该虚拟机管理 模块接收到该配置响应消息后, 接收该虚拟机管理模块发送的连接 请求消息。  The receiving unit 901 is further configured to: after the virtual machine is created and the virtual machine management module receives the configuration response message, receive a connection request message sent by the virtual machine management module.
需要说明的是, 上述网络配置可以针对 VLAN、 ACL、 QoS 等 进行的配置, 本发明对此不作限定。  It should be noted that the foregoing network configuration may be configured for a VLAN, an ACL, a QoS, etc., which is not limited by the present invention.
可选地, 该发送单元 903还用于, 向该网络管理中心发送连接 成功消息, 以便该网络管理中心在确定存在冲突虚拟机时, 向该冲 突虚拟机对应的交换装置发送连接断开消息, 以使得该冲突虚拟机 对应的交换装置根据该连接断开消息断开与该冲突虚拟机的连接。 Optionally, the sending unit 903 is further configured to send a connection success message to the network management center, so that the network management center detects the presence of the conflicting virtual machine. The switching device corresponding to the virtual machine sends a connection disconnect message, so that the switching device corresponding to the conflicting virtual machine disconnects the conflicting virtual machine according to the connection disconnect message.
其中, 该冲突虚拟机为网络地址与该虚拟机的网络地址相同的 虚拟机。  The conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine.
进一步地, 该交换装置可以包括源交换装置, 该接收单元 901 还用于, 接收虚拟机管理中心发送的连接断开消息。  Further, the switching device may include a source switching device, and the receiving unit 901 is further configured to receive a disconnection message sent by the virtual machine management center.
该处理单元 902 , 还用于根据该接收单元 901 接收的连接断开 消息断开与该源虚拟机的连接。  The processing unit 902 is further configured to disconnect the connection with the source virtual machine according to the connection disconnection message received by the receiving unit 901.
需要说明的是, 所属本领域的技术人员可以清楚地了解到, 为 描述的方便和简洁, 上述描述的交换装置的具体工作过程及描述, 可以参考前述方法实施例中的对应过程, 在此不再贅述。  It should be clearly understood that those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process and description of the foregoing switching device can refer to the corresponding process in the foregoing method embodiments, Let me repeat.
通过采用上述交换装置, 通过虚拟机管理模块和交换装置的直 接交互实现对虚拟机的网络配置, 有效地减少了对虚拟机网络配置 过程中消息交互的流程和时间, 在降低时延的同时, 保证了业务的 稳定性和持续性。  By adopting the foregoing switching device, the network configuration of the virtual machine is realized through direct interaction between the virtual machine management module and the switching device, thereby effectively reducing the flow and time of message interaction in the virtual machine network configuration process, while reducing the delay, Guarantee the stability and continuity of the business.
需要说明的是, 上述虚拟机管理模块和上述交换装置可以合设 在同一个主机中, 而对于虚拟机数据迁移场景, 源虚拟机管理模块 和源交换装置可以合设在源主机中, 目 的虚拟机管理模块和目 的交 换装置可以合设在目 的主机中。  It should be noted that the virtual machine management module and the switching device may be co-located in the same host, and for the virtual machine data migration scenario, the source virtual machine management module and the source switching device may be combined in the source host, and the destination virtual The machine management module and the destination switching device can be integrated in the destination host.
图 10 为本发明提供的一种对虚拟机进行网络配置的装置的结 构示意图, 如图 10所示, 该装置 100 包括:  FIG. 10 is a schematic structural diagram of an apparatus for performing network configuration on a virtual machine according to the present invention. As shown in FIG. 10, the apparatus 100 includes:
处理器 ( processor ) 101、 通信接口 ( Communications Interface ) 102、 存储器( memory ) 103和通信总线 104 ; 其中, 所述处理器 101、 所述通信接口 102和所述存储器 103通过所述通信总线 104完成相 互间的通信。  a processor 101, a communication interface 102, a memory 103, and a communication bus 104; wherein the processor 101, the communication interface 102, and the memory 103 are completed by the communication bus 104 Communication with each other.
处理器 101可能是一个中央处理器 CPU , 或者是特定集成电路 ASIC ( Application Specific Integrated Circuit ) , 或者是被配置成实 施本发明实施例的一个或多个集成电路。  The processor 101 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
存储器 103用于存放程序代码, 所述程序代码包括计算机操作 指令。 存储器 103可能包含高速 RAM存储器, 也可能还包括非易失 性存 4诸器 ( non-volatile memory ) , 例: ¾口至少一个磁盘存 4诸器。 The memory 103 is used to store program code, and the program code includes computer operation Instruction. The memory 103 may include a high speed RAM memory, and may also include a non-volatile memory, for example: at least one disk memory device.
所述通信接口 102 , 用于输出图像的压缩后的码流。  The communication interface 102 is configured to output a compressed code stream of an image.
所述处理器 101执行程序代码, 用于创建虚拟机, 并向创建的 虚拟机对应的虚拟交换机发送包括该虚拟机的网络连接信息的网络 配置触发消息, 以使得该虚拟交换机根据该虚拟机的网络连接信息 建立该虚拟交换机与该虚拟机的连接, 并接收该虚拟机与该虚拟交 换机建立连接的确认消息。  The processor 101 executes program code, and creates a virtual machine, and sends a network configuration trigger message including network connection information of the virtual machine to the virtual switch corresponding to the created virtual machine, so that the virtual switch is configured according to the virtual machine. The network connection information establishes a connection between the virtual switch and the virtual machine, and receives an acknowledgement message that the virtual machine establishes a connection with the virtual switch.
其中, 该网络配置触发消息包括网络连接消息。  The network configuration trigger message includes a network connection message.
可选地, 该处理器 101还用于接收虚拟机管理中心发送的创建 虚拟机请求消息, 并根据该创建虚拟机请求消息, 选择该虚拟机对 应的物理资源并创建该虚拟机。  Optionally, the processor 101 is further configured to receive a create virtual machine request message sent by the virtual machine management center, and select a virtual machine corresponding to the virtual machine according to the create virtual machine request message and create the virtual machine.
可选地, 该处理器 101还用于向该虚拟交换机发送网络配置请 求消息或者连接请求消息, 该网络配置请求消息或者连接请求消息 包括该虚拟机的网络连接信息。  Optionally, the processor 101 is further configured to send a network configuration request message or a connection request message to the virtual switch, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
可选地, 该处理器 101还用于接收该虚拟交换机发送的网络配 置响应消息, 并在该虚拟机创建完成且接收到该配置响应消息后, 向该虚拟交换机发送连接请求消息。  Optionally, the processor 101 is further configured to receive a network configuration response message sent by the virtual switch, and send a connection request message to the virtual switch after the virtual machine is created and the configuration response message is received.
进一步地, 该处理器 101 还用于接收虚拟机管理中心发送的虚 拟机迁移请求消息, 并才艮据该虚拟机迁移请求消息选择该虚拟机对 应的物理资源并创建该虚拟机。  Further, the processor 101 is further configured to receive a virtual machine migration request message sent by the virtual machine management center, and select the physical resource corresponding to the virtual machine according to the virtual machine migration request message and create the virtual machine.
可选地, 该处理器 101还用于向该虚拟交换机发送网络配置请 求消息, 以便该虚拟交换机在接收到该网络配置请求消息后, 向该 网络管理中心发送网络配置信息请求消息。  Optionally, the processor 101 is further configured to send a network configuration request message to the virtual switch, so that the virtual switch sends a network configuration information request message to the network management center after receiving the network configuration request message.
可选地, 该处理器 101还用于向虚拟机管理中心发送数据迁移 请求消息, 以便该虚拟机管理中心根据该数据迁移请求消息将源虚 拟机的数据迁移至目 的虚拟机, 并在该数据迁移完成后, 接收该虚 拟机管理中心发送的数据迁移完成消息。 图 11 为本发明提供的一种对虚拟机进行网络配置的装置的结 构示意图, 如图 11所示, 该装置 110 包括: Optionally, the processor 101 is further configured to send a data migration request message to the virtual machine management center, so that the virtual machine management center migrates the data of the source virtual machine to the destination virtual machine according to the data migration request message, and the data is After the migration is complete, receive the data migration complete message sent by the virtual machine management center. FIG. 11 is a schematic structural diagram of an apparatus for performing network configuration on a virtual machine according to the present invention. As shown in FIG. 11, the apparatus 110 includes:
处理器 ( processor ) 111、 通信接口 ( Communications Interface ) 112、 存储器( memory) 113和通信总线 114; 其中, 所述处理器 111、 所述通信接口 112和所述存储器 113通过所述通信总线 114完成相 互间的通信。  a processor 111, a communication interface 112, a memory 113, and a communication bus 114; wherein the processor 111, the communication interface 112, and the memory 113 are completed by the communication bus 114 Communication with each other.
处理器 111可能是一个中央处理器 CPU, 或者是特定集成电路 ASIC ( Application Specific Integrated Circuit ), 或者是被配置成实 施本发明实施例的一个或多个集成电路。  The processor 111 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
存储器 113 用于存放程序代码, 所述程序代码包括计算机操作 指令。 存储器 113可能包含高速 RAM存储器, 也可能还包括非易失 性存 4诸器 ( non-volatile memory ), 例: ¾口至少一个磁盘存 4诸器。  The memory 113 is for storing program code, and the program code includes computer operation instructions. The memory 113 may include a high speed RAM memory, and may also include a non-volatile memory, for example, at least one disk memory.
所述通信接口 112, 用于输出图像的压缩后的码流。  The communication interface 112 is configured to output a compressed code stream of an image.
所述处理器 111 执行程序代码, 用于接收虚拟机管理模块发送 的网络配置触发消息, 所述网络配置触发消息用于为所述虚拟机管 理模块所创建的虚拟机进行网络配置, 包括所述虚拟机的网络连接 信息, 并根据所述网络连接信息建立与所述虚拟机的连接, 并向所 述虚拟机管理模块返回所述虚拟机与所述虚拟交换机网络连接已建 立的确认消息。  The processor 111 is configured to receive a network configuration trigger message sent by the virtual machine management module, where the network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module, including the Network connection information of the virtual machine, and establishing a connection with the virtual machine according to the network connection information, and returning an acknowledgement message that the virtual machine and the virtual switch network connection have been established to the virtual machine management module.
进一步地, 该处理器 111 还用于接收所述虚拟机管理模块发送 的网络配置请求消息或者连接请求消息, 所述网络配置请求消息或 者连接请求消息包括所述虚拟机的网络连接信息。  Further, the processor 111 is further configured to receive a network configuration request message or a connection request message sent by the virtual machine management module, where the network configuration request message or the connection request message includes network connection information of the virtual machine.
可选地, 该处理器 111 还用于在接收到所述网络连接信息后, 若确定自身已配置所述虚拟机的网络连接信息对应的虚拟网络, 则 直接建立与所述虚拟机的连接; 若确定自身未配置所述虚拟机的网 络连接信息对应的虚拟网络, 则向网络管理中心发送网络配置信息 请求消息, 以便所述网络管理中心根据所述网络配置信息请求消息 返回网络配置信息; 所述虚拟交换机根据所述网络配置信息配置虚 拟网络并建立与所述虚拟机的连接。 可选地, 该处理器 1 1 1 还用于若接收到所述虚拟机管理模块发 送的网络配置请求消息, 在建立与所述虚拟机的连接之前, 向所述 虚拟机管理模块发送网络配置响应消息; 在所述虚拟机创建完成且 所述虚拟机管理模块接收到所述配置响应消息后, 接收所述虚拟机 管理模块发送的连接请求消息。 Optionally, the processor 111 is further configured to: after receiving the network connection information, if it is determined that the virtual network corresponding to the network connection information of the virtual machine is configured, directly establish a connection with the virtual machine; If it is determined that the virtual network corresponding to the network connection information of the virtual machine is not configured, the network configuration information request message is sent to the network management center, so that the network management center returns the network configuration information according to the network configuration information request message; The virtual switch configures the virtual network according to the network configuration information and establishes a connection with the virtual machine. Optionally, the processor 112 is further configured to: if receiving the network configuration request message sent by the virtual machine management module, send a network configuration to the virtual machine management module before establishing a connection with the virtual machine. a response message; after the virtual machine is created and the virtual machine management module receives the configuration response message, receiving a connection request message sent by the virtual machine management module.
可选地, 该处理器 1 1 1 还用于向所述网络管理中心发送连接成 功消息, 以便所述网络管理中心在确定存在冲突虚拟机时, 向所述 冲突虚拟机对应的虚拟交换机发送连接断开消息, 以使得所述冲突 虚拟机对应的虚拟交换机根据所述连接断开消息断开与所述冲突虚 拟机的连接, 其中, 所述冲突虚拟机为网络地址与所述虚拟机的网 络地址相同的虚拟机。  Optionally, the processor 1 1 1 is further configured to send a connection success message to the network management center, so that the network management center sends a connection to the virtual switch corresponding to the conflicting virtual machine when determining that there is a conflicting virtual machine. Disconnecting the message, so that the virtual switch corresponding to the conflicting virtual machine disconnects from the conflicting virtual machine according to the connection disconnection message, where the conflicting virtual machine is a network address and a network of the virtual machine A virtual machine with the same address.
进一步地, 该处理器 1 1 1 还用于在虚拟机数据迁移场景下, 接 收虚拟机管理中心发送的连接断开消息, 并根据所述连接断开消息 断开与所述源虚拟机的连接。  Further, the processor 1 1 1 is further configured to receive a connection disconnection message sent by the virtual machine management center in a virtual machine data migration scenario, and disconnect the source virtual machine according to the connection disconnection message. .
本发明实施例提供一种计算机可读介质,包含计算机执行指令, 当计算机的中央处理器执行所述计算机执行指令时, 所述计算机用 于执行上述图 10描述的装置的处理器 101所执行的程序代码或者上 述图 1 1描述的装置的处理器 1 1 1所执行的程序代码。  An embodiment of the present invention provides a computer readable medium, comprising computer executed instructions, when the central processor of a computer executes the computer execution instructions, the computer is configured to execute the processor 101 of the apparatus described in FIG. The program code or the program code executed by the processor 1 1 1 of the apparatus described above with respect to FIG.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或 部分步骤可以通过程序指令相关的硬件来完成, 前述的程序可以存 储于一计算机可读取存储介质中, 该程序在执行时, 执行包括上述 方法实施例的步骤; 而前述的存储介质包括: ROM、 RAM , 磁碟或 者光盘等各种可以存储程序代码的介质。  A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围 并不局限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技 术范围内, 可轻易想到变化或替换, 都应涵盖在本发明的保护范围 之内。 因此, 本发明的保护范围应所述以权利要求的保护范围为准。  The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims

权 利 要 求 书 claims
1、 一种对虚拟机进行网络配置的方法, 其特征在于, 包括: 创建虚拟机; 接信息的网络配置触发消 , , 以使得所述虚拟交换机根据所述虚拟机 的网络连接信息建立所述虚拟交换机与所述虚拟机的连接, 其中, 所 述网络配置触发消息用于为所述虚拟机管理模块所创建的虚拟机进 行网络配置; 1. A method for network configuration of a virtual machine, characterized in that it includes: creating a virtual machine; triggering a deactivation of the network configuration of the connection information, so that the virtual switch establishes the network connection information of the virtual machine according to the network connection information of the virtual machine. The connection between the virtual switch and the virtual machine, wherein the network configuration trigger message is used to perform network configuration for the virtual machine created by the virtual machine management module;
接收所述虚拟机与所述虚拟交换机建立连接的确认消 , ¾。 Receive a confirmation message for establishing a connection between the virtual machine and the virtual switch.
2、 根据权利要求 1 所述的方法, 其特征在于, 所述创建虚拟机 包括: 2. The method according to claim 1, characterized in that said creating a virtual machine includes:
接收虚拟机管理中心发送的创建虚拟机请求消 , ¾; Receive the virtual machine creation request message sent by the virtual machine management center;
根据所述创建虚拟机请求消息,选择所述虚拟机对应的物理资源 并创建所述虚拟机。 According to the virtual machine creation request message, select the physical resource corresponding to the virtual machine and create the virtual machine.
3、 根据权利要求 2所述的方法, 其特征在于, 所述向所述虚拟 置触发消息, 包括: 3. The method according to claim 2, characterized in that: setting a trigger message to the virtual device includes:
向所述虚拟交换机发送网络配置请求消息或者连接请求消息,所 述网络配置请求消息或者连接请求消息包括所述虚拟机的网络连接 信息。 Send a network configuration request message or a connection request message to the virtual switch, where the network configuration request message or connection request message includes the network connection information of the virtual machine.
4、 根据权利要求 3 所述的方法, 其特征在于, 若向所述虚拟交 换机发送网络配置请求消息, 在所述建立所述虚拟机与所述虚拟交换 机的连接之前, 所述方法还包括: 4. The method according to claim 3, wherein if a network configuration request message is sent to the virtual switch, before establishing the connection between the virtual machine and the virtual switch, the method further includes:
接收所述虚拟交换机发送的网络配置响应消息; Receive a network configuration response message sent by the virtual switch;
在所述虚拟机创建完成且接收到所述配置响应消息后,向所述虚 拟交换机发送连接请求消 , ¾。 After the creation of the virtual machine is completed and the configuration response message is received, a connection request message is sent to the virtual switch.
5、 根据权利要求 1 所述的方法, 其特征在于, 所述创建虚拟机 包括: 5. The method according to claim 1, characterized in that said creating a virtual machine includes:
接收虚拟机管理中心发送的虚拟机迁移请求消息; 根据所述虚拟机迁移请求消息选择所述虚拟机对应的物理资源 并创建所述虚拟机。 Receive the virtual machine migration request message sent by the virtual machine management center; Select the physical resource corresponding to the virtual machine according to the virtual machine migration request message and create the virtual machine.
6、 根据权利要求 5所述的方法, 其特征在于, 所述方法还包括: 向所述虚拟交换机发送网络配置请求消息,以便所述虚拟交换机 在接收到所述网络配置请求消息后, 向所述网络管理中心发送网络配 置信息请求消息。 6. The method according to claim 5, characterized in that, the method further includes: sending a network configuration request message to the virtual switch, so that after receiving the network configuration request message, the virtual switch sends the network configuration request message to the virtual switch. The network management center sends a network configuration information request message.
7、 根据权利要求 5或 6所述的方法, 其特征在于, 所述方法还 包括: 7. The method according to claim 5 or 6, characterized in that the method further includes:
向虚拟机管理中心发送数据迁移请求消 , ,以便所述虚拟机管理 中心根据所述数据迁移请求消息将源虚拟机的数据迁移至目 的虚拟 机; Send a data migration request message to the virtual machine management center, so that the virtual machine management center can migrate the data of the source virtual machine to the destination virtual machine according to the data migration request message;
在所述数据迁移完成后,接收所述虚拟机管理中心发送的数据迁 移完成消息。 After the data migration is completed, a data migration completion message sent by the virtual machine management center is received.
8、 一种对虚拟机进行网络配置的方法, 其特征在于, 包括: 接收虚拟机管理模块发送的网络配置触发消息,所述网络配置触 发消息用于为所述虚拟机管理模块所创建的虚拟机进行网络配置, 包 括所述虚拟机的网络连接信息; 8. A method for network configuration of a virtual machine, characterized by comprising: receiving a network configuration trigger message sent by a virtual machine management module, where the network configuration trigger message is used for the virtual machine created by the virtual machine management module. Perform network configuration on the virtual machine, including network connection information of the virtual machine;
根据所述网络连接信息建立与所述虚拟机的连接; 连接已建立的确认消息。 Establish a connection with the virtual machine according to the network connection information; and a confirmation message that the connection has been established.
9、 根据权利要求 8所述的方法, 其特征在于, 所述接收所述虚 拟机管理模块发送的网络配置触发消息包括: 接收所述虚拟机管理模 块发送的网络配置请求消息或者连接请求消息, 所述网络配置请求消 息或者连接请求消息包括所述虚拟机的网络连接信息。 9. The method according to claim 8, wherein receiving the network configuration trigger message sent by the virtual machine management module includes: receiving a network configuration request message or a connection request message sent by the virtual machine management module, The network configuration request message or connection request message includes network connection information of the virtual machine.
10、 根据权利要求 8或 9所述的方法, 所述根据所述网络连接信 息建立与所述虚拟机的连接, 包括: 10. The method according to claim 8 or 9, wherein establishing a connection with the virtual machine according to the network connection information includes:
在接收到所述网络连接信息后,若确定自身已配置所述虚拟机的 网络连接信息对应的虚拟网络, 则直接建立与所述虚拟机的连接; 若确定自身未配置所述虚拟机的网络连接信息对应的虚拟网络, 则向网络管理中心发送网络配置信息请求消息, 以便所述网络管理中 心根据所述网络配置信息请求消息返回网络配置信息; 所述虚拟交换 机根据所述网络配置信息配置虚拟网络并建立与所述虚拟机的连接。 After receiving the network connection information, if it is determined that the virtual network corresponding to the network connection information of the virtual machine has been configured, a connection with the virtual machine is directly established; if it is determined that the network of the virtual machine has not been configured. The virtual network corresponding to the connection information, Then send a network configuration information request message to the network management center, so that the network management center returns network configuration information according to the network configuration information request message; the virtual switch configures a virtual network according to the network configuration information and establishes a connection with the virtual switch. machine connection.
1 1、 根据权利要求 9或 10所述的方法, 其特征在于, 若接收到 所述虚拟机管理模块发送的网络配置请求消息, 在建立与所述虚拟机 的连接之前, 所述方法还包括: 1 1. The method according to claim 9 or 10, characterized in that, if a network configuration request message sent by the virtual machine management module is received, before establishing a connection with the virtual machine, the method further includes: :
向所述虚拟机管理模块发送网络配置响应消息; Send a network configuration response message to the virtual machine management module;
在所述虚拟机创建完成且所述虚拟机管理模块接收到所述配置 响应消息后, 接收所述虚拟机管理模块发送的连接请求消息。 After the virtual machine is created and the virtual machine management module receives the configuration response message, receive a connection request message sent by the virtual machine management module.
12、 根据权利要求 8至 1 1任一项所述的方法, 其特征在于, 所 述方法还包括: 12. The method according to any one of claims 8 to 11, characterized in that the method further includes:
向所述网络管理中心发送连接成功消息,以便所述网络管理中心 在确定存在冲突虚拟机时, 向所述冲突虚拟机对应的虚拟交换机发送 接断开消息断开与所述冲突虚拟机的连接, 其中, 所述冲突虚拟机为 网络地址与所述虚拟机的网络地址相同的虚拟机。 Send a connection success message to the network management center, so that when the network management center determines that a conflicting virtual machine exists, it sends a connection and disconnection message to the virtual switch corresponding to the conflicting virtual machine to disconnect the conflicting virtual machine. , wherein the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine.
13、 根据权利要求 1 1或 12所述的方法, 其特征在于, 在虚拟机 数据迁移场景下, 目的虚拟交换机通知虚拟机管理中心将源虚拟机中 的数据迁移至目的虚拟机, 所述目的虚拟机对应的目的虚拟交换机建 立与所述目的虚拟机的连接; 所述源虚拟机对应有源虚拟交换机; 所 述在所述目 的虚拟机对应的目 的虚拟交换机建立与所述目 的虚拟机 的连接之前还包括: 13. The method according to claim 11 or 12, characterized in that, in a virtual machine data migration scenario, the destination virtual switch notifies the virtual machine management center to migrate the data in the source virtual machine to the destination virtual machine. The destination virtual switch corresponding to the virtual machine establishes a connection with the destination virtual machine; the source virtual machine corresponds to an active virtual switch; the destination virtual switch corresponding to the destination virtual machine establishes a connection with the destination virtual machine Also previously included:
源虚拟交换机接收虚拟机管理中心发送的连接断开消息; 源虚拟交换机根据所述连接断开消息断开与所述源虚拟机的连 接。 The source virtual switch receives the connection disconnection message sent by the virtual machine management center; the source virtual switch disconnects the connection with the source virtual machine according to the connection disconnection message.
14、 一种虚拟机管理模块, 其特征在于, 包括: 14. A virtual machine management module, characterized by including:
处理单元, 用于创建虚拟机; Processing unit, used to create virtual machines;
发送单元, 用于向所述处理单元创建的虚拟机对应的虚拟交换 机发送包括所述虚拟机的网络连接信息的网络配置触发消, , 以使 得所述虚拟交换机根据所述虚拟机的网络连接信息建立所述虚拟交 换机与所述虚拟机的连接, 其中, 所述网络配置触发消息用于为所述 虚拟机管理模块所创建的虚拟机进行网络配置; A sending unit, configured to send a network configuration trigger message including network connection information of the virtual machine to the virtual switch corresponding to the virtual machine created by the processing unit, so that The virtual switch establishes a connection between the virtual switch and the virtual machine according to the network connection information of the virtual machine, wherein the network configuration trigger message is used to configure the virtual machine created by the virtual machine management module. Network Configuration;
接收单元,用于接收所述虚拟机与所述虚拟交换机建立连接的确 认消息。 A receiving unit, configured to receive a confirmation message for establishing a connection between the virtual machine and the virtual switch.
15、 根据权利要求 14所述的模块, 其特征在于, 所述接收单元 还用于接收虚拟机管理中心发送的创建虚拟机请求消 , ¾; 15. The module according to claim 14, wherein the receiving unit is further configured to receive a virtual machine creation request message sent by the virtual machine management center;
所述处理单元具体用于根据所述接收单元接收的创建虚拟机请 求消息, 选择所述虚拟机对应的物理资源并创建所述虚拟机。 The processing unit is specifically configured to select the physical resource corresponding to the virtual machine and create the virtual machine according to the virtual machine creation request message received by the receiving unit.
16、 根据权利要求 15所述的模块, 其特征在于, 所述发送单元 具体用于向所述虚拟交换机发送网络配置请求消息或者连接请求消 息, 所述网络配置请求消息或者连接请求消息包括所述虚拟机的网络 连接信息。 16. The module according to claim 15, wherein the sending unit is specifically configured to send a network configuration request message or a connection request message to the virtual switch, and the network configuration request message or the connection request message includes the Network connection information for the virtual machine.
17、 根据权利要求 16所述的模块, 其特征在于, 所述接收单元 还用于, 接收所述虚拟交换机发送的网络配置响应消息; 17. The module according to claim 16, wherein the receiving unit is further configured to receive a network configuration response message sent by the virtual switch;
所述发送单元还用于,在所述处理单元虚拟机创建完成且所述接 收单元接收到所述配置响应消息后, 向所述虚拟交换机发送连接请求 消息。 The sending unit is also configured to send a connection request message to the virtual switch after the creation of the processing unit virtual machine is completed and the receiving unit receives the configuration response message.
18、 根据权利要求 14所述的模块, 其特征在于, 所述接收单元 具体用于接收虚拟机管理中心发送的虚拟机迁移请求消 , ¾; 18. The module according to claim 14, wherein the receiving unit is specifically configured to receive a virtual machine migration request message sent by the virtual machine management center;
所述处理单元具体用于根据所述接收单元接收的虚拟机迁移请 求消息选择所述虚拟机对应的物理资源并创建所述虚拟机。 The processing unit is specifically configured to select the physical resource corresponding to the virtual machine and create the virtual machine according to the virtual machine migration request message received by the receiving unit.
19、 根据权利要求 1 8所述的设备, 其特征在于, 所述发送单元 还用于, 向所述虚拟交换机发送网络配置请求消息, 以便所述虚拟交 换机在接收到所述网络配置请求消息后, 向所述网络管理中心发送网 络配置信息请求消息。 19. The device according to claim 18, wherein the sending unit is further configured to send a network configuration request message to the virtual switch, so that after receiving the network configuration request message, the virtual switch , sending a network configuration information request message to the network management center.
20、 根据权利要求你 1 8 或 19 所述的模块, 其特征在于, 所述 发送单元还用于, 向虚拟机管理中心发送数据迁移请求消息, 以便所 述虚拟机管理中 ' ^根据所述数据迁移请求消 , 将源虚拟机的数据迁 移至目的虚拟机; 20. The module according to claim 18 or 19, characterized in that the sending unit is also used to send a data migration request message to the virtual machine management center, so that the virtual machine management center can The data migration request is canceled and the data of the source virtual machine is migrated. Move to the destination virtual machine;
所述接收单元还用于, 在所述数据迁移完成后, 接收所述虚拟机 管理中心发送的数据迁移完成消息。 The receiving unit is also configured to receive a data migration completion message sent by the virtual machine management center after the data migration is completed.
21、 一种交换装置, 用于虚拟机的网络交换, 其特征在于, 包括: 接收单元,用于接收所述虚拟机管理模块发送的网络配置触发消 息, 所述网络配置触发消息用于为所述虚拟机管理模块所创建的虚拟 机进行网络配置, 包括所述虚拟机的网络连接信息; 21. A switching device for network switching of virtual machines, characterized in that it includes: a receiving unit configured to receive a network configuration trigger message sent by the virtual machine management module, and the network configuration trigger message is used to Perform network configuration on the virtual machine created by the virtual machine management module, including network connection information of the virtual machine;
处理单元,用于根据所述接收单元接收的网络连接信息建立与所 述虚拟机的连接; A processing unit, configured to establish a connection with the virtual machine according to the network connection information received by the receiving unit;
发送单元,用于向所述虚拟机管理模块返回所述虚拟机与所述交 换装置网络连接已建立的确认消息。 A sending unit configured to return to the virtual machine management module a confirmation message that the network connection between the virtual machine and the switching device has been established.
22、 根据权利要求 21 所述的交换装置, 其特征在于, 所述接收 单元具体用于, 接收所述虚拟机管理模块发送的网络配置请求消息或 者连接请求消息, 所述网络配置请求消息或者连接请求消息包括所述 虚拟机的网络连接信息。 22. The switching device according to claim 21, wherein the receiving unit is specifically configured to receive a network configuration request message or a connection request message sent by the virtual machine management module, and the network configuration request message or connection request message is The request message includes network connection information of the virtual machine.
23、 根据权利要求 21或 22所述的交换装置, 其特征在于, 所述 处理单元具体用于, 在接收到所述网络连接信息后, 若确定自身已配 置所述虚拟机的网络连接信息对应的虚拟网络, 则直接建立与所述虚 拟机的连接; 23. The switching device according to claim 21 or 22, wherein the processing unit is specifically configured to, after receiving the network connection information, if it determines that it has configured the network connection information corresponding to the virtual machine. virtual network, directly establish a connection with the virtual machine;
若确定自身未配置所述虚拟机的网络连接信息对应的虚拟网络, 则向网络管理中心发送网络配置信息请求消息, 以便所述网络管理中 心根据所述网络配置信息请求消息返回网络配置信息; 所述处理单元 根据所述网络配置信息配置虚拟网络并建立与所述虚拟机的连接。 If it is determined that the virtual network corresponding to the network connection information of the virtual machine has not been configured, a network configuration information request message is sent to the network management center, so that the network management center returns network configuration information according to the network configuration information request message; so The processing unit configures a virtual network according to the network configuration information and establishes a connection with the virtual machine.
24、 根据权利要求 22或 23所述的交换装置, 其特征在于, 所述 发送单元还用于, 在建立与所述虚拟机的连接之前, 向所述虚拟机管 理模块发送网络配置响应消息; 24. The switching device according to claim 22 or 23, wherein the sending unit is further configured to send a network configuration response message to the virtual machine management module before establishing a connection with the virtual machine;
所述接收单元还用于,在所述虚拟机创建完成且所述虚拟机管理 模块接收到所述配置响应消息后, 接收所述虚拟机管理模块发送的连 接请求消息。 The receiving unit is further configured to receive a connection request message sent by the virtual machine management module after the virtual machine is created and the virtual machine management module receives the configuration response message.
25、根据权利要求 21至 24任一项所述的交换装置,其特征在于, 所述发送单元还用于, 向所述网络管理中心发送连接成功消息, 以便 所述网络管理中心在确定存在冲突虚拟机时 , 向所述冲突虚拟机对应 的交换装置发送连接断开消息, 以使得所述冲突虚拟机对应的交换装 置根据所述连接断开消息断开与所述冲突虚拟机的连接, 其中, 所述 冲突虚拟机为网络地址与所述虚拟机的网络地址相同的虚拟机。 25. The switching device according to any one of claims 21 to 24, wherein the sending unit is further configured to send a connection success message to the network management center, so that the network management center determines that a conflict exists. virtual machine, sending a connection disconnection message to the switching device corresponding to the conflicting virtual machine, so that the switching device corresponding to the conflicting virtual machine disconnects from the conflicting virtual machine according to the connection disconnection message, wherein , the conflicting virtual machine is a virtual machine whose network address is the same as the network address of the virtual machine.
26、 根据权利要求 24或 25所述的交换装置, 其特征在于, 所述 接收单元还用于, 接收虚拟机管理中心发送的连接断开消息; 26. The switching device according to claim 24 or 25, wherein the receiving unit is further configured to receive a connection disconnect message sent by the virtual machine management center;
所述处理单元,还用于根据所述接收单元接收的连接断开消息断 开与所述源虚拟机的连接。 The processing unit is further configured to disconnect from the source virtual machine according to the connection disconnection message received by the receiving unit.
27、 一种对虚拟机进行网络配置的装置, 其特征在于, 包括处理 器和存储器, 所述存储器存储计算机执行指令, 所述处理器与所述存 储器通过通信总线连接; 27. A device for network configuration of a virtual machine, characterized in that it includes a processor and a memory, the memory stores computer execution instructions, and the processor and the memory are connected through a communication bus;
当所述装置运行时,所述处理器执行所述存储器存储的所述计算 机执行指令, 使得所述装置执行权利要求 1至 7任一所述的方法。 When the device is running, the processor executes the computer execution instructions stored in the memory, so that the device executes the method described in any one of claims 1 to 7.
28、 一种对虚拟机进行网络配置的装置, 其特征在于, 包括处理 器和存储器, 所述存储器存储计算机执行指令, 所述处理器与所述存 储器通过通信总线连接; 28. A device for network configuration of a virtual machine, characterized in that it includes a processor and a memory, the memory stores computer execution instructions, and the processor and the memory are connected through a communication bus;
当所述装置运行时,所述处理器执行所述存储器存储的所述计算 机执行指令, 使得所述装置执行权利要求 8至 13任一所述的方法。 When the device is running, the processor executes the computer execution instructions stored in the memory, so that the device executes the method described in any one of claims 8 to 13.
29、 一种计算机可读介质, 其特征在于, 包含计算机执行指令, 当计算机的中央处理器执行所述计算机执行指令时, 所述计算机执行 权利要求 1至 7或者 8至 13任一所述的方法。 29. A computer-readable medium, characterized in that it contains computer-executable instructions. When the central processor of the computer executes the computer-executable instructions, the computer executes any one of claims 1 to 7 or 8 to 13. method.
PCT/CN2012/084477 2012-11-12 2012-11-12 Method and device for performing network configuration on virtual machine WO2014071637A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/084477 WO2014071637A1 (en) 2012-11-12 2012-11-12 Method and device for performing network configuration on virtual machine
CN201280002829.4A CN104040950B (en) 2012-11-12 2012-11-12 A kind of method and apparatus that network configuration is carried out to virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/084477 WO2014071637A1 (en) 2012-11-12 2012-11-12 Method and device for performing network configuration on virtual machine

Publications (1)

Publication Number Publication Date
WO2014071637A1 true WO2014071637A1 (en) 2014-05-15

Family

ID=50683964

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/084477 WO2014071637A1 (en) 2012-11-12 2012-11-12 Method and device for performing network configuration on virtual machine

Country Status (2)

Country Link
CN (1) CN104040950B (en)
WO (1) WO2014071637A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108599998A (en) * 2018-04-04 2018-09-28 刘昱 Management-control method, device and the computer readable storage medium of network
CN108768895A (en) * 2018-05-18 2018-11-06 华为技术有限公司 A kind of method of virtual machine (vm) migration and data center

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107276783B (en) * 2016-04-08 2022-05-20 中兴通讯股份有限公司 Method, device and system for realizing unified management and intercommunication of virtual machines

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102084340A (en) * 2009-04-28 2011-06-01 思科技术公司 Traffic forwarding for virtual machines
CN102412978A (en) * 2010-09-21 2012-04-11 杭州华三通信技术有限公司 Method for carrying out network configuration for VM and system thereof
WO2012109868A1 (en) * 2011-08-01 2012-08-23 华为技术有限公司 Network policy configuration method, management device and network management centre device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102084340A (en) * 2009-04-28 2011-06-01 思科技术公司 Traffic forwarding for virtual machines
CN102412978A (en) * 2010-09-21 2012-04-11 杭州华三通信技术有限公司 Method for carrying out network configuration for VM and system thereof
WO2012109868A1 (en) * 2011-08-01 2012-08-23 华为技术有限公司 Network policy configuration method, management device and network management centre device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108599998A (en) * 2018-04-04 2018-09-28 刘昱 Management-control method, device and the computer readable storage medium of network
CN108768895A (en) * 2018-05-18 2018-11-06 华为技术有限公司 A kind of method of virtual machine (vm) migration and data center
CN108768895B (en) * 2018-05-18 2021-02-23 华为技术有限公司 Virtual machine migration method and data center
US11928490B2 (en) 2018-05-18 2024-03-12 Huawei Cloud Computing Technologies Co., Ltd. Virtual machine migration method and data center

Also Published As

Publication number Publication date
CN104040950A (en) 2014-09-10
CN104040950B (en) 2017-09-29

Similar Documents

Publication Publication Date Title
US11005755B2 (en) Packet processing method in cloud computing system, host, and system
US11200079B2 (en) System and method for virtual machine live migration
US10171567B2 (en) Load balancing computer device, system, and method
US11941423B2 (en) Data processing method and related device
KR102328388B1 (en) Quality of service control method and related device
CN105323136B (en) Information processing method and device
EP2834735B1 (en) Virtualized movement of enhanced network services associated with a virtual machine
EP3176980B1 (en) Unified server communication method, baseboard management controller and server
WO2016015559A1 (en) Bearer resource allocation method, apparatus and system for cloudified data center network
US20100287262A1 (en) Method and system for guaranteed end-to-end data flows in a local networking domain
US20140068045A1 (en) Network system and virtual node migration method
JP6432955B2 (en) Method, apparatus and system for migrating virtual network function instances
KR20170037623A (en) Network functions virtualization
WO2014101531A1 (en) Creating method and device for virtual base station
JP2014535228A (en) Port setting method, routing device, and computer program product
US11018990B2 (en) Route priority configuration method, device, and controller
WO2016155291A1 (en) Method and apparatus for managing virtualized network function scaling
CN111371694B (en) Shunting method, device and system, processing equipment and storage medium
EP3038296A1 (en) Pool element status information synchronization method, pool register and pool element
WO2014071637A1 (en) Method and device for performing network configuration on virtual machine
KR20150002426A (en) Methods for supporting mobility of virtual machine in network input output virtualization environment and apparatus for performing the same
US11095514B2 (en) System and method for propagating anima network objective changes
WO2016000648A1 (en) Controlling virtual edge port aggregator
US11996993B2 (en) Packet transmission method, apparatus, and system, and storage medium
JP2015156587A (en) Network system, network switch apparatus, and information processing apparatus, and setting method

Legal Events

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

Ref document number: 12887879

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12887879

Country of ref document: EP

Kind code of ref document: A1