CN114153549A - Virtual machine creation method and related equipment - Google Patents

Virtual machine creation method and related equipment Download PDF

Info

Publication number
CN114153549A
CN114153549A CN202011196975.8A CN202011196975A CN114153549A CN 114153549 A CN114153549 A CN 114153549A CN 202011196975 A CN202011196975 A CN 202011196975A CN 114153549 A CN114153549 A CN 114153549A
Authority
CN
China
Prior art keywords
numa
virtual machine
node
processor
created
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011196975.8A
Other languages
Chinese (zh)
Inventor
罗思标
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Publication of CN114153549A publication Critical patent/CN114153549A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

Abstract

The application discloses a virtual machine creating method and related equipment, comprising the following steps: the virtual machine creating device acquires processor specifications of a virtual machine to be created, which are input by a tenant through a virtual machine creating interface, and acquires whether a processor core of the virtual machine to be created, which is selected by the tenant, is arranged at different NUMA nodes or one NUMA node through a cross NUMA selection interface; selecting a compute node having a NUMA architecture for creating a virtual machine; allocating processor cores for a virtual machine to be created from one NUMA node without crossing NUMA nodes; and across NUMA nodes, allocating processor cores for a virtual machine to be created from a plurality of different NUMA nodes. Of course, the processor cores allocated from one or more NUMA nodes match the processor specification. Therefore, the user-defined of the tenant on the distribution of the processor cores corresponding to the virtual machines is realized, and the user experience is improved.

Description

