Movatterモバイル変換


[0]ホーム

URL:


CN116069447B - A method, device, equipment, and medium for generating NUMA topology of a virtual machine - Google Patents

A method, device, equipment, and medium for generating NUMA topology of a virtual machine

Info

Publication number
CN116069447B
CN116069447BCN202310112889.1ACN202310112889ACN116069447BCN 116069447 BCN116069447 BCN 116069447BCN 202310112889 ACN202310112889 ACN 202310112889ACN 116069447 BCN116069447 BCN 116069447B
Authority
CN
China
Prior art keywords
virtual machine
numa
target
topology
nodes
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.)
Active
Application number
CN202310112889.1A
Other languages
Chinese (zh)
Other versions
CN116069447A (en
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.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology 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 Inspur Jinan data Technology Co ltdfiledCriticalInspur Jinan data Technology Co ltd
Priority to CN202310112889.1ApriorityCriticalpatent/CN116069447B/en
Publication of CN116069447ApublicationCriticalpatent/CN116069447A/en
Application grantedgrantedCritical
Publication of CN116069447BpublicationCriticalpatent/CN116069447B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本申请公开了一种虚拟机NUMA拓扑生成方法、装置、设备、介质,涉及虚拟化技术领域,包括:当接收对虚拟机的调度请求之后,基于调度请求判断虚拟机资源模型是否指定虚拟机的NUMA节点数量;若虚拟机资源模型未指定虚拟机的NUMA节点数量,则基于虚拟机的资源大小与标准资源大小关系确定虚拟机的目标NUMA节点数量;按照目标NUMA节点数量生成虚拟机的NUMA拓扑并选择对应的目标主机。增加了在调度的过程中动态的选择虚拟机NUMA拓扑的过程,最终虚拟创建使用的NUMA拓扑即为虚拟机的最佳NUMA拓扑,能够在优先保证虚拟机具有最高的性能的同时保证虚拟机创建的成功率,能覆盖备选主机列表硬件情况不尽相同的复杂场景。

This application discloses a method, apparatus, device, and medium for generating a virtual machine NUMA topology, relating to the field of virtualization technology. The method comprises: upon receiving a scheduling request for a virtual machine, determining whether the virtual machine resource model specifies the number of NUMA nodes for the virtual machine based on the scheduling request; if the virtual machine resource model does not specify the number of NUMA nodes for the virtual machine, determining the target number of NUMA nodes for the virtual machine based on the relationship between the virtual machine resource size and the standard resource size; generating the virtual machine's NUMA topology according to the target number of NUMA nodes and selecting the corresponding target host. A process for dynamically selecting the virtual machine's NUMA topology during scheduling has been added, and the NUMA topology ultimately used for virtual creation is the optimal NUMA topology for the virtual machine. This method can prioritize the highest performance for the virtual machine while ensuring the success rate of virtual machine creation, and can cover complex scenarios where the hardware conditions of the candidate host list vary.

Description

Virtual machine NUMA topology generation method, device, equipment and medium
Technical Field
The present invention relates to the field of virtualization technologies, and in particular, to a virtual machine NUMA topology generation method, device, equipment, and medium.
Background
In the virtualization scenario, cpu and memory perform best under the same hardware conditions when the virtual machine is bound to a single NUMA node of the host. In the current OpenStack nova, the virtual machine is created by default without specifying NUMA topology to the virtual machine unless the user specifies hw numa_nodes in the specification metadata. In addition, because a user can set whether the NUMA topology is specified in the specification metadata, the virtual machines which are not specified with the NUMA topology in the actual production environment can run on one host at the same time, and because the memory occupation of the virtual machines which are not specified with the NUMA topology can be distributed on each NUMA node of the host at random in practice, the management surface cannot be controlled, the problem that memory contention can occur when two types of virtual machines coexist on the same host and the stability of the service is influenced is caused, and the community needs to create the virtual machines with the specified NUMA topology by specifying hw (numa_nodes) in the specification metadata, so that the problem that the user is easy to configure errors and the use cost is high is caused.
The OpenStack community suggests that NUMA topology with the number of NUMA nodes being 1 is allocated to a virtual machine by default when the virtual machine is created by designating hw: mem_page_size=any in metadata of specifications, but some large specifications exist, and the problem that the virtual machine is created to fail may be caused. By inquiring the disclosure materials, the scheme which is not disclosed at present can automatically generate the optimal NUMA topology for the virtual machine, reduce the use cost and ensure the success rate of virtual machine creation while ensuring the maximum performance of the virtual machine.
In summary, how to select the optimal NUMA topology according to the situation of the alternative host by default without the need of a user to specify the number of NUMA nodes in the specification metadata, and reducing the use difficulty and cost of the user are technical problems to be solved in the field.
Disclosure of Invention
In view of the above, the present invention aims to provide a virtual machine NUMA topology generation method, apparatus, device, and medium, which can avoid the need for a user to specify the number of NUMA nodes in specification metadata, and the system can select the optimal NUMA topology by default according to the situation of an alternative host, thereby reducing the difficulty and cost of user use. The specific scheme is as follows:
in a first aspect, the application discloses a virtual machine NUMA topology generating method, which comprises the following steps:
After receiving a scheduling request for a virtual machine, judging whether a virtual machine resource model designates the number of NUMA nodes of the virtual machine or not based on the scheduling request;
If the virtual machine resource model does not specify the NUMA node number of the virtual machine, determining the target NUMA node number of the virtual machine based on the relation between the resource size of the virtual machine and the standard resource size;
and generating NUMA topology of the virtual machine according to the number of the target NUMA nodes and selecting a corresponding target host.
Optionally, after determining whether the virtual machine resource model specifies the NUMA node number of the virtual machine based on the scheduling request, the method further includes:
And if the virtual machine resource model designates the NUMA node number of the virtual machine, acquiring the target NUMA node number of the virtual machine designated in the virtual machine resource model, and selecting a corresponding target host according to the target NUMA node number.
Optionally, the determining the target NUMA node number of the virtual machine based on the resource size of the virtual machine and the standard resource size relationship includes:
The number and the memory resource size of the central processing units to be created of the virtual machine are respectively compared with the standard number of the central processing units of the single NUMA node and the standard memory resource size of the single NUMA node to obtain corresponding comparison results;
And if the comparison result is that the number of the central processors to be created and the memory resource size are smaller than and/or equal to the standard number of the central processors of the single NUMA node and the standard memory resource size of the single NUMA node, setting the target number of the NUMA nodes of the virtual machine as the preset number.
Optionally, after comparing the number of central processors to be created and the memory resource size of the virtual machine with the standard number of central processors of a single NUMA node and the standard memory resource size of the single NUMA node respectively to obtain corresponding comparison results, the method further includes:
And if the comparison result is that the number of the central processors to be created is larger than the standard number of the central processors of the single NUMA node and/or the memory resource size is larger than the standard memory resource size of the single NUMA node, adjusting the preset number, and setting the target NUMA node number of the virtual machine as the adjusted preset number.
Optionally, after receiving the scheduling request for the virtual machine, before determining whether the virtual machine resource model specifies the NUMA node number of the virtual machine, the method further includes:
and adjusting the arrangement sequence of a filter queue formed by the resource filters, and placing a target filter for filtering NUMA resources at the tail position of the filter queue.
Optionally, the generating the NUMA topology of the virtual machine according to the number of the target NUMA nodes and selecting a corresponding target host includes:
And generating NUMA topology of the virtual machine by using the target filter and based on the number of target NUMA nodes and selecting a corresponding target host from a host list.
Optionally, the selecting, by using the target filter and based on the number of target NUMA nodes, a corresponding target host from a host list includes:
judging whether a corresponding target host exists in a host list based on the number of target NUMA nodes, if not, adjusting the number of target NUMA nodes, determining the number of newly increased target NUMA nodes, and selecting the corresponding target host by utilizing the number of newly increased target NUMA nodes.
In a second aspect, the present application discloses a virtual machine NUMA topology generation apparatus, including:
The judging module is used for judging whether the virtual machine resource model designates the NUMA node number of the virtual machine or not based on the scheduling request after receiving the scheduling request of the virtual machine;
The resource determining module is used for determining the target NUMA node number of the virtual machine based on the relation between the resource size of the virtual machine and the standard resource size if the NUMA node number of the virtual machine is not specified by the virtual machine resource model;
and the topology generation module is used for generating NUMA topology of the virtual machine according to the number of the target NUMA nodes and selecting a corresponding target host.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and a processor for executing the computer program to implement the steps of the virtual machine NUMA topology generating method disclosed above.
In a fourth aspect, the present application discloses a computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the virtual machine NUMA topology generation method disclosed above.
The application discloses a virtual machine NUMA topology generation method, which comprises the steps of judging whether a virtual machine resource model designates the number of NUMA nodes of a virtual machine or not based on a scheduling request after receiving the scheduling request of the virtual machine, determining the number of target NUMA nodes of the virtual machine based on the relation between the resource size of the virtual machine and the standard resource size if the virtual machine resource model does not designate the number of the NUMA nodes of the virtual machine, and generating the NUMA topology of the virtual machine and selecting a corresponding target host according to the number of the target NUMA nodes. Therefore, by adding the step of judging the scheduling request of the virtual machine, compared with the process of directly distributing the corresponding NUMA topology according to a default mode after receiving the scheduling request, the method and the device increase the process of dynamically selecting the NUMA topology of the virtual machine in the scheduling process, and finally, the NUMA topology used by virtual creation is the optimal NUMA topology of the virtual machine, so that the success rate of virtual machine creation can be ensured while the highest performance of the virtual machine is preferentially ensured, and complex scenes with different hardware conditions of the list of alternative hosts can be covered.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a virtual machine NUMA topology generation method disclosed by the application;
FIG. 2 is a flowchart of a specific virtual machine NUMA topology generating method disclosed by the application;
FIG. 3 is a schematic diagram of a virtual machine NUMA topology disclosed by the application;
fig. 4 is a block diagram of an electronic device according to the present disclosure.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the virtualization scenario, cpu and memory perform best under the same hardware conditions when the virtual machine is bound to a single NUMA node of the host. In the current OpenStack nova, the virtual machine is created by default without specifying NUMA topology to the virtual machine unless the user specifies hw numa_nodes in the specification metadata. In addition, because a user can set whether the NUMA topology is specified in the specification metadata, the virtual machines which are not specified with the NUMA topology in the actual production environment can run on one host at the same time, and because the memory occupation of the virtual machines which are not specified with the NUMA topology can be distributed on each NUMA node of the host at random in practice, the management surface cannot be controlled, the problem that memory contention can occur when two types of virtual machines coexist on the same host and the stability of the service is influenced is caused, and the community needs to create the virtual machines with the specified NUMA topology by specifying hw (numa_nodes) in the specification metadata, so that the problem that the user is easy to configure errors and the use cost is high is caused.
The OpenStack community suggests that NUMA topology with the number of NUMA nodes being 1 is allocated to a virtual machine by default when the virtual machine is created by designating hw: mem_page_size=any in metadata of specifications, but some large specifications exist, and the problem that the virtual machine is created to fail may be caused. By inquiring the disclosure materials, the scheme which is not disclosed at present can automatically generate the optimal NUMA topology for the virtual machine, reduce the use cost and ensure the success rate of virtual machine creation while ensuring the maximum performance of the virtual machine.
Therefore, the virtual machine NUMA topology generation scheme provided by the application can avoid the specification metadata of a user to specify the number of NUMA nodes, and the system can select the optimal NUMA topology by default according to the condition of the alternative host, so that the use difficulty and cost of the user are reduced.
Referring to fig. 1, the embodiment of the invention discloses a virtual machine NUMA topology generation method, which comprises the following steps:
And step S11, after receiving a scheduling request for the virtual machine, judging whether the virtual machine resource model designates the NUMA node number of the virtual machine or not based on the scheduling request.
In this embodiment, in the virtualization scenario, multiple virtual machines are created through the host machine to process the corresponding service request, where isolation exists between the virtual machines, that is, the memory occupied by each virtual machine and the central processor resource are also separated and do not affect each other, and in the OpenStack project, the virtual machine computing resource is managed through nova. The OpenStack is an open-source cloud computing management platform project and is a combination of a series of open-source software projects. When managing the resources of the virtual machine, the NUMA is involved, and the NUMA is provided with a plurality of nodes, each node can be provided with a plurality of CPUs, and a common memory controller is used in the node, so that all memory access delays of the node are identical to all central processing units of the node. Therefore, after receiving the scheduling request of the virtual machine, firstly judging the resources in the virtual machine resource model, namely judging whether the number of nodes of NUMA is included in the specification, specifically, when the scheduling request is executed by a resource scheduling component nova-schedule, firstly judging whether hw is specified in the specification, wherein the nova-schedule is a component responsible for scheduling for nova projects, and is used for selecting the best target host for creating the virtual machine, specifically, filtering different resources through a plurality of filters, and finally, taking the host of which the filtered various resources meet the preset conditions as the target host.
In this embodiment, after determining whether the virtual machine resource model specifies the number of NUMA nodes of the virtual machine based on the scheduling request, the method further includes obtaining a target number of NUMA nodes of the virtual machine specified in the virtual machine resource model if the virtual machine resource model specifies the number of NUMA nodes of the virtual machine, and selecting a corresponding target host according to the target number of NUMA nodes. It will be appreciated that if the number of NUMA nodes for the virtual machine has been specified in the specification, i.e., the hw: numa_nodes metadata is specified, then the target host with appropriate resources is selected according to the specified hw: numa_nodes metadata without triggering subsequent operations, i.e., the virtual machine to be created at this time defaults to a virtual machine of the specified NUMA topology.
And step S12, if the NUMA node number of the virtual machine is not specified by the virtual machine resource model, determining the target NUMA node number of the virtual machine based on the relation between the resource size of the virtual machine and the standard resource size.
In this embodiment, if the number of NUMA nodes of the virtual machine is not specified by the virtual machine resource model, an operation of dynamically generating and adjusting the NUMA topology of the virtual machine is triggered, and the resource size of the virtual machine is compared with a preset standard resource size, where the virtual machine resource to be compared may be a central processor to be created, a memory resource, and the like, and specifically, the number of central processors to be created, the memory resource size of the virtual machine are respectively compared with the standard number of central processors of a single NUMA node, and the standard memory resource size of a single NUMA node, so as to obtain a corresponding comparison result. The largest memory of the single-host largest NUMA node is the standard memory resource of the single NUMA node, and the largest cpu of the single-host largest NUMA node is the central processor of the single NUMA node.
In a specific embodiment, the comparison result is that the number of the central processing units to be created, the memory resource size are smaller than and/or equal to the standard number of single-NUMA node central processing units and the standard memory resource size of single-NUMA node, and then the target number of NUMA nodes of the virtual machine is set to be a preset number. It can be understood that, when the comparison result indicates that the number of the central processing units to be created is not greater than max_node_cpu and the memory resource size is not greater than max_node_mem, it indicates that the resources required by the virtual machine can work under a default node number, that is, the number of NUMA nodes is set to be a preset number. Specifically, when the preset number is set to 1, the number of NUMA nodes of the NUMA topology of the virtual machine may be set to 1 when the comparison result of the two resources of the virtual machine is smaller than the preset two resources, and when the preset number is set to 1, the virtual machine is mainly considered to be deployed in one NUMA node, so that the efficiency can be improved.
In another specific embodiment, the comparison result is that the number of the central processing units to be created is greater than the standard number of the central processing units of a single NUMA node and/or the memory resource size is greater than the standard memory resource size of the single NUMA node, then the preset number is adjusted, and the target NUMA node number of the virtual machine is set to be the adjusted preset number. It can be understood that the operation of NUMA node quantity adjustment is triggered when any one of the following three situations occurs, wherein the three situations specifically include that the quantity of the central processing units to be created is greater than max_node_cpu, and the memory resource size is not greater than max_node_mem; the method comprises the steps of setting the number of the virtual machines to be deployed and the memory requirement to be 1, setting the number to be 1 to be unsuitable, enabling the virtual machines to use 2 nodes or more, specifically setting the number of NUMA nodes to be max (mem/max_node_ mme, cpu/max_node_cpu) (taking the minimum even number), namely, calculating the first value of the number of the virtual machines to be created divided by the standard number of the central processors of a single MA node, taking the second value of the virtual machines after the number of the virtual machines to be created is divided by the first value of the standard number of the central processors of the single MA node, taking the maximum even number, and taking the second value of the virtual machines after the number of the virtual machines is divided by the second value of the single MA node, taking the maximum value as the maximum value, wherein the first value is updated after the first value is set to be the maximum value.
And step S13, generating NUMA topology of the virtual machine according to the number of the target NUMA nodes and selecting a corresponding target host.
In this embodiment, the NUMA topology is generated according to the determined number of target NUMA nodes, and the corresponding target host is selected from the host list. Specifically, the strategy of using the most likely equally dividing the CPU and the memory is as follows:
If the number of cpus of the virtual machine can be divided by the number of set NUMA nodes, for example, the number of cpus is 32 and the number of set NUMA nodes is 2, the generated NUMA topology is equal, that is, [ node0: { vcpu =16, memory=mem/2 }, node1: { vcpu =16, memory=mem/2 } ]
Otherwise, for example, the cpu number is 22, the set NUMA node number is 4, and the generated NUMA topology is equally divided as much as possible, that is [ node0: { vcpu =6, memory=mem/4 }, node1: { vcpu =6, memory=mem/4 }, node2: { vcpu:5, memory=mem/4 }, node3: { vcpu:5, memory=mem/4 } ].
The application discloses a virtual machine NUMA topology generation method, which comprises the steps of judging whether a virtual machine resource model designates the number of NUMA nodes of a virtual machine or not based on a scheduling request after receiving the scheduling request of the virtual machine, determining the number of target NUMA nodes of the virtual machine based on the relation between the resource size of the virtual machine and the standard resource size if the virtual machine resource model does not designate the number of the NUMA nodes of the virtual machine, and generating the NUMA topology of the virtual machine and selecting a corresponding target host according to the number of the target NUMA nodes. Therefore, by adding the step of judging the scheduling request of the virtual machine, compared with the process of directly distributing the corresponding NUMA topology according to a default mode after receiving the scheduling request, the method and the device increase the process of dynamically selecting the NUMA topology of the virtual machine in the scheduling process, and finally, the NUMA topology used by virtual creation is the optimal NUMA topology of the virtual machine, so that the success rate of virtual machine creation can be ensured while the highest performance of the virtual machine is preferentially ensured, and complex scenes with different hardware conditions of the list of alternative hosts can be covered.
Referring to fig. 2, an embodiment of the present invention discloses a specific virtual machine NUMA topology generation method, and compared with the previous embodiment, the present embodiment further describes and optimizes a technical solution. Specific:
And S21, adjusting the arrangement sequence of a filter queue formed by the resource filters, and placing a target filter for filtering NUMA resources at the tail position of the filter queue.
In this embodiment, the target filter NUMATopologyFilter for filtering the NUMA resources is first placed behind all the resource filters, so as to perform NUMA resource filtering at last, where the resource filters are all filters for filtering whether the corresponding resources of the host meet the requirement of the virtual machine.
Step S22, after receiving the scheduling request for the virtual machine, judging whether the virtual machine resource model designates the NUMA node number of the virtual machine or not based on the scheduling request.
And S23, if the NUMA node number of the virtual machine is not specified by the virtual machine resource model, determining the target NUMA node number of the virtual machine based on the relation between the resource size of the virtual machine and the standard resource size.
In the more detailed processing in steps S22 and S23, please refer to the above disclosed embodiment, and the detailed description is omitted here.
And step S24, generating NUMA topology of the virtual machine according to the number of the target NUMA nodes and selecting a corresponding target host.
In this embodiment, after determining the number of target NUMA nodes, the target filter is utilized to generate a NUMA topology of the virtual machine based on the number of target NUMA nodes and select a corresponding target host from a host list. Specifically, NUMATopologyFilter, executing, generating a corresponding NUMA topology, selecting a target host meeting the number of target NUMA nodes from the host list, determining the target host, returning to the selected host list and the generated NUMA topology, and ending,
In this embodiment, whether a corresponding target host exists in the host list is determined based on the number of target NUMA nodes, if not, the number of target NUMA nodes is adjusted, the number of new target NUMA nodes is determined, and the corresponding target host is selected by using the number of new target NUMA nodes. It can be appreciated that, when NUMATopologyFilter is executed in the process of selecting the target host meeting the target NUMA node number from the host list, if the target host meeting the target NUMA node number does not exist in the host list, the NUMA node number is adjusted again, the adjusted policy is to increase the NUMA node number (to take the minimum even number), the current newly increased target NUMA node number is utilized to match the appropriate target host again from the host list, and if the current newly increased target NUMA node number is greater than max_node_num or is greater than the virtual machine cpu number, the target host is still not selected.
In this embodiment, because the alternative host list may have different hardware structures, for example, the hosts have different NUMA node numbers and the cpu or the total memory of a single NUMA node of the host is different, the target host in the host list needs to be selected by using the target NUMA node number obtained after processing in the scheduling process, so as to dynamically generate and adjust the virtual machine NUMA topology, thereby achieving the purpose of selecting the optimal NUMA topology.
Therefore, the virtual machines created in the environment are virtual machines with assigned NUMA topology by default, the performance of the virtual machines is improved, meanwhile, the problem of possible memory contention when the virtual machines with assigned NUMA topology and the virtual machines without assigned NUMA topology are operated on a host is solved, the performance and the success rate of virtual machine creation are simultaneously considered when the optimal NUMA topology is generated for the virtual machines, a scheme of automatically selecting the optimal NUMA topology for the virtual machines is adopted, the created virtual machines are provided with optimal performance by default, the success rate of virtual machine creation is guaranteed, and the optimal NUMA topology can be selected by combining the OpenStack nova scheduling process.
Referring to fig. 3, the embodiment of the invention also correspondingly discloses a virtual machine NUMA topology generating device, which includes:
A judging module 11, configured to, after receiving a scheduling request for a virtual machine, judge whether a virtual machine resource model specifies a NUMA node number of the virtual machine based on the scheduling request;
A resource determining module 12, configured to determine, if the virtual machine resource model does not specify the number of NUMA nodes of the virtual machine, a target number of NUMA nodes of the virtual machine based on a relationship between a resource size of the virtual machine and a standard resource size;
And the topology generation module 13 is used for generating NUMA topology of the virtual machine according to the number of the target NUMA nodes and selecting a corresponding target host.
The judging module 11 is specifically configured to create, in a virtualized scenario, a plurality of virtual machines through a host machine, where isolation exists between each virtual machine, that is, memory occupied by each virtual machine and central processor resources are also separated and do not affect each other, and in an OpenStack project, virtual machine computing resources are managed through nova. The OpenStack is an open-source cloud computing management platform project and is a combination of a series of open-source software projects. When managing the resources of the virtual machine, the NUMA is involved, and the NUMA is provided with a plurality of nodes, each node can be provided with a plurality of CPUs, and a common memory controller is used in the node, so that all memory access delays of the node are identical to all central processing units of the node. Therefore, after receiving the scheduling request of the virtual machine, firstly judging the resources in the virtual machine resource model, namely judging whether the number of nodes at NUMAw is included in the specification, specifically, when the scheduling request is executed by a resource scheduling component nova-schedule, firstly judging whether hw is specified in the specification, wherein the nova-schedule is a component responsible for scheduling for nova projects, and is used for selecting the best target host for creating the virtual machine, specifically, filtering different resources through a plurality of filters, and finally, taking the host of which the filtered various resources meet the preset conditions as the target host. After judging whether the virtual machine resource model designates the NUMA node number of the virtual machine based on the scheduling request, the method further comprises the steps of acquiring the target NUMA node number of the virtual machine designated by the virtual machine resource model if the virtual machine resource model designates the NUMA node number of the virtual machine, and selecting a corresponding target host according to the target NUMA node number. It will be appreciated that if the number of NUMA nodes for the virtual machine has been specified in the specification, i.e., the hw: numa_nodes metadata is specified, then the target host with appropriate resources is selected according to the specified hw: numa_nodes metadata without triggering subsequent operations, i.e., the virtual machine to be created at this time defaults to a virtual machine of the specified NUMA topology.
The resource determining module 12 is specifically configured to trigger an operation of dynamically generating and adjusting a virtual machine NUMA topology if the virtual machine resource model does not specify the number of NUMA nodes of the virtual machine, compare a resource size of the virtual machine with a preset standard resource size, wherein the virtual machine resource to be compared may be a central processor to be created, a memory resource, etc., specifically, compare the number of central processors to be created, the memory resource size of the virtual machine with the standard number of central processors of a single NUMA node, and the standard memory resource size of a single NUMA node respectively, so as to obtain a corresponding comparison result, and it can be understood that a number of NUMA nodes with a maximum single host in a list of candidate hosts is denoted as max_node_num, a number of cpu with a maximum single host NUMA node is denoted as max_node_mem, and a number of cpu with a maximum single host NUMA maximum host is denoted as max_node_cpu, and the max_node_mem is generally paired with max_node_cpu. The largest memory of the single-host largest NUMA node is the standard memory resource of the single NUMA node, and the largest cpu of the single-host largest NUMA node is the central processor of the single NUMA node.
In a specific embodiment, the comparison result is that the number of the central processing units to be created, the memory resource size are smaller than and/or equal to the standard number of single-NUMA node central processing units and the standard memory resource size of single-NUMA node, and then the target number of NUMA nodes of the virtual machine is set to be a preset number. It can be understood that, when the comparison result indicates that the number of the central processing units to be created is not greater than max_node_cpu and the memory resource size is not greater than max_node_mem, it indicates that the resources required by the virtual machine can work under a default node number, that is, the number of NUMA nodes is set to be a preset number. Specifically, when the preset number is set to 1, the number of NUMA nodes of the NUMA topology of the virtual machine may be set to 1 when the comparison result of the two resources of the virtual machine is smaller than the preset two resources, and when the preset number is set to 1, the virtual machine is mainly considered to be deployed in one NUMA node, so that the efficiency can be improved.
In another specific embodiment, the comparison result is that the number of the central processing units to be created is greater than the standard number of the central processing units of a single NUMA node and/or the memory resource size is greater than the standard memory resource size of the single NUMA node, then the preset number is adjusted, and the target NUMA node number of the virtual machine is set to be the adjusted preset number. It can be understood that the operation of NUMA node quantity adjustment is triggered when any one of the following three situations occurs, wherein the three situations specifically include that the quantity of the central processing units to be created is greater than max_node_cpu, and the memory resource size is not greater than max_node_mem; the method comprises the steps of setting the number of the virtual machines to be deployed and the memory requirement to be 1, setting the number to be 1 to be unsuitable, enabling the virtual machines to use 2 nodes or more, specifically setting the number of NUMA nodes to be max (mem/max_node_ mme, cpu/max_node_cpu) (taking the minimum even number), namely, calculating the first value of the number of the virtual machines to be created divided by the standard number of the central processors of a single MA node, taking the second value of the virtual machines after the number of the virtual machines to be created is divided by the first value of the standard number of the central processors of the single MA node, taking the maximum even number, and taking the second value of the virtual machines after the number of the virtual machines is divided by the second value of the single MA node, taking the maximum value as the maximum value, wherein the first value is updated after the first value is set to be the maximum value.
The application discloses a virtual machine NUMA topology generation device, which comprises the steps of judging whether a virtual machine resource model designates the number of NUMA nodes of a virtual machine or not based on a scheduling request after receiving the scheduling request of the virtual machine, determining the number of target NUMA nodes of the virtual machine based on the relation between the resource size of the virtual machine and the standard resource size if the virtual machine resource model does not designate the number of the NUMA nodes of the virtual machine, and generating the NUMA topology of the virtual machine and selecting a corresponding target host according to the number of the target NUMA nodes. Therefore, by adding the step of judging the scheduling request of the virtual machine, compared with the process of directly distributing the corresponding NUMA topology according to a default mode after receiving the scheduling request, the method and the device increase the process of dynamically selecting the NUMA topology of the virtual machine in the scheduling process, and finally, the NUMA topology used by virtual creation is the optimal NUMA topology of the virtual machine, so that the success rate of virtual machine creation can be ensured while the highest performance of the virtual machine is preferentially ensured, and complex scenes with different hardware conditions of the list of alternative hosts can be covered.
In some embodiments, the virtual machine NUMA topology generating apparatus may specifically include:
The host selection unit is used for acquiring the target NUMA node number of the virtual machine appointed by the virtual machine in the virtual machine resource model if the NUMA node number of the virtual machine is appointed by the virtual machine resource model, and selecting a corresponding target host according to the target NUMA node number.
In some embodiments, the resource determining module 12 may specifically include:
The first quantity determining unit is used for comparing the quantity and the memory resource size of the central processing units to be created of the virtual machine with the standard quantity and the standard memory resource size of the single NUMA node central processing unit respectively so as to obtain corresponding comparison results;
And if the comparison result is that the number of the central processors to be created and the memory resource size are smaller than and/or equal to the standard number of the central processors of the single NUMA node and the standard memory resource size of the single NUMA node, setting the target number of the NUMA nodes of the virtual machine as the preset number.
In some embodiments, the virtual machine NUMA topology generating apparatus may specifically include:
And the second number determining unit is used for adjusting the preset number and setting the target NUMA node number of the virtual machine as the adjusted preset number if the comparison result is that the number of the central processing units to be created is larger than the standard number of the central processing units of the single NUMA node and/or the memory resource size is larger than the standard memory resource size of the single NUMA node.
In some embodiments, the virtual machine NUMA topology generating apparatus may specifically include:
and the sequence adjusting unit is used for adjusting the arrangement sequence of the filter queue formed by the resource filters and placing the target filter for filtering the NUMA resources at the tail position of the filter queue.
In some embodiments, the topology generating module 13 may specifically include:
And the topology generation sub-module is used for generating NUMA topology of the virtual machine by utilizing the target filter and based on the number of target NUMA nodes and selecting a corresponding target host from a host list.
In some embodiments, the topology generating sub-module may specifically include:
The host determining unit is used for judging whether a corresponding target host exists in the host list based on the number of target NUMA nodes, if the corresponding target host does not exist, adjusting the number of target NUMA nodes, determining the number of newly added target NUMA nodes, and selecting the corresponding target host by utilizing the number of newly added target NUMA nodes.
Further, the embodiment of the present application further discloses an electronic device, and fig. 4 is a block diagram of an electronic device 20 according to an exemplary embodiment, where the content of the diagram is not to be considered as any limitation on the scope of use of the present application.
Fig. 4 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may include, in particular, at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input-output interface 25, and a communication bus 26. The memory 22 is configured to store a computer program, where the computer program is loaded and executed by the processor 21 to implement relevant steps in the virtual machine NUMA topology generation method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide working voltages for each hardware device on the electronic device 20, the communication interface 24 is capable of creating a data transmission channel with an external device for the electronic device 20, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein, and the input/output interface 25 is configured to obtain external input data or output data to the external device, and the specific interface type of the input/output interface may be selected according to the specific application needs and is not specifically limited herein.
Processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL Processing), FPGA (Field-Programmable gate array), PLA (Programmable Logic Array ). The processor 21 may also include a main processor, which is a processor for processing data in a wake-up state, also called a CPU (Central Processing Unit ), and a coprocessor, which is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 21 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon may include an operating system 221, a computer program 222, and the like, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the processor 21 on the mass data 223 in the memory 22, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further comprise a computer program capable of performing other specific tasks in addition to the computer program capable of performing the virtual machine NUMA topology generating method performed by the electronic device 20 as disclosed in any of the embodiments previously described. The data 223 may include, in addition to data received by the electronic device and transmitted by the external device, data collected by the input/output interface 25 itself, and so on.
Furthermore, the application also discloses a computer readable storage medium for storing a computer program, wherein the computer program realizes the virtual machine NUMA topology generating method when being executed by a processor. For specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no further description is given here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The foregoing describes the virtual machine NUMA topology generation method, apparatus, device and medium, and specific examples are provided herein to illustrate the principles and embodiments of the present invention, and the description of the foregoing examples is only for aiding in understanding the method and core concept of the present invention, and meanwhile, to those skilled in the art, according to the concept of the present invention, there are variations in the specific embodiments and application ranges, so the disclosure should not be construed as limiting the invention.

