A virtual machine network deployment method, system, device and storage medium
By creating and connecting multiple bridges, and utilizing network plug-in programs to achieve automated topology building and flexible configuration of virtual machine networks, the problems of traffic congestion and insufficient isolation in virtual machine network deployment are solved, and bandwidth and isolation are improved.
Patent Information
- Application Number
- CN202310182521.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-02-24
AI Technical Summary
In existing technologies, business virtual machine traffic is prone to congestion and business isolation cannot be achieved in virtual machine network deployment architectures, especially in multi-VLAN scenarios where flexible configuration is lacking.
By creating a first bridge to carry the network ports of virtual machines, obtaining a configuration file to record the number of second bridges, physical network card IDs and VLAN segments, and creating multiple second bridges based on this, loading physical network cards to the corresponding bridges, establishing connections between bridges, and using network plug-in programs to achieve automated topology construction and flexible configuration.
It increases the bandwidth of the business virtual machine, enhances business isolation, avoids traffic congestion, and enables flexible configuration in scenarios where multiple network cards support multiple network segments.
Smart Images

Figure CN116170306B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of virtual machines, in particular to a virtual machine network deployment method, system, device and storage medium. BACKGROUND
[0002] Now many enterprises establish private cloud platforms in the internal through cloud computing technology, deliver resources required by business operation through cloud platform, improve resource utilization, guarantee stable operation of business, and reduce business operation cost of company. The deployment architecture is generally as shown in Figure 1 .
[0003] In the deployment architecture, eth0 is a management network card, all cloud platform nodes are connected through eth0 to form a management network plane, and the cloud platform control node issues instructions through eth0 network card, operates ovs bridge, and creates port configuration IP, etc. eth1 is a business network card, all cloud platform nodes are connected through eth1 to form a business network plane, and only this network plane, Figure 1 It is shown that the physical network card eth1 carries traffic between vlan 100-399 vlan segments, but it is easy to cause congestion of business virtual machine traffic, and business isolation cannot be achieved. SUMMARY
[0004] Therefore, in order to overcome at least one aspect of the above problems, the embodiments of the present application provide a virtual machine network deployment method, comprising the following steps:
[0005] Creating a first bridge carrying a virtual machine network port;
[0006] Obtaining a configuration file, wherein the configuration file records the number of second bridges to be created, the physical network card ID corresponding to each second bridge, and the carried vlan segment;
[0007] Creating a plurality of second bridges based on the configuration file and loading the physical network card into the corresponding second bridge;
[0008] Creating a port on the first bridge and each second bridge and establishing the connection between the port of each second bridge and the port of the first bridge.
[0009] In some embodiments, further comprising:
[0010] Creating a label corresponding to each second bridge in the configuration file, so that when the virtual machine creates a network, the connection with the corresponding second bridge is established through the label.
[0011] In some embodiments, further comprising:
[0012] corresponding vlan segment of each of the labels in the configuration file, so that when the virtual machine creates a network, the corresponding vlan segment is obtained through the label and a vlan ID is selected therefrom.
[0013] In some embodiments, the creating the first bridge carrying the network port of the virtual machine further comprises:
[0014] detecting whether the first bridge exists;
[0015] in response to the first bridge not existing, invoking the OVS interface to create the first bridge through an encapsulation command.
[0016] Based on the same inventive concept, according to another aspect of the present application, embodiments of the present application further provide a virtual machine network deployment system, comprising:
[0017] a creating module configured to create a first bridge carrying a network port of a virtual machine;
[0018] an obtaining module configured to obtain a configuration file, wherein the configuration file records a number of second bridges to be created, a physical network card ID corresponding to each of the second bridges, and a vlan segment carried thereby;
[0019] a loading module configured to create a plurality of second bridges based on the configuration file and load a physical network card into a corresponding second bridge;
[0020] a connecting module configured to create a port on the first bridge and each of the second bridges and establish a connection between the port of each of the second bridges and the port of the first bridge.
[0021] In some embodiments, further comprising a labeling module configured to:
[0022] create a label corresponding to each of the second bridges in the configuration file, so that when the virtual machine creates a network, a connection with a corresponding second bridge is established through the label.
[0023] In some embodiments, further comprising an associating module configured to:
[0024] associate a vlan segment corresponding to each of the labels in the configuration file, so that when the virtual machine creates a network, the corresponding vlan segment is obtained through the label and a vlan ID is selected therefrom.
[0025] In some embodiments, the creating module is further configured to:
[0026] detect whether the first bridge exists;
[0027] In response to the absence, the OVS interface is invoked to create the first bridge by encapsulating a command.
[0028] Based on the same inventive concept, according to another aspect of the present application, embodiments of the present application further provide a computer device, comprising:
[0029] at least one processor; and
[0030] a memory storing a computer program capable of running on the processor, wherein the processor executes the program to perform the steps of any of the virtual machine network deployment methods described above.
[0031] Based on the same inventive concept, according to another aspect of the present application, embodiments of the present application further provide a computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to perform the steps of any of the virtual machine network deployment methods described above.
[0032] The present application has one of the following beneficial technical effects: the scheme provided by the present application fully encapsulates multiple network cards on a server hardware, so that virtual machine network traffic uses multiple physical network cards, increases the bandwidth of service virtual machines, and also increases the isolation of services, avoids congestion of service virtual machine traffic, and also realizes flexible configuration in the scenario of multiple network cards carrying multiple network segments. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other embodiments can also be obtained without creative labor on the basis of these drawings.
[0034] Figure 1 a virtual machine network deployment architecture in the prior art;
[0035] Figure 2 a flowchart of a virtual machine network deployment method provided by an embodiment of the present application;
[0036] Figure 3 a virtual machine network deployment architecture diagram provided by an embodiment of the present application;
[0037] Figure 4 a virtual network topology diagram provided by an embodiment of the present application;
[0038] Figure 5 a structural diagram of a virtual machine network deployment system provided by an embodiment of the present application;
[0039] Figure 6 A structural schematic diagram of a computer device provided for an embodiment of the present application is shown in the following figure.
[0040] Figure 7 A structural schematic diagram of a computer readable storage medium provided for an embodiment of the present application is shown in the following figure. DETAILED DESCRIPTION
[0041] In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application are further described in detail below with reference to the accompanying drawings.
[0042] It should be noted that all the expressions of “first” and “second” in the embodiments of the present application are used to distinguish two same-named different entities or different parameters, and it can be seen that “first” and “second” are only for the convenience of description and should not be understood as a limitation on the embodiments of the present application. The subsequent embodiments will not be described one by one.
[0043] In the embodiments of the present application, OVS: full name OpenvSwitch, OVS is a high-quality, multi-layer virtual switch software. Its purpose is to support large-scale network automation through programming extension, and also support standard management interface and protocol.
[0044] According to one aspect of the present application, an embodiment of the present application provides a virtual machine network deployment method, as shown in the following figure, which can include the following steps: Figure 2
[0045] S1, creating a first bridge carrying a virtual machine network port;
[0046] S2, obtaining a configuration file, wherein the configuration file records the number of second bridges to be created, the physical network card ID corresponding to each second bridge and the carried vlan segment;
[0047] S3, creating a plurality of second bridges based on the configuration file and loading the physical network card to the corresponding second bridge;
[0048] S4, creating a port on the first bridge and each second bridge and establishing the connection between the port of each second bridge and the port of the first bridge.
[0049] The scheme provided by the present application fully encapsulates multiple network cards on the server hardware, so that the virtual machine network flow uses multiple physical network cards, increases the bandwidth of the service virtual machine, increases the service isolation, avoids the congestion of the service virtual machine flow, and also realizes the flexible configuration in the multiple network card carrying multiple network segment scenario.
[0050] In some embodiments, creating a first bridge carrying a virtual machine network port further includes:
[0051] Check if the first bridge exists;
[0052] In response to the absence of the bridge, the first bridge is created by calling the OVS interface through a wrapper command.
[0053] Specifically, when the network plugin program starts, it checks whether the br-int bridge (the first bridge) exists. If the br-int bridge does not exist, the network plugin program creates it by encapsulating the ovs-vsctl command and calling the OVS interface. Figure 3 As shown in ①, the br-int bridge is a bridge that carries virtual machine ports; all virtual machines are created on the br-int bridge.
[0054] In some embodiments, such as Figure 3 As shown, the network plug-in program is deployed on all server nodes under the cloud platform and is responsible for building a virtual network topology on the server nodes.
[0055] The network plug-in program reads the configuration file, whose parameters specify which virtual bridges need to be created on the server node, which physical network interface card (NIC) is the uplink port of each virtual bridge, and which VLAN segments the virtual machine network will handle. For example... Figure 3 As shown, the network plugin program reads and parses the value of the `bridge_bonding` parameter to identify the three bridges `br-eth1`, `br-eth2`, and `br-eth3` to be created on the server node. The creation logic is the same as that of the `br-int` bridge. If the bridge does not exist, it calls the OVS bonding interface to create it. Figure 3 As shown in ②; the value of the `bridge_bonding` parameter also instructs the plugin program to create the uplink physical links of the bridge after it is created, such as `br-eth1` being bound to the `eth1` network interface, `br-eth2` being bound to the `eth2` network interface, and `br-eth3` being bound to the `eth3` network interface, as shown in ②. Figure 3 As shown in ③, these are all automatic initialization processes completed through simple configuration parameters, which is an automated extension process that other cloud platforms have not yet achieved.
[0056] After br-int and the bridges required by the configuration file are automatically created, the network plugin program still needs to connect the bridges, such as... Figure 3 As shown in ④, the network plugin program creates patch ports on the br-int and br-ethx bridges, connecting the two ports. This establishes the network link between the virtual machine's network card and br-int, enabling communication between virtual machines on all server nodes of the cloud platform.
[0057] In some embodiments, further comprising:
[0058] Creating a tag corresponding to each of the second bridge in the configuration file, so that when the virtual machine creates a network, the connection with the corresponding second bridge is established through the tag.
[0059] In some embodiments, further comprising:
[0060] Associating the vlan segment corresponding to each of the tags in the configuration file, so that when the virtual machine creates a network, the corresponding vlan segment is obtained through the tag and a vlan ID is selected therefrom.
[0061] Specifically, the network plug-in program can also parse the bridge_mappings and network_vlan_range parameters. The bridge_mappings parameter provides a tag for operating br-eth1, br-eth2 and br-eth3. When creating a vlan-eth1 network under the cloud platform, the corresponding operation is the br-eth1 bridge. Similarly, creating a vlan-eth2 and a vlan-eth3 network corresponds to the operation of the br-eth2 and the br-eth3 bridge, and the traffic forwarding rule is updated in the respective bridge. The network_vlan_range parameter is also associated with the vlan segment that should be carried on the virtual bridge through the tag. The tag of the vlan-eth1 corresponds to the vlan[100,199), and the corresponding vlan[100,199) network traffic is carried by the br-eth1 virtual bridge, and the corresponding physical network card is eth1. Similarly, the physical network card corresponding to the vlan[200,299) network traffic is eth2, and the physical network card corresponding to the vlan[300,399) network traffic is eth3. These are an automatic initialization process completed through simple configuration parameters, and are an automatic expansion process that other cloud platforms have not achieved.
[0062] The present application completes the establishment of the virtual network topology on all server nodes through the network plug-in program, and after completing the establishment of the virtual network topology, the network plug-in program flexibly completes the binding of the virtual network topology to the physical network card through the loading and parsing of the configuration file. For example, Figure 4As shown, the multi-network card of the server is fully utilized, the virtual machine traffic is isolated using the physical network card, under the current cloud platform, the vlan[100, 399] only uses the eth1 as the physical outlet, all virtual machine traffic is superimposed on the network card, which is easy to cause network congestion, even if there are multiple physical network cards that can be split and utilized, the current cloud platform lacks flexible expansion software mechanism and means, and the application provides such software mechanism and means, through the network plug-in program and the flexible configuration file loading, the vlan[100, 399] segment is easily split into three segments, and three network cards are provided as physical outlets, and the virtual machine traffic superposition pressure is dispersed.
[0063] Based on the same inventive concept, according to another aspect of the application, embodiments of the application also provide a virtual machine network deployment system 400, as shown in Figure 5 The system comprises:
[0064] A creating module 401 configured to create a first network bridge carrying a virtual machine network port;
[0065] An obtaining module 402 configured to obtain a configuration file, wherein the configuration file records the number of second network bridges to be created, the physical network card ID corresponding to each second network bridge, and the carried vlan segment;
[0066] A loading module 403 configured to create a plurality of second network bridges based on the configuration file and load the physical network card into the corresponding second network bridge;
[0067] A connecting module 404 configured to create a port on the first network bridge and each second network bridge and establish a connection between the port of each second network bridge and the port of the first network bridge.
[0068] In some embodiments, further comprising a marking module configured to:
[0069] Create a mark corresponding to each second network bridge in the configuration file, so that when the virtual machine creates a network, the connection with the corresponding second network bridge is established through the mark.
[0070] In some embodiments, further comprising an association module configured to:
[0071] Associate the vlan segment corresponding to each mark in the configuration file, so that when the virtual machine creates a network, the corresponding vlan segment is obtained through the mark and one vlan ID is selected therefrom.
[0072] In some embodiments, the creating module is further configured to:
[0073] Detect whether the first network bridge exists;
[0074] In response to the absence, the OVS interface is invoked to create the first bridge by encapsulating a command.
[0075] Based on the same inventive concept, according to another aspect of the present application, as shown in Figure 6 An embodiment of the present application also provides a computer device 501, comprising:
[0076] at least one processor 520; and
[0077] a memory 510, the memory 510 storing a computer program 511 executable on the processor, the processor 520 executing the program to perform the following steps:
[0078] S1, creating a first bridge bearing a virtual machine network port;
[0079] S2, obtaining a configuration file, wherein the configuration file records the number of second bridges to be created, the physical network card ID corresponding to each second bridge and the bearing vlan segment;
[0080] S3, creating a plurality of second bridges based on the configuration file and loading the physical network card to the corresponding second bridge;
[0081] S4, creating a port on the first bridge and each second bridge and establishing the connection between the port of each second bridge and the port of the first bridge.
[0082] The scheme provided by the present application fully encapsulates a plurality of network cards on a server hardware, so that the virtual machine network flow uses a plurality of physical network cards, increases the bandwidth of the service virtual machine and also increases the service isolation, avoids the congestion of the service virtual machine flow and also realizes the flexible configuration in the scenario of the multiple network cards bearing multiple network segments.
[0083] In some embodiments, the first bridge bearing the virtual machine network port is further created, comprising:
[0084] detecting whether the first bridge exists;
[0085] In response to the absence, the OVS interface is invoked to create the first bridge by encapsulating a command.
[0086] Specifically, when the network plug-in program is started, it is detected whether the br-int bridge (the first bridge) exists, if the br-int bridge does not exist, the network plug-in program creates the ovs interface by encapsulating the ovs-vsctl command to invoke the ovs, as shown in Figure 3 ①. The br-int bridge is a bridge bearing a virtual machine port, and all virtual machines are created on the br-int bridge.
[0087] In some embodiments, as shown in Figure 3 The network plug-in is deployed on all server nodes under the cloud platform, and is responsible for building a virtual network topology on the server nodes.
[0088] The network plug-in reads a configuration file, and parameters in the configuration file indicate which virtual bridges need to be created on the server nodes, which physical network card is the uplink port of the virtual bridge, and which vlan segment is borne by the virtual machine network of the virtual bridge. As shown in Figure 3 The network plug-in reads and parses the value of the bridge_bonding parameter, identifies that three bridges br-eth1, br-eth2, and br-eth3 are to be created on the server node, and the creation logic is consistent with that of the br-int bridge. If it is determined that the bridge does not exist, an ovs-vswitch interface is called to create, as shown in Figure 3 At the same time, the value of the bridge_bonding parameter also instructs the plug-in to create the uplink physical link of the bridge after the creation of the bridge is completed, such as binding br-eth1 on the eth1 network card, binding br-eth2 on the eth2 network card, and binding br-eth3 on the eth3 network card, as shown in Figure 3 These are automatic initialization processes completed through simple configuration parameters, and are automatic expansion processes that other cloud platforms have not achieved.
[0089] After the br-int and the bridges required to be created in the configuration file are automatically created, the network plug-in also needs to connect the bridges, as shown in Figure 3 The network plug-in creates a patch port on the br-int and the br-ethx bridge, and connects the two ports, so that the network link of the virtual machine network card <-> br-int <-> br-ethx <-> ethx is connected, and the communication between the virtual machines between the server nodes under the cloud platform is also connected.
[0090] In some embodiments, further comprising:
[0091] Creating a tag corresponding to each of the second bridges in the configuration file, so that when the virtual machine creates a network, the tag is used to establish a connection with the corresponding second bridge.
[0092] In some embodiments, further comprising:
[0093] Associating a vlan segment corresponding to each of the tags in the configuration file, so that when the virtual machine creates a network, the tag is used to obtain the corresponding vlan segment and select a vlan ID therefrom.
[0094] Specifically, the network plug-in program can also parse the bridge_mappings and network_vlan_range parameters. The bridge_mappings parameter provides a label for operating the br-eth1, br-eth2 and br-eth3. When the network of vlan-eth1 is created under the cloud platform, the br-eth1 bridge is operated. Similarly, when the networks of vlan-eth2 and vlan-eth3 are created, the br-eth2 and br-eth3 are operated, respectively. The traffic forwarding rule is updated in the respective bridges. The network_vlan_range parameter is also associated with the vlan segment that should be carried on the virtual bridge through the label. The label of vlan-eth1 corresponds to the vlan[100, 199), and the network traffic of the vlan[100, 199) is carried by the br-eth1 virtual bridge. The corresponding physical network card is eth1. Similarly, the physical network card corresponding to the network traffic of the vlan[200, 299) is eth2, and the physical network card corresponding to the network traffic of the vlan[300, 399) is eth3. These are automatic initialization processes completed through simple configuration parameters, and are also automatic expansion processes that cannot be achieved by other cloud platforms.
[0095] The network plug-in program completes the establishment of the virtual network topology on all server nodes, and after the establishment of the virtual network topology, the network plug-in program flexibly completes the binding of the virtual network topology to the physical network card through the loading and parsing of the configuration file. Figure 4 As shown in the figure, the multiple network cards of the server are fully utilized, and the virtual machine traffic is isolated using the physical network card. In the current cloud platform, the vlan[100, 399] only uses the eth1 as the physical outlet, and all virtual machine traffic is superimposed on the network card, which is easy to cause network congestion. Even if multiple physical network cards can be split and utilized, the current cloud platform lacks flexible expansion software mechanisms and means. The present application provides such software mechanisms and means, which can be easily horizontally expanded by the network plug-in program and the flexible configuration file loading. The vlan[100, 399] segment is split into three segments, and three network cards are provided as physical outlets to disperse the virtual machine traffic superimposed pressure.
[0096] Based on the same inventive concept, according to another aspect of the present application, as shown in the figure, the embodiment of the present application also provides a computer readable storage medium 601, which stores a computer program 610. The computer program 610 is executed by a processor to perform the following steps: Figure 7
[0097] S1, creating a first bridge carrying a virtual machine network port;
[0098] S2, obtaining a configuration file, wherein the configuration file records the number of second bridges to be created, the physical network card ID corresponding to each second bridge and the carried vlan segment;
[0099] S3, creating a plurality of second bridges based on the configuration file and loading the physical network card to the corresponding second bridge;
[0100] S4, creating a port on the first bridge and each second bridge and establishing the connection between the port of each second bridge and the port of the first bridge.
[0101] The scheme fully encapsulates a plurality of network cards on the server hardware, so that the virtual machine network flow uses a plurality of physical network cards, increases the bandwidth of the service virtual machine and also increases the service isolation, avoids the congestion of the service virtual machine flow, and also realizes the flexible configuration in the multiple network card carrying multiple network segment scenario.
[0102] In some embodiments, creating the first bridge carrying the virtual machine network port further comprises:
[0103] detecting whether the first bridge exists;
[0104] in response to the non-existence, creating the first bridge by encapsulating the ovs interface through the ovs-vsctl command.
[0105] Specifically, when the network plug-in program starts, it is detected whether the br-int bridge (the first bridge) exists, if the br-int bridge does not exist, the network plug-in program creates the ovs interface through the encapsulation of the ovs-vsctl command, as shown in ① in the description. Figure 3 The br-int bridge is a bridge carrying the virtual machine port, and all the virtual machines are created on the br-int bridge.
[0106] In some embodiments, as shown in Figure 3 The network plug-in program is deployed on all the server nodes under the cloud platform and is responsible for constructing the virtual network topology on the server node.
[0107] The network plug-in program reads the configuration file, and the parameters in the configuration file indicate which virtual bridges need to be created on the server node, which physical network card is the uplink port of the virtual bridge, and which vlan segment does the virtual bridge undertake for the virtual machine network. Figure 3As shown, the network plugin program reads and parses the value of the `bridge_bonding` parameter to identify the three bridges `br-eth1`, `br-eth2`, and `br-eth3` to be created on the server node. The creation logic is the same as that of the `br-int` bridge. If the bridge does not exist, it calls the OVS bonding interface to create it. Figure 3 As shown in ②; the value of the `bridge_bonding` parameter also instructs the plugin program to create the uplink physical links of the bridge after it is created, such as `br-eth1` being bound to the `eth1` network interface, `br-eth2` being bound to the `eth2` network interface, and `br-eth3` being bound to the `eth3` network interface, as shown in ②. Figure 3 As shown in ③, these are all automatic initialization processes completed through simple configuration parameters, which is an automated extension process that other cloud platforms have not yet achieved.
[0108] After br-int and the bridges required by the configuration file are automatically created, the network plugin program still needs to connect the bridges, such as... Figure 3 As shown in ④, the network plugin program creates patch ports on the br-int and br-ethx bridges, connecting the two ports. This establishes the network link between the virtual machine's network card and br-int, enabling communication between virtual machines on all server nodes of the cloud platform.
[0109] In some embodiments, it also includes:
[0110] A tag is created in the configuration file for each of the second bridges so that when the virtual machine creates a network, it establishes a connection with the corresponding second bridge through the tag.
[0111] In some embodiments, it also includes:
[0112] The configuration file associates each of the tags with a corresponding VLAN segment so that when the virtual machine creates a network, it can obtain the corresponding VLAN segment through the tag and select a VLAN ID from it.
[0113] Specifically, the network plug-in program can also parse the bridge_mappings and network_vlan_range parameters. The bridge_mappings parameter provides a label for operating br-eth1, br-eth2 and br-eth3. When a network of vlan-eth1 is created under the cloud platform, the corresponding operation bridge is br-eth1. Similarly, when networks of vlan-eth2 and vlan-eth3 are created, the corresponding operation bridges are br-eth2 and br-eth3, respectively. The traffic forwarding rule is updated in the respective bridge. The network_vlan_range parameter is also associated with the vlan segment that should be carried on the virtual bridge through the label. The label of vlan-eth1 corresponds to vlan[100,199), and the network traffic of vlan[100,199) is carried by the br-eth1 virtual bridge. The corresponding physical network card is eth1. Similarly, the physical network card corresponding to the network traffic of vlan[200,299) is eth2, and the physical network card corresponding to the network traffic of vlan[300,399) is eth3. These are automatic initialization processes completed through simple configuration parameters, and are also automatic expansion processes that cannot be achieved by other cloud platforms.
[0114] The present application establishes the virtual network topology on all server nodes through the network plug-in program. After the virtual network topology is established, the network plug-in program flexibly completes the binding of the virtual network topology to the physical network card through the loading and parsing of the configuration file. Figure 4 As shown in the figure, the multiple network cards of the server are fully utilized to isolate the virtual machine traffic. In the current cloud platform, vlan[100,399] only uses eth1 as the physical outlet, and all virtual machine traffic is superimposed on the network card, which easily causes network congestion. Even if multiple physical network cards can be used, the current cloud platform lacks flexible expansion software mechanisms and means. The present application provides such software mechanisms and means. Through the network plug-in program and the flexible configuration file loading, horizontal expansion is very easy, vlan[100,399] is divided into three segments, and three network cards are provided as physical outlets to disperse the virtual machine traffic superimposed pressure.
[0115] Finally, it should be noted that those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by a computer program to instruct related hardware to complete. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments.
[0116] Moreover, it is to be understood that the computer-readable storage medium (e.g., the memory) of the present disclosure can be either volatile or nonvolatile storage, or can include both volatile and nonvolatile storage.
[0117] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
[0118] The above are exemplary embodiments disclosed by the present disclosure, but it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed by the present disclosure defined by the claims. The functions, steps and / or actions of the method claims described in connection with the embodiments disclosed herein need not be performed in any particular order. Furthermore, although elements of the embodiments disclosed by the present disclosure can be described or claimed in individual form, or in a singular tense, a plurality can be understood unless specifically restricted in context as exceptions.
[0119] It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises", "comprising", "includes" and / or "including", as used herein, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0120] The above-mentioned embodiment numbers of the embodiments disclosed by the present disclosure are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0121] Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by programs instructing relevant hardware, and the programs can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0122] Those skilled in the art should understand that the above discussion of any embodiment is only exemplary, and is not intended to mean that the scope of the embodiments disclosed by the present application (including claims) is limited to these examples; under the idea of the embodiments of the present application, the above embodiments or technical features in different embodiments can also be combined, and there are many other changes of different aspects of the embodiments of the present application as above. In order to be brief, they are not provided in details. Therefore, any omission, modification, equivalent replacement, improvement, etc. made in the spirit and principle of the embodiments of the present application shall be included in the protection scope of the embodiments of the present application.
Claims
1. A method for deploying virtual machine networks, characterized in that, Includes the following steps: Create the first bridge to carry the virtual machine's network port; Obtain the configuration file, which records the number of second bridges to be created, the physical network interface card ID corresponding to each second bridge, and the VLAN segment it carries; Based on the configuration file, multiple second bridges are created and physical network cards are loaded into the corresponding second bridges; Create ports on the first bridge and each of the second bridges, and establish a connection between the port of each of the second bridges and the port of the first bridge.
2. The method as described in claim 1, characterized in that, Also includes: A tag is created in the configuration file for each of the second bridges so that when the virtual machine creates a network, it establishes a connection with the corresponding second bridge through the tag.
3. The method as described in claim 2, characterized in that, Also includes: The configuration file associates each of the tags with a corresponding VLAN segment, so that when the virtual machine creates a network, it can obtain the corresponding VLAN segment through the tag and select a VLAN ID from it.
4. The method as described in claim 1, characterized in that, Creating a first bridge to carry the network ports of the virtual machines, further includes: Check if the first bridge exists; In response to the absence of the bridge, the first bridge is created by calling the OVS interface through a wrapper command.
5. A virtual machine network deployment system, characterized in that, include: Create a module and configure it to create the first bridge that carries the network ports of the virtual machines; The acquisition module is configured to acquire a configuration file, wherein the configuration file records the number of second bridges to be created, the physical network card ID corresponding to each second bridge, and the VLAN segment it carries; The loading module is configured to create multiple second bridges based on the configuration file and load physical network cards into the corresponding second bridges; The connection module is configured to create ports on the first bridge and each of the second bridges and establish a connection between the port of each of the second bridges and the port of the first bridge.
6. The system as described in claim 5, characterized in that, It also includes a tagging module, configured as follows: A tag is created in the configuration file for each of the second bridges so that when the virtual machine creates a network, it establishes a connection with the corresponding second bridge through the tag.
7. The system as described in claim 6, characterized in that, It also includes associated modules, configured as follows: The configuration file associates each of the tags with a corresponding VLAN segment so that when the virtual machine creates a network, it can obtain the corresponding VLAN segment through the tag and select a VLAN ID from it.
8. The system as described in claim 5, characterized in that, The module creation is also configured as follows: Check if the first bridge exists; In response to the absence of the bridge, the first bridge is created by calling the OVS interface through a wrapper command.
9. A computer device, comprising: At least one processor; as well as A memory storing a computer program executable on the processor, characterized in that the processor executes the program by performing the steps of the method as described in any one of claims 1-4.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it performs the steps of the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Deployment method and device for virtual network
CN106161116A