Virtual machine creation method and related equipment
The present application claims priority of chinese patent application filed on 8/9/2020 of chinese intellectual property office under application number 202010935887.9 entitled "virtual machine creation method and apparatus", the entire contents of which are incorporated herein by reference.
Technical Field
The embodiment of the application relates to the technical field of virtual machines, in particular to a virtual machine creating method and related equipment.
Background
Virtual Machine (Virtual Machine) refers to a complete computer system with complete hardware system functions, which is simulated by software and runs in a completely isolated environment. Virtual machines may be deployed in a physical computer (also referred to as a host), and work that a physical computer can do is typically also done in virtual machines. When creating a virtual machine in a host, it is necessary to use a part of storage space and memory capacity of the host as the storage space and memory capacity of the virtual machine. The processor of the virtual machine, which may be referred to as a virtual processor (vCPU), may be implemented by a corresponding physical processor (pCPU) in the host, that is, a task executed by the vCPU is actually executed by a non-uniform memory access (NUMA) node in the pCPU or the pCPU.
In practical applications, there may be a difference in the locations of the processor cores corresponding to the vcpus of different virtual machines in the NUMA architecture, for example, a processor core that implements a vCPU of a portion of a virtual machine may be located in one NUMA node, and a processor core that implements a vCPU of another portion of the virtual machine may be distributed among a plurality of different NUMA nodes. Therefore, when a tenant requests to create a virtual machine, how to implement the tenant-defined distribution of processor cores corresponding to the virtual machine is an important problem to be solved urgently.
Disclosure of Invention
The embodiment of the application provides a virtual machine creation method, a virtual machine creation device, a computing device and a computer readable storage medium, wherein a cross-NUMA selection interface is provided for a tenant, and a user selects the distribution of processor cores corresponding to a virtual machine to be created, so that the tenant can realize the distribution of the processor cores corresponding to the virtual machine in a self-defined manner.
In a first aspect, an embodiment of the present application provides a virtual machine creation method, which may be executed by a virtual machine creation apparatus, and specifically, the virtual machine creation apparatus may provide a virtual machine creation interface, so as to obtain, through the virtual machine creation interface, a processor specification of a virtual machine to be created, which is input by a tenant, and also provide a cross-NUMA selection interface, so as to obtain, through the cross-NUMA selection interface, whether a processor core of the virtual machine to be created, which is selected by the tenant, is set in a different NUMA node or one NUMA node. Meanwhile, the virtual machine creation means selects a compute node having a NUMA architecture, and creates a virtual machine to be created on the selected compute node. In the event that the cross-NUMA selection interface instructs the tenant to select the processor core that will create the virtual machine to be placed in one of the NUMA nodes, the processor core in one of the NUMA nodes of the compute node is assigned to the virtual machine to be created, which of course provides a processor core that matches the processor specification entered by the tenant, i.e., the NUMA node provides a number of processor cores that implement virtual processor cores equal to the number of virtual processor cores indicated by the processor specification. And where the cross-NUMA selection interface instructs the tenant to select a processor core that sets the virtual machine to be created in a different NUMA node, the virtual machine creation apparatus can assign a processor core of a plurality of different NUMA nodes of the compute node to the virtual machine to be created, the total processor core provided by the plurality of different NUMA nodes matching, of course, the processor specification.
Because the virtual machine creation apparatus provides the tenant with a cross-NUMA selection interface for the distribution of processor cores of the virtual machine, the virtual machine creation apparatus can distribute the processor cores of the virtual machine among one or more different NUMA nodes depending on the selection and setting of whether the tenant has a cross-NUMA node for the processor cores of the virtual machine. Therefore, the user-defined of the tenant on the distribution of the processor cores corresponding to the virtual machines is realized, and the user experience is improved.
In a possible implementation manner of the first aspect, when allocating processor cores in a plurality of different NUMA nodes of a compute node to a virtual machine to be created, taking allocating processor cores in two NUMA nodes to the virtual machine to be created as an example, the virtual machine creating device may specifically determine a first NUMA node and a second NUMA node in the same slice of the compute node, and allocate a first part of the processor cores in the first NUMA node and a second part of the processor cores in the second NUMA node to the virtual machine to be created, where a sum of numbers of the first part of the processor cores and the second part of the processor cores matches a processor specification.
Because the first NUMA node and the second NUMA node determined by the virtual machine creation device for the virtual machine to be created are located on the same CPU chip, when the processor core in the first NUMA node accesses the processor core in the second NUMA node, the access speed is high, and the time delay is low.
In a possible implementation manner of the first aspect, the virtual machine creation means may determine, when determining the first NUMA node and the second NUMA node located in the same CPU chip in the compute nodes, the node distance between the NUMA nodes. Specifically, the virtual machine creation device may calculate a node distance between each NUMA node and another NUMA node in the compute node, and rank the node distances between each NUMA node and the other NUMA nodes, so that which NUMA nodes are located in the same CPU chip may be determined according to a node distance ranking result between NUMA nodes.
Because the node distance between NUMA nodes in the same chip is usually smaller than the node distance between NUMA nodes in different chips, NUMA nodes in the same chip can be accurately determined by determining the node distance between different NUMA nodes in the calculation nodes.
In one possible implementation of the first aspect, the number of the first portion of processor cores allocated to the virtual machine to be created from the first NUMA node is equal to the number of the second portion of processor cores allocated to the virtual machine to be created from the second NUMA node, and as such, the allocation and management of processor cores in the NUMA node by the virtual machine creation apparatus can be facilitated.
Of course, in other possible embodiments, the number of the first partial processor cores and the number of the second partial processor cores may be different.
In a possible implementation manner of the first aspect, the processor specification can also be used to indicate a memory space size of the virtual machine to be created, and then, the virtual machine creation apparatus may allocate a memory space in one NUMA node of the computing node to the virtual machine to be created, where the NUMA node to which the memory space is allocated is the same NUMA node to which the processor core is allocated, in a case where it is determined that the cross-NUMA selection interface indicates that the tenant selects to set the processor core of the virtual machine to be created in the one NUMA node. The size of the memory space provided in the NUMA node is equal to the size of the memory space indicated by the processor specification.
And under the condition that the cross-NUMA selection interface indicates the tenant to select the processor core of the virtual machine to be created to be arranged in one NUMA node, the virtual machine creating device can allocate the memory space in a plurality of different NUMA nodes of the computing node to the virtual machine to be created, wherein the NUMA node for allocating the memory space and the NUMA node for allocating the processor core are the same NUMA node, and the sum of the sizes of the memory spaces provided by the NUMA nodes is equal to the size of the memory space indicated by the processor specification.
Therefore, the virtual machine creating device not only realizes the allocation of the processor cores, but also realizes the allocation of the memory space.
In one possible implementation of the first aspect, upon determining that the cross-NUMA selection interface indicates to the tenant to select a processor core to set up the virtual machine to be created in one NUMA node, respective NUMA nodes of the different NUMA nodes are equal in size of memory space allocated to the virtual machine to be created. Thus, allocation and management of memory space in a NUMA node by a virtual machine creation device can be facilitated.
In a second aspect, the present application further provides a virtual machine creation method, so that the performance of the created virtual machine is higher. Specifically, the virtual machine creation means may receive a virtual machine creation request, and may determine a compute node having a NUMA architecture according to a processor specification of a virtual machine to be created included in the virtual machine creation request, and then, the virtual machine creation means may allocate a processor core in a NUMA node having a smallest node distance among the compute nodes to the virtual machine to be created further according to the processor specification.
Because the virtual machine is created based on the processor cores of one or more NUMA nodes having the smallest node distance, the performance of the virtual machine created based on the NUMA node in terms of memory access speed and the like can reach a high level.
In particular, when a virtual machine is created based on the creation of a processor core in two NUMA nodes (e.g., a first NUMA node and a second NUMA node), the node distance between the first NUMA node and the second NUMA node is not greater than the node distance between the first NUMA node and other NUMA nodes in the compute node.
In one possible implementation of the second aspect, the virtual machine creation means, in determining the NUMA nodes to be assigned to the virtual machine to be created, may also calculate the number of idle processor cores included in each of the NUMA nodes in combination. Specifically, the virtual machine creating device may first obtain the number of idle processor cores of the plurality of NUMA nodes in the compute node, and select, according to the processor specification (that is, the number of processor cores indicated by the processor specification) and the number of idle processor cores in the plurality of NUMA nodes, a first NUMA node and a second NUMA node, from the plurality of NUMA nodes, where the number of idle processor cores is not less than a first preset threshold, where the first preset threshold is determined based on the processor specification, for example, when the number of processor cores (virtual processor cores) indicated by the processor specification is 32, if there are two hyper-threads on each processor core (physical processor core) on the first NUMA node and the second NUMA node, the first preset threshold may be 8 (that is, (32/2)/2). Of course, the node distance between the selected first NUMA node and the second NUMA node is not greater than the node distance between the first NUMA node and the other NUMA nodes in the compute node. That is, the second NUMA node is a NUMA node having the smallest node distance from the first NUMA node among the plurality of NUMA nodes of the computation node with reference to the first NUMA node.
When the NUMA node used for creating the virtual machine is determined, the first NUMA node and the second NUMA node which contain more idle processor cores are determined according to the number of idle processor cores in the NUMA node, so that the situation that the virtual machine is created unsuccessfully due to the fact that the number of idle processor cores of the first UNMA node and the second NUMA node determined by the virtual machine creating device is small can be avoided, and the possibility of successful creation of the virtual machine is improved.
In one possible implementation of the second aspect, the number of processor cores in the first NUMA node that are allocated to create the virtual machine is equal to the number of processor cores in the second NUMA node that are allocated to create the virtual machine. In this manner, allocation and management of processor cores in a NUMA node by a virtual machine creation apparatus can be facilitated.
In a possible implementation of the second aspect, a processor specification may be used to indicate the number of processor cores allocated to the virtual machine to be created. For example, the processor specification may include a socket value (i.e., "way" number), the number of processor cores included per "way", and the number of hyper-threads per physical processor core, and the number of virtual machine processor cores is equal to the product of the socket value, the number of processor cores included per "way", and the number of hyper-threads per physical processor core. In this way, the virtual machine creation means can create a virtual machine that satisfies the specification from the processor specification.
In a possible implementation manner of the second aspect, the virtual machine creation device may further determine that the virtual machine can be created on one NUMA node when it is determined whether the processor specification is located or the number of processor cores allocated to the virtual machine to be created is not greater than a second preset threshold, and specifically, may select one processor core in one NUMA node among the computing nodes to allocate to the virtual machine to be created.
In a possible implementation manner of the second aspect, the virtual machine creation apparatus may further allocate a memory space for the virtual machine to be created. Specifically, the virtual machine creation device may further allocate, according to the processor specification, a first memory space in the first NUMA node and a second memory space in the second NUMA node to the virtual machine to be created, and a sum of a size of the first memory space and a size of the second memory space may be equal to a size of the memory space indicated by the processor specification. Therefore, the virtual machine creating device not only realizes the allocation of the processor cores, but also realizes the allocation of the memory space.
In a possible implementation manner of the second aspect, the size of the first memory space is equal to the size of the second memory space. Thus, management of memory space in the first NUMA node and the second NUMA node by the virtual machine to be created can be facilitated.
In a possible implementation manner of the second aspect, when the virtual machine creation apparatus obtains the processor specification, specifically, the virtual machine creation apparatus may present a specification input interface to the tenant, so that the tenant inputs the processor specification of the virtual machine to be created in the specification input interface, and thus the virtual machine creation apparatus may generate a corresponding virtual machine creation request based on an input operation of the tenant on the specification input interface, so as to trigger execution of a subsequent virtual machine creation process.
Because the specification input interface is provided for the tenant, the tenant can customize the processor specification of the virtual machine to be created on the specification input interface, the selectability of the tenant on the processor specification is increased, and the use experience of the tenant is improved.
In a possible implementation manner of the second aspect, a plurality of specification candidates of the virtual machine to be created can be included on the specification input interface, so that the tenant can select the processor specification on the specification input interface.
In a possible implementation manner of the second aspect, when determining a NUMA node used for creating a virtual machine, the virtual machine creating device may specifically bind the virtual machine to be created to a processor core in the NUMA node with the smallest distance from the determined node, such as establishing a correspondence between the virtual machine to be created and the processor core in the first NUMA node and the processor core in the second NUMA node.
In a third aspect, the present application further provides a virtual machine creating apparatus, including: the virtual machine creating interface is used for obtaining processor specifications of a virtual machine to be created and input by a tenant; a setting module, configured to provide a non-uniform memory access across NUMA selection interface, where the non-uniform memory access across NUMA selection interface is used for the tenant to select to set the processor core of the virtual machine to be created in a different NUMA node or one NUMA node; the virtual machine creating method comprises a selecting module, a creating module and a creating module, wherein the selecting module is used for selecting a computing node with a NUMA architecture and creating the virtual machine to be created on the computing node; an allocation module, configured to allocate a processor core in one of the compute nodes to a virtual machine to be created if the cross-NUMA selection interface indicates the tenant selects to set the processor core of the virtual machine to be created in one NUMA node, where the processor core provided by the one of the compute nodes matches the processor specification; the allocating module is further configured to allocate processor cores in different NUMA nodes of the compute nodes to the virtual machine to be created if the cross-NUMA selection interface indicates the tenant to select the processor cores of the virtual machine to be created to be set in the different NUMA nodes, wherein the processor cores provided by the different NUMA nodes of the compute nodes match the processor specification.
Any implementation manner of the third aspect or the third aspect is a method implementation manner corresponding to any implementation manner of the first aspect or the first aspect, and the description in any implementation manner of the first aspect or the first aspect is applicable to any implementation manner of the third aspect or the third aspect, and is not described herein again. The virtual machine creation apparatus provided by the third aspect has functions of implementing the embodiments of the first aspect. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In a fourth aspect, the present application further provides a virtual machine creating apparatus, including: the virtual machine creating method comprises the steps of receiving a virtual machine creating request, wherein the virtual creating request comprises processor specifications of a virtual machine to be created; the determining module is used for determining a computing node with a non-uniform memory access (NUMA) architecture according to the processor specification; and the allocation module is used for allocating the processor cores in the first NUMA node and the second NUMA node in the compute node to the virtual machine to be created according to the processor specification, the compute node further comprises a third NUMA node, and the node distance between the first NUMA node and the second NUMA node is not greater than the node distance between the first NUMA node and the third NUMA node.
Any implementation manner of the fourth aspect or the fourth aspect is a method implementation manner corresponding to any implementation manner of the first aspect or the first aspect, and the description in any implementation manner of the first aspect or the first aspect is applicable to any implementation manner of the fourth aspect or the fourth aspect, and is not repeated here. The virtual machine creation apparatus provided by the third aspect has functions of implementing the embodiments of the first aspect. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In a fifth aspect, the present application further provides a computing device comprising: a processor and a memory; the memory is configured to store instructions, and when the apparatus is running, the processor executes the instructions stored in the memory, so as to cause the apparatus to perform the virtual machine creation method in any implementation method of the first aspect or the first aspect. It should be noted that the memory may be integrated into the processor or may be independent from the processor. The apparatus may also include a bus. Wherein, the processor is connected with the memory through a bus. The memory may include a readable memory and a random access memory, among others.
In a sixth aspect, the present application further provides a computing device comprising: a processor and a memory; the memory is configured to store instructions, and when the apparatus is running, the processor executes the instructions stored in the memory, so as to cause the apparatus to perform the virtual machine creation method in any implementation method of the second aspect or the second aspect. It should be noted that the memory may be integrated into the processor or may be independent from the processor. The apparatus may also include a bus. Wherein, the processor is connected with the memory through a bus. The memory may include a readable memory and a random access memory, among others.
In a seventh aspect, the present application further provides a computer-readable storage medium, which stores a program or instructions, and when the program or instructions are run on a computer, the virtual machine creation method in any of the first aspects is executed.
In an eighth aspect, the present application further provides a computer-readable storage medium, which stores a program or instructions that, when executed on a computer, causes the virtual machine creation method of any of the above second aspects to be performed.
In a ninth aspect, embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the virtual machine creation method in any one of the first aspect.
In a tenth aspect, embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the virtual machine creation method in any of the first aspects.
In addition, for technical effects brought by any one implementation manner of the third aspect to the tenth aspect, reference may be made to technical effects brought by different implementation manners of the first aspect or the second aspect, and details are not described here.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram of a NUMA architecture;
FIG. 2 is a schematic diagram of an exemplary dispatch system;
fig. 3 is a schematic flowchart of a virtual machine creation method in an embodiment of the present application;
fig. 4 is a schematic flowchart of another virtual machine creation method in the embodiment of the present application;
FIG. 5 is a schematic view of an exemplary specification input interface in an embodiment of the present application;
FIG. 6 is a schematic view of yet another exemplary specification input interface in an embodiment of the present application;
FIG. 7 is a schematic graph of node distances between 4 NUMA nodes;
fig. 8 is a schematic structural diagram of a virtual machine creation apparatus in an embodiment of the present application;
fig. 9 is a schematic structural diagram of another virtual machine creation apparatus in the embodiment of the present application;
FIG. 10 is a diagram illustrating a hardware configuration of a computing device according to an embodiment of the present application;
fig. 11 is a schematic hardware structure diagram of another computing device in this embodiment.
Detailed Description
The technical solution in the embodiments of the present invention will be described below with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the specification. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise.
Wherein in the description of the present specification, "/" indicates a meaning, for example, a/B may indicate a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present specification, "a plurality" means two or more.
In the description of the present specification, the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
A tenant may desire to customize the distribution of processor cores in the NUMA architecture for the created virtual machine when requesting the creation of the virtual machine, e.g., a user may desire to create a virtual machine across NUMA nodes (i.e., the processor cores to which the virtual machine corresponds are located in different NUMA nodes) based on cost considerations, may desire to create a virtual machine on a NUMA node based on performance considerations, etc.
Based on this, the embodiment of the present application provides a virtual machine creation method to implement processor core distribution of a tenant-defined virtual machine, and the method may be implemented by a virtual machine creation apparatus. In specific implementation, the virtual machine creation device may provide a virtual machine creation interface to the tenant, where the virtual machine creation interface is used to obtain a processor specification of a virtual machine to be created, which is input by the tenant; meanwhile, the virtual machine creation device also provides a cross-NUMA selection interface which is used for the tenant to select the processor core of the virtual machine to be created to be arranged in different NUMA nodes or be arranged in one NUMA node. After the tenant completes the distribution setting for the processor core, the virtual machine creation means may select a compute node having a NUMA architecture, and create a virtual machine to be created on the selected compute node. Then, when the tenant selects to set the processor core of the virtual machine to be created in one NUMA node, the virtual machine creating device allocates the processor core in one NUMA node of the computing nodes to the virtual machine to be created, wherein the processor core provided by one NUMA node of the computing nodes is matched with the processor specification; and when the tenant selects to set the processor core of the virtual machine to be created in a plurality of different NUMA nodes, the virtual machine creation apparatus may select a plurality of different NUMA nodes from the compute nodes and allocate the processor cores in the plurality of different NUMA nodes to the virtual machine to be created, wherein the processor cores provided by the different NUMA nodes of the compute nodes match the processor specification.
Because the virtual machine creation apparatus provides the tenant with a cross-NUMA selection interface for the distribution of processor cores of the virtual machine, the virtual machine creation apparatus can distribute the processor cores of the virtual machine among one or more different NUMA nodes depending on the selection and setting of whether the tenant has a cross-NUMA node for the processor cores of the virtual machine. Therefore, the user-defined of the tenant on the distribution of the processor cores corresponding to the virtual machines is realized, and the user experience is improved.
In a part of scenarios of practical applications, in a virtualization and cloud computing platform, the vcpus of each virtual machine are generally managed by a virtual machine manager for scheduling management. When a virtual machine is created, the virtual machine manager will assign a NUMA node on the host machine to the created virtual machine as the vCPU of the virtual machine based on the load balancing policy. However, the performance of virtual machines created based on this method is generally low.
Referring to FIG. 1, a schematic diagram of a NUMA architecture is shown. As shown in fig. 1, NUMA architecture 100 includes 4 NUMA nodes, NUMA node 0, NUMA node 1, NUMA node 2, and NUMA node 3, respectively. NUMA node 0 and NUMA node 1 are located in CPU0, and NUMA node 2 and NUMA node 3 are located in CPU 1.
CPU0 and CPU1 may communicate over an interconnect bus, and NUMA node 0 may communicate with NUMA node 2 over the interconnect bus.
Each NUMA node may include 32 cores (cores), and as shown in fig. 1, NUMA node 0 includes 32 cores such as core 0, core 1, … …, and core 31, and NUMA node 2 includes 32 cores such as core 64, core 65, … …, and core 95. Meanwhile, each NUMA node may also be configured with a corresponding memory, for example, NUMA node 0 may be configured with memory 0, and the size may be 4 × 32G.
In the NUMA architecture shown in fig. 1, NUMA node 0 may be referred to as a local node (local node) with NUMA node 0 as a reference, and NUMA node 1 and NUMA node 2 adjacent to NUMA node 0 may be referred to as neighbor nodes (neighbor nodes) of NUMA node 0, and NUMA node 3 that is neither a local node nor a neighbor node may be referred to as a remote node (remote node).
The speed of the local node accessing the memory corresponding to different NUMA nodes is usually different. Specifically, when the local node accesses the self-configured memory 0, the access speed is fastest; when accessing the memory 3 of the remote node, the access speed is slowest; when accessing the memory 1 or the memory 2 of the neighbor node, the access speed is slower than the access speed of the memory 0, but faster than the access speed of the memory 3. For different neighbor nodes, the local node accesses the memory of the neighbor node located in the same CPU faster than the memory of the neighbor node located in different CPUs.
As an example, node distance (node distance) may be used to measure memory access speed (or memory access latency) between NUMA nodes. The node distance can reflect the memory access speed of the NUMA node, and the method specifically comprises the following steps: the larger the node distance is, the slower the representation speed of accessing the memory is; the smaller the node distance, the faster the representation accesses the memory. As shown in fig. 1, the node distance of the NUMA node 0 accessing the self-configured memory 0 is 10 (the memory access speed is fastest), the node distance of the memory 1 accessing the NUMA node 1 is 16, the node distance of the memory 2 accessing the NUMA node 2 is 32, and the node distance of the memory 3 accessing the NUMA node 3 is 33 (the memory access speed is slowest).
In a conventional embodiment of creating a virtual machine, a virtual machine manager generally determines a NUMA node corresponding to each virtual machine to be created by using a scheduling policy of load balancing, that is, the virtual machine manager may use one or more NUMA nodes with a smaller load as a vCPU of the virtual machine. However, this scheduling policy is not suitable for virtual machine creation under the NUMA architecture, and causes a problem that the performance of the created virtual machine is low. For example, when NUMA node load is measured as utilization, assume that NUMA nodes 0 through 3 have loads in the order: 10%, 20%, 35%, 5%, the virtual machine manager will take NUMA node 0 and NUMA node 3 that are less loaded as vcpus for the created virtual machine according to the load balancing policy. However, the node distance between NUMA node 0 and NUMA node 3 is 33, that is, the access speed when NUMA node 0 and NUMA node 3 access the memory of the other side to each other is slow, which makes the created virtual machine poor in performance in terms of the speed of accessing the memory; furthermore, NUMA node 0 and NUMA node 3 generally need to access each other through an interconnection bus between CPU0 and CPU1, and therefore, communication overhead generated by accessing the memory of the other party is large, and it is necessary to compete with other NUMA nodes for the interconnection bus between CPU0 and CPU 1. Therefore, the performance of the virtual machine created based on the load balancing policy is not high.
Based on this, the embodiment of the present application provides a virtual machine creation method, so that the performance of the created virtual machine is kept at a high level. In a specific implementation, a first NUMA node and a second NUMA node having a smaller node distance may be selected from predetermined compute nodes having a NUMA architecture according to a processor specification of a virtual machine to be created, and a node distance between the first NUMA node and the second NUMA node is not greater than a node distance between the first NUMA node and the remaining NUMA nodes in the compute nodes, so that performance of the created virtual machine in terms of memory access speed and the like can reach a higher level.
The example is still given by selecting a NUMA node from NUMA node 0 to NUMA node 3 as a virtual machine vCPU as an example. When a NUMA node is determined as a vCPU for a virtual machine to be created, since the node distance between NUMA node 0 and NUMA node 1 is 16, is smaller than the node distance 32 between NUMA node 0 and NUMA node 2, and is also smaller than the node distance 33 between NUMA node 0 and NUMA node 3, NUMA node 0 and NUMA node 1 can be used as a vCPU for the virtual machine to be created. This is faster than selecting NUMA node 0 and NUMA node 2 as vCPUs or NUMA node 0 and NUMA node 3 as vCPUs, so that the virtual machine created can be faster in memory access speed. And the two selected NUAM nodes are positioned in the same CPU, so that the two NUMA nodes do not need to access the other side memory through the interconnection bus between the CPUs, and the communication overhead required by the access of the memory can be reduced. In this way, the performance of the virtual machine created based on NUMA node 0 and NUMA node 1 can reach a higher level.
Furthermore, the above process of creating a virtual machine can be automated without requiring a user to manually configure which NUMA nodes in the compute nodes are to be vcpus, which not only can improve the efficiency of creating a virtual machine, but also, even if hot plug of the pCPU occurs, other changes occur in the topology of the NUMA nodes in the compute nodes, or virtual machine migration (including hot migration and virtual machine availability (HA) implementation) is required), dependence on the hardware topology of the NUMA nodes can be reduced by re-determining the NUMA nodes to be vcpus for the virtual machine by performing the above automated process again. In addition, the number of vcpus used by the created virtual machine need not be required to be a multiple of the actual number of pcpus.
Of course, in the above example, two NUMA nodes are taken as an example for illustration, and if it is determined that three NUMA nodes are taken as vcpus of the virtual machine to be created according to the specification of the vCPU of the virtual machine to be created, NUMA node 0, NUMA node 1, and NUMA node 2 having smaller node distances may be selected as vcpus, so that the performance of the created virtual machine is higher.
For example, the virtual machine creating apparatus executing the virtual machine creating method may be a server (such as a server implementing a cloud platform), or a device or a functional module applied to the server; alternatively, the virtual machine creation apparatus may be a device such as a terminal. Meanwhile, the virtual machine creation device may be implemented by software or hardware.
When the virtual machine creating device is implemented by software, the virtual machine creating device may be located in the scheduling system shown in fig. 2, the scheduling system may include a vCPU scheduling policy and a memory allocation policy, and the virtual machine creating device in the scheduling system may schedule a corresponding NUMA node from the underlying hardware as a vCPU of the virtual machine to be created according to the vCPU scheduling policy, and may allocate a corresponding memory space to the virtual machine to be created according to the memory allocation policy. The specification of the vCPU of the virtual machine may be obtained by the virtual machine creation device through the upper layer application, and the virtual machine of the specification may be started to be created according to a creation instruction from the human-machine interface or interface of the upper layer application.
When the virtual machine creating apparatus is implemented by hardware, the virtual machine creating apparatus may specifically be an application-specific integrated circuit (ASIC), or a Programmable Logic Device (PLD), and the PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof, to implement the functions of the virtual machine creating apparatus. In practical application, the virtual machine creation apparatus can be applied to a device including a plurality of NUMA nodes, such as a server, a terminal, or other possible network devices.
Various non-limiting embodiments of the present application will now be described with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 3, a flowchart of a virtual machine creation method in the embodiment of the present application is shown. For convenience of description, the following description will be exemplarily made by taking an example in which the method is applied to a virtual machine creation apparatus. The method specifically comprises the following steps:
s301: the virtual machine creating device provides a virtual machine creating interface which is used for acquiring the processor specification of the virtual machine to be created and input by the tenant.
The processor specification of the virtual machine to be created may be, for example, the number of virtual processor cores (cores) included in the virtual machine to be created, and the virtual processor cores of the virtual machine to be created may be implemented by physical processor cores in the compute node. In practical application, a physical processor core can support service execution of a virtual processor core, that is, a service executed by the virtual processor core in a virtual machine to be created is actually executed by the physical processor core; alternatively, one physical processor core may also support service execution of more than two (including two) virtual processor cores, for example, the physical processor core may simulate to implement more than two virtual processor cores in a time-sharing manner.
In this embodiment, when requesting to create a virtual machine, a tenant may define in advance what specification the virtual machine to be created has, for example, the tenant may request to create a vCPU with 32 cores, or create a vCPU with 20 cores, and the like. In specific implementation, the virtual machine creation apparatus may provide a virtual machine creation interface to the tenant, and the tenant may request creation of the virtual machine through the virtual machine creation interface and input a processor specification of the virtual machine to be created to the virtual machine creation apparatus. In this way, the virtual machine creation apparatus can acquire the processor specification input by the tenant.
S302: the virtual machine creation device provides a cross-NUMA selection interface for a tenant to select whether to set a processor core of a virtual machine to be created at a different NUMA node or at one NUMA node.
To facilitate tenants being able to customize the distribution of processor cores of the virtual machine to be created in the NUMA architecture, the virtual machine creation apparatus can provide a cross-NUMA selection interface to the tenant. Thus, the tenant can set, through the cross-NUMA selection interface, that processor cores of the virtual machine to be created are distributed at one NUMA node, and can also set a plurality of different NUMA nodes, and can further set the number of NUMA nodes to which the processor cores are distributed.
S303: the virtual machine creation means selects a compute node having a NUMA architecture and creates a virtual machine to be created on the compute node.
For example, the compute node may be a server having a NUMA architecture, or may be a device such as a terminal having a NUMA architecture, and the embodiment does not limit a specific implementation manner of the compute node.
In practical applications, the virtual machine creating apparatus may manage a plurality of computing nodes, for example, the virtual machine creating apparatus may record hardware architecture information of a plurality of servers in a data center, and some of the servers in the plurality of servers may have a NUMA architecture and another portion of the servers may have an SMP architecture. Thus, the virtual machine creation means can select a compute node having a NUMA architecture from the plurality of compute nodes managed and create a virtual machine on the selected compute node after determining to create the virtual machine.
In a possible embodiment, the virtual machine creation apparatus may further perform selection of the compute node by combining hardware architecture information of the compute node and load of each compute node or number of idle processor cores included. Specifically, the virtual machine creating device may determine, according to the hardware architecture information of each compute node, a compute node having a NUMA architecture, and then may further select, according to a load of each compute node or the number of idle processor cores included in the compute node, a compute node that can meet a processor specification of the virtual machine to be created from the determined compute nodes having the NUMA architecture. In this way, the possibility that the virtual machine creating device fails to create the virtual machine on the selected computing node due to too high load of the computing node or too small number of idle processor cores contained in the computing node can be reduced.
Of course, in practical application, the compute node having the NUMA architecture may also be determined in other ways, which is not limited in this embodiment.
S304: in the event that the cross-NUMA selection interface instructs the tenant to select a processor core to be set in one NUMA node for the virtual machine to be created, the virtual machine creation apparatus assigns the processor core in one NUMA node of the compute node to be created where the processor core provided by the one NUMA node of the compute node matches the processor specification.
Typically, a compute node can include multiple NUMA nodes, as shown in fig. 1 or fig. 2 can include 4 (or other number) NUMA nodes, and the processor cores in each NUMA node can include multiple processor cores. In practice, there may be differences in the number of idle processor cores included in different NUMA nodes, e.g., NUMA node 0 in FIG. 1 may include 12 of the 36 processor cores that are idle, while the remaining 24 processor cores may be used to implement vCPUs of other created virtual machines, or to perform other services; NUMA node 1 includes 36 processor cores, possibly 30 idle processor cores, the remaining 6 processor cores are occupied, and so on.
Thus, upon determining that the tenant selects to distribute the processor cores of the virtual machine to be created among one NUMA node, the virtual machine creation apparatus can select which NUMA node to create the virtual machine based on the number of idle processor cores in each of the NUMA nodes in the compute node and the number of processor cores that the virtual machine to be created requires to be created, and assign the processor cores in that NUMA node to the virtual machine to be created. For example, when the processor specification of the virtual machine to be created is 24 cores, then the virtual machine creation apparatus can choose to assign the processor cores in the NUMA1 node to the virtual machine to be created.
S305: in the event that the cross-NUMA selection interface instructs the tenant to select a setting of the processor core of the virtual machine to be created in a different NUMA node, the virtual machine creation device assigns the processor core in the different NUMA node of the compute node to the virtual machine to be created, wherein the processor cores provided by the different NUMA node of the compute node match the processor specification.
When the tenant selects to distribute the processor cores of the virtual machine to be created among a plurality of different NUMA nodes, the virtual machine creation apparatus may determine the number of NUMA nodes to which the processor cores set by the tenant are distributed, and select the number of NUMA nodes from among the plurality of NUMA nodes included in the compute node, and further select and allocate a corresponding number of processor cores from the NUMA nodes to the virtual machine to be created.
In an exemplary embodiment, because node distances between different NUMA nodes are different, and the node distance between NUMA nodes located on the same CPU chip is typically smaller than the node distance between two NUMA nodes on different CPU chips, when the number of NUMA nodes distributed by a processor core is plural, the virtual machine creation apparatus can select according to the node distance between the respective NUMA nodes in the compute node.
Specifically, taking the number of NUMA nodes distributed by the processor cores as 2 as an example, the virtual machine creation device may determine, by way of calculation or query, the node distance between each NUMA node in the calculation nodes and the other NUMA nodes, and sort the node distances between each NUMA node and the other NUMA nodes in the order from small to large, so that NUMA nodes located on the same CPU chip may be determined according to the node distance between the NUMA nodes, and the virtual machine creation device may use two NUMA nodes located on the same CPU chip as nodes for creating the virtual machine to be created. For ease of description, the two NUMA nodes selected to be on the same tile are referred to as a first NUMA node and a second NUMA node, respectively.
Then, the virtual machine creation device may allocate a first part of processor cores in the first NUMA node and a second part of processor cores in the second NUMA node to the virtual machine to be created, and a sum of the allocated first part of processor cores and the allocated second part of processor cores matches the processor specification, and specifically, the number of virtual processor cores implemented by the first part of processor cores and the second part of processor cores may be equal to the number of virtual processor cores indicated by the processor specification. The number of the virtual machine processor cores realized by the physical processor cores can be calculated based on the following formula (1):
number of cores of vCPU n p s (1)
Where n is the number of hyper-threads on each processor core, p is the number of processor cores per "way" (socket), and s is the "way" number (i.e., the number of CPU slots on the motherboard).
In some examples, to facilitate resource management and allocation, the virtual machine creation apparatus can allocate equal numbers of processor cores from the first NUMA node and the second NUMA node, i.e., equal numbers of first portions of processor cores and second portions of processor cores.
In practical applications, the virtual machine creation apparatus may allocate not only the processor core in the NUMA node to the virtual machine to be created, but also the memory space in the NUMA node to the virtual machine to be created as the memory space of the virtual machine to be created.
In a specific implementation, when determining that the tenant distributes the processor cores of the virtual machines to be created in one NUMA node, the virtual machine creation apparatus may allocate a memory space in the NUMA node where the processor cores are allocated to the virtual machines to be created, where the size of the allocated memory space is the size of the memory space indicated by the processor specification.
When it is determined that the tenant distributes the processor core of the virtual machine to be created among a plurality of different NUMA nodes, the virtual machine creation apparatus may allocate memory space in the plurality of different NUMA nodes to the virtual machine to be created, the plurality of different NUMA nodes also being NUMA nodes that allocate the processor core to the virtual machine to be created. Correspondingly, the sum of the sizes of the memory spaces provided by the different NUMA nodes for the virtual machine to be created is equal to the size of the memory space indicated by the processor specification. In a further possible embodiment, the size of the memory space allocated to the virtual machine to be created by each NUMA node is equal. For example, when 32GB of memory space is allocated to the virtual machine to be created based on the first NUMA node and the second NUMA node, a memory space of 16GB size in the first NUMA node may be allocated to the virtual machine to be created, and at the same time, a memory space of 16GB size in the second NUMA node is also allocated to the virtual machine to be created, so that the memory space of the virtual machine to be created is 32GB (i.e., 16GB +16 GB).
Referring to fig. 4, a flowchart of another virtual machine creation method in the embodiment of the present application is shown. For convenience of description, the following description will be exemplarily made by taking an example in which the method is applied to a virtual machine creation apparatus. The method specifically comprises the following steps:
s401: the virtual machine creation means receives a virtual machine creation request including a processor specification of a virtual machine to be created.
In practical applications, different virtual machines may be created with vcpus of different specifications, for example, vcpus with 32 cores, vcpus with 24 cores, vcpus with 16 cores, and the like, and accordingly, there may be differences in NUMA nodes or the number of processor cores in NUMA nodes used for implementing virtual machines of different specifications.
Therefore, when creating a virtual machine, the virtual machine creation apparatus may determine what processor specification the virtual machine to be created adopts, so as to create a corresponding virtual machine for the tenant based on the processor specification.
In some possible embodiments, the processor specification of the virtual machine may be determined by the tenant on the human-computer interaction interface. Specifically, the virtual machine creation means may present a specification input interface to the tenant, and input the processor specification of the virtual machine on the specification input interface by the tenant. In this way, the virtual machine creation device can determine what specification of virtual machine needs to be created according to the input operation of the tenant on the specification input interface. In this embodiment, the processor specification of the virtual machine may be, for example, the number of virtual processor cores included in the virtual machine to be created.
For example, the specification input interface presented by the virtual machine creation apparatus may be as shown in fig. 5, on which an input window of the number of vCPU cores (i.e., virtual processor cores in the vCPU) may be provided, and accordingly, the tenant may input the number of vCPU cores to be created in the input window. In this way, the virtual machine creation means may determine the processor specification of the virtual machine to be created, based on the input result received by the input window.
In other examples, a plurality of specification candidates of the virtual machine to be created may also be provided in the specification input interface presented by the virtual machine creation apparatus. As shown in fig. 6, the input window for the number of cores in the vCPU may present a value 24 in the initial state, characterizing the vCPU that created 24 cores by default. After clicking a pull-down menu button corresponding to the core number of the vCPU, a user can present a plurality of numerical values such as 4, 8, 16, 24 and the like on the specification input interface, wherein each numerical value is a candidate of the core number in the vCPU. In this way, the user can select one of the multiple specification candidates (i.e. multiple numerical values in fig. 6) presented according to the requirement of the actual application as the number of cores of the vCPU of the virtual machine to be created, thereby completing the input of the processor specification of the virtual machine to be created.
In further possible embodiments, the specification input interface may also present other information to the user. As shown in fig. 5 and 6, the specification input interface may further present information such as a core count, a thread count per core, the number of cores included in the vCPU, a socket value, a memory space of the virtual machine, and a charging price after the virtual machine is created. The core count is the number of processor cores of the vCPU for implementing the virtual machine. The socket value refers to the number of slots of the CPU on the motherboard, that is, the number of what is commonly called "ways" of the CPU, and the core count may be calculated by multiplying the socket value by the number of processor cores of each "way". When a user requests to create a virtual machine, the core count, the number of overstrain threads per core, the number of cores included in the vCPU (the numerical value may be automatically calculated by the virtual machine creation device according to the core count and the number of overstrain threads per core and presented on the specification input interface), the socket value, and the memory space of the virtual machine may be input in the specification input interface, and meanwhile, the specification input interface may automatically calculate and present a charging price required for creating the virtual machine, such as a charging amount per hour and the like, according to the input of the user.
In practical applications, the specific representation form of the specification input interface is not limited to the examples in fig. 5 and fig. 6, and in other possible implementations, the elements presented in the specification input interface may be increased or decreased correspondingly on the basis of fig. 5 and fig. 6, for example, the operating power of the virtual machine is increased and other attribute information is added, which is not limited in this embodiment.
In the above embodiment, the virtual machine creating device may create, in real time, a virtual machine that meets the user's expectations according to the virtual machine specification input by the user. In other possible embodiments, the virtual machine to be created may also be created in advance by creating one or more virtual machines with different specifications. The processor specification of the virtual machine to be created may also be defined by a preset specification template (navigator), and the specifications of different virtual machines may be defined by corresponding specification templates, as shown in fig. 2, the upper layer application may include a predefined specification template 1 and a predefined specification template 2, where the specification template 1 and the specification template 2 may define the NUMA node number (i.e., "hw: NUMA _ nodes" in fig. 2), a socket value (i.e., "cpu _ sockets" in fig. 2), the number of processor cores per "way" (i.e., "cpu _ cores" in fig. 2), and the number of hyper-threads (i.e., "cpu _ threads" in fig. 2) on each processor core. Therefore, the user can select the virtual machine with the corresponding specification to use according to the requirement. Then, the virtual machine creating means may create a virtual machine of the specification according to the processor specification of the virtual machine defined in the specification template.
S402: the virtual machine creation means determines a compute node having a NUMA architecture based on the processor specification.
In this embodiment, the computing nodes managed by the virtual machine creation apparatus may include a plurality of computing nodes, for example, the virtual machine creation apparatus may record hardware architecture information of a plurality of servers in a data center, and some of the servers in the plurality of servers may have a NUMA architecture and another portion of the servers may have an SMP architecture. Thus, the virtual machine creation means can select a compute node having a NUMA architecture from the plurality of compute nodes managed and create a virtual machine on the selected compute node after determining to create the virtual machine.
In some possible embodiments, the virtual machine creation means may select a compute node having a NUMA architecture based on a load balancing policy, that is, when creating the virtual machine, the virtual machine creation means may select a compute node having a NUMA architecture, which is currently less loaded, and create the virtual machine on the compute node. Of course, in practical application, the virtual machine creating apparatus may also select the computing node based on other policies, which is not limited in this embodiment.
S403: and the virtual machine creating device allocates the processor cores in the NUMA nodes with the minimum node distance in the computing nodes to the virtual machine to be created according to the determined processor specification.
The NUMA node having the smallest node distance is a NUMA node having the smallest node distance from a NUMA node determined based on one NUMA node (hereinafter referred to as a first NUMA node) among the calculation nodes. When the virtual machine creation device determines to create a virtual machine based on a NUMA node, the NUMA node that is the least distant from the first NUMA node is the first NUMA node itself. And when the virtual machine creation means determines to create the virtual machine based on the plurality of NUNMA nodes, taking the example of creating the virtual machine based on two NUMA nodes as an example, the NUMA node whose node distance is smallest includes the first NUMA node and a second NUMA node, where the second NUMA node is a NUMA node of the compute nodes whose node distance to the first NUMA node except the first NUMA node is smallest, that is, a node distance between the first NUMA node and the second NUMA node is not greater than a node distance between the first NUMA node and other NUMA nodes of the compute nodes.
In practice, the node distance of each NUMA node is typically less than the node distance between the NUMA node and other NUMA nodes, so when creating a virtual machine based on a NUNA node, the virtual machine creation apparatus can select any NUMA node to create a virtual machine based on a load balancing policy or random selection.
In this embodiment, it will be described with emphasis on how to select a plurality of NUMA nodes from the compute nodes as the NUMA nodes that create the virtual machine so that the performance of the virtual machine reaches a higher level. For ease of description, the following exemplifies the selection of the first NUMA node and the second NUMA node.
In a possible implementation manner, the virtual machine creation apparatus may obtain a node distance between each NUMA node in the compute nodes by calling a corresponding interface, and then select, according to the determined specification of the vCPU and the node distance between each NUMA node, a first NUMA node and a second NUMA node having a smaller node distance from the compute nodes as the vCPU of the virtual machine to be created.
If the NUMA node in the compute node that is not selected by the virtual machine creation device can be referred to as a third NUMA node, then the node distance between the first NUMA node and the second NUMA node is not greater than the node distance between the first NUMA node and the third NUMA node.
Taking the example that the compute node includes 4 NUMA nodes as shown in FIG. 1, the virtual machine creation device can obtain the node distance between the 4 NUMA nodes, as shown on the top side of FIG. 7. Wherein "U '0'" characterizes NUMA node 0, "U '1'" characterizes NUMA node 1, "U '2'" characterizes NUMA node 2, and U '3' "characterizes NUMA node 3. The virtual machine creation device can then order the node distances between each NUMA node and the other NUMA nodes by the size of the node distance, as shown in the lower side of FIG. 7. Assuming that the virtual machine creation apparatus can make the first NUMA node be NUMA node 0 in fig. 1, if it is determined from the specification of the vCPU that it is necessary to implement the vCPU based on the processor cores in the 2 NUMA nodes, the second NUMA node can be determined to be NUMA node 1 according to the sorted node distance shown in the lower side of fig. 7, and correspondingly, the third NUMA node can be NUMA node 2 and NUMA node 3. Particularly, the virtual machine creation device may also determine, according to the node distance between NUMA node 0 and NUMA node 1, that NUMA node 0 and NUMA node 1 are located in the same CPU, so that when the two NUMA nodes serving as the virtual machine vCPU access the memory, it is not necessary to perform cross-CPU access through an interconnection bus between CPUs, and thus the memory access overhead is reduced while the content access speed is increased, and contention for the interconnection bus is alleviated. If it is determined from the specification of the vCPU that the vCPU needs to be implemented based on the processor cores in the 3 NUMA nodes, the NUMA nodes with the smallest node distance may include NUMA node 0, NUMA node 1, and NUMA node 2 according to the sorted node distances shown in the lower side of fig. 7.
In some scenarios, such as when creating the first virtual machine, the virtual machine creation apparatus can determine which NUMA nodes are in the same CPU based on the node distance between the NUMA nodes and the number of NUMA nodes included in one CPU. The virtual machine creation device can preferentially select the second NUMA node from the remaining NUMA nodes located in the same CPU as the first NUMA node after sorting the node distances between the NUMA nodes. For example, assuming that N (N is a positive integer greater than 2) NUMA nodes are included in a CPU, the virtual machine creation apparatus can determine that the first (N-1) NUMA nodes that are less distant from the first NUMA node are located in the same CPU as the first NUMA node, so that the virtual machine creation apparatus can determine the second NUMA node from among the NUMA nodes.
In practical application, the virtual machine creation apparatus may select any one of the compute nodes as the first NUMA node, and obtain the node distance between the first NUMA node and each of the remaining NUMA nodes by calling the corresponding interface. The virtual machine creation device can then determine, as the second NUMA node, the N NUMA nodes that are the smallest node distance from the first NUMA node (N being a positive integer and the value of N being determinable from the specification of the vCPU). The virtual machine creation device obtains the node distance through the interface, and numerous existing technical implementations exist, which are not described in detail in this embodiment.
As an example, the virtual machine creation device can also present to the user the node distances between the NUMA nodes in the compute node, e.g., assuming the compute node includes the 4 NUMA nodes shown in FIG. 1, the node distances between the 4 NUMA nodes that are presented can be as shown in FIG. 7. In addition, the virtual machine creation apparatus may also present other information to the user, such as the processor cores included in each NUMA node, the memory space and available memory space that each NUMA node has (where "size" represents the memory space that a NUMA node has, and "free" represents the available memory space that a NUMA node has), and the like, as shown in fig. 7. Therefore, a user can apply for creating the virtual machine which can be satisfied by the computing node based on the information such as the node distance, the number of processor cores, the memory space and the like presented by the virtual machine creating device.
In this embodiment, the first NUMA node and the second NUMA node determined by the virtual machine creating apparatus are used to implement a vCPU of the virtual machine to be created, and in particular, when implementing the virtual machine, the virtual machine may bind the vCPU of the virtual machine to be created with the first NUMA node and the second NUMA node, specifically, bind the vCPU with a specific processor core in the first NUMA node and a specific processor core in the second NUMA node, for example, establish a correspondence between the vCPU and the specific processor core, and thus work executed by the vCPU may be implemented by the specific processor core in the first NUMA node and the second NUMA node.
The number of NUMA nodes may be determined according to the specification of the vCPU. For example, when the specification of the vCPU indicates that the vCPU includes 32 cores, the virtual machine creation apparatus may select 2 NUMA nodes as the vCPU of the virtual machine to be created according to a preset scheduling policy, and at this time, since the number of the first NUMA nodes is 1, the number of the second NUMA nodes determined by the virtual machine creation apparatus is 1; if the virtual machine creation apparatus selects 4 NUMA nodes as the vCPU of the virtual machine to be created, the number of the third NUMA nodes determined by the virtual machine creation apparatus is 3.
In this embodiment, the product of the total number of processor cores provided by the first NUMA node and the second NUMA node and the number of hyperthreads on each processor core may be equal to the number of cores included in the vCPU. Taking the example that the virtual machine creation device determines two NUMA nodes, the number of processor cores provided by the two NUMA nodes is 32, and at this time, the number of hyper-threads on each processor core is 1; in other embodiments, the number of processor cores that can be provided by two NUMA nodes can also be 16, and at this time, the number of hyper-threads on each processor core can be 2, that is, each processor core acts as two cores of the virtual machine by means of differential scheduling, and for the virtual machine to be created, it senses that there are two cores that are working in different time periods. The number of hyper-threads on each processor core may be selected and set by a user, for example, the user may input the number of hyper-threads on each processor core through the specification input interface shown in fig. 5 or fig. 6; alternatively, the number of hyper-threads per processor core may be a fixed value.
Further, the number of processor cores provided can be the same for each NUMA node determined by the virtual machine creation means. Specifically, assuming that the number of hyper threads on each processor core is 1, the first NUMA node for implementing the vCPU may include a first core, and the second NUMA node may include a second core, and then the sum of the number of the first cores of the first NUMA node and the number of the second cores of each second NUMA node is equal to the number of cores included in the vCPU. In this way, the scheduling performance of the virtual machine creation device for the processor core in the NUAM node can be improved. Of course, the number of the first cores may not be equal to the number of the second cores, and this embodiment does not limit this. Similarly, if the number of hyper-threads on each processor core is 2 or another value, the relationship between the first core in the first NUMA node, the second core in the second NUMA node, and the number of cores included by the vCPU may be as shown in equation (2) below:
vCPU has n (number of first cores + m of second cores) (2)
Where n is the number of hyper-threads on each processor core and m is the number of second NUMA nodes.
In this embodiment, the first core may be all processor cores in the first NUMA node or may be a part of processor cores in the first NUMA node. In particular, when the first core is part of a processor core in the first NUMA node, the virtual machine creation apparatus can obtain the processor cores needed by the vCPUs of the virtual machine to be created by "piecing together" the processor cores in the plurality of NUMA nodes, thereby eliminating the need to obtain all of the processor cores needed to create the virtual machine from a single NUMA node. Thus, when the specification of the vCPU of the virtual machine to be created is large, even if the number of the processor cores contained in a single NUMA node does not exist in the computing node and can meet the requirement of the vCPU, the number of the processor cores required by the specification of the vCPU can be obtained by 'piecing together' the processor cores in a plurality of NUMA nodes, and therefore the success rate of creating the virtual machine can be improved.
In practice, a processor core in a portion of the NUMA nodes in the compute node may be occupied, such as by other created virtual machines. Thus, in a further possible embodiment, the virtual machine creation apparatus can also determine the first NUMA node and the second NUMA node in combination with the number of idle processor cores in each NUMA node in the compute node and the specification of the vCPU, and thus can avoid that there are not enough idle processor cores in the determined first NUMA node or second NUMA node, and avoid that the virtual machine creation fails or that the created virtual machine has low performance because the processor cores are occupied.
In a specific implementation, the virtual machine creating device may obtain the number of idle processor cores of the plurality of NUMA nodes in the compute node, and determine, from the plurality of NUMA nodes in the compute node, a NUMA node whose number of idle processor cores is greater than a preset threshold, and then, the virtual machine creating device further determines, from the determined NUMA nodes, a first NUMA node and a second NUMA node which have smaller node distances according to the specification of the vCPU and the node distances between the NUMA nodes, so that the selected first NUMA node and the second NUMA node have a sufficient number of idle processor cores to implement the vCPU of the virtual machine to be created.
In yet another possible embodiment, the virtual machine creation device can also determine the first NUMA node and the second NUMA node in conjunction with calculating an allocation rate of each of the NUMA nodes. In a specific implementation, the virtual machine creating device may record a NUMA node corresponding to a currently created virtual machine, and thus determine the allocation rate of each NUMA node in the compute node according to the recorded correspondence between the same NUMA of the created virtual machine. In this way, when determining the first NUMA node and the second NUMA node, the virtual machine creation apparatus can determine the first NUMA node and the second NUMA node from NUMA nodes having a small allocation rate by sorting according to the size of the allocation rate of each NUMA and by determining a NUMA node having a small allocation rate from a plurality of NUMA nodes of the compute node, and thus the virtual machine creation apparatus can determine the first NUMA node and the second NUMA node from NUMA node having a small allocation rate according to the specification of the vCPU and the node distance. In this way, the allocation rate of NUMA nodes among the compute nodes can be improved.
In practical application, the virtual machine creation apparatus may allocate not only a NUMA node but also a corresponding memory space to the virtual machine to be created, as the memory space of the virtual machine to be created. Based on this, the present embodiment may further include the following steps:
s404: and the virtual machine creating device takes a first memory space in the first NUMA node and a second memory space in the second NUMA node as the memory space of the virtual machine to be created according to the determined processor specification, wherein the sum of the first memory space and the second memory space is equal to the memory space indicated by the processor specification.
In some possible embodiments, the virtual machine creating device may determine how large a memory space the virtual machine to be created has according to the memory space size input by the user in the specification input interface, so that the virtual machine creating device may perform memory space scheduling from the first NUMA node and the second NUMA node according to the memory space, specifically, may schedule the first memory space from the first NUMA node and schedule the second memory space from each second NUMA node, and the memory space size indicated by the specification of the vCPU is a sum of the first memory space and each second memory space.
In other possible embodiments, the size of the memory space of the virtual machine to be created may also be fixed. Then, when the virtual machine creating device creates a virtual machine, a memory space with a fixed size may be allocated to the virtual machine, specifically, a first memory space and a second memory space corresponding to the memory space are respectively scheduled from a first NUMA node and a second NUMA node according to the size of the memory space.
In practical application, the first memory space scheduled by the first NUMA node may be equal to the second memory space scheduled by the second NUMA node in size, so that the virtual machine creation apparatus may conveniently schedule the memory spaces. Of course, the size of the first memory space may not be equal to that of the second memory space, which is not limited in this embodiment.
Based on the virtual machine creation method described in the above embodiments, an embodiment of the present application further provides a virtual machine creation apparatus. Referring to fig. 8, a schematic structural diagram of a virtual machine creation apparatus is shown. As shown in fig. 8, the apparatus 800 may specifically include:
an obtaining module 801, configured to provide a virtual machine creation interface, where the virtual machine creation interface is used to obtain a processor specification of a virtual machine to be created, where the processor specification is input by a tenant;
a setting module 802, configured to provide a non-uniform memory access across NUMA selection interface, where the non-uniform memory access across NUMA selection interface is used by the tenant to select to set the processor core of the virtual machine to be created in different NUMA nodes or one NUMA node;
a selecting module 803, configured to select a compute node with a NUMA architecture, and create the virtual machine to be created on the compute node;
an allocating module 804, configured to allocate a processor core in one of the compute nodes to the virtual machine to be created if the cross-NUMA selection interface indicates that the tenant selects to set the processor core of the virtual machine to be created in one NUMA node, wherein the processor core provided by the one of the compute nodes matches the processor specification;
the allocating module 804 is further configured to allocate processor cores in different NUMA nodes of the compute node to the virtual machine to be created if the cross-NUMA selection interface indicates the tenant selects to set the processor cores of the virtual machine to be created in the different NUMA nodes, where the processor cores provided by the different NUMA nodes of the compute node match the processor specification.
In a possible implementation, the allocating module 804 is specifically configured to:
determining a first NUMA node and a second NUMA node within the same slice of the compute node;
allocating a first portion of processor cores in the first NUMA node and a second portion of processor cores in the second NUMA node to the virtual machine to be created, the sum of the number of the first portion of processor cores and the second portion of processor cores matching the processor specification.
In a possible implementation, the allocating module 804 is specifically configured to:
calculating node distances between a first NUMA node and other NUMA nodes in the compute node;
and sequencing the node distances between the first NUMA node and other NUMA nodes, and determining a second NUMA node in the other NUMA nodes, wherein the second NUMA node is positioned in the same chip with the first NUMA node, and the node distance between the first NUMA node and the second NUMA node is not greater than the node distances between the first NUMA node and other NUMA nodes.
In one possible implementation, the number of the first part of processor cores and the second part of processor cores is equal.
In a possible implementation, the processor specification is further configured to indicate a size of a memory space of the virtual machine to be created, and the allocating module 804 is further configured to:
under the condition that the cross-NUMA selection interface indicates the tenant to select the processor core of the virtual machine to be created to be arranged in one NUMA node, allocating the memory space in one NUMA node of the computing nodes to the virtual machine to be created, wherein the size of the memory space provided by one NUMA node of the computing nodes is equal to the size of the memory space indicated by the processor specification;
and under the condition that the cross-NUMA selection interface indicates the tenant to select the processor cores of the virtual machine to be created to be arranged in different NUMA nodes, allocating memory spaces in different NUMA nodes of the computing nodes to the virtual machine to be created, wherein the sum of the sizes of the memory spaces provided by the different NUMA nodes of the computing nodes is equal to the size of the memory space indicated by the processor specification.
In one possible implementation, each of the different NUMA nodes has an equal size of memory space allocated to the virtual machine to be created.
The virtual machine creating apparatus 800 provided in this embodiment corresponds to the virtual machine creating method in the embodiment shown in fig. 3, and therefore, specific implementation manners of the modules and technical effects thereof provided in this embodiment may refer to descriptions of relevant parts in the foregoing embodiment, and details are not described herein.
According to the virtual machine creation method in the embodiment shown in fig. 4, an embodiment of the present application further provides a virtual machine creation apparatus. Referring to fig. 9, a schematic structural diagram of a virtual machine creation apparatus is shown. As shown in fig. 9, the apparatus 900 may specifically include:
a receiving module 901, configured to receive a virtual machine creation request, where the virtual machine creation request includes a processor specification of a virtual machine to be created;
a determining module 902, configured to determine, according to the processor specification, a compute node having a non-uniform memory access NUMA architecture;
and an allocating module 903, configured to allocate, according to the processor specification, a processor core in a NUMA node with the smallest node distance in the computing nodes to the virtual machine to be created.
In a possible implementation, the allocating module 903 includes:
acquiring the number of idle processor cores of a plurality of NUMA nodes in the computing node;
according to the processor specification and the number of idle processor cores of the NUMA nodes, selecting the first NUMA node and the second NUMA node, of which the number of idle processor cores is not less than a first preset threshold value, from the NUMA nodes, and allocating the processor cores in the first NUMA node and the second NUMA node to the virtual machine to be created, wherein a node distance between the first NUMA node and the second NUMA node is not greater than a node distance between the first NUMA node and other NUMA nodes in the compute node, and the first preset threshold value is determined based on the processor specification.
In one possible embodiment, the number of processor cores in the first NUMA node assigned to the virtual machine to be created is equal to the number of processor cores in the second NUMA node assigned to the virtual machine to be created.
In one possible embodiment, the processor specification is used to indicate the number of processor cores allocated to the virtual machine to be created.
In a possible embodiment, the allocating module 903 is further configured to select a processor core in one NUMA node from the computing nodes to allocate to the virtual machine to be created when the number of processor cores allocated to the virtual machine to be created, which is indicated by the processor specification, is not greater than a second preset threshold.
In a possible implementation manner, the processor specification is further configured to indicate a size of a memory space of a virtual machine to be created, and the allocating module 903 is further configured to use, as the memory space of the virtual machine to be created, a first memory space in the first NUMA node and a second memory space in the second NUMA node according to the processor specification, where a sum of the size of the first memory space and the size of the second memory space is equal to the size of the memory space indicated by the processor specification.
In a possible implementation, the size of the first memory space is equal to the size of the second memory space.
In a possible implementation manner, the receiving module 901 is specifically configured to:
presenting a specification input interface;
and responding to the input operation of a user on the specification input interface aiming at the processor specification of the virtual machine to be created, and generating the virtual machine creation request.
In a possible implementation manner, the specification input interface comprises a plurality of specification candidates of the virtual machine to be created;
then, the input operation is specifically a selection operation for the multiple specification candidates.
In a possible implementation, the allocating module 903 is specifically configured to bind the virtual machine to be created with the processor core in the first NUMA node and the processor core in the second NUMA node.
The virtual machine creating apparatus 900 provided in this embodiment corresponds to the virtual machine creating method in the embodiment shown in fig. 4, and therefore, specific implementation manners of the modules and technical effects thereof provided in this embodiment may refer to descriptions of relevant parts in the foregoing embodiment, and details are not described herein.
In addition, according to the embodiment shown in fig. 3 or fig. 8, the embodiment of the present application further provides a computing device. As shown in fig. 10, the apparatus 1000 may include a communication interface 1010 and a processor 1020. Optionally, a memory 1030 may also be included in the apparatus 1000. The memory 1030 may be provided inside the apparatus or outside the apparatus. For example, the actions performed by the virtual machine creation apparatus in fig. 3 can be implemented by the processor 1020. The processor 1020 receives tenant input operations through the communication interface 1010 and is configured to implement any of the methods performed by the virtual machine creation apparatus described in fig. 2. This communication interface 1010 can include, among other things, the virtual machine creation interface described above, a cross-NUMA selection interface, and the like. In implementation, the steps of the processing flow may implement the method executed by the virtual machine creation apparatus in fig. 3 through instructions in the form of hardware integrated logic circuits or software in the processor 1020. For brevity, no further description is provided herein. Program code executed by processor 1020 to implement the above-described methods may be stored in memory 1030. The memory 1030 is coupled to the processor 1020, such as coupled to the processor.
Some of the features of the embodiments of the present application may be performed/supported by processor 1020 executing program instructions or software code in memory 1030. The software components loaded on memory 1030 may be generalized functionally or logically, such as the acquisition module 801, the setup module 802, the selection module 803, and the assignment module 804 shown in FIG. 8.
Any of the communication interfaces involved in the embodiments of the present application may be a circuit, a bus, a transceiver, or any other device that can be used for information interaction. Such as the communication interface 1010 in the apparatus 1000, and illustratively, the other apparatus may be a device connected to the apparatus 1000, such as a device used by a tenant.
In addition, according to the embodiment shown in fig. 4 or fig. 9, the embodiment of the present application further provides a computing device. As shown in fig. 11, a communication interface 1110 and a processor 1120 may be included in the apparatus 1100. Optionally, the device 1100 may also include a memory 1130. The memory 1130 may be provided inside the apparatus or outside the apparatus. The actions performed by the virtual machine creation apparatus in fig. 4 can be implemented by the processor 1120. Processor 1120 receives virtual machine creation requests through communication interface 1110 and is configured to implement any of the methods performed by the virtual machine creation apparatus described in fig. 4. In implementation, the steps of the processing flow may implement the method executed by the virtual machine creation apparatus in fig. 4 through instructions in the form of hardware integrated logic circuits or software in the processor 1120. For brevity, no further description is provided herein. Program code executed by processor 1120 to implement the above-described methods may be stored in memory 1130. The memory 1130 is coupled to the processor 1120, such as by a coupling.
Some of the features of the embodiments of the present application may be performed/supported by the processor 1120 executing program instructions or software code in the memory 1130. The software components loaded on the memory 1130 may be generalized functionally or logically, such as the receiving module 901, the determining module 902, and the allocating module 903 shown in fig. 9.
Any of the communication interfaces involved in the embodiments of the present application may be a circuit, a bus, a transceiver, or any other device that can be used for information interaction. Such as the communication interface 1110 in the apparatus 1100. illustratively, the other apparatus may be a device connected to the apparatus 1100, such as a device used by a tenant.
The processors referred to in the embodiments of the present application may be general purpose processors, digital signal processors, application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like that implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor.
The coupling in the embodiments of the present application is an indirect coupling or a communication connection between devices, modules or modules, and may be an electrical, mechanical or other form for information interaction between the devices, modules or modules.
The processor may cooperate with the memory. The memory may be a nonvolatile memory, such as a Hard Disk Drive (HDD) or a solid-state drive (SSD), and may also be a volatile memory, such as a random-access memory (RAM). The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such.
The embodiment of the present application does not limit the specific connection medium among the communication interface, the processor, and the memory. Such as memory, processor, and communication interfaces may be connected by a bus. The bus may be divided into an address bus, a data bus, a control bus, etc.
Based on the foregoing embodiments, the present application further provides a computer storage medium, where a software program is stored, and when the software program is read and executed by one or more processors, the software program may implement the method executed by the virtual machine creation apparatus provided in any one or more of the above embodiments. The computer storage medium may include: u disk, removable hard disk, read only memory, random access memory, magnetic or optical disk, etc. for storing program codes.
Based on the foregoing embodiments, an embodiment of the present application further provides a chip, where the chip includes a processor, and is configured to implement the functions of the virtual machine creation apparatus according to the foregoing embodiments, for example, to implement the method executed by the virtual machine creation apparatus in fig. 1. Optionally, the chip further comprises a memory for the processor to execute the necessary program instructions and data. The chip may be constituted by a chip, or may include a chip and other discrete devices.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the embodiments of the present application without departing from the scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to encompass such modifications and variations.

