Resource allocation method and computing device
By receiving creation requests at the management node, identifying target nodes, and allocating virtual network interface cards (VFs) with RDMA functionality to container groups, the problem of low efficiency in virtual network interface card allocation in large data centers is solved, achieving efficient communication and data transmission.
Patent Information
- Application Number
- CN202510873857.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-11-18
AI Technical Summary
In large data centers, the large number of physical network interface cards (NICs) leads to a large workload, low efficiency, high difficulty, and low efficiency in the allocation of virtual NICs.
The management node receives creation requests, determines target nodes, creates container groups on target nodes, and automatically allocates virtual network interface cards (VFs) with RDMA functionality to container groups. By combining RDMA and SR-IOV technologies, the allocation process is optimized.
It improves the allocation efficiency of virtual network cards, enhances the communication efficiency of nodes in the computer cluster, ensures low data transmission latency and high bandwidth, and achieves high data transmission efficiency between container groups.
Smart Images

Figure CN120973509A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computing device technology, and in particular to a resource allocation method and a computing device. Background Technology
[0002] Single Root I / O Virtualization (SR-IOV) technology supports the virtualization of a physical network interface card (PF) into multiple virtual network interfaces (VFs), and supports the allocation of virtual network interfaces to virtual machines or containers.
[0003] In large data centers, there are a large number of physical network interface cards (NICs), and a large number of virtual NICs corresponding to physical NICs. This results in a large workload and difficulty in allocating virtual NICs, leading to low allocation efficiency. Summary of the Invention
[0004] This application provides a resource allocation method and a computing device to solve the technical problem of low allocation efficiency.
[0005] In a first aspect, embodiments of this application provide a resource allocation method applied to a management node of a computer cluster, the method comprising:
[0006] Receive a creation request, the creation request being used to request the creation of a container group and allocate a virtual network interface (VF) with remote direct memory access (RDMA) functionality to the container group;
[0007] Based on the creation request, a target node is identified in the computer cluster, the target node including an available VF with RDMA capability;
[0008] The container group is created through the target node;
[0009] The target node allocates a VF with RDMA functionality to the container group.
[0010] In the above scheme, the management node can receive creation requests, determine the target node based on the creation request, create container groups through the target node, and allocate RDMA-enabled VFs to the container groups through the target node. This scheme achieves the goal of automatically allocating RDMA-enabled VFs to container groups, improving allocation efficiency. Furthermore, the above method combines RDMA and SR-IOV technologies, resulting in high communication efficiency among nodes in the computer cluster.
[0011] In one possible implementation, the creation request includes a first quantity, which is the number of RDMA-enabled VFs requested to be allocated to the container group; determining the target node in the computer cluster based on the creation request includes:
[0012] Obtain the number of available Virtual Functions (VFs) with RDMA functionality in each node of the computer cluster;
[0013] Based on the number of available Virtual Functions with RDMA functionality in each node, candidate nodes are determined in the computer cluster, wherein the number of available Virtual Functions with RDMA functionality in the candidate nodes is greater than or equal to the first number.
[0014] The target node is determined from the total number of candidate nodes.
[0015] In the above scheme, candidate nodes can be determined in the computer cluster, and target nodes can be determined from the candidate nodes, thus achieving the purpose of determining the target node.
[0016] In one possible implementation, determining the target node from the candidate nodes based on the total number of candidate nodes includes:
[0017] If the total number of candidate nodes is one, the candidate node is determined as the target node;
[0018] If the total number of candidate nodes is greater than one, obtain the load of each candidate node and determine the candidate node with the smallest load as the target node.
[0019] In the above scheme, the target node can be determined based on the number of candidate nodes, thus achieving the purpose of determining the target node.
[0020] In one possible implementation, obtaining the number of available Virtual Functions (VFs) with RDMA functionality in each node of the computer cluster includes:
[0021] For any node in a computer cluster, obtain the number of available Virtual Functions (VFs) with RDMA functionality on that node.
[0022] The above scheme achieves the goal of obtaining the number of available VFs with RDMA functionality in each node.
[0023] In one possible implementation, allocating a VF with RDMA functionality to the container group through the target node includes:
[0024] The target node allocates a first number of available VFs to the container group;
[0025] The RDMA function of the first number of available VFs is enabled through the target node.
[0026] The above scheme achieves the goal of allocating VFs with RDMA functionality to container groups.
[0027] In one possible implementation, for any node in the computer cluster, the method further includes:
[0028] The node is used to determine the first physical network interface card (NIC) in the node that has single root input / output virtualization (SR-IOV) function, and the physical NIC with SR-IOV function corresponds to at least one VF.
[0029] The second physical network interface card with RDMA functionality in the node is determined through the node;
[0030] The third physical network interface card (NIC) in the node is determined by the node. The third physical NIC belongs to the first physical NIC and the second physical NIC.
[0031] The above scheme achieves the goal of identifying physical network cards with SR-IOV and RDMA functions in a node.
[0032] In one possible implementation, the node includes at least one first physical network interface card (NIC), and for any one of the first physical NICs, the method further includes:
[0033] The number of available Virtual Functions (VFs) and the number of unavailable VFs corresponding to the first physical network card are determined by the node.
[0034] The above scheme achieves the goal of determining the number of available Virtual Functions (VFs) and the number of unavailable VFs corresponding to each physical network card with SR-IOV functionality.
[0035] In one possible implementation, the method further includes:
[0036] The number of available Virtual Functions (VFs) corresponding to the third physical network card is determined by the node as the number of available VFs with RDMA functionality in the node.
[0037] The above scheme achieves the goal of determining the number of available VFs with RDMA functionality in a node.
[0038] In one possible implementation, the method further includes:
[0039] The number of available VFs with RDMA functionality in the node is updated through the node.
[0040] The above scheme can update the number of available Virtual Functions (VFs) with RDMA functionality in a node, thus achieving the goal of dynamically updating the number of available VFs with RDMA functionality in a node.
[0041] Secondly, embodiments of this application provide a resource allocation device applied to a management node of a computer cluster. The device includes a receiving module, a determining module, a creating module, and an allocation module.
[0042] The receiving module is used to receive a creation request, the creation request being used to request the creation of a container group, and to allocate a virtual network interface card (VF) with remote direct memory access (RDMA) functionality to the container group;
[0043] The determining module is configured to, based on the creation request, determine a target node in the computer cluster, the target node including an available VF with RDMA functionality;
[0044] The creation module is used to create the container group through the target node;
[0045] The allocation module is used to allocate a VF with RDMA functionality to the container group through the target node.
[0046] In the above scheme, a creation request can be received, a target node can be determined based on the creation request, a container group can be created through the target node, and a VF with RDMA capability can be allocated to the container group through the target node. This scheme achieves the goal of automatically allocating RDMA-enabled VFs to container groups, improving allocation efficiency. Furthermore, the above scheme combines RDMA technology and SR-IOV technology, resulting in high communication efficiency between nodes in the computer cluster.
[0047] In one possible implementation, the creation request includes a first quantity, which is the number of RDMA-enabled VFs requested to be allocated to the container group; the determining module is specifically used for,
[0048] Obtain the number of available Virtual Functions (VFs) with RDMA functionality in each node of the computer cluster;
[0049] Based on the number of available Virtual Functions with RDMA functionality in each node, candidate nodes are determined in the computer cluster, wherein the number of available Virtual Functions with RDMA functionality in the candidate nodes is greater than or equal to the first number.
[0050] The target node is determined from the total number of candidate nodes.
[0051] In the above scheme, candidate nodes can be determined in the computer cluster, and target nodes can be determined from the candidate nodes, thus achieving the purpose of determining the target node.
[0052] In one possible implementation, the determining module is specifically used for,
[0053] If the total number of candidate nodes is one, the candidate node is determined as the target node;
[0054] If the total number of candidate nodes is greater than one, obtain the load of each candidate node and determine the candidate node with the smallest load as the target node.
[0055] In the above scheme, the target node can be determined based on the number of candidate nodes, thus achieving the purpose of determining the target node.
[0056] In one possible implementation, the determining module is specifically used for,
[0057] For any node in a computer cluster, obtain the number of available Virtual Functions (VFs) with RDMA functionality on that node.
[0058] The above scheme achieves the goal of obtaining the number of available VFs with RDMA functionality in each node.
[0059] In one possible implementation, the allocation module is specifically used for,
[0060] The target node allocates a first number of available VFs to the container group;
[0061] The RDMA function of the first number of available VFs is enabled through the target node.
[0062] The above scheme achieves the goal of allocating VFs with RDMA functionality to container groups.
[0063] In one possible implementation, for any node in the computer cluster, the determining module is further used to:
[0064] The node is used to determine the first physical network interface card (NIC) in the node that has single root input / output virtualization (SR-IOV) function, and the physical NIC with SR-IOV function corresponds to at least one VF.
[0065] The second physical network interface card with RDMA functionality in the node is determined through the node;
[0066] The third physical network interface card (NIC) in the node is determined by the node. The third physical NIC belongs to the first physical NIC and the second physical NIC.
[0067] The above scheme achieves the goal of identifying physical network cards with SR-IOV and RDMA functions in a node.
[0068] In one possible implementation, the node includes at least one first physical network interface card (NIC), and for any given first physical NIC, the determining module is specifically used for:
[0069] The number of available Virtual Functions (VFs) and the number of unavailable VFs corresponding to the first physical network card are determined by the node.
[0070] The above scheme achieves the goal of determining the number of available Virtual Functions (VFs) and the number of unavailable VFs corresponding to each physical network card with SR-IOV functionality.
[0071] In one possible implementation, the determining module is further configured to,
[0072] The number of available Virtual Functions (VFs) corresponding to the third physical network card is determined by the node as the number of available VFs with RDMA functionality in the node.
[0073] The above scheme achieves the goal of determining the number of available VFs with RDMA functionality in a node.
[0074] In one possible implementation, the apparatus further includes an update module, the update module being used to,
[0075] The number of available VFs with RDMA functionality in the node is updated through the node.
[0076] The above scheme can update the number of available Virtual Functions (VFs) with RDMA functionality in a node, thus achieving the goal of dynamically updating the number of available VFs with RDMA functionality in a node.
[0077] Thirdly, embodiments of this application provide a computing device, including: a memory and a processor;
[0078] The memory stores computer-executed instructions;
[0079] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0080] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0081] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect. Attached Figure Description
[0082] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0083] Figure 1 A schematic diagram of a computer cluster architecture provided for an embodiment of this application;
[0084] Figure 2 A flowchart illustrating a resource allocation method provided in an embodiment of this application;
[0085] Figure 3 A flowchart illustrating another resource allocation method provided in an embodiment of this application;
[0086] Figure 4 A flowchart illustrating yet another resource allocation method provided in an embodiment of this application;
[0087] Figure 5 A schematic diagram of a node provided in an embodiment of this application;
[0088] Figure 6 This is a schematic diagram of the structure of a resource allocation device provided in an embodiment of this application;
[0089] Figure 7 This is a schematic diagram of another resource allocation device provided in an embodiment of this application;
[0090] Figure 8 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0091] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0092] To facilitate understanding, the technical terms involved in the embodiments of this application will be explained first.
[0093] SR-IOV: refers to a hardware-assisted input / output (I / O) virtualization technology that allows a physical network interface card (NIC) to be virtualized into multiple virtual NICs. It is mainly used in server virtualization environments to improve I / O performance and efficiency.
[0094] Remote Direct Memory Access (RDMA) allows computers on a network to read or write data directly from memory without the intervention of the operating system or central processing unit (CPU). This direct memory access method significantly improves the efficiency and performance of data transfer while reducing the burden on the CPU and operating system.
[0095] To facilitate understanding, let's first combine... Figure 1 The architecture of the computer cluster involved in the embodiments of this application will be described.
[0096] Figure 1 This is a schematic diagram of a computer cluster architecture provided for an embodiment of this application. Please refer to [link / reference]. Figure 1 A computer cluster may include multiple computing devices, such as computing device 1, computing device 2, ... and computing device N.
[0097] Computing devices can be electronic devices capable of performing data read and write operations. For example, computing devices can be servers, laptops, desktop computers, tablets, microcontrollers, or artificial intelligence devices. Servers can be, for example, graphics processing unit (GPU) servers or AI servers.
[0098] In the aforementioned computer cluster, each computing device can be equipped with a physical network interface card (NIC), which can be virtualized into multiple virtual NICs. For example, computing device 1 can be equipped with physical NICs 11 and 12. Physical NIC 11 can be virtualized into VF111 and VF112, and physical NIC 12 can be virtualized into VF121, VF122, and VF123. Computing device 2 can be equipped with physical NIC 21, which can be virtualized into VF211, VF212, and VF213. Computing device N can be equipped with physical NICs N1, N2, and N3. Physical NIC N1 can be virtualized into VF N11 and VFN12, physical NIC N2 can be virtualized into VF N21 and VF N22, and physical NIC N3 can be virtualized into VF N31 and VFN32.
[0099] It should be noted that each computing device can contain one or more physical network interface cards (NICs) and the number of virtual virtual processors (VFs) corresponding to each NIC. Figure 1 The description of the computing devices included in the computer cluster, the physical network interface cards (NICs) installed in the computing devices, and the VFs corresponding to the physical NICs is merely illustrative and does not constitute a limitation on the technical solutions provided in the embodiments of this application.
[0100] In addition, the computer cluster may also include a management node (not shown in the figure), which can manage the various computing devices in the computer cluster. The management node can be any computing device, or it can be an electronic device independent of each computing device; this embodiment of the application does not limit this.
[0101] In the aforementioned computer cluster, the Virtual Functions (VFs) on the computing devices can also be allocated to virtual machines, containers, or container groups (Pods) running on the computing devices, enabling them to achieve stable network performance. However, if the number of computing devices in the computer cluster is large and each computing device has a large number of VFs, the workload and difficulty of VF allocation are significant, resulting in low allocation efficiency.
[0102] In view of this, embodiments of this application provide a resource allocation method to improve allocation efficiency.
[0103] The technical solutions of the embodiments of this application will be described in detail below with specific examples. These specific examples can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0104] Figure 2 This is a flowchart illustrating a resource allocation method provided in an embodiment of this application. The execution entity of this method can be the management node of a computer cluster, or a processor or processing chip located within the management node of the computer cluster. For example, a computer cluster can be... Figure 1 The computer cluster shown is illustrated below. For ease of understanding, the following explanation will use the management node of the computer cluster as the execution entity. Please refer to [link to relevant documentation]. Figure 2 The method may include:
[0105] S201, Receive creation request.
[0106] The creation request is used to request the creation of a container group and to allocate a VF with RDMA capabilities to the container group.
[0107] VF can be a virtual network interface card (NIC) created by virtualizing a physical NIC.
[0108] A VF with RDMA functionality can be a virtual network interface card (NIC) obtained by virtualizing a physical NIC with RDMA functionality.
[0109] In this embodiment, the management node can receive creation requests sent by other electronic devices, or the management node can receive creation requests input by the user through input operations.
[0110] S202. Based on the creation request, determine the target node in the computer cluster.
[0111] The target nodes include available VFs with RDMA capabilities.
[0112] In this embodiment, the creation request may further include a first quantity, which can be the number of RDMA-enabled VFs to be allocated to the container group. In practice, the management node can obtain the number of available RDMA-enabled VFs in each node of the computer cluster, and determine the target node based on the number of available RDMA-enabled VFs in each node and the first quantity.
[0113] Available VFs with RDMA functionality can be unoccupied VFs with RDMA functionality.
[0114] Specifically, the management node can identify candidate nodes from among the nodes in the computer cluster, provided that the number of available Virtual Functions (VFs) with RDMA functionality among the candidate nodes is greater than or equal to a first threshold. If there is only one candidate node, the management node can designate it as the target node. If there are multiple candidate nodes, the management node can obtain the load of each candidate node and designate the candidate node with the lowest load as the target node, thus ensuring a more balanced load across the nodes in the computer cluster.
[0115] S203. Create a container group through the target node.
[0116] It should be noted that the specific implementation of creating container groups can be found in relevant technologies, and will not be elaborated here.
[0117] S204. Assign a VF with RDMA functionality to the container group through the target node.
[0118] In this embodiment, the management node can allocate a container group with RDMA functionality from a target node, thereby achieving the goal of allocating RDMA-enabled VFs to the container group. Furthermore, the management node determines target nodes that meet the requirements of the creation request and allocates RDMA-enabled VFs to the container group through these target nodes, optimizing the VF allocation process and thus improving the performance of the computer cluster.
[0119] In the resource allocation method provided in this implementation, the management node can receive creation requests, determine target nodes based on the creation requests, create container groups through the target nodes, and allocate VFs with RDMA functionality to the container groups through the target nodes. This method achieves the goal of automatically allocating RDMA-enabled VFs to container groups, improving allocation efficiency. Furthermore, the above method combines RDMA and SR-IOV technologies, resulting in higher communication efficiency among nodes in the computer cluster.
[0120] Based on the above embodiments, the following is combined with Figure 3 The resource allocation method provided in the embodiments of this application will be further described.
[0121] Figure 3 This is a flowchart illustrating another resource allocation method provided in an embodiment of this application. The executing entity of this method can be the management node of a computer cluster, or a processor or processing chip located within the management node of the computer cluster. For example, a computer cluster can be... Figure 1 The computer cluster shown is illustrated below. For ease of understanding, the following explanation will use the management node of the computer cluster as the execution entity. Please refer to [link to relevant documentation]. Figure 3 The method may include:
[0122] S301, Receive creation request.
[0123] It should be noted that the specific implementation of S301 can be found in S201, and will not be repeated here.
[0124] S302. Obtain the number of available VFs with RDMA functionality in each node of the computer cluster.
[0125] It should be noted that the management device uses the same method to obtain the number of available Virtual Functions (VFs) with RDMA functionality in each node. The following explanation uses any single node as an example to illustrate the method for obtaining the number of available VFs with RDMA functionality in that node.
[0126] For any node in a computer cluster, the management node can obtain the number of available Virtual Functions (VFs) with RDMA functionality from the node.
[0127] In this embodiment, a first resource management plugin can run on the node. This plugin can be used to count the number of available Virtual Functions (VFs) with RDMA functionality in the node. The first resource management plugin can also be called "SRIOV RDMAResource Topology".
[0128] Specifically, the management node can obtain the number of available Virtual Functions (VFs) with RDMA functionality in the node from the node's first resource management plugin.
[0129] It should be noted that the method for the first resource management plugin to obtain the number of available VFs with RDMA functionality in a node can be found in [link to documentation]. Figure 4 Examples are not described here.
[0130] S303. Based on the number of available VFs with RDMA functionality in each node, determine the candidate nodes in the computer cluster.
[0131] The number of available VFs with RDMA functionality among the candidate nodes is greater than or equal to the first number.
[0132] S304. Based on the total number of candidate nodes, determine the target node from the candidate nodes.
[0133] In this embodiment, if the total number of candidate nodes is one, the candidate node can be determined as the target node; if the total number of candidate nodes is greater than one, the load of each candidate node can be obtained, and the candidate node with the smallest load can be determined as the target node.
[0134] S305. Create a container group through the target node.
[0135] S306. Allocate the first number of available VFs to the container group through the target node.
[0136] The first number of available VFs can be any available VF in the target node. It should be noted that this first number of available VFs can be the VFs corresponding to the physical network interface cards (NICs) with RDMA functionality in the target node.
[0137] In this embodiment, the target node can allocate a first number of available VFs to the container group by editing the container group's configuration file.
[0138] Specifically, the target node can set the number of VFs allocated to the container group in the container group's configuration file as a first number; and can add an identifier for this first number of available VFs in the container group's configuration file to achieve the purpose of allocating this first number of available VFs to the container group.
[0139] Furthermore, a resource allocation plugin can run on the target node. The target node can edit the container group's configuration file through this plugin to allocate a first number of available Virtual Functions (VFs) to the container group. This resource allocation plugin can also be called "SRIOV-CNI".
[0140] S307. Enable RDMA function for the first number of available VFs through the target node.
[0141] In this embodiment, the target node can enable the RDMA function of the first number of available VFs in the configuration file of the container group to achieve the purpose of enabling the RDMA function of the first number of available VFs.
[0142] Furthermore, the target node can enable VF's RDMA function through the resource allocation plugin.
[0143] In the resource allocation method provided in this embodiment, the management node can receive a creation request, obtain the number of available Virtual Containers (VFs) with RDMA functionality in each node of the computer cluster, determine candidate nodes in the computer cluster based on the number of available VFs with RDMA functionality in each node, determine a target node from the candidate nodes based on the total number of candidate nodes, create a container group through the target node, allocate a first number of available VFs to the container group through the target node, and enable the RDMA functionality of the first number of available VFs through the target node. Through the above method, the purpose of automatically allocating VFs with RDMA functionality to container groups can be achieved, improving allocation efficiency. Furthermore, container groups allocated with RDMA functionality can transmit data with other container groups through these VFs, resulting in low data transmission latency and high bandwidth, thereby improving the data transmission efficiency between container groups.
[0144] Based on any of the above embodiments, for any node in the computer cluster, the node can also count the number of Virtual Functions (VFs) with RDMA functionality within that node, so that the management node can obtain the number of VFs with RDMA functionality in that node. The following example uses any node in the computer cluster. Figure 4 The method for the management node to obtain the number of VFs with RDMA functionality in the node is explained.
[0145] Figure 4 This is a flowchart illustrating another resource allocation method provided in an embodiment of this application. The executing entity of this method can be the management node of a computer cluster, or a processor or processing chip located within the management node of the computer cluster. The computer cluster can be, for example, a... Figure 1 The computer cluster shown is illustrated below. For ease of understanding, the following explanation will use the management node of the computer cluster as the execution entity. Please refer to [link to relevant documentation]. Figure 4 The method may include:
[0146] S401. Determine the first physical network interface card (NIC) with SR-IOV functionality in the node through the node.
[0147] It should be understood that a physical network interface card (NIC) with SR-IOV functionality can be virtualized into at least one Virtual Function (VF). In other words, a physical NIC with SR-IOV functionality corresponds to at least one VF.
[0148] In this embodiment, a node may include at least one first physical network interface card (NIC). For any given first physical NIC, the management node can also determine the number of available Virtual Functions (VFs) and the number of unavailable VFs corresponding to that first physical NIC.
[0149] In this embodiment, a second resource management plugin can run on the node. This second resource management plugin can be used to obtain the topology information of the physical network interface cards (NICs) with SR-IOV functionality in the node; that is, the second resource management plugin can be used to obtain the topology information of the first physical NIC in the node. The second resource management plugin can also be called an "SRIOV Topology exporter".
[0150] The topology information of the first physical network interface card (NIC) may include: the total number of first physical NICs in the node, the identifier of each first physical NIC, the number of available Virtual Functions (VFs) corresponding to each first physical NIC, and the number of unavailable VFs, etc.
[0151] Specifically, the second resource management plugin can identify the first physical network interface card (NIC) in a node, and can also determine the number of available Virtual Functions (VFs) and the number of unavailable VFs corresponding to each first physical NIC.
[0152] In this embodiment, the second resource management plugin can obtain the topology information of the first physical network card at a fixed period or frequency, thereby achieving the purpose of dynamically updating the topology information of the first physical network card in the node.
[0153] S402. Identify the second physical network card with RDMA functionality in the node through the node.
[0154] In this embodiment, a third resource management plugin can run on the node. This plugin can be used to obtain the topology information of the physical network interface card (NIC) with RDMA functionality in the node; that is, it can be used to obtain the topology information of the second physical NIC in the node. The third resource management plugin can also be called an "rdma-device-plugin".
[0155] The topology information of the second physical network interface card (NIC) may include: the total number of second physical NICs in the node, and the identifier of each second physical NIC.
[0156] Specifically, the third resource management plugin determines the second physical network interface card in the node.
[0157] In this embodiment, the third resource management plugin can obtain the topology information of the second physical network card at a fixed period or frequency, thereby achieving the purpose of dynamically updating the topology information of the second physical network card in the node.
[0158] S403. Determine the third physical network interface card (NIC) in the node through the node.
[0159] The third physical network card belongs to the first physical network card, and the third physical network card belongs to the second physical network card.
[0160] In this embodiment, the intersection of the first physical network card and the second physical network card can be determined as the third physical network card.
[0161] For example, assuming that the first physical network interface card in a node includes physical network interface card 1, physical network interface card 2 and physical network interface card 3, and the second physical network interface card in a node includes physical network interface card 1 and physical network interface card 3, then it can be determined that the third physical network interface card includes physical network interface card 1 and physical network interface card 3.
[0162] In this embodiment, the management node can also determine the number of available Virtual Functions (VFs) corresponding to the third physical network interface card (NIC) as the number of available VFs with RDMA functionality in the node. It should be understood that since the third physical NIC has RDMA functionality, the number of available VFs corresponding to the third physical NIC in the node is the same as the number of available VFs with RDMA functionality in the node.
[0163] For example, assuming the third physical network interface card includes physical network interface card 1 and physical network interface card 3, the number of available VFs corresponding to physical network interface card 1 and the sum of the number of available VFs corresponding to physical network interface card 2 can be determined as the number of available VFs with RDMA function in the node.
[0164] In this embodiment, the second resource management plugin can send the topology information of the first physical network interface card (NIC) to the first resource management plugin, and the third resource management plugin can send the topology information of the second physical NIC to the first resource management plugin. Thus, the first resource management plugin can determine the third physical NIC and the number of available Virtual Functions (VFs) corresponding to the third physical NIC based on the topology information of the first and second physical NICs. In other words, the first resource management plugin can determine the number of available VFs with RDMA functionality in the node based on the topology information of the first and second physical NICs.
[0165] In the resource allocation method provided in this embodiment, the management node can determine the first physical network interface card (VIF) with SR-IOV functionality, the second physical network interface card (VIF) with RDMA functionality, and the third physical network interface card (VIF) in the node. This method allows for the identification of VIFs with RDMA functionality within the node, facilitating automatic allocation and improving allocation efficiency.
[0166] Based on any of the above embodiments, the following section takes any node in a computer cluster as an example, combined with... Figure 5 This section explains the process of counting the number of VFs with RDMA functionality within a node.
[0167] Figure 5 This is a schematic diagram of a node provided in an embodiment of this application. Please refer to... Figure 5 The node may include a first resource management plugin, a second resource management plugin, a third resource management plugin, a resource allocation plugin, and an application programming interface (API).
[0168] The first resource management plugin can connect to the second and third resource management plugins respectively. The first resource management plugin can also connect to the resource allocation plugin via API.
[0169] The API can be the Pod Resources API.
[0170] The second resource management plugin can be used to obtain the topology information of physical network cards with SR-IOV function in the node, and can send the topology information of physical network cards with SR-IOV function in the node to the first resource management plugin.
[0171] The third resource management plugin can be used to obtain the topology information of physical network cards with RDMA functionality in a node, and can send the topology information of physical network cards with RDMA functionality in a node to the first resource management plugin.
[0172] The first resource management plugin can determine the number of available virtual networks (VFs) with RDMA functionality in a node based on the topology information of the physical network interface cards (NICs) with SR-IOV functionality and the topology information of the physical network interface cards (NICs) with RDMA functionality in the node.
[0173] The first resource management plugin can also instruct the resource allocation plugin via API to allocate VFs with RDMA functionality to container groups.
[0174] In this embodiment, the second resource management plugin can acquire and send the topology information of physical network cards with SR-IOV functionality in the node to the first resource management plugin at a fixed period or frequency. Similarly, the third resource management plugin can acquire and send the topology information of physical network cards with RDMA functionality in the node to the first resource management plugin at a fixed period or frequency. This allows the first resource management plugin to dynamically update the number of available virtual network cards (VFs) with RDMA functionality in the node, resulting in higher accuracy in VF allocation.
[0175] Figure 6 This is a schematic diagram of a resource allocation device provided in an embodiment of this application. The resource allocation device 10 can be applied to the management node of a computer cluster. Please refer to... Figure 6 The resource allocation device 10 may include: a receiving module 11, a determining module 12, a creating module 13, and an allocation module 14, wherein,
[0176] The receiving module 11 is used to receive a creation request, the creation request being used to request the creation of a container group and to allocate a virtual network interface card (VF) with remote direct memory access (RDMA) functionality to the container group.
[0177] The determining module 12 is configured to determine a target node in the computer cluster based on the creation request, the target node including an available VF with RDMA functionality;
[0178] The creation module 13 is used to create the container group through the target node;
[0179] The allocation module 14 is used to allocate a VF with RDMA functionality to the container group through the target node.
[0180] In one possible implementation, the creation request includes a first quantity, which is the number of RDMA-enabled VFs requested to be allocated to the container group; the determining module 12 is specifically used for,
[0181] Obtain the number of available Virtual Functions (VFs) with RDMA functionality in each node of the computer cluster;
[0182] Based on the number of available Virtual Functions with RDMA functionality in each node, candidate nodes are determined in the computer cluster, wherein the number of available Virtual Functions with RDMA functionality in the candidate nodes is greater than or equal to the first number.
[0183] The target node is determined from the total number of candidate nodes.
[0184] In one possible implementation, the determining module 12 is specifically used for,
[0185] If the total number of candidate nodes is one, the candidate node is determined as the target node;
[0186] If the total number of candidate nodes is greater than one, obtain the load of each candidate node and determine the candidate node with the smallest load as the target node.
[0187] In one possible implementation, the determining module 12 is specifically used for,
[0188] For any node in a computer cluster, obtain the number of available Virtual Functions (VFs) with RDMA functionality on that node.
[0189] In one possible implementation, the allocation module 14 is specifically used for,
[0190] The target node allocates a first number of available VFs to the container group;
[0191] The RDMA function of the first number of available VFs is enabled through the target node.
[0192] In one possible implementation, for any node in the computer cluster, the determining module 12 is further configured to:
[0193] The node is used to determine the first physical network interface card (NIC) in the node that has single root input / output virtualization (SR-IOV) function, and the physical NIC with SR-IOV function corresponds to at least one VF.
[0194] The second physical network interface card with RDMA functionality in the node is determined through the node;
[0195] The third physical network interface card (NIC) in the node is determined by the node. The third physical NIC belongs to the first physical NIC and the second physical NIC.
[0196] In one possible implementation, the node includes at least one first physical network interface card (NIC), and for any given first physical NIC, the determining module 12 is specifically used for:
[0197] The number of available Virtual Functions (VFs) and the number of unavailable VFs corresponding to the first physical network card are determined by the node.
[0198] In one possible implementation, the determining module 12 is further configured to,
[0199] The number of available Virtual Functions (VFs) corresponding to the third physical network card is determined by the node as the number of available VFs with RDMA functionality in the node.
[0200] Figure 7This is a schematic diagram of another resource allocation device provided in an embodiment of this application. Figure 6 Based on this, the resource allocation device 10 further includes an update module 15, which is used for:
[0201] The number of available VFs with RDMA functionality in the node is updated through the node.
[0202] The resource allocation device provided in this embodiment can execute the technical solution executed by the management node of the computer cluster in any of the above method embodiments. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0203] Figure 8 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Figure 8 As shown, the computing device 20 may include a processor 21 and a memory 22, wherein the processor 21 and the memory 22 can communicate; for example, the processor 21 and the memory 22 communicate via a communication bus 23, the memory 22 is used to store computer execution instructions, and the processor 21 is used to invoke the computer execution instructions in the memory to execute the resource allocation method shown in any of the above method embodiments.
[0204] Optionally, the computing device 20 may also include a communication interface, which may include a transmitter and / or a receiver.
[0205] The computing device 20 can be the management node shown in any of the above method embodiments, and can execute the resource allocation method shown in any of the above method embodiments.
[0206] Optionally, the aforementioned processor can be a CPU, or it can be a GPU, a Baseboard Management Controller (BMC), other general-purpose processors, a Digital Signal Processor (DSP), or an Application Specific Integrated Circuit (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
[0207] This application provides a computer-readable storage medium storing computer-executable instructions; the computer-executable instructions are used to implement the resource allocation method as described in any of the above embodiments.
[0208] This application provides a computer program product, which includes a computer program that, when executed, causes a computer to perform the above-described resource allocation method.
[0209] All or part of the steps in the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof.
[0210] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable terminal device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable terminal device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0211] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0212] These computer program instructions can also be loaded onto a computer or other programmable terminal device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0213] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, the embodiments of this application are also intended to include these modifications and variations.
[0214] In the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. The term "or" and its variations can mean "and / or." In the embodiments of this application, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In the embodiments of this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0215] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the invention disclosed in the specification and in practice. The embodiments of this application are intended to cover any variations, uses, or adaptations of the embodiments of this application that follow the general principles of the embodiments of this application and include common knowledge or customary technical means in the art not disclosed in the embodiments of this application.
Claims
1. A resource allocation method, characterized in that, The method, applied to a management node in a computer cluster, includes: Receive a creation request, the creation request being used to request the creation of a container group and allocate a virtual network interface (VF) with remote direct memory access (RDMA) functionality to the container group; Based on the creation request, a target node is identified in the computer cluster, the target node including an available VF with RDMA capability; The container group is created through the target node; The target node allocates a VF with RDMA functionality to the container group.
2. The method according to claim 1, characterized in that, The creation request includes a first quantity, which is the number of VFs with RDMA functionality requested to be allocated to the container group; The step of determining the target node in the computer cluster according to the creation request includes: Obtain the number of available Virtual Functions (VFs) with RDMA functionality in each node of the computer cluster; Based on the number of available Virtual Functions with RDMA functionality in each node, candidate nodes are determined in the computer cluster, wherein the number of available Virtual Functions with RDMA functionality in the candidate nodes is greater than or equal to the first number. The target node is determined from the total number of candidate nodes.
3. The method according to claim 2, characterized in that, The step of determining the target node from the candidate nodes based on the total number of candidate nodes includes: If the total number of candidate nodes is one, the candidate node is determined as the target node; If the total number of candidate nodes is greater than one, obtain the load of each candidate node and determine the candidate node with the smallest load as the target node.
4. The method according to claim 2 or 3, characterized in that, The step of obtaining the number of available Virtual Functions (VFs) with RDMA functionality in each node of the computer cluster includes: For any node in a computer cluster, obtain the number of available Virtual Functions (VFs) with RDMA functionality on that node.
5. The method according to any one of claims 1-4, characterized in that, The step of allocating a VF with RDMA functionality to the container group through the target node includes: The target node allocates a first number of available VFs to the container group; The RDMA function of the first number of available VFs is enabled through the target node.
6. The method according to any one of claims 1-5, characterized in that, For any node in a computer cluster, the method further includes: The node is used to determine the first physical network interface card (NIC) in the node that has single root input / output virtualization (SR-IOV) function, and the physical NIC with SR-IOV function corresponds to at least one VF. The second physical network interface card with RDMA functionality in the node is determined through the node; The third physical network interface card (NIC) in the node is determined by the node. The third physical NIC belongs to the first physical NIC and the second physical NIC.
7. The method according to claim 6, characterized in that, The node includes at least one first physical network interface card (NIC), and for any one of the first physical NICs, the method further includes: The number of available Virtual Functions (VFs) and the number of unavailable VFs corresponding to the first physical network card are determined by the node.
8. The method according to claim 7, characterized in that, The method further includes: The number of available Virtual Functions (VFs) corresponding to the third physical network card is determined by the node as the number of available VFs with RDMA functionality in the node.
9. The method according to claim 8, characterized in that, The method further includes: The number of available VFs with RDMA functionality in the node is updated through the node.
10. A computing device, characterized in that, include: Memory and processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method according to any one of claims 1-9.
Citation Information
Patent Citations
Virtual machine creation method and apparatus
CN108614726A
Method and device for realizing virtualization of multiple RDMA network cards, and storage medium
CN113535319A
Container network creation method and device, equipment and storage medium
CN117221110A
Container creation method and device, computer equipment and storage medium
CN117591233A
Method and system for realizing lightweight virtualization based on RDMA (Remote Direct Memory Access) technology
CN117609115A