Cloud host creation method and apparatus, storage medium, and electronic device
Patent Information
- Application Number
- CN202311068989.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-08-23
AI Technical Summary
[0004]本申请提供了一种云主机创建方法、装置、存储介质以及电子设备,以解决numacell的内核资源管理混乱,使用率低的技术问题
[0015] Compared with the prior art, the above-mentioned technical solution provided in this application embodiment has the following advantages: When creating a target cloud host, the method provided in this application embodiment determines the target computing node from multiple computing nodes according to the number of kernels required by the target cloud host. Since the computing node reserves a reserved kernel for the cloud host with dual kernel group requirements, the target computing node can be determined according to the kernel group requirements of the target cloud host when creating the target cloud host, ensuring the full utilization of the kernel resources of the kernel group of each computing node and avoiding the waste of kernel resources of the kernel group of the computing node.
Smart Images

Figure CN117032982B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud servers, and more particularly to a method, apparatus, storage medium, and electronic device for creating a cloud server. Background Technology
[0002] In existing technologies, cloud hosts can be created on compute nodes within the NUMA framework model, either occupying a single NUMA cell or two NUMA cells. However, the creation of these cloud hosts does not consider the occupancy of the NUMA cells on the compute node; it only considers whether the compute node's NUMA cells have sufficient kernel resources. This method, however, leads to chaotic kernel resource management on some compute nodes' NUMA cells, wasting a significant amount of unusable kernel resources.
[0003] Therefore, in the existing technology, when creating a cloud host in a computing node under the numa framework model, the resource management of the computing node is chaotic, and the kernel resource utilization of the numa cell of the computing node is low. Summary of the Invention
[0004] This application provides a cloud host creation method, apparatus, storage medium, and electronic device to solve the technical problems of chaotic kernel resource management and low utilization rate in numacell.
[0005] In a first aspect, this application provides a method for creating a cloud host, comprising: upon receiving a creation request, obtaining a kernel requirement number from the creation request, wherein the kernel requirement number is the number of kernels required for the target cloud host to be created as requested in the creation request; determining a target computing node from multiple computing nodes based on the kernel requirement number, wherein each computing node includes a first kernel group and a second kernel group, the first kernel group and the second kernel group have the same number of kernels, the first kernel group and the second kernel group have reserved the same number of reserved kernels for creating a cloud host requiring dual kernel groups, and the remaining kernels of the first kernel group and the second kernel group, excluding the reserved kernels and system kernels, are used to create a cloud host requiring single kernel groups; and creating the target cloud host using the kernels in the target computing node.
[0006] Secondly, this application provides a cloud host creation apparatus, comprising: an acquisition module, configured to, upon receiving a creation request, acquire a kernel requirement number from the creation request, wherein the kernel requirement number is the number of kernels required for the target cloud host to be created as requested in the creation request; a determination module, configured to determine a target computing node from multiple computing nodes based on the kernel requirement number, wherein each computing node includes a first kernel group and a second kernel group, the first kernel group and the second kernel group have the same number of kernels, the first kernel group and the second kernel group have reserved the same number of reserved kernels for creating cloud hosts requiring dual kernel groups, and the remaining kernels of the first kernel group and the second kernel group, excluding the reserved kernels and system kernels, are used to create cloud hosts requiring single kernel groups; and a creation module, configured to create the target cloud host using the kernels in the target computing node.
[0007] As an optional example, the above-mentioned determining module includes: a determining unit, used to determine the cloud host type of the target cloud host based on the above-mentioned kernel requirement number, wherein the cloud host type is divided into single-kernel group cloud host and dual-kernel group cloud host, and the cloud host type is used to indicate whether the target cloud host is a cloud host with the above-mentioned single-kernel group requirement or a cloud host with the above-mentioned dual-kernel group requirement; and to determine the target computing node from multiple computing nodes based on the above-mentioned cloud host type.
[0008] As an optional example, the above-mentioned determining unit includes: a first determining subunit, used to determine the target cloud host as a dual-kernel cloud host when the number of kernel requirements is greater than or equal to a preset value; and to determine the target cloud host as a single-kernel cloud host when the number of kernel requirements is less than the preset value.
[0009] As an optional example, the determining unit includes: a second determining subunit, configured to determine the first computing node from the plurality of computing nodes in ascending order of the total number of available cores, wherein the total number of available cores is the sum of the number of available cores in the first kernel group and the number of available cores in the second kernel group, and the number of available cores is the sum of the available cores in the reserved kernels of the kernel group and the available cores in the remaining kernels; determine whether the cores of the first computing node are capable of creating the target cloud host; if the cores of the first computing node are capable of creating the target cloud host, determine the first computing node as the target computing node; if the cores of the first computing node are insufficient to create the target cloud host, continue to determine the next computing node as the first computing node, until the target computing node is determined or all the computing nodes are traversed.
[0010] As an optional example, the second determining subunit is further configured to: determine that the kernels of the first computing node are capable of creating the target cloud host when the target cloud host is a single-kernel group cloud host, and the number of available kernels in the remaining kernels of the first kernel group is greater than or equal to the number of kernels required, or the number of available kernels in the remaining kernels of the second kernel group is greater than or equal to the number of kernels required; or determine that the kernels of the first computing node are capable of creating the target cloud host when the target cloud host is a single-kernel group cloud host, and the number of available kernels in the remaining kernels of the first kernel group is less than the number of kernels required, and the number of available kernels in the remaining kernels of the second kernel group is less than the number of kernels required. In the following cases, the number of reserved cores in the first kernel group and the second kernel group is reduced. After reducing the number of reserved cores, if the number of available cores in the remaining cores of the first kernel group is greater than or equal to the number of cores required, or if the number of available cores in the remaining cores of the second kernel group is greater than or equal to the number of cores required, then the kernels of the first computing node are determined to be capable of creating the target cloud host. Alternatively, if the target cloud host is a dual-core cloud host, if the number of available cores in the reserved cores is greater than or equal to half of the number of cores required, then the kernels of the first computing node are determined to be capable of creating the target cloud host.
[0011] As an optional example, the second determining subunit is further configured to: reduce the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the remaining kernels of the first kernel group is equal to the number of kernels required; or reduce the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the remaining kernels of the second kernel group is equal to the number of kernels required; or reduce the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the reserved kernels is zero.
[0012] As an optional example, the second determining subunit is further configured to: reduce the number of reserved kernels by an integer multiple of a preset value each time the number of reserved kernels is reduced, wherein the preset value is half of the minimum number of kernels required for a cloud host with dual kernel group requirements.
[0013] Thirdly, this application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any of the above-described cloud host creation methods when executing the computer program.
[0014] Fourthly, this application also provides a computer storage medium storing computer-executable instructions, which are used to execute the cloud host creation method described in any of the above claims of this application.
[0015] Compared with the prior art, the above-mentioned technical solution provided in this application embodiment has the following advantages: When creating a target cloud host, the method provided in this application embodiment determines the target computing node from multiple computing nodes according to the number of kernels required by the target cloud host. Since the computing node reserves a reserved kernel for the cloud host with dual kernel group requirements, the target computing node can be determined according to the kernel group requirements of the target cloud host when creating the target cloud host, ensuring the full utilization of the kernel resources of the kernel group of each computing node and avoiding the waste of kernel resources of the kernel group of the computing node. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0019] Figure 1 A flowchart illustrating a cloud server creation method provided in this application embodiment;
[0020] Figure 2 A schematic diagram of the numa framework for a cloud host creation method provided in this application embodiment;
[0021] Figure 3 A schematic diagram of a computing node for a cloud host creation method provided in this application embodiment;
[0022] Figure 4 A flowchart illustrating another cloud host creation method provided in this application embodiment;
[0023] Figure 5 A flowchart illustrating yet another cloud server creation method provided in this application embodiment;
[0024] Figure 6 A kernel allocation diagram for a cloud host creation method provided in this application embodiment;
[0025] Figure 7 A cloud server creation diagram provided in this application embodiment illustrates a cloud server creation method.
[0026] Figure 8 Kernel allocation diagram for another cloud host creation method provided in this application embodiment;
[0027] Figure 9 This is a schematic diagram of the structure of a cloud server creation device provided in an embodiment of this application;
[0028] Figure 10 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0030] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0031] To address the technical problems of chaotic kernel resource management and low utilization rate in existing numa cells, this application provides a cloud host creation method that can improve the utilization rate of kernel resources in the kernel group of computing nodes.
[0032] Figure 1 This is a flowchart illustrating a cloud server creation method provided in an embodiment of this application. Figure 1 As shown, the above cloud server creation method includes:
[0033] S102, upon receiving a creation request, obtain the kernel requirement number from the creation request, where the kernel requirement number is the number of kernels required by the target cloud host to be created as requested in the creation request;
[0034] S104. Based on the number of kernels required, the target computing node is determined from multiple computing nodes. Each computing node includes a first kernel group and a second kernel group. The number of kernels in the first kernel group and the second kernel group is the same. The first kernel group and the second kernel group reserve the same number of reserved kernels for creating cloud hosts with dual kernel group requirements. The remaining kernels in the first kernel group and the second kernel group, excluding reserved kernels and system kernels, are used to create cloud hosts with single kernel group requirements.
[0035] S106, Use the kernel in the target compute node to create the target cloud host.
[0036] The above method for creating cloud servers can be applied to the creation of cloud servers within the NUMA framework. NUMA is an architectural model regarding how multiple central processing units (CPUs) access memory. Within this framework, there are multiple compute nodes, each a physical machine, specifically an N-core physical machine where N is an even number. The N cores of this physical machine are evenly divided into two core groups. For example, a 64-core physical machine is divided into two 32-core core groups. Each core group is a NUMA cell, also known as a core shard. Different compute nodes may contain different numbers of cores, but all compute nodes contain two core groups, and the number of cores in each core group is the same. For example, ... Figure 2 As shown, Figure 2 This is a schematic diagram of an exemplary NUMA framework. Figure 2 As shown, the NUMA framework includes three compute nodes, each consisting of two NUMA cells, with both cells having the same number of cores. It should be noted that... Figure 2 As not shown, the number of cores in a numa cell can be different between different compute nodes. For example, both numa cells on compute node 1 have 32 cores, while both numa cells on compute node 2 have 64 cores, and so on.
[0037] The cores of a compute node can be used to create a cloud server. For example, if a cloud server requires 24 cores, then 24 cores from a compute node are allocated to the cloud server, thus creating it. The 24 cores of the cloud server reside within a single compute node.
[0038] Cloud servers can be divided into two categories based on their requirements: single-core and dual-core servers. A single-core server occupies one numa cell on a compute node. For example, if a single-core server requires 24 cores, it will be created using all 24 cores from one numa cell on one compute node. A dual-core server occupies two numa cells on a compute node, with each cell utilizing half of the required cores. For example, if a dual-core server requires 24 cores, it will be created using 12 cores from one numa cell and 12 cores from another numa cell on one compute node.
[0039] In this embodiment, for each compute node, a certain number of cores can be reserved as reserved cores. These reserved cores are used to create cloud hosts that require dual-core groups. The remaining cores besides the reserved cores and system cores are called residual cores. System cores are those that will not be used to create cloud hosts; they are generally used by the system. Residual cores are used to create cloud hosts that require single-core groups. The number of reserved cores for each compute node can be different; the two numa cells within a compute node can have the same number of reserved cores. For example, ... Figure 3 As shown, Figure 3 This is a schematic diagram of a node. Figure 3 In the system, there are two numacells, each with 64 cores. One numacell has two cores occupied by the system (system kernels), and the other numacell has four cores occupied by the system (system kernels). Each numacell reserves 32 cores as reserved kernels. Therefore, the first numacell has 30 remaining cores, and the second numacell has 28 remaining cores.
[0040] In this embodiment, upon receiving a request from a client to create a target cloud host, the kernel requirement is first determined. For example, if a request is for a 32-core cloud host or an 18-core cloud host, the kernel requirement is used to determine the target compute node. Since each compute node has reserved kernels for creating cloud hosts with dual-core requirements, a more suitable target compute node can be selected based on the kernel requirement of the target cloud host. After determining the target compute node, the kernels on the target compute node are used to create the target cloud host.
[0041] The method provided in this application embodiment determines the target computing node from multiple computing nodes based on the number of kernels required by the target cloud host when creating the target cloud host. Since the computing node reserves a reserved kernel for the cloud host with dual kernel group requirements, the target computing node can be determined based on the kernel group requirements of the target cloud host when creating the target cloud host, ensuring the full utilization of the kernel resources of the kernel group of each computing node and avoiding the waste of kernel resources of the kernel group of the computing node.
[0042] As an optional example, such as Figure 4 As shown, based on the number of kernels required, the target computing nodes are determined from multiple computing nodes, including:
[0043] S402, Determine the cloud host type of the target cloud host based on the number of kernels required. The cloud host type is divided into single-kernel group cloud host and dual-kernel group cloud host. The cloud host type is used to indicate whether the target cloud host is a cloud host with single-kernel group requirements or a cloud host with dual-kernel group requirements.
[0044] S404 determines the target computing node from multiple computing nodes based on the cloud host type.
[0045] In this embodiment, since the creation request includes the number of kernels required by the target cloud host, the kernel requirement number can be used to determine whether the target cloud host requires a single kernel group or a dual kernel group. If the target cloud host requires a single kernel group, a single kernel group requirement tag is added; if the target cloud host requires a dual kernel group, a dual kernel group requirement tag is added. The target compute node is determined based on the target cloud host's single or dual kernel group requirement.
[0046] As an optional example, determining the cloud host type of the target cloud host based on the number of kernels required includes: if the number of kernels required is greater than or equal to a preset value, determining the target cloud host as a dual-kernel cloud host; if the number of kernels required is less than a preset value, determining the target cloud host as a single-kernel cloud host.
[0047] In this embodiment, when determining the cloud host type of the target cloud host based on the number of kernels required, a preset value can be set first. This preset value can represent the number of kernels. If the number of kernels required by the target cloud host is greater than or equal to the preset value, the target cloud host is determined to be a cloud host requiring a dual-kernel group. If the number of kernels required by the target cloud host is less than or equal to the preset value, the target cloud host is determined to be a cloud host requiring a single-kernel group. The preset value can be understood as a constraint value, the purpose of which is to determine cloud hosts with a large number of kernels required as cloud hosts requiring a dual-kernel group, thereby using the two numa cells of the compute node to provide kernels, avoiding the problem that when a single cloud host is created, a large number of kernels occupy a single numa cell of the compute node, while the other numa cell has a large number of kernels remaining, making it impossible to continue creating cloud hosts requiring a dual-kernel group.
[0048] The above preset values can be determined based on the difference in available kernels between the two numa cells of a compute node. If the difference is large, the preset value is reduced; if the difference is small, the preset value is increased.
[0049] As an optional example, such as Figure 5 As shown, based on the cloud host type, the target compute nodes are determined from multiple compute nodes, including:
[0050] S502, from multiple computing nodes, in ascending order of the total number of available kernels, the first computing node is determined as the first computing node. The total number of available kernels is the sum of the number of available kernels in the first kernel group and the number of available kernels in the second kernel group. The number of available kernels is the sum of the number of available kernels in the reserved kernels and the number of available kernels in the remaining kernels of the kernel group.
[0051] S504, determine whether the kernel of the first compute node is capable of creating the target cloud host;
[0052] S506-1, if the kernel of the first computing node is capable of creating the target cloud host, the first computing node is identified as the target computing node;
[0053] S506-2 If the kernel of the first compute node is insufficient to create the target cloud host, continue to determine the next compute node as the first compute node until the target compute node is determined or all compute nodes have been traversed.
[0054] In this embodiment, the basic approach to determining the target computing node is to prioritize filling one computing node. That is, start with computing nodes with fewer available cores to see if they can support the creation of the target cloud host. If they cannot, then select computing nodes with more available cores. The number of available cores is represented by the total number of available cores. The total number of available cores is the sum of the number of available cores in the two numa cells. The number of available cores in each numa cell is the sum of the number of available cores in the reserved cores and the number of available cores in the remaining cores.
[0055] For example, such as Figure 6 As shown. Taking two numa cells on a compute node as an example, each numa cell has 64 cores, of which 32 are reserved. The first numa cell has two system cores, so it has 30 remaining cores. The second numa cell has four system cores, so it has 28 remaining cores. The two numa cells create a cloud host requiring a dual-core group of 32 cores, therefore each numa cell uses 16 cores. Of the reserved cores in each numa cell, 16 cores are available. Of the remaining cores, the first numa cell has 6*2 cores already allocated for creating the cloud host, leaving 30 - 6*2 = 18 remaining cores available. The second numa cell has 28 - 4 = 24 remaining cores available. Figure 6 The area filled with vertical lines in the text indicates the available kernel.
[0056] Regardless of whether the target cloud host requires a single core group or a dual core group, the first compute node is determined by the total number of available cores. Then, it is checked whether the first compute node can create the target cloud host. If it cannot, the next first compute node is selected, and this process continues until a target compute node is determined, or all compute nodes are iterated through.
[0057] As an optional example, determining whether the kernel of the first compute node is capable of creating the target cloud host includes:
[0058] If the target cloud host is a single-core group cloud host, and the number of available cores in the remaining cores of the first core group is greater than or equal to the number of cores required, or the number of available cores in the remaining cores of the second core group is greater than or equal to the number of cores required, then it is determined that the cores of the first compute node are sufficient to create the target cloud host; or
[0059] If the target cloud host is a single-core group cloud host, and the number of available cores in the remaining cores of the first core group is less than the required number of cores, and the number of available cores in the remaining cores of the second core group is less than the required number of cores, then the reserved core count of the first and second core groups is reduced. After reducing the reserved core count, if the number of available cores in the remaining cores of the first core group is greater than or equal to the required number of cores, or the number of available cores in the remaining cores of the second core group is greater than or equal to the required number of cores, then it is determined that the cores of the first compute node are sufficient to create the target cloud host; or
[0060] If the target cloud host is a dual-core cloud host, and the number of available kernels in the reserved kernels is greater than or equal to half of the kernel requirement, then it is determined that the kernels of the first compute node are capable of creating the target cloud host.
[0061] In this embodiment, depending on whether the target cloud host requires a single kernel group or a dual kernel group, it can be compared whether the first computing node can create the target cloud host.
[0062] If the target cloud host requires a single core group, check if the number of available cores in the remaining cores of either of the two numa cells is greater than or equal to the number of cores required by the target cloud host. If the number of available cores in the remaining cores of one numa cell is greater than or equal to the number of cores required by the target cloud host, then the required number of cores can be determined from the available cores of that numa cell to create the target cloud host. If the number of available cores in the remaining cores of both numa cells is greater than the number of cores required, then the numa cell with fewer available cores in its remaining cores is selected to create the target cloud host. If the number of available cores in the remaining cores of both numa cells is less than the number of cores required, then some or all of the reserved cores are determined as remaining cores, i.e., the number of unused reserved cores is reduced, thus increasing the number of remaining cores. For example, if the number of reserved cores in each numa cell is reduced by 16, then the number of remaining cores in each numa cell increases by 16. After adjusting the number of reserved cores, check again whether the number of available cores in the remaining cores of the two numa cells is sufficient to create the target cloud host. If the number of available kernels in the reserved kernels of the two numa cells has been adjusted to the remaining kernels, and there are no more reserved kernels to be adjusted, but the two numa cells still cannot create the target cloud host, then it means that the first compute node cannot create the target cloud host.
[0063] If the target cloud host requires a dual-core group, then it is determined whether the number of available cores in the reserved cores of both numa cells is greater than or equal to half of the core requirement of the target cloud host. If the result is yes, then the first compute node can create the target cloud host. If the result is no, then the first compute node cannot create the target cloud host.
[0064] For example, continue to combine Figure 6 Examples are provided to illustrate this, such as Figure 7 As shown, Figure 7 In the two numa cells, the first numa cell has 16 available cores in its reserved cores and 18 available cores in its remaining cores. The second numa cell has 16 available cores in its reserved cores and 24 available cores in its remaining cores. If you are creating a cloud server with 20 cores but a single core group requirement, the first numa cell cannot be created; you can create it in the second numa cell. If you are creating a cloud server with 16 cores but a single core group requirement, both numa cells can be created; in this case, choose the numa cell with fewer available cores in its remaining cores. If you are creating a cloud server with 30 cores but a single core group requirement, neither numa cell can be created; in this case, [the numa cell with fewer available cores should be selected]. Figure 7 The dotted line in the diagram shifts downwards, meaning the number of reserved kernels in two numa cells is reduced, while the number of remaining kernels is increased (the reduction refers to the number of usable kernels among the reserved kernels, while the increase refers to the number of usable kernels among the remaining kernels; that is, some or all of the usable kernels in the reserved kernels are converted to usable kernels in the remaining kernels. In practice, reserved kernels and remaining kernels can be marked with different labels, and the conversion can be achieved by changing the labels). For example... Figure 7 If the horizontal line (dashed line) moves down to the upper boundary of the 16-core allocated area, then the 16 reserved cores in each of the two numa cells are already occupied. Of the remaining cores, the first numa cell has 18 + 16 = 34 available cores, and the second numa cell has 24 + 16 = 40 available cores. This is sufficient to create a cloud server requiring a 30-core single-core group, which was previously impossible to create. If all available cores from the reserved areas are converted to available cores from the remaining areas, and it still cannot create a cloud server requiring a 30-core single-core group, then this compute node cannot create such a cloud server. In this case, you can... Figure 7 The horizontal line (dashed line) in the middle is restored to the position of 32 cores, and the next computing node is replaced as the first computing node, until the target computing node is selected or all computing nodes are traversed.
[0065] As an optional example, reducing the number of reserved kernels in the first kernel group and the second kernel group includes: reducing the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the remaining kernels of the first kernel group equals the number of kernels required; or reducing the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the remaining kernels of the second kernel group equals the number of kernels required; or reducing the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the reserved kernel group is zero.
[0066] In this embodiment, for the reserved cores of two numa cells, reducing the number of reserved cores will increase the number of remaining cores. The reserved cores may include both already occupied cores and available cores. Reducing the number of reserved cores involves converting available cores from the reserved cores into available cores from the remaining cores. This can be done one core at a time, or multiple cores at a time, until the first compute node can create the target cloud host, or until all available cores from the reserved cores are converted into available cores from the remaining cores.
[0067] As an optional example, reducing the number of reserved kernels in the first kernel group and the second kernel group includes: each time the number of reserved kernels is reduced, it is reduced by an integer multiple of a preset value, where the preset value is half of the minimum kernel requirement for a cloud server with dual kernel groups.
[0068] In this embodiment, the aforementioned preset value can be half of the minimum number of kernels required for a cloud host with a dual-kernel group. For example, if the minimum number of kernels required for a cloud host with a dual-kernel group is 32, then the preset value is 16. When reducing the number of reserved kernels, it is reduced in multiples of 16 each time, such as 16, 32, 48, etc.
[0069] Let's illustrate this with an example. Imagine two compute nodes. The first compute node has two NUMA cells, each with 64 cores, while the second compute node has two NUMA cells, each with 128 cores. The core allocation for the first compute node is as follows: Figure 7 As shown, the kernel allocation of the second numa cell is as follows: Figure 8 As shown. Figure 8The vertical lines represent available kernels, while the dashed lines are horizontal lines indicating the boundary between reserved kernels and remaining kernels (excluding system kernels). These boundaries only emphasize the number of kernels at the boundary, not the actual number of kernels on the physical machine. Setting these boundaries ensures that the number of reserved kernels for each numa cell in a compute node is an integer multiple of a preset value. The preset value can be 16, because the minimum requirement for a dual-kernel cloud server is 32 cores. Therefore, a numa cell must reserve at least 16 cores to create a cloud server with the minimum dual-kernel requirement. Thus, the number of reserved kernels for a numa cell can be 16, 32, 48, 64, and so on.
[0070] exist Figure 7 and Figure 8 Based on two compute nodes, if a cloud host requiring 18 cores or less (a single kernel group) is created, the kernels are allocated by the first numa cell of the first compute node. If a cloud host requiring 18-24 cores (excluding 18) is created, the kernels are allocated by the second numa cell of the first compute node. If a cloud host requiring 24-32 cores (excluding 24 and 32) is created, the kernels are allocated by the second numa cell of the first compute node. Figure 7 Following the dotted line, kernels are allocated from the first numa cell of the first compute node (after lowering the dotted line, the first numa cell of the first compute node has 18 + 16 = 34 available kernels). Cloud hosts with 32 or more cores are eligible for dual-kernel group requirements. If a cloud host requires a dual-kernel group of 32 cores, it can be created using the reserved kernels of the two numa cells of the first compute node (each numa cell has 16 available reserved kernels). If a cloud host requires a dual-kernel group of more than 32 cores, the first compute node cannot create it, so it is created by the second compute node. The second compute node has 64 available reserved kernels, which is sufficient to create a cloud host requiring a dual-kernel group of more than 32 cores.
[0071] Figure 9 This is a schematic diagram of a cloud host creation device provided in an embodiment of this application.
[0072] like Figure 9 As shown, the cloud server creation device described above includes:
[0073] The acquisition module 902 is used to obtain the kernel requirement number from the creation request when a creation request is received, wherein the kernel requirement number is the number of kernels required by the target cloud host to be created by the creation request;
[0074] The determination module 904 is used to determine the target computing node from multiple computing nodes based on the number of kernels required. Each computing node includes a first kernel group and a second kernel group. The first kernel group and the second kernel group have the same number of kernels. The first kernel group and the second kernel group reserve the same number of reserved kernels for creating cloud hosts with dual kernel group requirements. The remaining kernels of the first kernel group and the second kernel group, excluding reserved kernels and system kernels, are used to create cloud hosts with single kernel group requirements.
[0075] Create module 906 to create the target cloud host using the kernel in the target compute node.
[0076] The aforementioned cloud server creation device can be applied to the creation of cloud servers within the NUMA framework. NUMA is an architectural model concerning how multiple central processing units access memory. Within this framework, there are multiple compute nodes, each a physical machine, specifically an N-core physical machine where N is an even number. The N cores of this physical machine are evenly divided into two core groups; for example, a 64-core physical machine is divided into two 32-core core groups. Each core group is a NUMA cell, also known as a core shard. Different compute nodes may contain different numbers of cores, but all compute nodes contain two core groups, and the number of cores in each core group is the same. For example, ... Figure 2 As shown, Figure 2 This is a schematic diagram of an exemplary NUMA framework. Figure 2 As shown, the NUMA framework includes three compute nodes, each consisting of two NUMA cells, with both cells having the same number of cores. It should be noted that... Figure 2 As not shown, the number of cores in a numa cell can be different between different compute nodes. For example, both numa cells on compute node 1 have 32 cores, while both numa cells on compute node 2 have 64 cores, and so on.
[0077] The cores of a compute node can be used to create a cloud server. For example, if a cloud server requires 24 cores, then 24 cores from a compute node are allocated to the cloud server, thus creating it. The 24 cores of the cloud server reside within a single compute node.
[0078] Cloud servers can be divided into two categories based on their requirements: single-core and dual-core servers. A single-core server occupies one numa cell on a compute node. For example, if a single-core server requires 24 cores, it will be created using all 24 cores from one numa cell on one compute node. A dual-core server occupies two numa cells on a compute node, with each cell utilizing half of the required cores. For example, if a dual-core server requires 24 cores, it will be created using 12 cores from one numa cell and 12 cores from another numa cell on one compute node.
[0079] In this embodiment, for each compute node, a certain number of cores can be reserved as reserved cores. These reserved cores are used to create cloud hosts that require dual-core groups. The remaining cores besides the reserved cores and system cores are called residual cores. System cores are those that will not be used to create cloud hosts; they are generally used by the system. Residual cores are used to create cloud hosts that require single-core groups. The number of reserved cores for each compute node can be different; the two numa cells within a compute node can have the same number of reserved cores. For example, ... Figure 3 As shown, Figure 3 This is a schematic diagram of a node. Figure 3 In the system, there are two numa cells, each with 64 kernels. One numa cell has two kernels occupied by the system (system kernels), and the other numa cell has four kernels occupied by the system (system kernels). Each numa cell reserves 32 kernels as reserved kernels. Therefore, the first numa cell has 30 kernels remaining as the remaining kernels, and the second numa cell has 28 kernels remaining as the remaining kernels.
[0080] In this embodiment, upon receiving a request from a client to create a target cloud host, the kernel requirement is first determined. For example, if a request is for a 32-core cloud host or an 18-core cloud host, the kernel requirement is used to determine the target compute node. Since each compute node has reserved kernels for creating cloud hosts with dual-core requirements, a more suitable target compute node can be selected based on the kernel requirement of the target cloud host. After determining the target compute node, the kernels on the target compute node are used to create the target cloud host.
[0081] The method provided in this application embodiment determines the target computing node from multiple computing nodes based on the number of kernels required by the target cloud host when creating the target cloud host. Since the computing node reserves a reserved kernel for the cloud host with dual kernel group requirements, the target computing node can be determined based on the kernel group requirements of the target cloud host when creating the target cloud host, ensuring the full utilization of the kernel resources of the kernel group of each computing node and avoiding the waste of kernel resources of the kernel group of the computing node.
[0082] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.
[0083] like Figure 10 As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0084] Memory 113 is used to store computer programs;
[0085] In one embodiment of this application, the processor 111, when executing the program stored in the memory 113, implements the cloud host creation method provided in any of the foregoing method embodiments.
[0086] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the cloud host creation method provided in any of the foregoing method embodiments.
[0087] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0088] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0089] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0090] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for creating a cloud server, characterized in that, include: Upon receiving a creation request, the kernel requirement number is obtained from the creation request, wherein the kernel requirement number is the number of kernels required by the target cloud host to be created as requested in the creation request; Based on the number of kernels required, a target computing node is determined from multiple computing nodes. Each computing node includes a first kernel group and a second kernel group. The first kernel group and the second kernel group have the same number of kernels. The first kernel group and the second kernel group reserve the same number of reserved kernels for creating cloud hosts with dual kernel group requirements. The remaining kernels of the first kernel group and the second kernel group, excluding the reserved kernels and system kernels, are used to create cloud hosts with single kernel group requirements. The target cloud host is created using the kernel in the target computing node; The step of determining the target computing node from multiple computing nodes based on the number of kernel requirements includes: determining the cloud host type of the target cloud host based on the number of kernel requirements, wherein the cloud host type is divided into single-kernel group cloud host and dual-kernel group cloud host, and the cloud host type is used to indicate whether the target cloud host is a cloud host with single-kernel group requirements or a cloud host with dual-kernel group requirements; and determining the target computing node from multiple computing nodes based on the cloud host type. The step of determining the target computing node from multiple computing nodes based on the cloud host type includes: determining the first computing node as the first computing node from the multiple computing nodes in ascending order of the total number of available cores, wherein the total number of available cores is the sum of the number of available cores in the first kernel group and the number of available cores in the second kernel group, and the number of available cores is the sum of the available cores in the reserved kernels and the available cores in the remaining kernels of the kernel group; determining whether the cores of the first computing node are capable of creating the target cloud host; if the cores of the first computing node are capable of creating the target cloud host, determining the first computing node as the target computing node; if the cores of the first computing node are insufficient to create the target cloud host, continuing to determine the next computing node as the first computing node, until the target computing node is determined or all the multiple computing nodes have been traversed; The step of determining whether the kernel of the first computing node can create the target cloud host includes: if the target cloud host is a single-kernel group cloud host, and the number of available kernels in the remaining kernels of the first kernel group is greater than or equal to the number of kernels required, or the number of available kernels in the remaining kernels of the second kernel group is greater than or equal to the number of kernels required, then the kernel of the first computing node can be determined to be capable of creating the target cloud host; or if the target cloud host is a single-kernel group cloud host, and the number of available kernels in the remaining kernels of the first kernel group is less than the number of kernels required, and the number of available kernels in the remaining kernels of the second kernel group is less than the number of kernels required. In the case of a certain number of cores required, the number of reserved cores in the first kernel group and the second kernel group is reduced. After reducing the number of reserved cores, if the number of available cores in the remaining cores of the first kernel group is greater than or equal to the number of cores required, or the number of available cores in the remaining cores of the second kernel group is greater than or equal to the number of cores required, then it is determined that the cores of the first compute node can create the target cloud host; or if the target cloud host is a dual-core cloud host, and the number of available cores in the reserved cores is greater than or equal to half of the number of cores required, then it is determined that the cores of the first compute node can create the target cloud host.
2. The method according to claim 1, characterized in that, The process of determining the cloud host type of the target cloud host based on the kernel requirement number includes: If the number of kernels required is greater than or equal to a preset value, the target cloud host is determined to be a dual-kernel cloud host; If the number of kernels required is less than the preset value, the target cloud host is determined to be a single-kernel group cloud host.
3. The method according to claim 1, characterized in that, The reduction of the number of reserved kernels in the first kernel group and the second kernel group includes: Reduce the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the remaining kernels of the first kernel group equals the number of kernels required; or Reduce the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the remaining kernels of the second kernel group equals the number of kernels required; or Reduce the number of reserved kernels in the first kernel group and the second kernel group until the number of available kernels in the reserved kernel group is zero.
4. The method according to claim 3, characterized in that, The reduction of the number of reserved kernels in the first kernel group and the second kernel group includes: Each time the number of reserved kernels is reduced, it is reduced by an integer multiple of a preset value, wherein the preset value is half of the minimum number of kernels required for a cloud host with dual kernel groups.
5. A cloud server creation device, characterized in that, include: The acquisition module is used to acquire the number of kernels required from the creation request when a creation request is received, wherein the number of kernels required is the number of kernels required by the target cloud host to be created by the creation request; The determination module is used to determine the target computing node from multiple computing nodes based on the number of kernels required. Each computing node includes a first kernel group and a second kernel group. The first kernel group and the second kernel group have the same number of kernels. The first kernel group and the second kernel group have the same number of reserved kernels reserved for creating cloud hosts with dual kernel group requirements. The remaining kernels of the first kernel group and the second kernel group, excluding the reserved kernels and system kernels, are used to create cloud hosts with single kernel group requirements. A module is created to create the target cloud host using the kernel in the target computing node; The step of determining the target computing node from multiple computing nodes based on the number of kernel requirements includes: determining the cloud host type of the target cloud host based on the number of kernel requirements, wherein the cloud host type is divided into single-kernel group cloud host and dual-kernel group cloud host, and the cloud host type is used to indicate whether the target cloud host is a cloud host with single-kernel group requirements or a cloud host with dual-kernel group requirements; and determining the target computing node from multiple computing nodes based on the cloud host type. The step of determining the target computing node from multiple computing nodes based on the cloud host type includes: determining the first computing node as the first computing node from the multiple computing nodes in ascending order of the total number of available cores, wherein the total number of available cores is the sum of the number of available cores in the first kernel group and the number of available cores in the second kernel group, and the number of available cores is the sum of the available cores in the reserved kernels and the available cores in the remaining kernels of the kernel group; determining whether the cores of the first computing node are capable of creating the target cloud host; if the cores of the first computing node are capable of creating the target cloud host, determining the first computing node as the target computing node; if the cores of the first computing node are insufficient to create the target cloud host, continuing to determine the next computing node as the first computing node, until the target computing node is determined or all the multiple computing nodes have been traversed; The step of determining whether the kernel of the first computing node can create the target cloud host includes: if the target cloud host is a single-kernel group cloud host, and the number of available kernels in the remaining kernels of the first kernel group is greater than or equal to the number of kernels required, or the number of available kernels in the remaining kernels of the second kernel group is greater than or equal to the number of kernels required, then the kernel of the first computing node can be determined to be capable of creating the target cloud host; or if the target cloud host is a single-kernel group cloud host, and the number of available kernels in the remaining kernels of the first kernel group is less than the number of kernels required, and the number of available kernels in the remaining kernels of the second kernel group is less than the number of kernels required. In the case of a certain number of cores required, the number of reserved cores in the first kernel group and the second kernel group is reduced. After reducing the number of reserved cores, if the number of available cores in the remaining cores of the first kernel group is greater than or equal to the number of cores required, or the number of available cores in the remaining cores of the second kernel group is greater than or equal to the number of cores required, then it is determined that the cores of the first compute node can create the target cloud host; or if the target cloud host is a dual-core cloud host, and the number of available cores in the reserved cores is greater than or equal to half of the number of cores required, then it is determined that the cores of the first compute node can create the target cloud host.
6. An electronic device, characterized in that, include: At least one communication interface; At least one bus connected to the at least one communication interface; At least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor executes the computer program to implement the method of any one of claims 1 to 4.
7. A computer-readable storage medium storing computer-executable instructions for performing the method described in any one of claims 1 to 4 of this application.
Citation Information
Patent Citations
Virtual machine creation method, system and device and medium
CN111722908A