Claims (36)

1. A virtual machine creation method, comprising:
providing a virtual machine creation interface, wherein the virtual machine creation interface is used for acquiring the processor specification of a virtual machine to be created, which is input by a tenant;
providing a non-uniform memory access (NUMA) selection interface, wherein the NUMA selection interface is used for the tenant to select the processor core of the virtual machine to be created to be arranged in different NUMA nodes or one NUMA node;
selecting a computing node with a NUMA architecture, and creating the virtual machine to be created on the computing node;
assigning a processor core in one of the compute nodes to the virtual machine to be created if the cross-NUMA selection interface indicates the tenant to select the processor core of the virtual machine to be created to be placed in one of the NUMA nodes, wherein the processor core provided by the one of the compute nodes matches the processor specification;
assigning processor cores in different NUMA nodes of the compute nodes to the virtual machine to be created if the cross-NUMA selection interface indicates the tenant to select the processor cores of the virtual machine to be created to be placed in different NUMA nodes, wherein the processor cores provided by the different NUMA nodes of the compute nodes match the processor specification.
2. The method of claim 1, wherein assigning processor cores in different NUMA nodes of the compute nodes to the virtual machine to be created comprises:
determining a first NUMA node and a second NUMA node within the same slice of the compute node;
allocating a first portion of processor cores in the first NUMA node and a second portion of processor cores in the second NUMA node to the virtual machine to be created, the sum of the number of the first portion of processor cores and the second portion of processor cores matching the processor specification.
3. The method of claim 2, wherein determining the first NUMA node and the second NUMA node within the same slice of the compute node comprises:
calculating node distances between a first NUMA node and other NUMA nodes in the compute node;
and sequencing the node distances between the first NUMA node and other NUMA nodes, and determining a second NUMA node in the other NUMA nodes, wherein the second NUMA node is positioned in the same chip with the first NUMA node, and the node distance between the first NUMA node and the second NUMA node is not greater than the node distances between the first NUMA node and other NUMA nodes.
4. The method of claim 2 or 3, wherein the number of the first portion of processor cores is equal to the number of the second portion of processor cores.
5. The method of any of claims 1 to 4, wherein the processor specification is further configured to indicate a size of a memory space in which the virtual machine is to be created, the method further comprising:
under the condition that the cross-NUMA selection interface indicates the tenant to select the processor core of the virtual machine to be created to be arranged in one NUMA node, allocating the memory space in one NUMA node of the computing nodes to the virtual machine to be created, wherein the size of the memory space provided by one NUMA node of the computing nodes is equal to the size of the memory space indicated by the processor specification;
and under the condition that the cross-NUMA selection interface indicates the tenant to select the processor cores of the virtual machine to be created to be arranged in different NUMA nodes, allocating memory spaces in different NUMA nodes of the computing nodes to the virtual machine to be created, wherein the sum of the sizes of the memory spaces provided by the different NUMA nodes of the computing nodes is equal to the size of the memory space indicated by the processor specification.
6. The method in accordance with claim 5, wherein each of the different NUMA nodes is allocated an equal amount of memory space for the virtual machine to be created.
7. A virtual machine creation method, the method comprising:
receiving a virtual machine creation request, wherein the virtual creation request comprises a processor specification of a virtual machine to be created;
determining a computing node with a non-uniform memory access (NUMA) architecture according to the processor specification;
and allocating the processor cores in the NUMA nodes with the minimum node distance in the computing nodes to the virtual machine to be created according to the processor specification.
8. The method of claim 7, wherein assigning processor cores in a NUMA node with a smallest node distance among the compute nodes to the virtual machine to be created according to the processor specification comprises:
acquiring the number of idle processor cores of a plurality of NUMA nodes in the computing node;
according to the processor specification and the number of idle processor cores of the NUMA nodes, selecting a first NUMA node and a second NUMA node, the number of which is not less than a first preset threshold value, from the NUMA nodes, and allocating the processor cores in the first NUMA node and the second NUMA node to the virtual machine to be created, wherein a node distance between the first NUMA node and the second NUMA node is not greater than a node distance between the first NUMA node and other NUMA nodes in the compute node, and the first preset threshold value is determined based on the processor specification.
9. The method of claim 8, wherein a number of processor cores in the first NUMA node allocated to the virtual machine to be created is equal to a number of processor cores in the second NUMA node allocated to the virtual machine to be created.
10. The method of any of claims 7 to 9, wherein the processor specification is used to indicate the number of processor cores allocated to the virtual machine to be created.
11. The method of claim 10, further comprising:
and when the number of the processor cores allocated to the virtual machine to be created, which is indicated by the processor specification, is not larger than a second preset threshold value, selecting a processor core in one NUMA node from the computing nodes to allocate to the virtual machine to be created.
12. The method of claim 8 or 9, wherein the processor specification is further configured to indicate a size of a memory space in which the virtual machine is to be created, the method further comprising:
and according to the processor specification, taking a first memory space in the first NUMA node and a second memory space in the second NUMA node as the memory space of the virtual machine to be created, wherein the sum of the size of the first memory space and the size of the second memory space is equal to the size of the memory space indicated by the processor specification.
13. The method of claim 12, wherein the size of the first memory space is equal to the size of the second memory space.
14. The method of any of claims 7 to 13, wherein receiving a virtual machine creation request comprises:
presenting a specification input interface;
and responding to the input operation of a user on the specification input interface aiming at the processor specification of the virtual machine to be created, and generating the virtual machine creation request.
15. The method of claim 14, wherein the specification input interface comprises a plurality of specification candidates for the virtual machine to be created;
then, the input operation is specifically a selection operation for the multiple specification candidates.
16. The method of any one of claims 7 to 15, wherein the assigning processor cores in a NUMA node with a smallest node distance among the compute nodes to the virtual machine to be created comprises:
and binding the virtual machine to be created with a processor core in a NUMA node with the minimum node distance in the computing nodes.
17. A virtual machine creation apparatus, comprising:
the virtual machine creating interface is used for obtaining processor specifications of a virtual machine to be created and input by a tenant;
a setting module, configured to provide a non-uniform memory access across NUMA selection interface, where the non-uniform memory access across NUMA selection interface is used for the tenant to select to set the processor core of the virtual machine to be created in a different NUMA node or one NUMA node;
the virtual machine creating method comprises a selecting module, a creating module and a creating module, wherein the selecting module is used for selecting a computing node with a NUMA architecture and creating the virtual machine to be created on the computing node;
an allocation module, configured to allocate a processor core in one of the compute nodes to a virtual machine to be created if the cross-NUMA selection interface indicates the tenant selects to set the processor core of the virtual machine to be created in one NUMA node, where the processor core provided by the one of the compute nodes matches the processor specification;
the allocating module is further configured to allocate processor cores in different NUMA nodes of the compute nodes to the virtual machine to be created if the cross-NUMA selection interface indicates the tenant to select the processor cores of the virtual machine to be created to be set in the different NUMA nodes, wherein the processor cores provided by the different NUMA nodes of the compute nodes match the processor specification.
18. The apparatus according to claim 17, wherein the allocation module is specifically configured to:
determining a first NUMA node and a second NUMA node within the same slice of the compute node;
allocating a first portion of processor cores in the first NUMA node and a second portion of processor cores in the second NUMA node to the virtual machine to be created, the sum of the number of the first portion of processor cores and the second portion of processor cores matching the processor specification.
19. The apparatus according to claim 18, wherein the allocation module is specifically configured to:
calculating node distances between a first NUMA node and other NUMA nodes in the compute node;
and sequencing the node distances between the first NUMA node and other NUMA nodes, and determining a second NUMA node in the other NUMA nodes, wherein the second NUMA node is positioned in the same chip with the first NUMA node, and the node distance between the first NUMA node and the second NUMA node is not greater than the node distances between the first NUMA node and other NUMA nodes.
20. The apparatus of claim 18 or 19, wherein the number of the first partial processor cores and the second partial processor cores is equal.
21. The apparatus of any of claims 17 to 20, wherein the processor specification is further configured to indicate a size of a memory space of the virtual machine to be created, and wherein the allocation module is further configured to:
under the condition that the cross-NUMA selection interface indicates the tenant to select the processor core of the virtual machine to be created to be arranged in one NUMA node, allocating the memory space in one NUMA node of the computing nodes to the virtual machine to be created, wherein the size of the memory space provided by one NUMA node of the computing nodes is equal to the size of the memory space indicated by the processor specification;
and under the condition that the cross-NUMA selection interface indicates the tenant to select the processor cores of the virtual machine to be created to be arranged in different NUMA nodes, allocating memory spaces in different NUMA nodes of the computing nodes to the virtual machine to be created, wherein the sum of the sizes of the memory spaces provided by the different NUMA nodes of the computing nodes is equal to the size of the memory space indicated by the processor specification.
22. The apparatus of claim 21 wherein each of the different NUMA nodes has an equal size of memory space allocated to the virtual machine to be created.
23. An apparatus for creating a virtual machine, the apparatus comprising:
the virtual machine creating method comprises the steps of receiving a virtual machine creating request, wherein the virtual creating request comprises processor specifications of a virtual machine to be created;
the determining module is used for determining a computing node with a non-uniform memory access (NUMA) architecture according to the processor specification;
and the allocation module is used for allocating the processor cores in the NUMA nodes with the minimum node distance in the computing nodes to the virtual machine to be created according to the processor specification.
24. The apparatus of claim 23, wherein the assignment module comprises:
acquiring the number of idle processor cores of a plurality of NUMA nodes in the computing node;
according to the processor specification and the number of idle processor cores of the NUMA nodes, selecting the first NUMA node and the second NUMA node, of which the number of idle processor cores is not less than a first preset threshold value, from the NUMA nodes, and allocating the processor cores in the first NUMA node and the second NUMA node to the virtual machine to be created, wherein a node distance between the first NUMA node and the second NUMA node is not greater than a node distance between the first NUMA node and other NUMA nodes in the compute node, and the first preset threshold value is determined based on the processor specification.
25. The apparatus of claim 24 wherein the number of processor cores in the first NUMA node allocated to the virtual machine to be created is equal to the number of processor cores in the second NUMA node allocated to the virtual machine to be created.
26. The apparatus of any of claims 23 to 25, wherein the processor specification is configured to indicate a number of processor cores allocated to the virtual machine to be created.
27. The apparatus of claim 26, wherein the assignment module is further configured to select a processor core of a NUMA node from the compute nodes to assign to the virtual machine to be created when the number of processor cores assigned to the virtual machine to be created as indicated by the processor specification is not greater than a second preset threshold.
28. The apparatus of claim 24 or 25, wherein the processor specification is further configured to indicate a size of a memory space of a virtual machine to be created, and wherein the allocation module is further configured to use a first memory space in the first NUMA node and a second memory space in the second NUMA node as the memory space of the virtual machine to be created according to the processor specification, and wherein a sum of the size of the first memory space and the size of the second memory space is equal to the size of the memory space indicated by the processor specification.
29. The apparatus of claim 28, wherein the size of the first memory space is equal to the size of the second memory space.
30. The apparatus according to any one of claims 23 to 29, wherein the receiving module is specifically configured to:
presenting a specification input interface;
and responding to the input operation of a user on the specification input interface aiming at the processor specification of the virtual machine to be created, and generating the virtual machine creation request.
31. The apparatus of claim 30, wherein the specification input interface comprises a plurality of specification candidates for the virtual machine to be created;
then, the input operation is specifically a selection operation for the multiple specification candidates.
32. The apparatus according to any one of claims 23 to 31, wherein the assignment module is specifically configured to bind the virtual machine to be created to a processor core in a NUMA node with a smallest node distance among the compute nodes.
33. A computer device comprising a memory storing a program and a processor executing the program to perform the method of any of claims 1 to 6.
34. A computer device comprising a memory storing a program and a processor executing the program to perform the method of any of claims 7 to 16.
35. A computer-readable storage medium comprising instructions that, when executed on a computing device, cause the computing device to perform the method of any of claims 1 to 6.
36. A computer-readable storage medium comprising instructions that, when executed on a computing device, cause the computing device to perform the method of any of claims 7 to 16.
CN202011196975.8A 2020-09-08 2020-10-30 Virtual machine creation method and related equipment Pending CN114153549A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2020109358879 2020-09-08
CN202010935887 2020-09-08

