Method, device, cloud platform, equipment and medium for deploying virtual switch
Patent Information
- Application Number
- CN202310944233.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-07-28
AI Technical Summary
[0004]有鉴于此,本发明提供了一种虚拟交换机的部署方法、装置、云平台、设备及介质,以解决在多个节点上部署OVS时操作繁琐影响部署效率的问题
[0010]在本实施例中,在目标节点上部署第二虚拟交换机,可以提高目标节点的数据处理性能和吞吐量,进而提高目标节点的数据处理效率。
Smart Images

Figure CN116846764B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of virtualization network technology, specifically to deployment methods, apparatus, cloud platforms, devices, and media for virtual switches. Background Technology
[0002] With the rapid development of information technology, virtualized networks are showing tremendous development potential. Compared with traditional switches, Open vSwitch (OVS) has simpler network functions at the data link layer and stronger communication reliability.
[0003] In cloud computing services, OVS needs to be deployed across multiple nodes. When the network interface card (NIC) names of the nodes are inconsistent, configuration issues with the OVS deployment program necessitate on-site personnel to adjust the deployment program before OVS can be deployed on each node. This process is cumbersome and impacts deployment efficiency. Summary of the Invention
[0004] In view of this, the present invention provides a method, apparatus, cloud platform, device and medium for deploying virtual switches, so as to solve the problem of cumbersome operation affecting deployment efficiency when deploying OVS on multiple nodes.
[0005] In a first aspect, the present invention provides a method for deploying a virtual switch, applied to a cloud platform, the cloud platform including multiple nodes, the method including: obtaining resource information of each of the multiple nodes; generating multiple configuration files based on the resource information of each of the multiple nodes, the multiple configuration files corresponding one-to-one with the multiple nodes; deploying a first virtual switch on a target node according to the configuration file of a target node, the target node being at least one of the multiple nodes, and the first virtual switch being a kernel-based virtual switch.
[0006] The virtual switch deployment method provided in this invention involves obtaining resource information for each of multiple nodes and generating multiple configuration files based on that information. Then, a first virtual switch is deployed on the target node according to its configuration file. In other words, based on this virtual switch deployment method, a cloud platform can automatically deploy virtual switches on corresponding nodes according to their configuration files, thereby reducing manual intervention, improving deployment efficiency and accuracy, and lowering deployment costs.
[0007] In one alternative implementation, before deploying the first virtual switch on the target node according to the target node's configuration file, the method further includes: determining whether to deploy a second virtual switch on the target node, the second virtual switch being a virtual switch accelerated by a data plane development kit; the deployment of the first virtual switch on the target node according to the target node's configuration file includes: if it is determined that the second virtual switch will not be deployed, deploying the first virtual switch on the target node according to the target node's configuration file.
[0008] The virtual switch deployment method provided in this embodiment determines whether to deploy a second virtual switch on the target node before deploying the first virtual switch on the target node according to the target node's configuration file. If it is determined that the second virtual switch will not be deployed, the first virtual switch is then deployed on the target node according to the target node's configuration file. This allows users to flexibly select a suitable virtual switch to deploy on the target node based on their network performance requirements.
[0009] In an optional implementation, the method further includes: if it is determined that the second virtual switch will be deployed, deploying the second virtual switch on the target node according to the target node's configuration file.
[0010] In this embodiment, deploying a second virtual switch on the target node can improve the data processing performance and throughput of the target node, thereby improving the data processing efficiency of the target node.
[0011] In one alternative implementation, determining whether to deploy the second virtual switch on the target node includes: determining whether to deploy the second virtual switch on the target node based on whether the user-level process of the data plane development kit is enabled.
[0012] In this embodiment, when determining to deploy the second virtual switch, the relevant services of the data plane development kit can be deployed directly based on the user-level process of the data plane development kit, thereby improving deployment efficiency.
[0013] In one optional implementation, the resource information includes one or more of the following: node role information, configuration information of isolated central processing units, configuration information of large page memory, configuration information of virtual logical networks, configuration information of physical network interface cards and configuration information of logical network interface cards, or the attributes of the maximum transmission unit of the interface.
[0014] In one optional implementation, deploying the second virtual switch on the target node according to the target node's configuration file includes: deploying a service container for the virtual switch database; deploying a service container for the virtual switch daemon; deploying a data plane development kit; creating a tunnel bridge when the data plane development kit is deployed for the first time; changing the type of the tunnel bridge to user mode when the data plane development kit is deployed for the first time; after changing the type of the tunnel bridge to user mode when the data plane development kit is deployed for the first time, controlling the data plane development kit driver to take over the network interface card (NIC); deleting ports already connected to the tunnel bridge when the data plane development kit is deployed for a non-first time; after deleting ports already connected to the tunnel bridge when the data plane development kit is deployed for a non-first time, controlling the data plane development kit driver to take over the NIC; after controlling the data plane development kit driver to take over the NIC, determining whether to build a logical NIC; and configuring the logical NIC according to the target node's configuration file when a logical NIC is built.
[0015] The virtual switch deployment method provided in this embodiment configures logical network cards according to the configuration file of the target node. Even when there are differences in resource information among multiple nodes, virtual switches can be deployed on each node.
[0016] Secondly, the present invention provides a deployment apparatus for a virtual switch, the apparatus comprising: an acquisition module for acquiring resource information of each of a plurality of nodes; a generation module for generating a plurality of configuration files based on the resource information of each of the plurality of nodes, wherein the plurality of configuration files correspond one-to-one with the plurality of nodes; and a deployment module for deploying a first virtual switch on a target node based on the configuration file of a target node, wherein the target node is at least one of the plurality of nodes, and the first virtual switch is a kernel-based virtual switch.
[0017] In one optional implementation, the apparatus further includes: a determining module, configured to determine whether to deploy a second virtual switch on the target node, the second virtual switch being a virtual switch accelerated by a data plane development kit; and a deployment module, configured to deploy the first virtual switch on the target node according to the target node's configuration file if it is determined that the second virtual switch will not be deployed.
[0018] In an optional implementation, the deployment module further includes a deployment unit, configured to deploy the second virtual switch on the target node according to the target node's configuration file if it is determined that the second virtual switch will be deployed.
[0019] In one optional implementation, the determining module includes: a determining unit, configured to determine whether to deploy the second virtual switch based on whether the user-level process of the data plane development kit is enabled.
[0020] In one optional implementation, the resource information includes one or more of the following: node role information, configuration information of isolated central processing units, configuration information of large page memory, configuration information of virtual logical networks, configuration information of physical network interface cards and configuration information of logical network interface cards, or the attributes of the maximum transmission unit of the interface.
[0021] In one optional implementation, the deployment unit includes: a first deployment subunit for deploying a service container for a virtual switch database; a second deployment subunit for deploying a service container for a virtual switch daemon; a third deployment subunit for deploying a data plane development kit; a first processing unit for creating a tunnel bridge upon initial deployment of the data plane development kit; a second processing unit for modifying the type of the tunnel bridge to user mode upon initial deployment of the data plane development kit; and a third processing unit for modifying the type of the tunnel bridge to user mode upon initial deployment of the data plane development kit. Subsequently, the data plane development kit driver is controlled to take over the network interface card (NIC); the fourth processing unit is used to delete the ports already connected to the tunnel bridge when the data plane development kit is not deployed for the first time; the fifth processing unit is used to control the data plane development kit driver to take over the NIC after deleting the ports already connected to the tunnel bridge when the data plane development kit is not deployed for the first time; the sixth processing unit is used to determine whether to build a logical NIC after controlling the data plane development kit driver to take over the NIC; the seventh processing unit is used to configure the logical NIC according to the configuration file of the target node when a logical NIC is built.
[0022] Thirdly, the present invention provides a cloud platform comprising: multiple nodes, each of the multiple nodes storing resource information; a virtual switch deployment device for acquiring the resource information of each of the multiple nodes; the virtual switch deployment device further comprising generating multiple configuration files based on the resource information of each of the multiple nodes, the multiple configuration files corresponding one-to-one with the multiple nodes; and the virtual switch deployment device further comprising deploying a first virtual switch on a target node based on the configuration file of a target node, the target node being at least one of the multiple nodes, and the first virtual switch being a kernel-based virtual switch.
[0023] Fourthly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the deployment method of the first aspect or any corresponding embodiment described above.
[0024] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the deployment method of the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0025] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0026] Figure 1 This is a flowchart illustrating a method for deploying a virtual switch according to an embodiment of the present invention;
[0027] Figure 2 This is a flowchart illustrating another method for deploying a virtual switch according to an embodiment of the present invention;
[0028] Figure 3 This is a flowchart illustrating another method for deploying a virtual switch according to an embodiment of the present invention;
[0029] Figure 4 This is a structural block diagram of a virtual switch deployment apparatus according to an embodiment of the present invention;
[0030] Figure 5 This is a structural block diagram of a cloud platform according to an embodiment of the present invention;
[0031] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] Before describing the technical solution of the present invention, the terminology of the related technologies involved in the present invention will be introduced first.
[0034] (1) Cloud platform managed projects
[0035] OpenStack, a cloud platform management system, is one of the most popular cloud computing platforms today. It integrates massive infrastructure, software components, and data storage into a huge resource pool, providing users with computing, storage, and network resources. OpenStack primarily consists of control nodes, network nodes, compute nodes, and storage nodes. The control node is the management node of OpenStack, responsible for managing its core services and resources. The control node typically includes various OpenStack management components, such as databases, message queues, authentication services, image services, network services, and metering services. The network node communicates with the control node, compute nodes, and storage nodes, and also facilitates communication between external virtual machines and the corresponding network. Compute nodes consume the majority of resources and provide computing power to virtual machines. Storage nodes are used to store data. Control nodes, compute nodes, network nodes, and storage nodes can all be servers or host devices.
[0036] (2) Data Plane Development Kit
[0037] The Data Plane Development Kit (DPDK) is primarily based on the Linux operating system and is a collection of function libraries and drivers for fast packet processing. It can greatly improve data processing performance and throughput, and increase the efficiency of data plane applications.
[0038] (3) OVS
[0039] OVS is a logically integrated switch that connects multiple physical switches. Compared to traditional switches, OVS not only enables the load balancing and redundancy required by Spanning Tree Protocol (STP) and Virtual Router Redundancy Protocol (VRRP), but also reduces the number of network devices, simplifies the network architecture, and thus alleviates the pressure of system management and maintenance.
[0040] This invention provides a method for deploying a virtual switch, which can be applied to a cloud platform comprising multiple nodes. For example, the cloud platform can be an OpenStack-based cloud platform.
[0041] The virtual switch deployment method provided by this invention allows the cloud platform to automatically deploy virtual switches based on node configuration files, reducing manual intervention, improving deployment efficiency and accuracy, and lowering deployment costs.
[0042] According to an embodiment of the present invention, a method for deploying a virtual switch is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0043] This embodiment provides a method for deploying a virtual switch, which can be used on the cloud platform described above. Figure 1 This is a flowchart illustrating a method for deploying a virtual switch according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0044] Step S101: Obtain resource information for each of the multiple nodes.
[0045] For example, this application does not limit the role of the node; for instance, the node can be a computing node, a network node, or a storage node. That is, this invention can obtain resource information of computing nodes, network nodes, or storage nodes.
[0046] Resource information represents the configuration information of physical resources on the node related to the deployment of OVS. For example, resource information may include node role information, configuration information of isolated Central Processing Unit (CPU), configuration information of large page memory, configuration information of virtual logical network (overlay), configuration information of physical network interface card (NIC) and logical network interface card (Bond), or attribute information of the maximum transmission unit (MTU) of the interface.
[0047] Step S102: Generate multiple configuration files based on the resource information of each node in the multiple nodes.
[0048] Each configuration file corresponds to a specific node.
[0049] Specifically, after obtaining the resource information of each of the multiple nodes, the node resource information is input into a configuration file generation tool, which then converts the node resource information into a configuration file. For example, the configuration file generation tool is created by staff and pre-configured in the cloud platform.
[0050] For example, a configuration file can include resource information for each of multiple nodes, in which case the multiple configuration files corresponding to multiple nodes are the same. Alternatively, a configuration file can include resource information for only one node, in which case the multiple configuration files corresponding to multiple nodes may be different.
[0051] Step S103: Deploy the first virtual switch on the target node according to the target node's configuration file.
[0052] The target node is at least one of multiple nodes. That is, if the cloud platform includes N nodes, the target node can be any M nodes out of the N nodes. N and M are both positive integers, and 1 ≤ M ≤ N. The first virtual switch is a kernel-based virtual switch.
[0053] For example, after determining multiple configuration files, these configuration files can be distributed to the corresponding nodes. When deploying the first virtual switch on the target node, the deployment procedure for the first virtual switch can be modified according to the configuration files stored on the target node, and the first virtual switch can be deployed on the target node according to the modified deployment procedure.
[0054] For example, when there are multiple target nodes, the order in which the first virtual switch is deployed on the multiple nodes is not limited; they can be deployed sequentially or simultaneously. For instance, a cloud platform includes nodes a, b, and c. If the target nodes are nodes b and c, the cloud platform can first deploy the first virtual switch on node b according to node b's configuration file, and then deploy the first virtual switch on node c according to node c's configuration file. Alternatively, the cloud platform can first deploy the first virtual switch on node c according to node c's configuration file, and then deploy the first virtual switch on node b according to node b's configuration file. Furthermore, the cloud platform can simultaneously deploy the first virtual switch on node c according to node c's configuration file and on node b according to node b's configuration file.
[0055] In an optional embodiment of the present invention, the node roles of nodes a, b, and c can be the same or different. For example, nodes a, b, and c can all be compute nodes. As another example, node a can be a compute node, node b a network node, and node c a storage node.
[0056] The virtual switch deployment method provided in this invention involves obtaining resource information for each of multiple nodes and generating multiple configuration files based on that information. Then, a first virtual switch is deployed on the target node according to its configuration file. In other words, based on this virtual switch deployment method, a cloud platform can automatically deploy virtual switches on corresponding nodes according to their configuration files, thereby reducing manual intervention, improving deployment efficiency and accuracy, and lowering deployment costs.
[0057] This embodiment provides a method for deploying a virtual switch, which can be used on the cloud platform described above. Figure 2 This is a flowchart illustrating another method for deploying a virtual switch according to an embodiment of the present invention. Figure 2 As shown, the method includes the following steps:
[0058] Step S201: Obtain resource information for each of the multiple nodes.
[0059] Please see details Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0060] Step S202: Generate multiple configuration files based on the resource information of each node in the multiple nodes.
[0061] Please see details Figure 1 Step S102 of the illustrated embodiment will not be described again here.
[0062] Step S203: Determine whether to deploy a second virtual switch on the target node.
[0063] The second virtual switch is a virtual switch accelerated by DPDK.
[0064] Specifically, compared to kernel-based virtual switches, DPDK-accelerated virtual switches can improve data processing performance and throughput, thus increasing data processing efficiency. This step allows users to select the appropriate virtual switch to deploy on the corresponding nodes based on their network requirements.
[0065] For example, if the target node does not deploy a second virtual switch, the following step S204 is performed; if the target node deploys a second virtual switch, the following step S205 is performed.
[0066] In some alternative implementations, step S203 above includes: determining whether to deploy a second virtual switch on the target node based on the indication information.
[0067] Specifically, the indication information can come from the client device and may include one bit of 0 or 1, indicating whether to deploy a second virtual switch on the target node. For example, when the indication information includes one bit of 1, the second virtual switch is deployed on the target node; when the indication information includes one bit of 0, the second virtual switch is not deployed on the target node, and the first virtual switch may be deployed on the target node instead. For example, the client device can be a computer, PC, or mobile phone.
[0068] In some alternative implementations, step S203 above includes: determining whether to deploy a second virtual switch based on whether the user-level process of DPDK (DPDK-init) is enabled.
[0069] For example, a user-level process of DPDK is configured on a node of the cloud platform. If the user-level process of DPDK on the target node is enabled, a second virtual switch is deployed on the target node. If the user-level process of DPDK on the target node is disabled (not enabled, DPDK-init=false), a second virtual switch is not deployed on the target node. In this case, a first virtual switch may be deployed on the target node.
[0070] In this embodiment, when determining to deploy the second virtual switch, the relevant services of DPDK can be deployed directly based on the user-level process of DPDK, thereby improving deployment efficiency.
[0071] Step S204: If the second virtual switch is not deployed on the target node, deploy the first virtual switch on the target node according to the target node's configuration file.
[0072] Specifically, step S204 is Figure 1 Further limitations of step S103 in the illustrated embodiment will not be described in detail here.
[0073] The virtual switch deployment method provided in this embodiment determines whether to deploy a second virtual switch on the target node before deploying the first virtual switch on the target node according to the target node's configuration file. If it is determined that the second virtual switch will not be deployed, the first virtual switch is then deployed on the target node according to the target node's configuration file. This allows users to flexibly select a suitable virtual switch to deploy on the target node based on their network performance requirements.
[0074] Step S205: If a second virtual switch is deployed on the target node, deploy the second virtual switch on the target node according to the target node's configuration file.
[0075] In this embodiment, deploying a second virtual switch on the target node can improve the data processing performance and throughput of the target node, thereby improving the data processing efficiency of the target node.
[0076] This embodiment provides a method for deploying a virtual switch, which can be used on the cloud platform described above. Figure 3 This is a flowchart illustrating another method for deploying a virtual switch according to an embodiment of the present invention. Figure 3 As shown, the method includes the following steps:
[0077] Step S301: Obtain resource information for each of the multiple nodes.
[0078] Please see details Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0079] Step S302: Generate multiple configuration files based on the resource information of each node in the multiple nodes.
[0080] Please see details Figure 1 Step S102 of the illustrated embodiment will not be described again here.
[0081] Step S303: Determine whether to deploy a second virtual switch on the target node.
[0082] Please see details Figure 2 Step S203 of the illustrated embodiment will not be described again here.
[0083] Step S304: If the second virtual switch is not deployed on the target node, deploy the first virtual switch on the target node according to the target node's configuration file.
[0084] Please see details Figure 2 Step S204 of the illustrated embodiment will not be described again here.
[0085] Step S305: If a second virtual switch is deployed on the target node, deploy the second virtual switch on the target node according to the target node's configuration file.
[0086] Specifically, step S305 includes:
[0087] Step S3051: Deploy the service container for the virtual switch database.
[0088] Specifically, deploying a service container (Pod) for the Virtual Switch Database (OVSdb) can be used for subsequent database-related operations in OVS.
[0089] Step S3052: Deploy the service container for the virtual switch daemon.
[0090] Step S3053: Deploy DPDK.
[0091] Step S3054: Create a tunnel bridge.
[0092] Specifically, in the case of the first deployment of DPDK on the cloud platform, after the deployment of DPDK, step S3054 is executed.
[0093] Step S3055: Change the type of the tunnel bridge to user mode.
[0094] Specifically, after creating the tunnel bridge, to facilitate DPDK taking over the network interface card, the tunnel bridge type is changed to user space (Netdev).
[0095] Step S3056: Delete the ports that the tunnel bridge has already connected to.
[0096] Specifically, if DPDK is not being deployed for the first time on the cloud platform, after deploying DPDK, execute step S3056 to clarify the ports that the tunnel bridge has already connected to, so that DPDK can take over the new network card.
[0097] Step S3057: Control the DPDK driver to take over the network card.
[0098] Specifically, in the case of the first deployment of DPDK, step S3057 is executed after step S3055. In the case of a subsequent deployment of DPDK, step S3057 is executed after step S3056.
[0099] Step S3058: Determine whether to build Bond.
[0100] Specifically, in the case where the names of multiple network interface cards (NICs) managed by DPDK are inconsistent, in order to avoid affecting the deployment process, a Bond can be built to make the names of the multiple NICs managed by DPDK consistent.
[0101] Step S3059: Configure Bond according to the target node's configuration file.
[0102] Specifically, when a Bond needs to be built, the Bond is configured according to the target node's configuration file. For example, the name of the Bond is configured.
[0103] The virtual switch deployment method provided in this embodiment configures Bond according to the target node's configuration file. Even when there are differences in resource information among multiple nodes, virtual switches can be deployed on each node.
[0104] The deployment method of the virtual switch provided by the present invention will be described below with the cloud platform including node a, node b and node c.
[0105] First, the cloud platform obtains resource information for node a, node b, and node c. Second, the cloud platform generates configuration file 1 based on the resource information of node a, configuration file 2 based on the resource information of node b, and configuration file 3 based on the resource information of node c, and sends configuration file 1 to node a, configuration file 2 to node b, and configuration file 3 to node c. For example, the configuration files can be stored in the ` / run / openvswitch` directory on each node.
[0106] Then, the cloud platform determines whether to deploy a second virtual switch on nodes a, b, and c. If the first virtual switch is deployed on node a, and the second virtual switch is deployed on nodes b and c, the deployment procedure for the first virtual switch is modified according to configuration file 1 of node a, and the first virtual switch is deployed on node a according to the modified deployment procedure. Simultaneously, the deployment procedure for the second virtual switch is modified according to configuration file 2 of node b, and the second virtual switch is deployed on node b according to the modified deployment procedure. Finally, the deployment procedure for the second virtual switch is modified according to configuration file 3 of node c, and the second virtual switch is deployed on node c according to the modified deployment procedure.
[0107] This embodiment also provides a virtual switch deployment apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0108] This embodiment provides a deployment device for a virtual switch, such as... Figure 4 As shown, the deployment device for the virtual switch includes:
[0109] The acquisition module 401 is used to acquire resource information for each of the multiple nodes.
[0110] The generation module 402 is used to generate multiple configuration files based on the resource information of each of the multiple nodes. Each configuration file corresponds one-to-one with a specific node.
[0111] Deployment module 403 is used to deploy the first virtual switch on the target node according to the target node's configuration file. The target node is one of multiple nodes, and the first virtual switch is a kernel-based virtual switch.
[0112] In some alternative implementations, the deployment apparatus for the virtual switch further includes:
[0113] The determination module is used to determine whether to deploy a second virtual switch on the target node. This second virtual switch is a virtual switch accelerated by DPDK.
[0114] Deployment module 403 is used to deploy the first virtual switch on the target node according to the target node's configuration file, if it is determined that a second virtual switch will be deployed.
[0115] In some alternative implementations, deployment module 403 includes:
[0116] The deployment unit is used to deploy a second virtual switch on the target node according to the target node's configuration file, provided that it is determined that a second virtual switch will be deployed.
[0117] In some alternative implementations, the determining module includes:
[0118] The determining unit is used to determine whether to deploy the second virtual switch based on whether the user-level process of DPDK is enabled.
[0119] In some alternative implementations, the resource information includes one or more of the following:
[0120] Node role information, configuration information of isolated central processing units, configuration information of large page memory, configuration information of virtual logical networks, configuration information of physical network cards and Bonds, or the attributes of the maximum transmission unit of the interface.
[0121] In some alternative implementations, the deployment unit includes:
[0122] The first deployment subunit is used to deploy the service container for the virtual switch database;
[0123] The second deployment subunit is used to deploy the service container of the virtual switch daemon.
[0124] The third deployment subunit is used to deploy DPDK;
[0125] The first processing unit is used to create tunnel bridges in the case of initial DPDK deployment;
[0126] The second processing unit is used to change the type of the tunnel bridge to user mode when DPDK is deployed for the first time;
[0127] The third processing unit is used to control the DPDK driver to take over the network interface card after the tunnel bridge type is changed to user mode in the case of the first deployment of DPDK.
[0128] The fourth processing unit is used to delete ports already connected to the tunnel bridge when DPDK is not being deployed for the first time;
[0129] The fifth processing unit is used to control the DPDK driver to take over the network card after deleting the ports already connected to the tunnel bridge in cases where DPDK is not deployed for the first time.
[0130] The sixth processing unit is used to determine whether to build a Bond after the DPDK driver takes over the network card;
[0131] The seventh processing unit is used to configure the Bond according to the target node's configuration file when constructing the Bond.
[0132] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0133] In this embodiment, the deployment device for the virtual switch is presented in the form of a functional unit. Here, a unit refers to an application-specific integrated circuit (ASIC), a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0134] This invention also provides a cloud platform. Figure 5 This is a schematic diagram of the structure of a cloud platform according to an embodiment of the present invention. Figure 5 As shown, the cloud platform includes multiple nodes (e.g., such as...). Figure 5 The deployment device 504 for nodes 501, 502 and 503 and the virtual switch shown.
[0135] Each of the multiple nodes stores resource information. The virtual switch deployment device 504 is used to obtain the resource information of each of the multiple nodes. The virtual switch deployment device 504 is also used to generate multiple configuration files based on the resource information of each of the multiple nodes, with each configuration file corresponding to one of the multiple nodes. The virtual switch deployment device 504 is also used to deploy a first virtual switch on a target node based on the configuration file of the target node, where the target node is at least one of the multiple nodes, and the first virtual switch is a kernel-based virtual switch.
[0136] For example, the deployment device 504 of the virtual switch can be as described above. Figure 4 The virtual switch deployment device shown.
[0137] This invention also provides a computer device having the above-described features. Figure 4 The virtual switch deployment device shown.
[0138] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6As shown, the computer device includes one or more processors 610, memory 620, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take the 610 processor as an example.
[0139] The processor 610 may be a central processing unit, a network processor, or a combination thereof. The processor 610 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0140] The memory 620 stores instructions executable by at least one processor 610 to cause the at least one processor 610 to perform the method shown in the above embodiments.
[0141] The memory 620 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 620 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 620 may optionally include memory remotely located relative to the processor 610, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0142] The memory 620 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 620 may also include a combination of the above types of memory.
[0143] The computer device also includes a communication interface 630 for communicating with other devices or communication networks.
[0144] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0145] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for deploying a virtual switch, characterized in that, Applied to a cloud platform, wherein the cloud platform includes multiple nodes, the method includes: Obtain resource information for each of the plurality of nodes. The resource information represents the configuration information of physical resources related to the deployment of virtual switches on the corresponding node. The resource information of the plurality of nodes may differ. Multiple configuration files are generated based on the resource information of each of the multiple nodes, and the multiple configuration files correspond one-to-one with the multiple nodes; Determine whether to deploy a second virtual switch on the target node, the second virtual switch being a virtual switch accelerated by the data plane development kit; If it is determined that the second virtual switch will not be deployed, the first virtual switch is deployed on the target node according to the configuration file of the target node, wherein the target node is at least one of the plurality of nodes, and the first virtual switch is a kernel version virtual switch; If it is determined that the second virtual switch will be deployed, the second virtual switch will be deployed on the target node according to the target node's configuration file; Deploying the second virtual switch on the target node according to the target node's configuration file includes: Deploy a service container for the virtual switch database; deploy a service container for the virtual switch daemon. Deploy the data plane development kit; In the initial deployment of the data plane development kit, create a tunnel bridge; When deploying the data plane development kit for the first time, change the type of the tunnel bridge to user mode; In the case of the initial deployment of the data plane development kit, after the type of the tunnel bridge is changed to user mode, the data plane development kit driver is controlled to take over the network interface card; If the data plane development kit is not being deployed for the first time, delete the ports that the tunnel bridge is already connected to; In cases where the data plane development kit is not being deployed for the first time, after deleting the ports that the tunnel bridge has already connected to, the data plane development kit driver is controlled to take over the network interface card. After the control of the data plane development kit driver takes over the network interface card, it is determined whether to build a logical network interface card; When constructing a logical network interface card (NIC), the logical NIC is configured according to the configuration file of the target node.
2. The method according to claim 1, characterized in that, The process of determining whether to deploy a second virtual switch on the target node includes: Whether to deploy the second virtual switch on the target node is determined based on whether the user-level process of the data plane development kit is enabled.
3. The method according to claim 1 or 2, characterized in that, The resource information includes one or more of the following: Node role information, configuration information of isolated central processing units, configuration information of large page memory, configuration information of virtual logical networks, configuration information of physical network interface cards (NICs) and logical NICs, or the attributes of the maximum transmission unit of the interface.
4. A deployment device for a virtual switch, characterized in that, The device includes: The acquisition module is used to acquire resource information of each of the multiple nodes. The resource information represents the configuration information of physical resources related to the deployment of virtual switches on the corresponding node. The resource information of the multiple nodes may differ. The generation module is used to generate multiple configuration files based on the resource information of each of the multiple nodes, and the multiple configuration files correspond one-to-one with the multiple nodes; The determination module is used to determine whether to deploy a second virtual switch on the target node, wherein the second virtual switch is a virtual switch accelerated by the data plane development kit; The deployment module is used to deploy a first virtual switch on the target node according to the configuration file of the target node if it is determined that the second virtual switch will not be deployed. The target node is at least one of the plurality of nodes, and the first virtual switch is a kernel version virtual switch. The deployment module is further configured to, upon determining that the second virtual switch will be deployed, deploy the second virtual switch on the target node according to the target node's configuration file; the deployment module includes: a service container for deploying the virtual switch database; a service container for deploying the virtual switch daemon; a data plane development kit; in the case of the first deployment of the data plane development kit, creating a tunnel bridge; in the case of the first deployment of the data plane development kit, modifying the type of the tunnel bridge to user mode; in the case of the first deployment of the data plane development kit, after modifying the type of the tunnel bridge to user mode, controlling the data plane development kit driver to take over the network interface card; in the case of non-first deployments of the data plane development kit, deleting the ports already connected to the tunnel bridge; in the case of non-first deployments of the data plane development kit, after deleting the ports already connected to the tunnel bridge, controlling the data plane development kit driver to take over the network interface card; after controlling the data plane development kit driver to take over the network interface card, determining whether to build a logical network interface card; and in the case of building a logical network interface card, configuring the logical network interface card according to the target node's configuration file.
5. A cloud platform, characterized in that, include: Multiple nodes, each of which stores resource information; The virtual switch deployment device is used to obtain resource information of each of the plurality of nodes. The resource information represents the configuration information of physical resources related to the deployment of the virtual switch on the corresponding node. The resource information of the plurality of nodes is different. The deployment device of the virtual switch is also used to generate multiple configuration files based on the resource information of each of the multiple nodes, and the multiple configuration files correspond one-to-one with the multiple nodes; The virtual switch deployment device is further configured to determine whether to deploy a second virtual switch on the target node, wherein the second virtual switch is a virtual switch accelerated by the data plane development kit. The virtual switch deployment device is further configured to deploy a first virtual switch on a target node according to the configuration file of the target node if it is determined that the second virtual switch will not be deployed, wherein the target node is at least one of the plurality of nodes, and the first virtual switch is a kernel version virtual switch. The virtual switch deployment apparatus is further configured to, when it is determined that the second virtual switch will be deployed, deploy the second virtual switch on the target node according to the target node's configuration file; specifically, this includes: deploying a service container for the virtual switch database; deploying a service container for the virtual switch daemon; deploying a data plane development kit; creating a tunnel bridge when the data plane development kit is deployed for the first time; modifying the type of the tunnel bridge to user mode when the data plane development kit is deployed for the first time; after modifying the type of the tunnel bridge to user mode when the data plane development kit is deployed for the first time, controlling the data plane development kit driver to take over the network interface card (NIC); deleting ports already connected to the tunnel bridge when the data plane development kit is not deployed for the first time; after deleting ports already connected to the tunnel bridge when the data plane development kit is deployed for the first time, controlling the data plane development kit driver to take over the NIC; after controlling the data plane development kit driver to take over the NIC, determining whether to build a logical NIC; and configuring the logical NIC according to the target node's configuration file when a logical NIC is built.
6. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 3.
Citation Information
Patent Citations
Test processing method and device, electronic equipment and computer readable storage medium
CN114168462A