Claims (9)

CN202310112889.1A2023-02-102023-02-10 A method, device, equipment, and medium for generating NUMA topology of a virtual machineActiveCN116069447B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202310112889.1ACN116069447B (en)2023-02-102023-02-10 A method, device, equipment, and medium for generating NUMA topology of a virtual machine

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202310112889.1ACN116069447B (en)2023-02-102023-02-10 A method, device, equipment, and medium for generating NUMA topology of a virtual machine

Publications (2)

Publication NumberPublication Date
CN116069447A CN116069447A (en)2023-05-05
CN116069447Btrue CN116069447B (en)2025-08-22

Family

ID=86179998

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202310112889.1AActiveCN116069447B (en)2023-02-102023-02-10 A method, device, equipment, and medium for generating NUMA topology of a virtual machine

Country Status (1)

CountryLink
CN (1)CN116069447B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116755829A (en)*2023-05-112023-09-15阿里云计算有限公司Method for generating host PCIe topological structure and method for distributing container resources
CN116610372B (en)*2023-07-142024-02-09腾讯科技(深圳)有限公司CPU configuration method, device and related products

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114020405A (en)*2021-10-272022-02-08郑州云海信息技术有限公司Virtual machine scheduling method, device, equipment and medium
CN114153549A (en)*2020-09-082022-03-08华为云计算技术有限公司 A kind of virtual machine creation method and related equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US9535767B2 (en)*2009-03-262017-01-03Microsoft Technology Licensing, LlcInstantiating a virtual machine with a virtual non-uniform memory architecture
CN110750336B (en)*2019-10-292022-06-17北京浪潮数据技术有限公司OpenStack virtual machine memory hot-expanding method
CN111722908B (en)*2020-06-122023-01-06苏州浪潮智能科技有限公司 Method, system, device and medium for creating a virtual machine
US12086634B2 (en)*2021-07-232024-09-10VMware LLCOptimizing VM NUMA configuration and workload placement in a heterogeneous cluster
CN115269118A (en)*2022-07-292022-11-01天翼云科技有限公司 A scheduling method, device and device for a virtual machine

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114153549A (en)*2020-09-082022-03-08华为云计算技术有限公司 A kind of virtual machine creation method and related equipment
CN114020405A (en)*2021-10-272022-02-08郑州云海信息技术有限公司Virtual machine scheduling method, device, equipment and medium