Publications (1)

Publication Number Publication Date
CN114153549A true CN114153549A (en) 2022-03-08

Family

ID=80462208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011196975.8A Pending CN114153549A (en) 2020-09-08 2020-10-30 Virtual machine creation method and related equipment

Country Status (1)

Country Link
CN (1) CN114153549A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002046A (en) * 2022-05-26 2022-09-02 北京天融信网络安全技术有限公司 Message processing method, NUMA node, electronic device and storage medium
WO2023179170A1 (en) * 2022-03-24 2023-09-28 华为云计算技术有限公司 Instance configuration method and apparatus, and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023179170A1 (en) * 2022-03-24 2023-09-28 华为云计算技术有限公司 Instance configuration method and apparatus, and device
CN115002046A (en) * 2022-05-26 2022-09-02 北京天融信网络安全技术有限公司 Message processing method, NUMA node, electronic device and storage medium
CN115002046B (en) * 2022-05-26 2024-01-23 北京天融信网络安全技术有限公司 Message processing method, NUMA node, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11714671B2 (en) Creating virtual machine groups based on request
US10331491B2 (en) Virtual data center resource mapping method and device
JPWO2012066640A1 (en) Computer system, migration method and management server
US11029998B2 (en) Grouping of tasks for distribution among processing entities
CN114416352A (en) Computing resource allocation method and device, electronic equipment and storage medium
CN114153549A (en) Virtual machine creation method and related equipment
CN111124687A (en) CPU resource reservation method, device and related equipment
US20210200704A1 (en) Input/output command rebalancing in a virtualized computer system
CN108228350A (en) A kind of resource allocation methods and device
CN114629960A (en) Resource scheduling method, device, system, device, medium, and program product
US11294591B2 (en) Apparatus configured to create extended configuration proposal of storage system including multiple notes
JP6666553B2 (en) Information processing apparatus, job management method, and job management program
CN106020971B (en) CPU scheduling method and device in cloud host system
WO2022063273A1 (en) Resource allocation method and apparatus based on numa attribute
CN116339989A (en) Mixed part server, resource management method and device of mixed part server
CN115098269A (en) Resource allocation method, device, electronic equipment and storage medium
CN115150268A (en) Network configuration method and device of Kubernetes cluster and electronic equipment
US11307889B2 (en) Schedule virtual machines
US11237745B2 (en) Computer system and volume arrangement method in computer system to reduce resource imbalance
CN109617954B (en) Method and device for creating cloud host
CN113821157A (en) Local disk mounting method, device, equipment and storage medium
WO2023226437A1 (en) Resource scheduling method, apparatus and device
CN116483740B (en) Memory data migration method and device, storage medium and electronic device
CN117349009A (en) Cluster node determining method and device
CN117193947A (en) Container set allocation method, device, equipment and storage medium based on multiple resources

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination