Communication method, device and processor between virtual machine instances across cloud servers
By building a virtual Ethernet network card in a virtual machine instance and using the vxlan tunnel interface and virtual switch, the problem that the internal containers or virtual machine network cards of the virtual machine cannot be registered with the cloud server is solved, and data information interaction between virtual machine instances across cloud servers is realized.
Patent Information
- Application Number
- CN202111425572.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-11-26
AI Technical Summary
The IP address of the container or virtual machine network card running inside the virtual machine cannot be registered with the software-defined network of the cloud server, resulting in the container or virtual machine network card of the virtual machine cannot communicate with each other across cloud server virtual machine instances.
A virtual Ethernet network card is built in a virtual machine instance, and the virtual Ethernet network card processed and sent to the target virtual machine instance is used to package and parse data with the vxlan tunnel interface and virtual switch to realize data information interaction between different cloud servers.
It realizes data information interaction between virtual machine instances in different cloud servers, solving the problem that containers or virtual machine network cards running inside the virtual machine cannot communicate with each other across cloud servers.
Smart Images

Figure CN114356493B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud service communication technology, and in particular to a method, device and processor for communication between virtual machine instances across cloud servers. Background Art
[0002] Cloud servers on public clouds implement virtual private cloud technology using software-defined networking (SDN). For virtual machine instances running on a cloud server to communicate, the SDN system must first know the corresponding network five-tuple information and inject the relevant flow table information into the entire SDN network. If a container system is running within a VM or additional VM network adapters are configured, and the IP addresses of these containers or VM network adapters cannot be registered with the SDN of the cloud server, these container systems or devices not intended for the cloud server will be unable to communicate across VM instances on the cloud server.
[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0004] Embodiments of the present invention provide a method, device, and processor for communication between virtual machine instances across cloud servers, to at least solve the technical problem that the containers or virtual machine network cards running inside the virtual machines cannot communicate with each other across cloud server virtual machine instances because the IP addresses of the containers or virtual machine network cards running inside the virtual machines cannot be registered with the software-defined network of the cloud server.
[0005] According to one aspect of an embodiment of the present invention, a method for communication between virtual machine instances across cloud servers is provided, comprising: when detecting that virtual machine instance one sends data information, processing the data through virtual Ethernet network card one corresponding to the virtual machine instance one to obtain processed data information, wherein the virtual Ethernet network card one is pre-constructed in the virtual machine instance one; sending the processed data information to a target virtual Ethernet network card of a target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance one are set in different cloud servers; parsing the processed data information through the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers.
[0006] Furthermore, when it is detected that the virtual machine instance 1 sends data information, before sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance, the method further includes: constructing a target virtual Ethernet network card in the target virtual machine instance.
[0007] Furthermore, constructing a virtual Ethernet network card in the virtual machine instance of each cloud server includes: constructing a vxlan tunnel interface in the virtual machine instance; creating a first virtual switch in the virtual machine instance; creating a pair of virtual network cards in the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card one and virtual network card two, adding virtual network card one to the first virtual switch, and using virtual network card two as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two to the on state; and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two as the virtual Ethernet network card.
[0008] Furthermore, the method further includes: configuring a forwarding database in the virtual machine instance, wherein the forwarding database is used to guide the first virtual switch to forward the first packet data information.
[0009] Furthermore, when the virtual network card 2 is used as the uplink interface of multiple container networks in the virtual machine instance, before processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, the method also includes: creating a second virtual switch in the virtual machine instance, wherein the second virtual switch is used to receive the data information sent by the multiple container networks; adding the virtual network card 2 to the second virtual switch; processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information includes: transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; in the first virtual switch, packaging the data information through the vxlan tunnel interface to obtain the processed data information.
[0010] Furthermore, the virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22. Before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, the method further includes: creating multiple virtual switches in the virtual machine instance, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 2 network; adding the virtual network card 21 to the virtual machine instance In the third virtual switch, the virtual network card 22 is added to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; the data is processed by the virtual Ethernet network card 1 corresponding to the virtual machine instance 1, and the processed data information includes: the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
[0011] Furthermore, the vxlan tunnel interface is provided by Linux or Open vSwitch.
[0012] According to one aspect of an embodiment of the present invention, a communication method between virtual machine instances across cloud servers is provided, comprising: displaying processed data information on a target interface, wherein, when it is detected that virtual machine instance one sends data information, processing the data through virtual Ethernet network card one corresponding to the virtual machine instance one to obtain the processed data information, wherein the virtual Ethernet network card one is pre-constructed in the virtual machine instance one; displaying sending information on the target interface, wherein the sending information is used to indicate that the processed data information is sent to a target virtual Ethernet network card of a target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance one are set in different cloud servers; displaying a parsing result of the processed data information on the target interface, wherein the processed data information is parsed by the target virtual Ethernet network card of the target virtual machine instance to obtain the parsing result, so as to realize data information interaction between virtual machine instances in different cloud servers.
[0013] Furthermore, the method also includes: displaying the vxlan tunnel interface constructed in the virtual machine instance on the target interface; displaying the first virtual switch created in the virtual machine instance on the target interface; displaying a pair of virtual network cards created in the virtual machine instance on the target interface, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, adding virtual network card 1 to the first virtual switch, and using virtual network card 2 as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 to the open state on the target interface, and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 as the virtual Ethernet network card.
[0014] Furthermore, when the virtual network card 2 is used as the uplink interface of multiple container networks in the virtual machine instance, the method also includes: before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, displaying the second virtual switch created in the virtual machine instance on the target interface, wherein the second virtual switch is used to receive data information sent by the multiple container networks and add the virtual network card 2 to the second virtual switch; transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; and displaying the processed data information obtained by packaging the data information in the first virtual switch through the vxlan tunnel interface on the target interface.
[0015] Furthermore, the virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22, and the method further includes: before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, displaying multiple virtual switches created in the virtual machine instance on the target interface, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 2 network. information; the target interface displays the addition of the virtual network card 21 to the third virtual switch, and the addition of the virtual network card 22 to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the processed data information obtained by packaging the data information through the vxlan tunnel interface is displayed on the target interface.
[0016] According to one aspect of an embodiment of the present invention, a communication device between virtual machine instances across cloud servers is provided, comprising: a processing unit for, when detecting that virtual machine instance 1 sends data information, processing the data through virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, wherein the virtual Ethernet network card 1 is pre-constructed in the virtual machine instance 1; a sending unit for sending the processed data information to a target virtual Ethernet network card of a target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance 1 are set in different cloud servers; and a parsing unit for parsing the processed data information through the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers.
[0017] Furthermore, the device also includes: a construction unit, which is used to construct a target virtual Ethernet network card in the target virtual machine instance before sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance when it is detected that the virtual machine instance sends data information.
[0018] Furthermore, the construction unit also includes: a first construction module, used to construct a vxlan tunnel interface within the virtual machine instance; a second construction module, used to create a first virtual switch within the virtual machine instance; a third construction module, used to create a pair of virtual network cards within the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, adding the virtual network card 1 to the first virtual switch, and using the virtual network card 2 as the data interface of the virtual machine instance; a first setting module, used to set the status of the vxlan tunnel interface, the first virtual switch, the virtual network card 1 and the virtual network card 2 to the open state; a first determination module, used to use the link composed of the vxlan tunnel interface, the first virtual switch, the virtual network card 1 and the virtual network card 2 as the virtual Ethernet network card.
[0019] Furthermore, the construction unit further includes: a first configuration module, configured to configure a forwarding database within the virtual machine instance, wherein the forwarding database is used to guide the first virtual switch to forward the first packet data information.
[0020] Furthermore, the device also includes: a first creation unit, which is used to create a second virtual switch in the virtual machine instance when the virtual network card 2 is used as the uplink interface of multiple container networks in the virtual machine instance, before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance to obtain processed data information, wherein the second virtual switch is used to receive data information sent by the multiple container networks; a first adding unit, which is used to add the virtual network card 2 to the second virtual switch; the processing unit also includes: a transmission module, which is used to transmit the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; and a processing module, which is used to package the data information in the first virtual switch through the vxlan tunnel interface to obtain processed data information.
[0021] Furthermore, the virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22, and the device further includes: a second creation unit, configured to process data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 and obtain the processed data information, before creating multiple virtual switches in the virtual machine instance, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is configured to receive data information sent by at least one container 1 network, and the fourth virtual switch is configured to receive data information sent by at least one container 2 network; a second addition unit A unit is used to add the virtual network card 21 to the third virtual switch and add the virtual network card 22 to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; the processing unit also includes: a transmission module, used for the virtual network card 2 to transmit the received data information to the first virtual switch, and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
[0022] Furthermore, the vxlan tunnel interface is provided by Linux or Open vSwitch.
[0023] In an embodiment of the present invention, a method of communicating across cloud servers through a virtual Ethernet card is adopted. When detecting that virtual machine instance one sends data information, the data is processed by the virtual Ethernet network card one corresponding to the virtual machine instance one to obtain processed data information, wherein the virtual Ethernet network card one is pre-constructed in the virtual machine instance one; the processed data information is sent to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance one are set in different cloud servers; the processed data information is parsed by the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers, thereby achieving the technical effect of realizing data information interaction between virtual machine instances in different cloud servers through a virtual Ethernet card, thereby solving the technical problem that the container or virtual machine network card of the virtual machine running inside the virtual machine cannot communicate with each other across the virtual machine instances of the cloud server because the IP address of the container or virtual machine network card running inside the virtual machine cannot be registered with the software-defined network of the cloud server. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0025] Figure 1 is a hardware structure block diagram of a computer terminal according to an embodiment of the present invention;
[0026] Figure 2 Flowchart of a method for communication between virtual machine instances across cloud servers provided in accordance with a first embodiment of the present invention;
[0027] Figure 3 This is a schematic diagram of an optional communication method between virtual machine instances across cloud servers provided in accordance with the first embodiment of the present invention. Figure 1 ;
[0028] Figure 4 This is a schematic diagram of the processing in the communication method between virtual machine instances across cloud servers provided in accordance with the first embodiment of the present invention;
[0029] Figure 5 This is a schematic diagram of an optional communication method between virtual machine instances across cloud servers provided in accordance with the first embodiment of the present invention. Figure 2 ;
[0030] Figure 6 This is a schematic diagram of an optional communication method between virtual machine instances across cloud servers provided in accordance with the first embodiment of the present invention. Figure 3 ;
[0031] Figure 7 This is a schematic diagram of an optional communication method between virtual machine instances across cloud servers provided in accordance with the first embodiment of the present invention. Figure 4 ;
[0032] Figure 8 Schematic diagram of an optional communication method between virtual machine instances across cloud servers provided in accordance with a second embodiment of the present invention;
[0033] Figure 9 2 is a schematic diagram of a communication device between virtual machine instances across cloud servers provided by a third embodiment of the present invention;
[0034] Figure 10 is a structural block diagram of an optional computer terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0036] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:
[0038] VXLAN: A UDP-based network isolation technology that encapsulates original data link layer network data in UDP packets for transmission.
[0039] VLAN: Virtual LAN technology, often used to isolate data link layer networks.
[0040] veth: Virtual Ethernet card, a pair of virtual network cards that comes with the Linux system. Their sending and receiving ends are directly connected together, that is, a pair of veth network cards: A and B. The message sent by A is directly connected to the receiving end of B.
[0041] ovs: short for openvswitch, an open source virtual switch implementation.
[0042] VPC: Virtual Private Cloud, which uses underlying technologies to build an isolated network area on a public cloud;
[0043] Software defined network: software defined network, referred to as SDN.
[0044] Elastic Compute Service (ECS) is a cloud server that provides elastic computing services, virtual machines, and related infrastructure and service-level services.
[0045] Example 1
[0046] According to an embodiment of the present invention, an embodiment of a communication method between virtual machine instances across cloud servers is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0047] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a communication method between virtual machine instances across cloud servers is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more ( Figure 1 The computer system 102 is shown as 102a, 102b, ..., 102n) processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0048] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0049] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the communication method between virtual machine instances across cloud servers in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the communication method between virtual machine instances across cloud servers of the above-mentioned application. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0050] The transmission device is used to receive or send data via a network. Specific examples of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0051] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0052] Under the above operating environment, this application provides Figure 2 The communication method between virtual machine instances across cloud servers is shown. Figure 2 4 is a flow chart of a method for communicating between virtual machine instances across cloud servers according to a first embodiment of the present invention.
[0053] Step S201: When detecting that virtual machine instance 1 sends data information, the data is processed by virtual Ethernet network card 1 corresponding to virtual machine instance 1 to obtain processed data information, wherein virtual Ethernet network card 1 is pre-built in virtual machine instance 1.
[0054] The virtual Ethernet network card 1 mentioned above can be Figure 3As shown, virtual Ethernet network card 1 packages the data to be sent by virtual machine instance 1, and the processed data is then sent through eth0 of virtual machine instance 1. Using the pre-built virtual Ethernet network card in the cloud server's virtual machine instance, you can send communication data from the cloud server's virtual machine instance or receive communication data from virtual machine instances on other cloud servers.
[0055] It should be noted that in the embodiments of the present application, ECS is used as the basic resource to create virtual machine instances normally. These virtual machines have normal management-level network cards inside. The IP addresses of these network cards are automatically allocated and configured internally by ECS. These network cards are recorded as eth0.
[0056] In step S202, the processed data information is sent to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance 1 are set in different cloud servers.
[0057] The target virtual machine instance of the data recipient also pre-configures a target virtual Ethernet network card. Therefore, when the processed data is sent to the target virtual Ethernet network card of the target virtual machine instance, the target virtual Ethernet network card of the target virtual machine instance can receive the data sent by virtual Ethernet network card 1. Therefore, to achieve communication between virtual machine instances of different cloud servers, upon detecting that virtual machine instance 1 is sending data, before sending the processed data to the target virtual Ethernet network card of the target virtual machine instance, the method further includes: constructing a target virtual Ethernet network card in the target virtual machine instance.
[0058] Step S203: The processed data information is parsed by the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers.
[0059] After the target virtual Ethernet network card of the target virtual machine instance receives the processed data information, it parses it to obtain the parsed data information, which can be recognized by the target virtual machine instance, thereby realizing communication between virtual machine instances in different cloud servers.
[0060] Through the above steps, the method of using virtual Ethernet cards for cross-cloud server communication is adopted to achieve the technical effect of using virtual Ethernet cards to realize data information interaction between virtual machine instances in different cloud servers, thereby solving the technical problem that the container running inside the virtual machine or the IP address of the virtual machine network card cannot be registered with the software-defined network of the cloud server, causing the virtual machine container or virtual machine network card to be unable to communicate with each other across cloud server virtual machine instances.
[0061] Optionally, in the communication method between virtual machine instances across cloud servers of embodiment one of the present invention, building a virtual Ethernet network card in the virtual machine instance of each cloud server includes: building a vxlan tunnel interface within the virtual machine instance; creating a first virtual switch within the virtual machine instance; creating a pair of virtual network cards within the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card one and virtual network card two, adding virtual network card one to the first virtual switch, and using virtual network card two as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two to the on state; and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two as the virtual Ethernet network card.
[0062] Optionally, in the communication method between virtual machine instances across cloud servers of the first embodiment of the present invention, the method further includes: configuring a forwarding database in the virtual machine instance, wherein the forwarding database is used to guide the first virtual switch to forward the first packet data information;
[0063] In an embodiment of the present application, a vxlan tunnel interface is created inside each virtual machine instance, denoted as: vxlan-0. A bridge based on openvswitch is created (corresponding to the first virtual switch mentioned above), denoted as: mock-br. An fdb table entry (corresponding to the forwarding database mentioned above) is configured to guide the forwarding of the first packet of data link layer broadcasts and unknown unicasts. A pair of veth network cards is created, one of which is denoted as veth-br (corresponding to the virtual network card one mentioned above), and the opposite end of network card one (corresponding to the virtual network card two mentioned above) can be named as the network card that the business wants to actually use, for example: eth1 (indicating the virtual network card two mentioned above). Add veth-br to mock-br; set the link status of all newly created network cards and bridge device interfaces to the open state. After the above construction is completed, the link consisting of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two is the virtual Ethernet network card in this application, such as Figure 3 The virtual Ethernet NIC 1 and the target virtual Ethernet NIC are shown as follows.
[0064] Through the above solution, a virtual Ethernet network card is built in each virtual machine instance. The data to be sent in the virtual machine instance can be packaged and processed through the vxlan tunnel interface in the virtual Ethernet network card. The processed data information can then be sent through eht0 of the virtual machine instance. Alternatively, when eht0 of the virtual machine instance receives data information sent by virtual machine instances of other cloud servers, the received data information can be parsed through the vxlan tunnel interface in the virtual Ethernet network card. The parsed data information can be recognized by the virtual machine instance, thereby realizing communication between virtual machine instances in different cloud servers.
[0065] When used by the upper-layer business system, the virtual Ethernet network card running in the virtual machine can be completely regarded as the Ethernet card of an ordinary physical server. It can be used to create any VLAN sub-interface, which can be used as the uplink interface of the container network.
[0066] It should be noted that eth1 is a virtual Ethernet network card that can be used similarly to a regular physical server. VLAN subinterfaces can be created on this card, and the card itself or its subinterfaces can be added to the service bridge to meet various service requirements. The vxlan tunnel interface can be provided by Linux or Open vSwitch.
[0067] In addition, before constructing a virtual Ethernet network card in each virtual machine instance of the cloud server, the method further includes: reading the node IP list configuration file through the agent component running on each node in the virtual machine instance; and sending the read virtual switch IP information and forwarding database information. That is, the software structure in the virtual machine includes an agent component running on each node, such as Figure 4 As shown, it is responsible for the basic network configuration initialization and regular detection status maintenance functions in the process of building the virtual Ethernet network card, thereby ensuring the normal operation of the virtual Ethernet network card.
[0068] Optionally, in the communication method between virtual machine instances across cloud servers of embodiment one of the present invention, when virtual network card 2 is used as the uplink interface of multiple container networks within the virtual machine instance, before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, the method also includes: creating a second virtual switch within the virtual machine instance, wherein the second virtual switch is used to receive data information sent by multiple container networks; adding virtual network card 2 to the second virtual switch; processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information includes: transmitting the data information sent from the second virtual switch to the first virtual switch through virtual network card 2; and in the first virtual switch, packaging the data information through the vxlan tunnel interface to obtain the processed data information.
[0069] like Figure 5 As shown, eth1 (virtual network card 2) is used as the uplink interface of a large number of container networks, and a linux bridge (second virtual switch) is created in the virtual machine instance. The Linux bridge is used to receive data information sent by multiple container networks; eth1 is added to the linux bridge; when a container in multiple containers sends data to virtual network card 2, the data information sent from the second virtual switch is transmitted to the first virtual switch through virtual network card 2; in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information, thereby sending the data information sent by the container in the virtual machine instance, thereby realizing communication between virtual machine instances in different cloud servers.
[0070] Optionally, in the communication method between virtual machine instances across cloud servers of embodiment 1 of the present invention, virtual network card 2 extends multiple VLAN sub-interfaces, wherein the multiple VLAN sub-interfaces include virtual network card 21 and virtual network card 22, and before processing data through virtual Ethernet network card 1 corresponding to virtual machine instance 1 to obtain processed data information, the method further includes: creating multiple virtual switches within the virtual machine instance, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 2 network data information sent; adding virtual network card 21 to the third virtual switch, and adding virtual network card 22 to the fourth virtual switch, wherein the data information sent in the third virtual switch is transmitted to virtual network card 2 through virtual network card 21, and the data information sent in the fourth virtual switch is transmitted to virtual network card 2 through virtual network card 22; processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1, and obtaining the processed data information includes: virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
[0071] In order to ensure the security and confidentiality of communication data, VLAN is used to isolate the network within the virtual machine instance. Specifically, eth1 (corresponding to the virtual network card 2 mentioned above) extends multiple VLAN sub-interfaces, such as Figure 6As shown, multiple Linux bridges (virtual switches) are created in the virtual machine instance, wherein the multiple virtual switches include at least Linux Bridge 1 (corresponding to the third virtual switch mentioned above) and Linux Bridge 2 (corresponding to the third virtual switch mentioned above), Linux Bridge 1 is used to receive data information sent by the container 1 network, and Linux Bridge 2 is used to receive data information sent by the container 2, container 3 and container 4 networks; eth1.9 (corresponding to the virtual network card 21) is added to Linux Bridge 1, and eth1.11 (corresponding to the virtual network card 22) is added to Linux Bridge 2, wherein the data information sent from Linux Bridge 1 is transmitted to eth1 (corresponding to the virtual network card 2) through eth1.9, and the data information sent from Linux Bridge 2 is transmitted to eth1 (corresponding to the virtual network card 2) through eth1.11; eth1 transmits the received data information to OpenVSwitch Mock-BR (corresponding to the first virtual switch mentioned above), and in the first virtual switch, the data information is packaged and processed through the VXLAN tunnel interface to obtain the processed data information.
[0072] Through the above solution, multiple eth1-based VLAN sub-interfaces are used within the virtual machine instance to carry out VLAN-based network communication, ensuring the security and confidentiality of communication data.
[0073] like Figure 7As shown, while using virtual network card 2 as the uplink interface of multiple container networks in the virtual machine instance, virtual network card 2 also expands the application scenarios of multiple VLAN sub-interfaces. Multiple Linux bridges (virtual switches) are created in the virtual machine instance, wherein the multiple virtual switches include at least Linux Bridge 1 and Linux Bridge 2, Linux Bridge 1 is used to receive data information sent from the container 1 network, and Linux Bridge 2 is used to receive data information sent from the container 2, container 3, and container 4 networks; eth1 (corresponding to the above-mentioned virtual network card 21) is added to Linux Bridge 1, and eth1.11 (corresponding to the above-mentioned virtual network card 22) is added to Linux Bridge 2, wherein data information sent from Linux Bridge 1 is transmitted to virtual network card 2 via eth1, and data information sent from Linux Bridge 2 is transmitted to eth1 (corresponding to the above-mentioned virtual network card 2) via eth1. Virtual network card 2 transmits the received data information to openvswitch mock-br (corresponding to the above-mentioned first virtual switch), and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information. Through the above solution, it is also possible to use multiple eth1-based VLAN sub-interfaces within the virtual machine instance for VLAN-based network communication, and also ensure the security and confidentiality of the communication data.
[0074] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0075] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
[0076] Example 2
[0077] Under the above operating environment, this application provides Figure 8 The communication method between virtual machine instances across cloud servers is shown. Figure 8 4 is a flow chart of a method for communication between virtual machine instances across cloud servers according to a second embodiment of the present invention.
[0078] Step S801: Displaying processed data information on a target interface, wherein, upon detecting that virtual machine instance 1 sends data information, processing the data using virtual Ethernet network card 1 corresponding to virtual machine instance 1 to obtain processed data information, wherein virtual Ethernet network card 1 is pre-configured in virtual machine instance 1;
[0079] Step S802: Displaying sending information on the target interface, wherein the sending information is used to instruct to send the processed data information to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and virtual machine instance 1 are set in different cloud servers;
[0080] Step S802: Display the parsing result of the processed data information on the target interface, wherein the parsing result is obtained by parsing the processed data information through the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers.
[0081] Through the above steps, the data interaction of virtual machine instances across cloud servers is displayed on the target interface by using a virtual Ethernet card for cross-cloud server communication, thereby achieving the technical effect of using a virtual Ethernet card to realize data information interaction between virtual machine instances in different cloud servers, thereby solving the technical problem that the container or virtual machine network card running inside the virtual machine cannot be registered with the software-defined network of the cloud server, causing the virtual machine container or virtual machine network card to be unable to communicate with each other across cloud server virtual machine instances.
[0082] Optionally, in the communication method between virtual machine instances across cloud servers of the second embodiment of the present invention, the method further includes: displaying the vxlan tunnel interface constructed in the virtual machine instance on the target interface; displaying the first virtual switch created in the virtual machine instance on the target interface; displaying a pair of virtual network cards created in the virtual machine instance on the target interface, wherein the pair of virtual network cards includes: virtual network card one and virtual network card two, adding virtual network card one to the first virtual switch, and using virtual network card two as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two to the on state on the target interface, and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two as a virtual Ethernet network card.
[0083] In an embodiment of the present application, the process of constructing a virtual Ethernet network card is displayed on the target display interface. Specifically, a vxlan tunnel interface is created inside each virtual machine instance, which is recorded as: vxlan-0. A bridge based on openvswitch is created (corresponding to the first virtual switch mentioned above), which is recorded as: mock-br. An fdb table entry (corresponding to the forwarding database mentioned above) is configured to guide the forwarding of the first packet of data link layer broadcast and unknown unicast. A pair of veth network cards is created, one of which is recorded as veth-br (corresponding to the virtual network card one mentioned above), and the other end of network card one (corresponding to the virtual network card two mentioned above) can be named as the network card name that the business wants to actually use, for example: eth1 (representing the virtual network card two mentioned above). Veth-br is added to mock-br; the link status of all newly created network cards and bridge device interfaces is set to the open state. After the above construction is completed, the link consisting of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two is the virtual Ethernet network card in this application.
[0084] Through the above solution, a virtual Ethernet network card is built in each virtual machine instance. The data to be sent in the virtual machine instance can be packaged and processed through the vxlan tunnel interface in the virtual Ethernet network card. The processed data information can then be sent through eht0 of the virtual machine instance. Alternatively, when eht0 of the virtual machine instance receives data information sent by virtual machine instances of other cloud servers, the received data information can be parsed through the vxlan tunnel interface in the virtual Ethernet network card. The parsed data information can be recognized by the virtual machine instance, thereby realizing communication between virtual machine instances in different cloud servers.
[0085] When used by the upper-layer business system, the virtual Ethernet network card running in the virtual machine can be completely regarded as the Ethernet card of an ordinary physical server. It can be used to create any VLAN sub-interface, which can be used as the uplink interface of the container network.
[0086] It should be noted that eth1 is a virtual Ethernet network card that can be used similarly to a regular physical server. VLAN subinterfaces can be created on this card, and the card itself or its subinterfaces can be added to the service bridge to meet various service requirements. The vxlan tunnel interface can be provided by Linux or Open vSwitch.
[0087] Furthermore, before building a virtual Ethernet network card in each cloud server's virtual machine instance, the method further includes: reading a node IP list configuration file through an agent component running on each node in the virtual machine instance; and distributing the read virtual switch IP information and forwarding database information. Specifically, the software architecture within the virtual machine includes an agent component running on each node, responsible for initializing the basic network configuration and maintaining periodic network status during the virtual Ethernet network card building process, thereby ensuring the normal operation of the virtual Ethernet network card.
[0088] Optionally, in the communication method between virtual machine instances across cloud servers of the second embodiment of the present invention, when virtual network card 2 is used as the uplink interface of multiple container networks within the virtual machine instance, the method also includes: before processing data through virtual Ethernet network card 1 corresponding to virtual machine instance 1 to obtain processed data information, a second virtual switch created within the virtual machine instance is displayed on the target interface, wherein the second virtual switch is used to receive data information sent by multiple container networks, and virtual network card 2 is added to the second virtual switch; the data information sent from the second virtual switch is transmitted to the first virtual switch through virtual network card 2; and the processed data information is displayed on the target interface by packaging the data information through the vxlan tunnel interface in the first virtual switch.
[0089] For example, use eth1 (virtual network card 2) as the uplink interface of a large number of container networks, create a linux bridge (second virtual switch) in the virtual machine instance, and the Linux bridge is used to receive data information sent by multiple container networks; add eth1 to the linux bridge; when the container in multiple containers sends data to virtual network card 2, the data information sent from the second virtual switch is transmitted to the first virtual switch through virtual network card 2; in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information, thereby sending the data information sent by the container in the virtual machine instance, thereby realizing communication between virtual machine instances in different cloud servers.
[0090] Optionally, in the communication method between virtual machine instances across cloud servers of embodiment 2 of the present invention, virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22, and the method further includes: before processing data through virtual Ethernet network card 1 corresponding to virtual machine instance 1 and obtaining processed data information, multiple virtual switches created in the virtual machine instance are displayed on the target interface, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 1 network. The virtual switch is used to receive data information sent by at least one container 2 network; the target interface displays that virtual network card 21 is added to the third virtual switch, and virtual network card 22 is added to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to virtual network card 2 through virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to virtual network card 2 through virtual network card 22; virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the processed data information obtained by packaging the data information through the vxlan tunnel interface is displayed on the target interface.
[0091] In order to ensure the security and confidentiality of communication data, VLAN is used to isolate the network in the virtual machine instance. Specifically, eth1 (corresponding to the above-mentioned virtual network card 2) extends multiple VLAN sub-interfaces, and creates multiple Linux bridges (virtual switches) in the virtual machine instance, wherein the multiple virtual switches include at least Linux bridge1 (corresponding to the above-mentioned third virtual switch) and Linux bridge2 (corresponding to the above-mentioned third virtual switch). Linux bridge1 is used to receive data information sent by the container 1 network, and Linux bridge2 is used to receive data information sent by the container 2, container 3 and container 4 networks; eth1.9 (corresponding to the above-mentioned virtual network card 21) is added to Linux bridge1, and eth1.11 (corresponding to the above-mentioned virtual network card 22) is added to Linux bridge2, wherein the data information sent from Linux bridge1 is transmitted to eth1 (corresponding to the above-mentioned virtual network card 2) through eth1.9, and the data information sent from Linux bridge2 is transmitted to eth1 (corresponding to the above-mentioned virtual network card 2) through eth1.11; eth1 transmits the received data information to openvswitch mock-br (corresponding to the first virtual switch mentioned above) packages the data information in the first virtual switch through the vxlan tunnel interface to obtain the processed data information.
[0092] Through the above solution, multiple eth1-based VLAN sub-interfaces are used within the virtual machine instance to carry out VLAN-based network communication, ensuring the security and confidentiality of communication data.
[0093] It should be noted that the processing method in the method for communicating between virtual machine instances across cloud servers in Example 2 of the present application is the same as the processing method in the method for communicating between virtual machine instances across cloud servers in Example 1. Other processing methods will not be described in detail here. The method for communicating between virtual machine instances across cloud servers in Example 2 of the present application displays the process data information in the method for communicating between virtual machine instances across cloud servers in Example 1 on the target interface, thereby improving the visualization of data information.
[0094] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0095] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
[0096] Example 3
[0097] According to an embodiment of the present invention, there is also provided a device for implementing the above-mentioned communication method between virtual machine instances across cloud servers, such as Figure 9 As shown, the device includes: a processing unit 901, a sending unit 902 and a parsing unit 903.
[0098] Specifically, the processing unit 901 is configured to, upon detecting that the virtual machine instance 1 sends data information, process the data using the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, wherein the virtual Ethernet network card 1 is pre-configured in the virtual machine instance 1;
[0099] A sending unit 902 is configured to send the processed data information to a target virtual Ethernet network card of a target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance 1 are set in different cloud servers;
[0100] The parsing unit 903 is configured to parse the processed data information through the target virtual Ethernet network card of the target virtual machine instance to implement data information interaction between virtual machine instances in different cloud servers.
[0101] In summary, in the communication device between virtual machine instances across cloud servers provided in Example 3 of the present application, when the processing unit 901 detects that virtual machine instance 1 sends data information, the data is processed by the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, wherein the virtual Ethernet network card 1 is pre-constructed in the virtual machine instance 1; the sending unit 902 sends the processed data information to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance 1 are set in different cloud servers; the parsing unit 903 parses the processed data information through the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers. By adopting the method of communicating across cloud servers through virtual Ethernet cards, the technical effect of realizing data information interaction between virtual machine instances in different cloud servers through virtual Ethernet cards is achieved, thereby solving the technical problem that the container or virtual machine network card of the virtual machine running inside the virtual machine cannot register the IP address of the virtual machine network card to the software-defined network of the cloud server, causing the container or virtual machine network card of the virtual machine to be unable to communicate with each other across the virtual machine instances of the cloud server.
[0102] Optionally, in the communication device between virtual machine instances across cloud servers provided in Example 3 of the present application, the device also includes: a construction unit for, when detecting that virtual machine instance 1 sends data information, constructing a target virtual Ethernet network card in the target virtual machine instance before sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance.
[0103] Optionally, in the communication device between virtual machine instances across cloud servers provided in Example 3 of the present application, the construction unit also includes: a first construction module, used to construct a vxlan tunnel interface within the virtual machine instance; a second construction module, used to create a first virtual switch within the virtual machine instance; a third construction module, used to create a pair of virtual network cards within the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, virtual network card 1 is added to the first virtual switch, and virtual network card 2 is used as the data interface of the virtual machine instance; a first setting module, used to set the status of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 to the on state; a first determination module, used to use the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 as a virtual Ethernet network card.
[0104] Optionally, in the communication device between virtual machine instances across cloud servers provided in Example 3 of the present application, the construction unit also includes: a first configuration module, used to configure a forwarding database within the virtual machine instance, wherein the forwarding database is used to guide the first virtual switch to forward the first packet data information.
[0105] Optionally, in the communication device between virtual machine instances across cloud servers provided in Example 3 of the present application, the device also includes: a first creation unit, which is used to use virtual network card 2 as the uplink interface of multiple container networks in the virtual machine instance, and before processing data through virtual Ethernet network card 1 corresponding to virtual machine instance 1 to obtain processed data information, create a second virtual switch in the virtual machine instance, wherein the second virtual switch is used to receive data information sent by multiple container networks; a first adding unit, which is used to add virtual network card 2 to the second virtual switch; the processing unit also includes: a transmission module, which is used to transmit the data information sent from the second virtual switch to the first virtual switch through virtual network card 2; and a processing module, which is used to package and process the data information in the first virtual switch through the vxlan tunnel interface to obtain processed data information.
[0106] Optionally, in the communication device between virtual machine instances across cloud servers provided in Example 3 of the present application, virtual network card 2 extends multiple VLAN sub-interfaces, wherein the multiple VLAN sub-interfaces include virtual network card 21 and virtual network card 22, and the device also includes: a second creation unit, used to create multiple virtual switches within the virtual machine instance before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 and obtaining the processed data information, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 1 network. The machine is used to receive data information sent by at least one container 2 network; the second adding unit is used to add virtual network card 21 to the third virtual switch, and add virtual network card 22 to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to virtual network card 2 through virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to virtual network card 2 through virtual network card 22; the processing unit also includes: a transmission module, used for virtual network card 2 to transmit the received data information to the first virtual switch, and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
[0107] Optionally, in the communication device between virtual machine instances across cloud servers provided in Example 3 of the present application, the vxlan tunnel interface is provided by Linux or Open vSwitch.
[0108] It should be noted that the processing unit 901, the sending unit 902, and the parsing unit 903 correspond to steps S201 to S203 in Example 1. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.
[0109] Example 4
[0110] The embodiment of the present invention can provide a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal can also be replaced by a terminal device such as a mobile terminal.
[0111] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network.
[0112] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of an application: when it is detected that virtual machine instance one sends data information, the data is processed through the virtual Ethernet network card one corresponding to the virtual machine instance one to obtain processed data information, wherein the virtual Ethernet network card one is pre-constructed in the virtual machine instance one; the processed data information is sent to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance one are set in different cloud servers; the processed data information is parsed through the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers.
[0113] Optionally, the above-mentioned computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of an application: when it is detected that virtual machine instance 1 sends data information, before sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance, the method also includes: constructing a target virtual Ethernet network card in the target virtual machine instance.
[0114] Optionally, the above-mentioned computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of the application: building a virtual Ethernet network card in the virtual machine instance of each cloud server includes: building a vxlan tunnel interface within the virtual machine instance; creating a first virtual switch within the virtual machine instance; creating a pair of virtual network cards within the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, adding virtual network card 1 to the first virtual switch, and using virtual network card 2 as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 to the open state; and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 as the virtual Ethernet network card.
[0115] Optionally, the above-mentioned computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances of an application across cloud servers: the method also includes: configuring a forwarding database within the virtual machine instance, wherein the forwarding database is used to guide the first virtual switch to forward the first packet data information.
[0116] Optionally, the above-mentioned computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of the application: when using the virtual network card 2 as the uplink interface of multiple container networks in the virtual machine instance, before processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, the method also includes: creating a second virtual switch in the virtual machine instance, wherein the second virtual switch is used to receive the data information sent by the multiple container networks; adding the virtual network card 2 to the second virtual switch; processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information includes: transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; in the first virtual switch, packaging the data information through the vxlan tunnel interface to obtain the processed data information.
[0117] Optionally, the computer terminal may also execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of an application: the virtual network card 2 extends multiple VLAN sub-interfaces, wherein the multiple VLAN sub-interfaces include virtual network card 21 and virtual network card 22, and before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, the method further includes: creating multiple virtual switches within the virtual machine instance, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 2 network. data information; adding the virtual network card 21 to the third virtual switch, and adding the virtual network card 22 to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information includes: the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
[0118] Optionally, the above-mentioned computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances of an application across cloud servers: the vxlan tunnel interface is provided by Linux or Open vSwitch.
[0119] Optionally, the above-mentioned computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of the application: displaying the processed data information on the target interface, wherein, when it is detected that virtual machine instance one sends data information, the data is processed by the virtual Ethernet network card one corresponding to the virtual machine instance one to obtain the processed data information, wherein the virtual Ethernet network card one is pre-constructed in the virtual machine instance one; displaying the sending information on the target interface, wherein the sending information is used to indicate that the processed data information is sent to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance one are set in different cloud servers; displaying the parsing result of the processed data information on the target interface, wherein the processed data information is parsed by the target virtual Ethernet network card of the target virtual machine instance to obtain the parsing result, so as to realize data information interaction between virtual machine instances in different cloud servers.
[0120] Optionally, the above-mentioned computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of an application: the method also includes: displaying the vxlan tunnel interface constructed in the virtual machine instance on the target interface; displaying the first virtual switch created in the virtual machine instance on the target interface; displaying a pair of virtual network cards created in the virtual machine instance on the target interface, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, adding virtual network card 1 to the first virtual switch, and using virtual network card 2 as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 to the open state on the target interface, and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 as the virtual Ethernet network card.
[0121] Optionally, the above-mentioned computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of an application: when the virtual network card 2 is used as the uplink interface of multiple container networks in the virtual machine instance, the method also includes: before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, the second virtual switch created in the virtual machine instance is displayed on the target interface, wherein the second virtual switch is used to receive the data information sent by the multiple container networks and add the virtual network card 2 to the second virtual switch; transmit the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; and display the processed data information obtained by packaging the data information in the first virtual switch through the vxlan tunnel interface on the target interface.
[0122] Optionally, the computer terminal can also execute the program code of the following steps in the communication method between virtual machine instances across cloud servers of the application: the virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22, and the method further includes: before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 and obtaining the processed data information, displaying multiple virtual switches created in the virtual machine instance on the target interface, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container network, and the fourth virtual switch is used to receive data information sent by at least one container network. The virtual switch is used to receive data information sent by at least one container 2 network; the virtual network card 21 is added to the third virtual switch, and the virtual network card 22 is added to the fourth virtual switch, which is displayed on the target interface, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the processed data information obtained by packaging the data information through the vxlan tunnel interface is displayed on the target interface.
[0123] Optionally, Figure 10 1 is a block diagram of a computer terminal according to an embodiment of the present invention. Figure 10 As shown, the computer terminal may include: one or more ( Figure 10 Only one is shown) processor, memory.
[0124] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the communication method and device between virtual machine instances across cloud servers in the embodiments of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned communication method between virtual machine instances across cloud servers. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely located relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, corporate intranet, local area network, mobile communication network and combinations thereof.
[0125] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: when detecting that virtual machine instance one sends data information, processing the data through the virtual Ethernet network card one corresponding to the virtual machine instance one to obtain processed data information, wherein the virtual Ethernet network card one is pre-built in the virtual machine instance one; sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance one are set in different cloud servers; parsing the processed data information through the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers.
[0126] Optionally, the above-mentioned processor can also execute the program code of the following steps: when detecting that virtual machine instance 1 sends data information, before sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance, the method also includes: constructing a target virtual Ethernet network card in the target virtual machine instance.
[0127] Optionally, the processor may also execute the program code of the following steps: constructing a virtual Ethernet network card in the virtual machine instance of each cloud server includes: constructing a vxlan tunnel interface within the virtual machine instance; creating a first virtual switch within the virtual machine instance; creating a pair of virtual network cards within the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card one and virtual network card two, adding virtual network card one to the first virtual switch, and using virtual network card two as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two to the on state; and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two as the virtual Ethernet network card.
[0128] Optionally, the processor may further execute program code of the following steps: the method further includes: configuring a forwarding database within the virtual machine instance, wherein the forwarding database is used to guide the first virtual switch to forward the first packet data information.
[0129] Optionally, the processor may also execute the program code of the following steps: when the virtual network card 2 is used as the uplink interface of multiple container networks within the virtual machine instance, before processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, the method further includes: creating a second virtual switch within the virtual machine instance, wherein the second virtual switch is used to receive the data information sent by the multiple container networks; adding the virtual network card 2 to the second virtual switch; processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information including: transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; and in the first virtual switch, packaging the data information through the vxlan tunnel interface to obtain the processed data information.
[0130] Optionally, the processor may also execute the following program code: the virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22, and before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, the method further includes: creating multiple virtual switches within the virtual machine instance, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 2 network; the virtual Network card 21 is added to the third virtual switch, and virtual network card 22 is added to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to virtual network card 2 through virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to virtual network card 2 through virtual network card 22; data is processed by virtual Ethernet network card 1 corresponding to virtual machine instance 1, and the processed data information includes: virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
[0131] Optionally, the above-mentioned processor can also execute the program code of the following steps: the vxlan tunnel interface is provided by Linux or Open vSwitch.
[0132] Optionally, the processor may also execute the program code of the following steps: displaying processed data information on a target interface, wherein, when detecting that virtual machine instance 1 sends data information, processing the data through virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, wherein the virtual Ethernet network card 1 is pre-constructed in the virtual machine instance 1; displaying sending information on the target interface, wherein the sending information is used to indicate that the processed data information is sent to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance 1 are set in different cloud servers; displaying the parsing result of the processed data information on the target interface, wherein the processed data information is parsed through the target virtual Ethernet network card of the target virtual machine instance to obtain the parsing result, so as to realize data information interaction between virtual machine instances in different cloud servers.
[0133] Optionally, the processor may also execute the program code of the following steps: the method further includes: displaying the vxlan tunnel interface constructed in the virtual machine instance on the target interface; displaying the first virtual switch created in the virtual machine instance on the target interface; displaying a pair of virtual network cards created in the virtual machine instance on the target interface, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, adding virtual network card 1 to the first virtual switch, and using virtual network card 2 as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 to the open state on the target interface, and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 as the virtual Ethernet network card.
[0134] Optionally, the processor may also execute the program code of the following steps: when the virtual network card 2 is used as the uplink interface of multiple container networks within the virtual machine instance, the method further includes: before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, displaying the second virtual switch created in the virtual machine instance on the target interface, wherein the second virtual switch is used to receive data information sent by the multiple container networks and add the virtual network card 2 to the second virtual switch; transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; and displaying the processed data information obtained by packaging the data information in the first virtual switch through the vxlan tunnel interface on the target interface.
[0135] Optionally, the processor may further execute the following program code: the virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22, the method further comprising: before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 and obtaining the processed data information, displaying multiple virtual switches created in the virtual machine instance on the target interface, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container network, and the fourth virtual switch is used to receive at least one container network. The data information sent by the virtual network card 2 is displayed on the target interface; the virtual network card 21 is added to the third virtual switch, and the virtual network card 22 is added to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the processed data information obtained by packaging the data information through the vxlan tunnel interface is displayed on the target interface.
[0136] According to an embodiment of the present invention, a method for communicating between virtual machine instances across cloud servers is provided. By adopting a method of communicating across cloud servers through a virtual Ethernet card, when detecting that virtual machine instance 1 sends data information, the data is processed by the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, wherein the virtual Ethernet network card 1 is pre-constructed in the virtual machine instance 1; the processed data information is sent to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance 1 are set in different cloud servers; the processed data information is parsed by the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers, thereby achieving the technical effect of realizing data information interaction between virtual machine instances in different cloud servers through a virtual Ethernet card, thereby solving the technical problem that the container or virtual machine network card of the virtual machine running inside the virtual machine cannot communicate with each other across cloud server virtual machine instances because the IP address of the container or virtual machine network card running inside the virtual machine cannot be registered with the software-defined network of the cloud server.
[0137] It can be understood by those skilled in the art that Figure 10 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 10 It does not limit the structure of the above electronic device. For example, the computer terminal 10 may also include Figure 10 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 10 Different configurations shown.
[0138] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0139] Example 5
[0140] An embodiment of the present invention further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store program codes executed by the communication method between virtual machine instances across cloud servers provided in the first embodiment.
[0141] Optionally, in this embodiment, the above-mentioned storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0142] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when it is detected that virtual machine instance one sends data information, processing the data through the virtual Ethernet network card one corresponding to the virtual machine instance one to obtain processed data information, wherein the virtual Ethernet network card one is pre-constructed in the virtual machine instance one; sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance one are set in different cloud servers; parsing the processed data information through the target virtual Ethernet network card of the target virtual machine instance to realize data information interaction between virtual machine instances in different cloud servers.
[0143] Optionally, the storage medium is also configured to store program code for executing the following steps: when detecting that virtual machine instance 1 sends data information, before sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance, the method also includes: constructing a target virtual Ethernet network card in the target virtual machine instance.
[0144] Optionally, the storage medium is also configured to store program code for performing the following steps: constructing a virtual Ethernet network card in the virtual machine instance of each cloud server includes: constructing a vxlan tunnel interface within the virtual machine instance; creating a first virtual switch within the virtual machine instance; creating a pair of virtual network cards within the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card one and virtual network card two, adding virtual network card one to the first virtual switch, and using virtual network card two as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two to the on state; and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card one and virtual network card two as the virtual Ethernet network card.
[0145] Optionally, the storage medium is further configured to store program code for executing the following steps: the method further includes: configuring a forwarding database within the virtual machine instance, wherein the forwarding database is used to guide the first virtual switch to forward the first packet data information.
[0146] Optionally, the storage medium is also configured to store program codes for executing the following steps: when the virtual network card 2 is used as the uplink interface of multiple container networks within the virtual machine instance, before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, the method also includes: creating a second virtual switch within the virtual machine instance, wherein the second virtual switch is used to receive data information sent by the multiple container networks; adding the virtual network card 2 to the second virtual switch; processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information includes: transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; in the first virtual switch, packaging the data information through the vxlan tunnel interface to obtain processed data information.
[0147] Optionally, the storage medium is further configured to store program codes for executing the following steps: the virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22, and before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, the method further includes: creating multiple virtual switches within the virtual machine instance, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 2 network; The virtual network card 21 is added to the third virtual switch, and the virtual network card 22 is added to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; the data is processed by the virtual Ethernet network card 1 corresponding to the virtual machine instance 1, and the processed data information includes: the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
[0148] Optionally, the storage medium is further configured to store program code for executing the following steps: the vxlan tunnel interface is provided by Linux or Open vSwitch.
[0149] Optionally, the storage medium is also configured to store program code for executing the following steps: displaying processed data information on a target interface, wherein, when it is detected that virtual machine instance one sends data information, processing the data through virtual Ethernet network card one corresponding to the virtual machine instance one to obtain the processed data information, wherein the virtual Ethernet network card one is pre-constructed in the virtual machine instance one; displaying sending information on the target interface, wherein the sending information is used to indicate that the processed data information is sent to the target virtual Ethernet network card of the target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance one are set in different cloud servers; displaying the parsing result of the processed data information on the target interface, wherein the processed data information is parsed by the target virtual Ethernet network card of the target virtual machine instance to obtain the parsing result, so as to realize data information interaction between virtual machine instances in different cloud servers.
[0150] Optionally, the storage medium is also configured to store program code for executing the following steps: the method also includes: displaying the vxlan tunnel interface constructed in the virtual machine instance on the target interface; displaying the first virtual switch created in the virtual machine instance on the target interface; displaying a pair of virtual network cards created in the virtual machine instance on the target interface, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, adding virtual network card 1 to the first virtual switch, and using virtual network card 2 as the data interface of the virtual machine instance; setting the status of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 to the open state on the target interface, and using the link composed of the vxlan tunnel interface, the first virtual switch, virtual network card 1 and virtual network card 2 as the virtual Ethernet network card.
[0151] Optionally, the storage medium is also configured to store program code for executing the following steps: when the virtual network card 2 is used as the uplink interface of multiple container networks in the virtual machine instance, the method further includes: before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, displaying the second virtual switch created in the virtual machine instance on the target interface, wherein the second virtual switch is used to receive data information sent by the multiple container networks and add the virtual network card 2 to the second virtual switch; transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; and displaying the processed data information obtained by packaging the data information in the first virtual switch through the vxlan tunnel interface on the target interface.
[0152] Optionally, the storage medium is further configured to store program codes for executing the following steps: the virtual network card 2 extends multiple vlan sub-interfaces, wherein the multiple vlan sub-interfaces include virtual network card 21 and virtual network card 22, and the method further includes: before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 and obtaining the processed data information, displaying multiple virtual switches created in the virtual machine instance on the target interface, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container network, and the fourth virtual switch is used to receive at least one The data information sent by the container 2 network is displayed on the target interface; the virtual network card 21 is added to the third virtual switch, and the virtual network card 22 is added to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the processed data information obtained by packaging the data information through the vxlan tunnel interface is displayed on the target interface.
[0153] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0154] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0155] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0156] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0157] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0158] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0159] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for communicating between virtual machine instances across cloud servers, characterized in that: include: When detecting that virtual machine instance 1 sends data information, processing the data by virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, wherein the virtual Ethernet network card 1 is pre-built in the virtual machine instance 1; Sending the processed data information to a target virtual Ethernet network card of a target virtual machine instance, wherein the target virtual machine instance and the virtual machine instance 1 are set in different cloud servers; Parsing the processed data information through the target virtual Ethernet network card of the target virtual machine instance to achieve data information interaction between virtual machine instances in different cloud servers; Building a virtual Ethernet network card in each cloud server virtual machine instance includes: Constructing a vxlan tunnel interface within the virtual machine instance; Creating a first virtual switch within the virtual machine instance; Creating a pair of virtual network cards in the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, adding the virtual network card 1 to the first virtual switch, and using the virtual network card 2 as a data interface of the virtual machine instance; The link composed of the vxlan tunnel interface, the first virtual switch, the virtual network card 1 and the virtual network card 2 is used as the virtual Ethernet network card, wherein a forwarding database is configured in the virtual machine instance, and the forwarding database is used to guide the first virtual switch to forward the first packet data information, and send or receive the processed data information through the network card on the virtual machine instance.
2. The method according to claim 1, characterized in that Before sending the processed data information to the target virtual Ethernet network card of the target virtual machine instance, the method further includes: constructing a target virtual Ethernet network card in the target virtual machine instance.
3. The method according to claim 2, characterized in that Building a virtual Ethernet network card in each cloud server virtual machine instance includes: Set the status of the vxlan tunnel interface, the first virtual switch, the virtual network card 1 and the virtual network card 2 to the open state.
4. The method according to claim 3, characterized in that The method further comprises: A forwarding database is configured within the virtual machine instance.
5. The method according to claim 3, characterized in that When the virtual network card 2 is used as the uplink interface of multiple container networks in the virtual machine instance, Before processing the data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, the method further includes: creating a second virtual switch in the virtual machine instance, wherein the second virtual switch is used to receive the data information sent by the multiple container networks; adding the virtual network card 2 to the second virtual switch; The data is processed by the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, including: transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
6. The method according to claim 3, characterized in that The virtual network card 2 extends multiple VLAN sub-interfaces, wherein the multiple VLAN sub-interfaces include virtual network card 21 and virtual network card 22. Before processing the data by the virtual Ethernet network card corresponding to the virtual machine instance to obtain processed data information, the method further includes: Creating multiple virtual switches within the virtual machine instance, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container first network, and the fourth virtual switch is used to receive data information sent by at least one container second network; Adding the virtual network card 21 to the third virtual switch and adding the virtual network card 22 to the fourth virtual switch, wherein data information sent from the third virtual switch is transmitted to the virtual network card 2 via the virtual network card 21, and data information sent from the fourth virtual switch is transmitted to the virtual network card 2 via the virtual network card 22; The data is processed by the virtual Ethernet network card 1 corresponding to the virtual machine instance 1, and the processed data information includes: the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, the data information is packaged and processed through the vxlan tunnel interface to obtain the processed data information.
7. The method according to claim 3, characterized in that The vxlan tunnel interface is provided by Linux or OpenvSwitch.
8. A method for communicating between virtual machine instances across cloud servers, characterized in that: include: Displaying processed data information on a target interface, wherein, upon detecting that virtual machine instance 1 sends data information, processing the data using virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain the processed data information, wherein the virtual Ethernet network card 1 is pre-built in the virtual machine instance 1; Displaying sending information on the target interface, wherein the sending information is used to instruct that the processed data information be sent to a target virtual Ethernet network card of a target virtual machine instance, wherein the target virtual machine instance and the first virtual machine instance are set in different cloud servers; Displaying a parsing result of the processed data information on the target interface, wherein the processed data information is parsed by a target virtual Ethernet network card of the target virtual machine instance to obtain the parsing result, so as to realize data information interaction between virtual machine instances in different cloud servers; The method further comprises: Displaying the vxlan tunnel interface constructed in the virtual machine instance on the target interface; Displaying a first virtual switch created in the virtual machine instance on the target interface; Displaying a pair of virtual network cards created in the virtual machine instance on the target interface, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, adding the virtual network card 1 to the first virtual switch, and using the virtual network card 2 as a data interface of the virtual machine instance; The link composed of the vxlan tunnel interface, the first virtual switch, the virtual network card 1 and the virtual network card 2 is used as the virtual Ethernet network card, wherein a forwarding database is configured in the virtual machine instance, and the forwarding database is used to guide the first virtual switch to forward the first packet data information, and send or receive the processed data information through the network card on the virtual machine instance.
9. The method according to claim 8, characterized in that The method further comprises: On the target interface, the status of the vxlan tunnel interface, the first virtual switch, the virtual network card one and the virtual network card two are set to be on.
10. The method according to claim 9, characterized in that When the virtual network card 2 is used as an uplink interface of multiple container networks in the virtual machine instance, the method further includes: Before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, displaying a second virtual switch created in the virtual machine instance on the target interface, wherein the second virtual switch is used to receive data information sent by the multiple container networks, and adding the virtual network card 2 to the second virtual switch; and transmitting the data information sent from the second virtual switch to the first virtual switch through the virtual network card 2; The target interface displays the processed data information obtained by packaging the data information through the vxlan tunnel interface in the first virtual switch.
11. The method according to claim 9, characterized in that The virtual network card 2 extends multiple VLAN sub-interfaces, wherein the multiple VLAN sub-interfaces include virtual network card 21 and virtual network card 22. The method further includes: Before processing data through the virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, displaying multiple virtual switches created in the virtual machine instance on the target interface, wherein the multiple virtual switches include at least a third virtual switch and a fourth virtual switch, the third virtual switch is used to receive data information sent by at least one container 1 network, and the fourth virtual switch is used to receive data information sent by at least one container 2 network; The target interface displays that the virtual network card 21 is added to the third virtual switch, and the virtual network card 22 is added to the fourth virtual switch, wherein the data information sent from the third virtual switch is transmitted to the virtual network card 2 through the virtual network card 21, and the data information sent from the fourth virtual switch is transmitted to the virtual network card 2 through the virtual network card 22; the virtual network card 2 transmits the received data information to the first virtual switch, and in the first virtual switch, The processed data information obtained by packaging the data information through the vxlan tunnel interface is displayed on the target interface.
12. A communication device between virtual machine instances across cloud servers, characterized in that: include: a processing unit configured to, upon detecting that virtual machine instance 1 sends data information, process the data using virtual Ethernet network card 1 corresponding to the virtual machine instance 1 to obtain processed data information, wherein the virtual Ethernet network card 1 is pre-built in the virtual machine instance 1; a sending unit, configured to send the processed data information to a target virtual Ethernet network card of a target virtual machine instance, wherein the target virtual machine instance and the first virtual machine instance are set in different cloud servers; a parsing unit, configured to parse the processed data information through a target virtual Ethernet network card of the target virtual machine instance, so as to implement data information interaction between virtual machine instances in different cloud servers; The communication device between virtual machine instances across cloud servers further includes a construction unit, which further includes: A first building module is used to build a vxlan tunnel interface in the virtual machine instance; A second building module is configured to create a first virtual switch within the virtual machine instance; a third building module, configured to create a pair of virtual network cards within the virtual machine instance, wherein the pair of virtual network cards includes: virtual network card 1 and virtual network card 2, add virtual network card 1 to the first virtual switch, and use virtual network card 2 as a data interface of the virtual machine instance; The first determination module is used to use the link composed of the vxlan tunnel interface, the first virtual switch, the virtual network card one and the virtual network card two as the virtual Ethernet network card, wherein a forwarding database is configured in the virtual machine instance, and the forwarding database is used to guide the first virtual switch to forward the first packet data information, and send or receive the processed data information through the network card on the virtual machine instance.
13. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the communication method between virtual machine instances across cloud servers as described in any one of claims 1 to 11.
14. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the communication method between virtual machine instances across cloud servers as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Cloud computing network configuration method, cloud computing network system and a storage medium
CN112398687A
Data processing method and device, equipment and storage medium
CN113300985A