Also Published As

Publication numberPublication date
CN116069447A (en)2023-05-05

Similar Documents

PublicationPublication DateTitle
US11704144B2 (en)Creating virtual machine groups based on request
EP3761170B1 (en)Virtual machine creation method and apparatus
KR102281739B1 (en) Resource scheduling method, scheduling server, cloud computing system, and storage medium
CN116069447B (en) A method, device, equipment, and medium for generating NUMA topology of a virtual machine
US10324754B2 (en)Managing virtual machine patterns
CN103473136A (en)Resource allocation method of virtual machines, and communication equipment
CN107704310B (en) A method, apparatus and device for realizing container cluster management
US12081438B2 (en)Automatic policy engine selection
WO2020252921A1 (en)Multi-active load balancing application expansion method, application, device, and storage medium
WO2024260034A1 (en)Distributed training task scheduling method, device, and non-volatile readable storage medium
CN113032102A (en)Resource rescheduling method, device, equipment and medium
CN115269118A (en) A scheduling method, device and device for a virtual machine
JP6966432B2 (en) Cloud file processing method and equipment
CN108958975A (en)A kind of method, device and equipment controlling data resume speed
CN114153549A (en) A kind of virtual machine creation method and related equipment
WO2025103006A1 (en)Serverless computing-based data processing methods and electronic device
CN113626173A (en)Scheduling method, device and storage medium
CN109617954B (en) A method and apparatus for creating a cloud host
CN111404712B (en)NFV network element deployment system, method, device, medium and equipment
KR20240164269A (en)Method and system for managing host node resource for container-based cloud database
CN116881012A (en)Container application vertical capacity expansion method, device, equipment and readable storage medium
JP6870390B2 (en) Resource allocation method, connection management server and connection management program in a system based on a virtual infrastructure
CN111831398A (en) Virtual machine creation and CPU resource allocation method, device, and device
JP6339978B2 (en) Resource allocation management device and resource allocation management method
CN110750503A (en)File deletion speed control method, device, equipment and readable storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp