WO2023160033A1 - 虚拟网卡资源的配置方法、装置、计算机设备及介质 - Google Patents

虚拟网卡资源的配置方法、装置、计算机设备及介质 Download PDF

Info

Publication number
WO2023160033A1
WO2023160033A1 PCT/CN2022/132148 CN2022132148W WO2023160033A1 WO 2023160033 A1 WO2023160033 A1 WO 2023160033A1 CN 2022132148 W CN2022132148 W CN 2022132148W WO 2023160033 A1 WO2023160033 A1 WO 2023160033A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual network
network card
group
cards
target
Prior art date
Application number
PCT/CN2022/132148
Other languages
English (en)
French (fr)
Inventor
王文潇
陈培
王德奎
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2023160033A1 publication Critical patent/WO2023160033A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting

Definitions

  • the present application relates to a configuration method, device, computer equipment and medium of a virtual network card resource.
  • Kubernetes is an open source container orchestration engine, which is used to automatically deploy, scale and manage containerized applications; Pod is the smallest scheduling unit that can be scheduled in Kubernetes, which can be understood as a container group including at least one container .
  • a container group can communicate with other container groups or exchange data based on the loaded virtual network card.
  • the virtual network card resources loaded by the container group are selected in advance from the multiple virtual network cards in the node where the container group is located, and manually compared and screened one by one to determine the virtual network card to be allocated to the container group, and then configure it in the container group for container groups to load.
  • the inventor realizes that using this method to configure virtual network cards for container groups requires manual screening, resulting in low configuration efficiency. And when the container group needs to load multiple virtual network cards, it takes a lot of configuration time, resulting in high time costs, which in turn affects the loading efficiency of virtual network card resources.
  • the present application provides a virtual network card resource configuration method, device, computer equipment and media.
  • a method for configuring virtual network card resources comprising:
  • a device for configuring virtual network card resources comprising:
  • the acquisition unit is used to integrate multiple virtual network cards in the node where the container group is located, to obtain a virtual network card set including multiple virtual network card groups;
  • An allocation unit configured to allocate a target virtual network adapter group to the container group from the virtual network adapter set
  • the parsing unit is configured to parse the target virtual network card group to obtain address information of the target virtual network card in the target virtual network card group;
  • the configuration unit is used to configure the virtual network card resource for the container group according to the address information.
  • a computer device including a memory and one or more processors, the memory and the processor are connected to each other in communication, and computer-readable instructions are stored in the memory, and one or more processors execute the computer-readable instructions to perform the above-mentioned Steps in a method for configuring virtual network card resources of any item.
  • a non-transitory computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are used to make a computer execute the steps of any one of the methods for configuring virtual network card resources.
  • Fig. 1 is a flowchart of a method for configuring virtual network card resources according to one or more embodiments.
  • Fig. 2 is a flowchart of a method for obtaining a virtual network card set according to one or more embodiments.
  • Fig. 3 is a schematic diagram of a process of integrating virtual network card groups according to one or more embodiments.
  • Fig. 4 is a flowchart of a method for configuring virtual network card resources according to another or more embodiments.
  • Fig. 5 is a flowchart of a method for configuring virtual network card resources according to yet another one or more embodiments.
  • Fig. 6 is a structural block diagram of an apparatus for configuring virtual network card resources according to one or more embodiments.
  • Fig. 7 is a schematic diagram of a hardware structure of a computer device according to one or more embodiments.
  • FIG. 8 is a schematic structural diagram of a non-transitory computer readable storage medium according to one or more embodiments.
  • the virtual network card resources loaded by the container group are selected in advance from the multiple virtual network cards in the node where the container group is located, and manually compared and screened one by one to determine the virtual network card to be allocated to the container group, and then configure it in the container group for container groups to load.
  • the configuration efficiency of the virtual network card is low.
  • an embodiment of the present application provides a method for configuring virtual network card resources, which is used in computer equipment.
  • the execution subject may be a device for configuring virtual network card resources.
  • a combination of software and hardware can be implemented as part or all of computer equipment, wherein the computer equipment can be a terminal or a client or a server, and the server can be a single server or a server cluster composed of multiple servers.
  • the terminals in the embodiments may be smart phones, personal computers, tablet computers, wearable devices, intelligent robots and other intelligent hardware devices.
  • the execution subject is a computer device as an example for illustration.
  • the computer device in this embodiment is one of the nodes (host) in the deployment kubernetes cluster, and includes at least one physical network card in the computer device, so as to provide a network environment for each container group in the kubernetes cluster.
  • the physical network card can be a single root virtualization (Single Root I/O Virtualization, sriov) network card, and then multiple lightweight PCI-e (peripheral component interconnect express, external device interconnection bus) can be virtualized through the physical network card Interface) protocol physical device, get multiple virtual NICs.
  • the method for configuring virtual network card resources provided in this application is applicable to a usage scenario where a container group loads multiple virtual network card resources.
  • multiple virtual network cards in the node where the container group is located can be integrated in advance to obtain a virtual network card set including multiple virtual network card groups, and then when configuring virtual network card resources for the container group , can assign target virtual network cards to container groups on a group basis, so that container groups can quickly obtain virtual network card resources, improve configuration efficiency, and help avoid or reduce manual intervention, thereby making the configuration process of virtual network card resources more convenient. intelligent.
  • Fig. 1 is a flowchart of a method for configuring virtual network card resources according to one or more embodiments. As shown in FIG. 1 , the method for configuring virtual network card resources includes the following steps S101 to S104.
  • step S101 multiple virtual network adapters in the node where the container group is located are integrated to obtain a virtual network adapter set including multiple virtual network adapter groups.
  • the node where the container group is located includes multiple virtual network cards.
  • multiple virtual network cards are integrated and processed in the form of groups. Together, multiple virtual network card groups are obtained, and then when virtual resource configuration is performed, virtual network cards can be quickly configured in the form of groups, and then multiple virtual network cards can be quickly allocated to container groups, thereby shortening configuration time and improving configuration. purpose of efficiency.
  • some virtual network cards in the virtual network card group correspond to the same physical network card in the node.
  • each virtual network card in the virtual network card group corresponds to a different physical network card in the node, and then when configuring the virtual network card resources, the resources of each physical network card can be fully and balancedly utilized.
  • step S102 a target virtual network adapter group is assigned to the container group from the virtual network adapter set.
  • the target virtual network card group may be any virtual network card group to be configured in the virtual network card set, so as to avoid sending multiple container groups sharing the same target virtual network card group.
  • a target virtual network adapter group may be assigned to the container group according to the virtual network adapter resource requirements of the container group.
  • the virtual network card resource requirements of the container group can be written into the container group's preset configuration file (a configuration file in yaml format), so that when applying for virtual network card resources from the Kubernetes cluster to build a container group, Able to specify the target virtual NIC group required by the container group.
  • the configured number of virtual network card groups is 1 by default.
  • the identification of each virtual network adapter group can be created and stored, so that the Kubernetes cluster can determine the target to be allocated through the identification Virtual NIC group.
  • the name of the virtual network card set is represented by sriov_netdevice, and each virtual container group is replaced by Arabic numerals.
  • the identifiers 0, 1, 2, and 3 represent four different virtual container groups.
  • step S103 the target virtual network card group is analyzed to obtain address information of the target virtual network card in the target virtual network card group.
  • each target virtual network card when allocating virtual network card resources, each target virtual network card is allocated to the container group in the form of a target virtual network card group. Therefore, in order to clarify the address information of each target virtual network card, the target virtual network card group is analyzed, so that when configuring the virtual network card resources of each target virtual network card for the container group, the address information of the target virtual network card can be used for targeted configuration.
  • step S104 configure virtual network card resources for the container group according to the address information.
  • each target virtual network card according to the address information of each target virtual network card, the location of each target virtual network card is specified, and then when configuring virtual network card resources for a container group, targeted configuration can be performed, thereby improving configuration efficiency and accuracy.
  • multiple virtual network adapters in the node where the container group is located can be integrated in advance to obtain a virtual network adapter set including multiple virtual network adapter groups, and then when configuring virtual network adapter resources for the container group, it is possible to use the group as a unit as a container
  • the group assigns the target virtual network card, so that the container group can quickly obtain virtual network card resources, improve configuration efficiency, and help avoid or reduce manual intervention, so that the configuration process of virtual network card resources is more convenient and intelligent.
  • Fig. 2 is a flowchart of a method for obtaining a virtual network card set according to one or more embodiments. As shown in FIG. 2 , the method for obtaining a virtual network card set includes the following steps.
  • step S201 based on the physical network card in the node where the container group is located, determine the physical network card information included in the node where the container group is located.
  • the virtual network card resource is obtained by virtualizing the physical network card. Therefore, in order to make reasonable use of the resources of each physical network card, the physical network card information included in the current node is determined, so as to pass The physical network card information specifies the number of physical network cards included in the node.
  • step S202 each physical network card included in the physical network card information is virtualized to obtain a plurality of virtual network cards corresponding to each physical network card.
  • each physical network card included in the physical network card information is virtualized Process to obtain multiple virtual network cards corresponding to each physical network card, so that each container group in the node can obtain sufficient virtual network card resources.
  • the number of virtual network cards corresponding to each physical network card is the same.
  • step S203 the virtual network cards are integrated to obtain a virtual network card set including a plurality of virtual network card groups.
  • each virtual network card group includes multiple virtual network cards, and different virtual network cards correspond to different physical network cards.
  • the virtual network cards in the virtual network card group are integrated according to different physical network cards, and then when the virtual network card groups are allocated, network card resources of each physical network card can be fully utilized.
  • the physical network cards corresponding to the virtual network cards are integrated, and then when the virtual network card groups are allocated, network card resources of each physical network card can be fully utilized.
  • each virtual network card in the same virtual network card group corresponds to a different physical network card respectively, in order to avoid being unable to distinguish the physical network card corresponding to each virtual network card when integrating the virtual network card group, thereby causing repeated selection of the same physical network card corresponding to
  • the source of virtual network cards in the process of integrating virtual network cards, by establishing the corresponding relationship between network segments and virtual network cards, the source of virtual network cards can be clarified, thereby improving the integration accuracy of virtual network card groups, so that network card resources can be used reasonably in the future.
  • the physical network card information includes the number of physical network cards in the node, and then the number of network cards can be specified through the physical network card information.
  • the number of NICs determine the same number of network segments as the number of physical NICs. That is, the number of network segments is the same as the number of physical network cards, and when establishing a correspondence between virtual network cards and network segments, physical network cards corresponding to virtual network cards can be distinguished through network segments.
  • the network segments of the multiple virtual network cards corresponding to the same physical network card are the same.
  • virtual network cards with different network segments are integrated into the same virtual network card group to obtain a virtual network card set including multiple virtual network card groups.
  • the integration process of the virtual network card group may be as shown in FIG. 3 .
  • Fig. 3 is a schematic diagram of a process of integrating virtual network card groups according to one or more embodiments.
  • the physical network card is represented by pf and the virtual network card is represented by vf below.
  • the network segment allocated to physical network card 1 (pf1) is represented by net1
  • the network segment allocated to physical network card 2 (pf2) is represented by net2.
  • the virtual graphics card obtained by pf1 after virtualization processing is represented by pf1-n, n ⁇ 1
  • the virtual graphics card obtained by pf2 after virtualization processing is represented by pf2-n, n ⁇ 1.
  • two network segments are divided to establish a corresponding relationship with the vfs corresponding to each pf. For example: establish a corresponding relationship between net1 (12.0.0.0/24) and each vf in pf1, and establish a corresponding relationship between net2 (13.0.0.0/24) and each vf in pf2.
  • the corresponding relationship can be as follows: pf1: ⁇ vf1-1,vf1-2,...,vf1-n ⁇ --12.0.0.0/24(net1), pf2: ⁇ vf1-1,vf1-2,...,vf1-n ⁇ --13.0.0.0/24(net2).
  • each virtual network card to obtain a virtual network card set including multiple virtual network card groups: [vf1-1@net1/vf2-1@net2,vf1-2@net1/vf2-2@net2,...,vf1-n @net1/vf2-n@net2].
  • vf1-1@net1/vf2-1@net2, vf1-2@net1/vf2-2@net2...vf1-n@net1/vf2-n@net2 respectively represent each virtual network card group.
  • each target virtual network card in the target virtual network card group has a corresponding relationship with the network segment, and then in order to quickly locate each target virtual network card, the target virtual network card group assigned to the container group is analyzed and determined Multiple target virtual network cards included in the target virtual network card group, and then according to the corresponding relationship between virtual network cards and network segments, determine the target network segment corresponding to each target virtual network card, so that according to each target virtual network card and each target virtual network card The target network segment, and obtain the address information of each target virtual network card in the target virtual network card group.
  • vf1-1@net1/vf2-1@net2 take vf1-1@net1/vf2-1@net2 as the target virtual network card group as an example, when parsing the target virtual network card group, divide vf1-1@net1/vf2-1@net2 with "/", Get the target virtual network card vf1-1@net1 and target virtual network card vf2-1@net2, and then use "@" to specify the target network segment corresponding to each target virtual network card, so as to get vf1-1 according to vf1-1@net1 and @net1 Address information, get the address information of vf1-2 according to vf2-1@net2 and @net2.
  • the network proxy configuration of each target virtual network card can be constructed respectively according to the address information, so that through the network proxy configuration, for the container Group configuration of virtual network card resources, so as to realize the rapid configuration of virtual network card resources.
  • the target virtual network card group can be resolved through the multi-container network interface (multus-Container Network Interface, multus-cni) component in the node, and then through the sriov-cni plug-in, according to the address information of the target virtual network card , configure virtual network card resources for the container group at the bottom layer of the node.
  • a method for configuring virtual network card resources may be as shown in FIG. 4 .
  • Fig. 4 is a flowchart of a method for configuring virtual network card resources according to another or more embodiments.
  • the multiple physical network cards included in the node are integrated, and each physical network card is virtualized to obtain multiple virtual network cards, and the physical network cards are corresponding to them
  • Multiple virtual NICs are bound and reported to the kubelet (the node agent used to run the kubernetes cluster on the node), and according to the virtual network card resource requirements in the container group's preset configuration file, the target virtual network card group is assigned to the container group.
  • calico is a network plug-in, which is used to provide multi-host communication for the virtual machine and container group where the virtual network card is located. Wherea bouts are used to track network source code.
  • any configuration method of virtual network card resources provided by this application can be applied to deep learning training in a kubernetes cluster, using Remote Direct Memory Access (rdma ) technology for remote direct memory access or data interaction scenarios.
  • rdma Remote Direct Memory Access
  • a method for configuring virtual network card resources may be as shown in FIG. 5 .
  • Fig. 5 is a flowchart of a method for configuring virtual network card resources according to yet another one or more embodiments.
  • step S501 each physical network card in the node is virtualized to obtain multiple virtual network cards.
  • each physical network card has the same number of virtual network cards obtained through virtualization processing.
  • each node is traversed, the physical network card information of each node is determined, and the number of physical network cards included in each node is specified. For example, there are two physical network cards pf1 and pf2 on the node.
  • step S502 network segments are divided for multiple virtual network cards.
  • a plurality of network segments with the same number as the network card are determined, and then when establishing the corresponding relationship between the virtual network card and the network segment, the multiple network segments divided by the same physical network card Establish a corresponding relationship between the virtual network card and the same network segment. That is, the network segments of multiple virtual network cards corresponding to the same physical network card are the same, and the network segments of multiple virtual network cards corresponding to different physical network cards are different, so that virtual network cards can be configured for container groups through network segments later.
  • step S503 the virtual network cards are integrated to obtain a virtual network card set including a plurality of virtual network card groups.
  • the integrated virtual network adapter set is registered in the kubernetes cluster, and the resource name of the virtual network adapter set ( For example: set to sriov_netdevice), each virtual container group is identified by Arabic numerals, and then there are multiple virtual network card group resources in the kubernetes cluster.
  • step S504 a target virtual network adapter group is assigned to the container group from the virtual network adapter set.
  • a container group in the kubernetes cluster to apply for virtual network card resource requirements (for example: to apply for network card driver device (sriov_netdevice) resources)
  • select a virtual network card group from the sriov_netdevice that has been registered in the Kubernetes cluster as the target virtual network card
  • the NIC group is assigned, for example: vf1-1@net1/vf2-1@net2 is used as the target virtual NIC group.
  • step S505 the virtual network card resource is configured for the container group by analyzing the target virtual network card group.
  • the container group nccl environment variable can be constructed so that nccl can configure the communication environment of multiple graphics processing units (graphics processing unit, GPU) through multiple target virtual network cards.
  • nccl is the abbreviation of Nvidia Nvidia's Multi-GPU multi-card communication framework (Nvidia Collective multi-GPU Communication Library).
  • the number of GPU communication environments constructed is the same as the number of target virtual network cards, thereby helping to increase the communication efficiency of the GPU, thereby helping to accelerate deep learning training.
  • the virtual network card resources of multiple physical network cards are integrated and managed, and the target virtual network card for deep learning training can be bound to the environment variable of the container group, and then in the multi-cni component Analyze the target virtual network card group, and configure multiple target virtual network cards into the container one by one, which helps to increase the abstraction of business logic, achieve the effect of high cohesion and low coupling, and also helps to reduce the configuration of each in the kubernetes cluster. Redundant operation of container group vNIC resources.
  • the present application also provides a device for configuring virtual network card resources.
  • Fig. 6 is a structural block diagram of an apparatus for configuring virtual network card resources according to one or more embodiments.
  • the device for configuring virtual network card resources includes an acquisition unit 601 , an allocation unit 602 , an analysis unit 603 and a configuration unit 604 .
  • the obtaining unit 601 is configured to integrate multiple virtual network cards in the node where the container group is located, to obtain a virtual network card set including multiple virtual network card groups;
  • An allocating unit 602 configured to allocate a target virtual network card group to the container group from the virtual network card set;
  • the parsing unit 603 is configured to parse the target virtual network card group to obtain address information of the target virtual network card in the target virtual network card group;
  • the configuration unit 604 is configured to configure virtual network card resources for the container group according to the address information.
  • the obtaining unit 601 includes: a determining unit configured to determine, based on the physical network card on the node where the container group resides, the physical network card information included in the node where the container group resides.
  • the virtualization processing unit is configured to perform virtualization processing on each physical network card included in the physical network card information to obtain multiple virtual network cards corresponding to each physical network card.
  • the integration unit is configured to integrate the virtual network cards to obtain a virtual network card set including multiple virtual network card groups. Wherein, each virtual network card group includes multiple virtual network cards, and different virtual network cards correspond to different physical network cards.
  • the physical network card information includes the number of physical network cards
  • the integration unit includes: a network segment determining unit, configured to determine the same number of network segments as the number of physical network cards according to the number of network cards.
  • the creation unit is used to establish a corresponding relationship between virtual network cards and network segments, wherein the network segments of multiple virtual network cards corresponding to the same physical network card are the same.
  • the integration subunit is used to integrate virtual network cards with different network segments into the same virtual network card group to obtain a virtual network card set including multiple virtual network card groups.
  • the target virtual network card group includes a plurality of target virtual network cards
  • the parsing unit includes: a first parsing unit, configured to parse the target virtual network card group, and determine the multiple target virtual network card groups included in the target virtual network card group virtual network card.
  • the second parsing unit is configured to determine the target network segment corresponding to each target virtual network card according to the corresponding relationship between the virtual network card and the network segment.
  • the address information obtaining unit is configured to obtain the address information of each target virtual network card in the target virtual network card group according to each target virtual network card and the target network segment corresponding to each target virtual network card.
  • the configuration unit 604 includes: a construction unit configured to respectively construct the network proxy configuration of each target virtual network card according to the address information.
  • the configuration subunit is used to configure virtual network card resources for container groups through network proxy configuration.
  • the device further includes: a marking unit, configured to create and store the identifiers of each virtual network adapter group, so as to determine the target virtual network adapter group to be allocated through the identifiers.
  • the allocating unit 602 includes: a requirement determining unit, configured to determine the virtual network card resource requirement of the container group according to the preset configuration file of the container group.
  • the allocation subunit is used to assign a target virtual network adapter group to the container group from the virtual network adapter set according to the resource requirements of the virtual network adapter.
  • Each of the above-mentioned modules can be fully or partially realized by software, hardware and a combination thereof.
  • the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
  • Fig. 7 is a schematic diagram of a hardware structure of a computer device according to one or more embodiments.
  • the device includes one or more processors 710 and a memory 720 , and the memory 720 includes a persistent memory, a volatile memory, and a hard disk.
  • one processor 710 is taken as an example.
  • the device may also include: an input device 730 and an output device 740 .
  • the processor 710, the memory 720, the input device 730, and the output device 740 may be connected via a bus or in other ways, and connection via a bus is taken as an example in FIG. 7 .
  • the processor 710 may be a central processing unit (Central Processing Unit, CPU).
  • the processor 710 can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate array (Field-Programmable Gate Array, FPGA) or Other chips such as programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above-mentioned types of chips.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the memory 720 is a non-transitory computer-readable storage medium, including persistent memory, volatile memory and hard disk, and can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the The program instruction/module corresponding to the business management method.
  • the processor 710 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 720, that is, implements any one of the above virtual network card resource configuration methods.
  • the memory 720 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required by at least one function;
  • the memory 720 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices.
  • the memory 720 may optionally include a memory that is remotely located relative to the processor 710, and these remote memories may be connected to the data processing device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 730 can receive input numbers or character information, and generate key signal input related to user settings and function control.
  • the output device 740 may include a display device such as a display screen.
  • One or more modules are stored in the memory 720, and when executed by one or more processors 710, the methods shown in FIGS. 1-4 are performed.
  • FIG. 8 is a schematic structural diagram of a non-transitory computer-readable storage medium according to one or more embodiments.
  • the computer-readable storage medium 80 stores computer-readable instructions 81 , and when the computer-readable instructions 81 are executed by one or more processors, the method in any one or more method embodiments above can be executed.
  • the storage medium can be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive) , abbreviation: HDD) or solid-state drive (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memory.
  • Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM random access memory
  • RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

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

Abstract

本申请提供一种虚拟网卡资源的配置方法,包括:整合容器组所在节点中的多个虚拟网卡,得到包括多个虚拟网卡组的虚拟网卡集。从虚拟网卡集中为容器组分配目标虚拟网卡组。解析目标虚拟网卡组,得到目标虚拟网卡组中目标虚拟网卡的地址信息。根据地址信息,为容器组配置虚拟网卡资源。

Description

虚拟网卡资源的配置方法、装置、计算机设备及介质
相关申请的交叉引用
本申请要求于2022年02月28日提交中国专利局,申请号为202210183411.3,申请名称为“虚拟网卡资源的配置方法、装置、计算机设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种虚拟网卡资源的配置方法、装置、计算机设备及介质。
背景技术
随着容器技术在企业生产中逐步落地,用户对容器云的网络特性的要求也越来越高。因此,kubernetes技术应运而生,实现了服务的抽象、解耦、高扩展、统一调度与集中化管理。其中,Kubernetes是一种开源的容器编排引擎,用来对容器化应用进行自动化部署、扩缩和管理;Pod是Kubernetes中可被调度的最小调度单元,可以理解为是包括至少一个容器的容器组。
在Kubernetes集群中,容器组可以基于加载的虚拟网卡与其他容器组进行通讯访问或者数据交互。相关技术中,容器组所加载的虚拟网卡资源是预先从容器组所在节点内的多个虚拟网卡中,通过人工逐一对比、筛选,确定待分配至容器组的虚拟网卡,进而将其配置于容器组,以便容器组进行加载。
发明人意识到,采用该种方式为容器组配置虚拟网卡,由于需要人工筛选,导致配置效率低。且当容器组需要加载多个虚拟网卡时,则需要消耗大量的配置时间,导致时间成本过高,进而影响虚拟网卡资源的加载效率。
发明内容
本申请根据本申请公开的各种实施例,提供一种虚拟网卡资源的配置方法、装置、计算机设备及介质。
一种虚拟网卡资源的配置方法,该方法包括:
整合容器组所在节点中的多个虚拟网卡,得到包括多个虚拟网卡组的虚拟网卡集;
从虚拟网卡集中为容器组分配目标虚拟网卡组;
解析目标虚拟网卡组,得到目标虚拟网卡组中目标虚拟网卡的地址信息;以及
根据地址信息,为容器组配置虚拟网卡资源。
一种虚拟网卡资源的配置装置,该装置包括:
获取单元,用于整合容器组所在节点中的多个虚拟网卡,得到包括多个虚拟网卡组的虚拟网卡集;
分配单元,用于从虚拟网卡集中为容器组分配目标虚拟网卡组;
解析单元,用于解析目标虚拟网卡组,得到目标虚拟网卡组中目标虚拟网卡的地址信息;以及
配置单元,用于根据地址信息,为容器组配置虚拟网卡资源。
一种计算机设备,包括存储器和一个或多个处理器,存储器和处理器之间互相通信连接,存储器中存储有计算机可读指令,一个或多个处理器通过执行计算机可读指令,从而执行上述任一项的虚拟网卡资源的配置方法的步骤。
一种非暂态计算机可读存储介质,非暂态计算机可读存储介质存储有计算机可读指令,计算机可读指令用于使计算机执行上述任一项的虚拟网卡资源的配置方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是根据一个或多个实施例的虚拟网卡资源的配置方法的流程图。
图2是根据一个或多个实施例的虚拟网卡集的获取方法的流程图。
图3是根据一个或多个实施例的整合虚拟网卡组的过程示意图。
图4是根据另一个或多个实施例的虚拟网卡资源的配置方法的流程图。
图5是根据又一个或多个实施例的虚拟网卡资源的配置方法的流程图。
图6是根据一个或多个实施例的虚拟网卡资源的配置装置的结构框图。
图7是根据一个或多个实施例的计算机设备的硬件结构示意图。
图8是根据一个或多个实施例的非暂态计算机可读存储介质的结构示意图。
具体实施方式
下面将结合附图对本申请的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
相关技术中,容器组所加载的虚拟网卡资源是预先从容器组所在节点内的多个虚拟网卡中,通过人工逐一对比、筛选,确定待分配至容器组的虚拟网卡,进而将其配置于容器组,以便容器组进行加载。但由于虚拟网卡是基于人工进行配置,进而导致虚拟网卡的配置效率较低。当容器组需要加载多个虚拟网卡时,若仍采用上述方式为容器组配置虚拟网卡资源,则需要消耗大量的配置时间,进而导致时间成本过高,影响虚拟网卡资源的加载效率。
为解决上述问题,本申请实施例中提供一种虚拟网卡资源的配置方法,用于计算机设备中,需要说明的是,其执行主体可以是虚拟网卡资源的配置装置,该装置可以通过软件、硬件或者软硬件结合的方式实现成为计算机设备的部分或者全部,其中,该计算机设备可以是终端或客户端或服务器,服务器可以是一台服务器,也可以为由多台服务器组成的服务器集群,本申请实施例中的终端可以是智能手机、个人电脑、平板电脑、可穿戴设备以及智能机器人等其他智能硬件设备。下述方法实施例中,均以执行主体是计算机设备为例来进行说明。
本实施例的计算机设备为部署kubernetes集群中的其中一个节点(宿主机),且在该计算机设备中包括至少一个物理网卡,以便为kubernetes集群中的各容器组提供网络环境。其中,物理网卡可以为单根虚拟化(Single Root I/O Virtualization,sriov)网卡,进而可以通过该物理网卡虚拟出来多个轻量化的使用PCI-e(peripheral component interconnect express,外部设备互连总线接口)协议的物理设备,得到多个虚拟网卡。
本申请所提供的虚拟网卡资源的配置方法适用于容器组加载多个虚拟网卡资源的使用场景。通过本申请所提供的虚拟网卡资源的配置方法,能够预先将容器组所在节点内的多个虚拟网卡进行整合,得到包括多个虚拟网卡组的虚拟网卡集,进而为容器组配置虚拟网卡资源时,能够以组为单位为容器组分配目标虚拟网卡,使容器组能够快速获取虚拟网卡资源,提高配置效率的同时,有助于避免或者减少人工干预,从而使虚拟网卡资源的配置过程更便捷、智能。
图1是根据一个或多个实施例的虚拟网卡资源的配置方法的流程图。如图1所示, 虚拟网卡资源的配置方法包括如下步骤S101至步骤S104。
在步骤S101中,整合容器组所在节点中的多个虚拟网卡,得到包括多个虚拟网卡组的虚拟网卡集。
在本申请实施例中,容器组所在节点中包括多个虚拟网卡,为便于分配虚拟网卡资源,提高分配效率,则将多个虚拟网卡进行整合处理,将多个虚拟网卡以组的形式整合在一起,得到多个虚拟网卡组,进而后续在进行虚拟资源配置时,便可以将虚拟网卡以组的形式进行快速配置,进而为容器组快速分配多个虚拟网卡,从而达到缩短配置时间,提高配置效率的目的。
在一个或多个实施例中,虚拟网卡组中的部分虚拟网卡对应于节点内同一物理网卡。在另一个或多个实施例中,虚拟网卡组中的各虚拟网卡分别对应于节点内的不同物理网卡,进而后续在配置虚拟网卡资源时,能够充分且均衡的利用各物理网卡资源。
在步骤S102中,从虚拟网卡集中为容器组分配目标虚拟网卡组。
在本申请实施例中,目标虚拟网卡组可以为虚拟网卡集中任意一个待配置的虚拟网卡组,进而避免多个容器组共用同一个目标虚拟网卡组的情况发送。
在一个或多个实施例中,可以根据容器组的虚拟网卡资源需求为其分配目标虚拟网卡组。在创建容器组的过程中,可以将容器组的虚拟网卡资源需求写入容器组的预置配置文件(一种yaml格式的配置文件)中,以便向Kubernetes集群申请虚拟网卡资源构建容器组时,能够明确容器组所需目标虚拟网卡组。在一个或多个实施例中,虚拟网卡组的配置数量默认为1。
在另一个或多个实施例中,为便于分配目标虚拟网卡组,可以在各虚拟网卡组整合完成后,创建并存储各虚拟网卡组的标识,以便Kubernetes集群通过所述标识确定待分配的目标虚拟网卡组。例如:将虚拟网卡集的名称采用sriov_netdevice进行表示,各虚拟容器组采用阿拉伯数字进行标识代替,例如:标识0、1、2、3分别表示4个不同的虚拟容器组。进而在构建容器组的预置配置文件时,在kubernetes集群中的虚拟网卡资源限制(spec-containers-resources)中配置“sriov_netdevice:1”即可,以便在创建容器组时,向Kubernetes集群申请将标识为1的虚拟网卡组作为该容器组的目标虚拟网卡组。
在步骤S103中,解析目标虚拟网卡组,得到目标虚拟网卡组中目标虚拟网卡的地址信息。
在本申请实施例中,由于在分配虚拟网卡资源时,是将各目标虚拟网卡以目标虚拟网卡组的形式分配至容器组。因此,为明确各目标虚拟网卡的地址信息,则将目标虚拟网卡组进行解析,以便在为容器组配置各目标虚拟网卡的虚拟网卡资源时,能够通过目 标虚拟网卡的地址信息进行针对性配置。
在步骤S104中,根据地址信息,为容器组配置虚拟网卡资源。
在本申请实施例中,根据各目标虚拟网卡的地址信息,明确各目标虚拟网卡的所在位置,进而为容器组配置虚拟网卡资源时,能够进行针对性配置,从而提高配置效率和准确率。
通过上述实施例,能够预先将容器组所在节点内的多个虚拟网卡进行整合,得到包括多个虚拟网卡组的虚拟网卡集,进而为容器组配置虚拟网卡资源时,能够以组为单位为容器组分配目标虚拟网卡,使容器组能够快速获取虚拟网卡资源,提高配置效率的同时,有助于避免或者减少人工干预,从而使虚拟网卡资源的配置过程更便捷、智能。
以下实施例将具体说明虚拟网卡集的获取过程。
图2是根据一个或多个实施例的虚拟网卡集的获取方法的流程图。如图2所示,虚拟网卡集的获取方法包括如下步骤。
在步骤S201中,基于容器组所在节点中的物理网卡,确定容器组所在节点中包括的物理网卡信息。
在本申请实施例中,虚拟网卡资源是通过将物理网卡进行虚拟化处理后得到的网卡资源,因此,为合理利用各物理网卡的资源,则确定当前节点中所包括的物理网卡信息,以便通过该物理网卡信息明确节点中包括的物理网卡数量。
在步骤S202中,对物理网卡信息中包括的每一个物理网卡进行虚拟化处理,得到每一个物理网卡对应的多个虚拟网卡。
在本申请实施例中,为充分利用各物理网卡所能提供的网卡资源,且容器组的数量在kubernetes集群中的数量不唯一,因此,对物理网卡信息中包括的每一个物理网卡进行虚拟化处理,得到每一个物理网卡对应的多个虚拟网卡,以便节点内的各容器组均能够得到足够的虚拟网卡资源。其中,各物理网卡对应的虚拟网卡数量相同。
在步骤S203中,将各虚拟网卡进行整合,得到包括多个虚拟网卡组的虚拟网卡集。
在本申请实施例中,每一虚拟网卡组中包括多个虚拟网卡,不同的虚拟网卡对应不同的物理网卡。将虚拟网卡组中的虚拟网卡根据不同的物理网卡进行整合,进而分配虚拟网卡组时,能够充分利用各物理网卡的网卡资源。
通过上述实施例,在整合虚拟网卡组时,是将各虚拟网卡对应的物理网卡进行整合,进而分配虚拟网卡组时,能够充分利用各物理网卡的网卡资源。
在一个或多个实施例中,同一虚拟网卡组中的各虚拟网卡分别对应于不同物理网卡,为避免在整合虚拟网卡组时无法区分各虚拟网卡对应物理网卡,进而导致重复选取同一 物理网卡对应的虚拟网卡的情况,则在整合虚拟网卡的过程中,通过建立网段与虚拟网卡之间的对应关系,明确虚拟网卡来源,进而提高虚拟网卡组的整合准确度,以便后续合理利用网卡资源。
具体的,物理网卡信息包括节点中物理网卡的网卡数量,进而通过物理网卡信息,能够明确网卡数量。根据网卡数量,确定与物理网卡数量相同数量的网段。即,网段数量与物理网卡的数量相同,进而建立虚拟网卡与网段之间的对应关系时,能够通过网段区分虚拟网卡对应的物理网卡。其中,同一物理网卡对应的多个虚拟网卡的网段相同。进而将网段不同的虚拟网卡整合至同一虚拟网卡组中,得到包括多个虚拟网卡组的虚拟网卡集。
在一个或多个实施场景中,虚拟网卡组的整合过程可以如图3所示。图3是根据一个或多个实施例的整合虚拟网卡组的过程示意图。为便于描述,以下将物理网卡采用pf表示,将虚拟网卡采用vf表示。将分配给物理网卡1(pf1)的网段采用net1表示,将分配给物理网卡2(pf2)的网段采用net2表示。pf1经过虚拟化处理后得到的虚拟显卡采用pf1-n表示,n≥1,pf2经过虚拟化处理后得到的虚拟显卡采用pf2-n表示,n≥1。
根据物理网卡信息,若确定节点中包括两个pf,则划分两个网段用于与各pf对应的vf建立对应关系。例如:将net1(12.0.0.0/24)与pf1中的各vf建立对应关系,将net2(13.0.0.0/24)与pf2中的各vf建立对应关系。对应关系可以如下:pf1:{vf1-1,vf1-2,…,vf1-n}--12.0.0.0/24(net1),pf2:{vf1-1,vf1-2,…,vf1-n}--13.0.0.0/24(net2)。进而将各虚拟网卡进行整合,得到包括多个虚拟网卡组的虚拟网卡集:[vf1-1@net1/vf2-1@net2,vf1-2@net1/vf2-2@net2,…,vf1-n@net1/vf2-n@net2]。其中,vf1-1@net1/vf2-1@net2、vf1-2@net1/vf2-2@net2…vf1-n@net1/vf2-n@net2分别表示各个虚拟网卡组。
在一个或多个实施例中,由于目标虚拟网卡组中各目标虚拟网卡与网段具有对应关系,进而为快速定位各目标虚拟网卡,则将分配至容器组的目标虚拟网卡组进行解析,确定目标虚拟网卡组中包括的多个目标虚拟网卡,进而根据虚拟网卡与网段之间的对应关系,确定每一个目标虚拟网卡对应的目标网段,从而根据各目标虚拟网卡以及各目标虚拟网卡对应的目标网段,得到目标虚拟网卡组中每一个目标虚拟网卡的地址信息。例如:以vf1-1@net1/vf2-1@net2为目标虚拟网卡组为例,在解析该目标虚拟网卡组时,将vf1-1@net1/vf2-1@net2以“/”分割打算,得到目标虚拟网卡vf1-1@net1和目标虚拟网卡vf2-1@net2,进而通过“@”明确各目标虚拟网卡对应的目标网段,从而根据vf1-1@net1和@net1得到vf1-1的地址信息,根据vf2-1@net2和@net2得到vf1-2的地址信息。
在另一个或多个实施例中,当确定地址信息后,在为容器组配置虚拟网卡资源时, 可以根据地址信息,分别构建各目标虚拟网卡的网络代理配置,以便通过网络代理配置,为容器组配置虚拟网卡资源,从而实现虚拟网卡资源的快速配置。在一个或多个实施场景中,可以通过节点中的多容器网络接口(multus-Container Network Interface,multus-cni)组件解析目标虚拟网卡组,进而通过sriov-cni插件,根据目标虚拟网卡的地址信息,在节点底层为容器组配置虚拟网卡资源。
在一个或多个实施场景中,虚拟网卡资源的配置方法可以如图4所示。图4是根据另一个或多个实施例的虚拟网卡资源的配置方法的流程图。
在网卡驱动程序(sriov-device-plugin,sriov-dp)组件中将节点中包括的多个物理网卡进行整合,并将各物理网卡进行虚拟化处理,得到多个虚拟网卡,将物理网卡与其对应的多个虚拟网卡进行绑定上报至kubelet(节点上用于运行kubernetes集群的节点代理)中,并根据容器组的预置配置文件中虚拟网卡资源需求,为容器组分配目标虚拟网卡组。通过multus-cni解析目标虚拟网卡组,确定各目标虚拟网卡,进而由sriov-cni根据目标虚拟网卡的地址信息,在节点底层为容器组配置虚拟网卡资源。其中,calico是一种网络插件,用于为虚拟网卡所在的虚拟机和容器组提供多主机间通信。Wherea bouts用于跟踪网络源码。
在另一个或多个实施场景中,本申请所提供的任意一种虚拟网卡资源的配置方法,可以适用于在kubernetes集群中进行深度学习训练,使用远程直接数据存取(Remote Direct Memory Access,rdma)技术进行远程直接访问内存或者数据交互的使用场景中。
在又一个或多个实施场景中,虚拟网卡资源的配置方法可以如图5所示。图5是根据又一个或多个实施例提出的虚拟网卡资源的配置方法的流程图。
在步骤S501中,将节点中的各物理网卡进行虚拟化处理,得到多个虚拟网卡。
在本申请实施例中,各物理网卡通过虚拟化处理得到的虚拟网卡数量相同。
在一个或多个实施例中,若在kubernetes集群中包括多个节点,则遍历各节点,确定各节点的物理网卡信息,明确各节点中包括的物理网卡数量。例如节点上有pf1,pf2两个物理网卡。
在步骤S502中,为多个虚拟网卡划分网段。
在本申请实施例中,根据节点中物理网卡的网卡数量,确定与该网卡数量相同的多个网段,进而建立虚拟网卡与网段之间的对应关系时,将同一物理网卡划分的多个虚拟网卡与同一网段建立对应关系。即,同一物理网卡对应的多个虚拟网卡的网段相同,不同物理网卡对应的多个虚拟网卡的网段不同,以便后续能够通过网段为容器组配置虚拟网卡。
在步骤S503中,将各虚拟网卡进行整合,得到包括多个虚拟网卡组的虚拟网卡集。
在本申请实施例中,为便于kubernetes集群能够识别该虚拟网卡集,进而为容器组分配目标容器组,则将整合后的虚拟网卡集注册至kubernetes集群中,并设置虚拟网卡集的资源名称(例如:设置为sriov_netdevice),各虚拟容器组采用阿拉伯数字进行标识代替,进而在kubernetes集群中便拥有多个虚拟网卡组资源。在构建容器组的预置配置文件时,在kubernetes集群中的虚拟网卡资源限制(spec-containers-resources)中配置“sriov_netdevice:1”即可,以便在创建容器组时,向Kubernetes集群申请将标识为1的虚拟网卡组作为该容器组的目标虚拟网卡组。
在步骤S504中,从虚拟网卡集中为容器组分配目标虚拟网卡组。
在本申请实施例中,若kubernetes集群中有容器组申请虚拟网卡资源需求(例如:申请网卡驱动设备(sriov_netdevice)资源),则从已经注册到Kubernetes集群中的sriov_netdevice选择一个虚拟网卡组作为目标虚拟网卡组进行分配,例如:将vf1-1@net1/vf2-1@net2作为目标虚拟网卡组。
在步骤S505中,通过解析目标虚拟网卡组,为容器组配置虚拟网卡资源。
在一个或多个实施场景中,可以通过构建容器组nccl环境变量,让nccl能够通过多个目标虚拟网卡配置多个图形处理器(graphics processing unit,GPU)的通讯环境。其中,nccl为Nvidia英伟达的Multi-GPU多卡通信框架(Nvidia Collective multi-GPU Communication Library)的简称。则在构建环境变量时,基于目标虚拟网卡进行构建。例如:环境变量如下:CONTAINER_NCCL_INFO=/etc/nccl.conf,其中nccl.conf文件中的内容格式为:NCCL_IB_HCA=vf1-1,vf2-1。在一个或多个实施例中,GPU通信环境的构建数量与目标虚拟网卡的数量相同,进而有助于增加GPU的通讯效率,从而有助于加速深度学习训练。
通过上述实施例,通过抽象化物理网卡,对多个物理网卡的虚拟网卡资源进行整合管理,能够将深度学习训练的目标虚拟网卡绑定到容器组的环境变量中,进而在multu-cni组件中对目标虚拟网卡组进行解析,逐一将多个目标虚拟网卡配置到容器中,从而有助于增加业务逻辑的抽象性,达到高内聚低耦合的效果,同时也有助于减轻配置kubernetes集群中各容器组虚拟网卡资源的冗余操作。
基于相同发明构思,本申请还提供一种虚拟网卡资源的配置装置。
图6是根据一个或多个实施例的虚拟网卡资源的配置装置的结构框图。如图6所示,虚拟网卡资源的配置装置包括获取单元601、分配单元602、解析单元603和配置单元604。
获取单元601,用于整合容器组所在节点中的多个虚拟网卡,得到包括多个虚拟网卡组的虚拟网卡集;
分配单元602,用于从虚拟网卡集中为容器组分配目标虚拟网卡组;
解析单元603,用于解析目标虚拟网卡组,得到目标虚拟网卡组中目标虚拟网卡的地址信息;以及
配置单元604,用于根据地址信息,为容器组配置虚拟网卡资源。
在一个或多个实施例中,获取单元601包括:确定单元,用于基于容器组所在节点中的物理网卡,确定容器组所在节点中包括的物理网卡信息。虚拟化处理单元,用于对所述物理网卡信息中包括的每一个物理网卡进行虚拟化处理,得到每一个物理网卡对应的多个虚拟网卡。整合单元,用于将各虚拟网卡进行整合,得到包括多个虚拟网卡组的虚拟网卡集。其中,每一虚拟网卡组中包括多个虚拟网卡,不同的虚拟网卡对应不同的物理网卡。
在另一个或多个实施例中,物理网卡信息包括物理网卡的网卡数量,整合单元包括:网段确定单元,用于根据网卡数量,确定与物理网卡数量相同数量的网段。创建单元,用于建立虚拟网卡与网段之间的对应关系,其中,同一物理网卡对应的多个虚拟网卡的网段相同。整合子单元,用于将网段不同的虚拟网卡整合至同一虚拟网卡组中,得到包括多个虚拟网卡组的虚拟网卡集。
在又一个或多个实施例中,目标虚拟网卡组中包括多个目标虚拟网卡,解析单元包括:第一解析单元,用于解析目标虚拟网卡组,确定目标虚拟网卡组中包括的多个目标虚拟网卡。第二解析单元,用于根据虚拟网卡与网段之间的对应关系,确定每一个目标虚拟网卡对应的目标网段。地址信息获取单元,用于根据各目标虚拟网卡以及各目标虚拟网卡对应的目标网段,得到目标虚拟网卡组中每一个目标虚拟网卡的地址信息。
在又一个或多个实施例中,配置单元604包括:构建单元,用于根据地址信息,分别构建各目标虚拟网卡的网络代理配置。配置子单元,用于通过网络代理配置,为容器组配置虚拟网卡资源。
在又一个或多个实施例中,该装置还包括:标记单元,用于创建并存储各虚拟网卡组的标识,以便通过标识确定待分配的目标虚拟网卡组。
在又一个或多个实施例中,分配单元602包括:需求确定单元,用于根据容器组的预置配置文件,确定容器组的虚拟网卡资源需求。分配子单元,用于根据虚拟网卡资源需求,从虚拟网卡集中为容器组分配目标虚拟网卡组。
上述虚拟网卡资源的配置装置的具体限定以及有益效果可以参见上文中对于虚拟网 卡资源的配置方法的限定,在此不再赘述。上述各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
图7是根据一个或多个实施例的计算机设备的硬件结构示意图。如图7所示,该设备包括一个或多个处理器710以及存储器720,存储器720包括持久内存、易失内存和硬盘,图7中以一个处理器710为例。该设备还可以包括:输入装置730和输出装置740。
处理器710、存储器720、输入装置730和输出装置740可以通过总线或者其他方式连接,图7中以通过总线连接为例。
处理器710可以为中央处理器(Central Processing Unit,CPU)。处理器710还可以为其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等芯片,或者上述各类芯片的组合。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器720作为一种非暂态计算机可读存储介质,包括持久内存、易失内存和硬盘,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的业务管理方法对应的程序指令/模块。处理器710通过运行存储在存储器720中的非暂态软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述任意一种虚拟网卡资源的配置方法。
存储器720可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据、需要使用的数据等。此外,存储器720可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器720可选包括相对于处理器710远程设置的存储器,这些远程存储器可以通过网络连接至数据处理装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置730可接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键信号输入。输出装置740可包括显示屏等显示设备。
一个或者多个模块存储在存储器720中,当被一个或者多个处理器710执行时,执行如图1-图4所示的方法。
上述产品可执行本申请任意一个或多个实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,具体可参见如图1-图4所示的实施例中的相关描述。
本申请实施例还提供了一种非暂态计算机可读存储介质,参考图8所示,图8为根据一个或多个实施例的非暂态计算机可读存储介质的结构示意图,非暂态计算机可读存储介质80存储有计算机可读指令81,该计算机可读指令81被一个或多个处理器执行时,可执行上述任意一个或多个方法实施例中的方法。
其中,存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)、随机存储记忆体(Random Access Memory,RAM)、快闪存储器(Flash Memory)、硬盘(Hard Disk Drive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;存储介质还可以包括上述种类的存储器的组合。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序计算机可读指令来指令相关的硬件来完成,所述的计算机程序计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机程序计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
显然,上述实施例仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本申请创造的保护范围之中。

Claims (20)

  1. 一种虚拟网卡资源的配置方法,其特征在于,所述方法包括:
    整合容器组所在节点中的多个虚拟网卡,得到包括多个虚拟网卡组的虚拟网卡集;
    从所述虚拟网卡集中为所述容器组分配目标虚拟网卡组;
    解析所述目标虚拟网卡组,得到所述目标虚拟网卡组中目标虚拟网卡的地址信息;以及
    根据所述地址信息,为所述容器组配置虚拟网卡资源。
  2. 根据权利要求1所述的方法,其特征在于,所述整合容器组所在节点中的多个虚拟网卡,得到包括多个虚拟网卡组的虚拟网卡集,包括:
    基于容器组所在节点中的物理网卡,确定所述容器组所在节点中包括的物理网卡信息;
    对所述物理网卡信息中包括的每一个物理网卡进行虚拟化处理,得到每一个物理网卡对应的多个虚拟网卡;以及
    将各所述虚拟网卡进行整合,得到包括多个虚拟网卡组的虚拟网卡集。
  3. 根据权利要求2所述的方法,其特征在于,每一虚拟网卡组中包括多个虚拟网卡。
  4. 根据权利要求3所述的方法,其特征在于,同一虚拟网卡组中的不同的虚拟网卡对应不同的物理网卡。
  5. 根据权利要求1所述的方法,其特征在于,所述目标虚拟网卡组为所述虚拟网卡集中任意一个待配置的虚拟网卡组。
  6. 根据权利要求2所述的方法,其特征在于,各所述物理网卡对应的虚拟网卡的数量相同。
  7. 根据权利要求2所述的方法,其特征在于,所述将各所述虚拟网卡进行整合,包括:将各虚拟网卡对应的物理网卡进行整合。
  8. 根据权利要求2所述的方法,其特征在于,所述物理网卡信息包括所述物理网卡的网卡数量,所述将各所述虚拟网卡进行整合,得到包括多个虚拟网卡组的虚拟网卡集,包括:
    根据所述网卡数量,确定与所述物理网卡数量相同数量的网段;
    建立虚拟网卡与网段之间的对应关系,其中,同一物理网卡对应的多个虚拟网卡的网段相同;以及
    将网段不同的虚拟网卡整合至同一虚拟网卡组中,得到包括多个虚拟网卡组的虚拟网卡集。
  9. 根据权利要求8所述的方法,其特征在于,所述目标虚拟网卡组中包括多个目标虚拟网卡,所述解析所述目标虚拟网卡组,得到所述目标虚拟网卡组中目标虚拟网卡的地址信息,包括:
    解析所述目标虚拟网卡组,确定所述目标虚拟网卡组中包括的多个目标虚拟网卡;
    根据虚拟网卡与网段之间的对应关系,确定每一个目标虚拟网卡对应的目标网段;以及
    根据各目标虚拟网卡以及各目标虚拟网卡对应的目标网段,得到所述目标虚拟网卡组中每一个目标虚拟网卡的地址信息。
  10. 根据权利要求1至9任一项所述的方法,其特征在于,所述根据所述地址信息,为所述容器组配置虚拟网卡资源,包括:
    根据所述地址信息,分别构建各所述目标虚拟网卡的网络代理配置;以及
    通过所述网络代理配置,为所述容器组配置虚拟网卡资源。
  11. 根据权利要求1至10任一项所述的方法,其特征在于,所述解析所述目标虚拟网卡组,包括:通过节点中的多容器网络接口组件解析目标虚拟网卡组。
  12. 根据权利要求1至11任一项所述的方法,其特征在于,所述方法还包括:
    创建并存储各所述虚拟网卡组的标识,以便通过所述标识确定待分配的目标虚拟网卡组。
  13. 根据权利要求12所述的方法,其特征在于,采用不同的数字作为不同的虚拟容器组的标识。
  14. 根据权利要求1至12任一项所述的方法,其特征在于,所述从所述虚拟网卡集中为所述容器组分配目标虚拟网卡组,包括:
    根据容器组的预置配置文件,确定所述容器组的虚拟网卡资源需求;以及
    根据所述虚拟网卡资源需求,从所述虚拟网卡集中为所述容器组分配目标虚拟网卡组。
  15. 根据权利要求1至14任一项所述的方法,其特征在于,所述方法用于在kubernetes集群中进行的深度学习训练。
  16. 根据权利要求1至15任一项所述的方法,其特征在于,所述方法还包括:
    构建容器组的环境变量,以使得所述环境变量为多个所述目标虚拟网卡配置多个图形处理器的通信环境。
  17. 根据权利要求16所述的方法,其特征在于,所述图形处理器的通信环境的构建数量与所述目标虚拟网卡的数量相同。
  18. 一种虚拟网卡资源的配置装置,其特征在于,所述装置包括:
    获取单元,用于整合容器组所在节点中的多个虚拟网卡,得到包括多个虚拟网卡组的虚拟网卡集;
    分配单元,用于从所述虚拟网卡集中为所述容器组分配目标虚拟网卡组;
    解析单元,用于解析所述目标虚拟网卡组,得到所述目标虚拟网卡组中目标虚拟网卡的地址信息;以及
    配置单元,用于根据所述地址信息,为所述容器组配置虚拟网卡资源。
  19. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行权利要求1-17中任一项所述的虚拟网卡资源的配置方法。
  20. 一个或多个存储有计算机可读指令的非暂态计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行权利要求1-17中任一项所述的虚拟网卡资源的配置方法。
PCT/CN2022/132148 2022-02-28 2022-11-16 虚拟网卡资源的配置方法、装置、计算机设备及介质 WO2023160033A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210183411.3A CN114244717B (zh) 2022-02-28 2022-02-28 虚拟网卡资源的配置方法、装置、计算机设备及介质
CN202210183411.3 2022-02-28

Publications (1)

Publication Number Publication Date
WO2023160033A1 true WO2023160033A1 (zh) 2023-08-31

Family

ID=80748207

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/132148 WO2023160033A1 (zh) 2022-02-28 2022-11-16 虚拟网卡资源的配置方法、装置、计算机设备及介质

Country Status (2)

Country Link
CN (1) CN114244717B (zh)
WO (1) WO2023160033A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117692322A (zh) * 2024-01-30 2024-03-12 苏州元脑智能科技有限公司 网卡配置方法、装置、电子设备及存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114244717B (zh) * 2022-02-28 2022-05-20 苏州浪潮智能科技有限公司 虚拟网卡资源的配置方法、装置、计算机设备及介质
CN114928490B (zh) * 2022-05-20 2023-08-15 国网江苏省电力有限公司 容器场景下的多端网络管控方法、装置、存储介质和电子设备
CN115102877B (zh) * 2022-05-23 2023-08-04 苏州浪潮智能科技有限公司 一种虚拟网卡网络检测方法、装置、设备及介质
CN115913937B (zh) * 2023-01-09 2023-05-23 苏州浪潮智能科技有限公司 一种容器多网卡网络配置方法、装置、设备及存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110093251A1 (en) * 2009-10-16 2011-04-21 Sun Microsystems, Inc. Virtualizing complex network topologies
CN104168135A (zh) * 2014-08-06 2014-11-26 中国船舶重工集团公司第七0九研究所 网卡资源池化管理方法及系统
CN104468311A (zh) * 2014-11-18 2015-03-25 浪潮(北京)电子信息产业有限公司 一种物理网卡虚拟成多个虚拟网卡的方法及系统
CN107678836A (zh) * 2017-10-12 2018-02-09 新华三大数据技术有限公司 集群的测试数据获取方法及装置
CN110138606A (zh) * 2019-05-06 2019-08-16 携程旅游信息技术(上海)有限公司 容器网络配置方法及系统
CN113535319A (zh) * 2020-04-09 2021-10-22 深圳致星科技有限公司 一种实现多rdma网卡虚拟化的方法、设备及存储介质
CN113746676A (zh) * 2021-09-01 2021-12-03 京东科技信息技术有限公司 基于容器集群的网卡管理方法、装置、设备、介质及产品
CN114244717A (zh) * 2022-02-28 2022-03-25 苏州浪潮智能科技有限公司 虚拟网卡资源的配置方法、装置、计算机设备及介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430110A (zh) * 2015-10-30 2016-03-23 浪潮(北京)电子信息产业有限公司 一种虚拟网络系统的容器配置方法及网络传输装置
CN106060122B (zh) * 2016-05-20 2019-03-05 北京奇虎科技有限公司 Docker容器上传/下载特性的控制方法及装置
CN107666446B (zh) * 2017-09-14 2020-06-05 北京京东尚科信息技术有限公司 下行流量、上行流量、双向流量限制方法和装置
CN109587281B (zh) * 2017-09-29 2020-07-28 华为技术有限公司 容器配置方法和计算节点
CN112925581A (zh) * 2021-02-22 2021-06-08 百果园技术(新加坡)有限公司 Dpdk容器的启动方法、装置及电子设备

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110093251A1 (en) * 2009-10-16 2011-04-21 Sun Microsystems, Inc. Virtualizing complex network topologies
CN104168135A (zh) * 2014-08-06 2014-11-26 中国船舶重工集团公司第七0九研究所 网卡资源池化管理方法及系统
CN104468311A (zh) * 2014-11-18 2015-03-25 浪潮(北京)电子信息产业有限公司 一种物理网卡虚拟成多个虚拟网卡的方法及系统
CN107678836A (zh) * 2017-10-12 2018-02-09 新华三大数据技术有限公司 集群的测试数据获取方法及装置
CN110138606A (zh) * 2019-05-06 2019-08-16 携程旅游信息技术(上海)有限公司 容器网络配置方法及系统
CN113535319A (zh) * 2020-04-09 2021-10-22 深圳致星科技有限公司 一种实现多rdma网卡虚拟化的方法、设备及存储介质
CN113746676A (zh) * 2021-09-01 2021-12-03 京东科技信息技术有限公司 基于容器集群的网卡管理方法、装置、设备、介质及产品
CN114244717A (zh) * 2022-02-28 2022-03-25 苏州浪潮智能科技有限公司 虚拟网卡资源的配置方法、装置、计算机设备及介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZTE,: "" Generic NRM for virtual network"", 3GPP TSG SA WG5 (TELECOM MANAGEMENT) MEETING #101 S5-153129, 15 May 2015 (2015-05-15) *
陈勇 等 (CHEN, YONG ET AL.): "虚拟多网卡应用技术 (Application Technique of Virtual Multiple Network Card)", 计算机与数字工程 (COMPUTER & DIGITAL ENGINEERING), no. 05, 20 October 2002 (2002-10-20) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117692322A (zh) * 2024-01-30 2024-03-12 苏州元脑智能科技有限公司 网卡配置方法、装置、电子设备及存储介质
CN117692322B (zh) * 2024-01-30 2024-04-23 苏州元脑智能科技有限公司 网卡配置方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN114244717B (zh) 2022-05-20
CN114244717A (zh) 2022-03-25

Similar Documents

Publication Publication Date Title
WO2023160033A1 (zh) 虚拟网卡资源的配置方法、装置、计算机设备及介质
CN107566541B (zh) 容器网络资源分配方法、系统、存储介质和电子设备
US10871995B2 (en) Managed container instances
US9990232B2 (en) Quality of service tagging for computing jobs
US11044230B2 (en) Dynamically opening ports for trusted application processes hosted in containers
US10324754B2 (en) Managing virtual machine patterns
US10594800B2 (en) Platform runtime abstraction
US11086685B1 (en) Deployment of virtual computing resources with repeatable configuration as a resource set
WO2012039053A1 (ja) 計算機システムの運用管理方法、計算機システム及びプログラムを記憶する計算機読み取り可能な媒体
US11599397B2 (en) Collaboration service to support cross-process coordination between active instances of a microservice
CN111984269A (zh) 提供应用构建服务的方法及应用构建平台
US10341181B2 (en) Method and apparatus to allow dynamic changes of a replica network configuration in distributed systems
CN111984270A (zh) 应用部署方法和系统
US10203976B2 (en) Virtual appliance management in a virtualized computing environment based on operational modes associated with virtual appliance
CN114531477B (zh) 功能组件的配置方法、装置、计算机设备和存储介质
US11249885B2 (en) Test case generator and user interface
US20200326931A1 (en) Federated Framework for Container Management
US20240070123A1 (en) Using Machine Learning to Provide a Single User Interface for Streamlined Deployment and Management of Multiple Types of Databases
CN113535087A (zh) 数据迁移过程中的数据处理方法、服务器及存储系统
JP2024501005A (ja) コンテナクラスタのための管理方法および装置
US10884774B2 (en) Virtual node deployments of cluster-based applications modified to exchange reference to file systems
US20230114321A1 (en) Cloud Data Ingestion System
WO2021232860A1 (zh) 通信方法、装置及系统
Mangwani et al. Evaluation of a Multitenant SaaS Using Monolithic and Microservice Architectures
KR101952651B1 (ko) 분산 컴퓨팅 환경을 위한 고유 식별자 생성 방법 및 그 장치

Legal Events

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

Ref document number: 22928294

Country of ref document: EP

Kind code of ref document: A1