Virtual machine creation method, device, computer equipment and storage medium

By obtaining the topological information of the virtual machine and the host, determining the target host and binding the processor and node, the memory access performance problem caused by the difference between the processor and the memory node during virtual machine migration is solved, and the performance of the virtual machine is improved .

CN113608833BActive Publication Date: 2024-12-03DAWNING INFORMATION IND (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110812653.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-19
Publication Date
2024-12-03
Estimated Expiration
2041-07-19

AI Technical Summary

Technical Problem

On physical machines based on NUMA architecture, the memory fetch performance is greatly reduced due to the different processor and NUMA nodes in memory during virtual machines migration.

Method used

By obtaining the node topology information of the virtual machine and the node topology information of the host cluster, determine the target host, and bind the processor and node according to the virtual machine type and host type, ensuring that the processor and memory of the virtual machine exist in the same NUMA node. .

Benefits of technology

It effectively avoids the memory access performance of virtual machines due to the different NUMA nodes of the processor and memory during operation, and improves the performance of virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113608833B_ABST
    Figure CN113608833B_ABST
Patent Text Reader

Abstract

The present application relates to a virtual machine creation method, device, computer equipment and storage medium. The method comprises: obtaining the node topology information and type of the virtual machine to be created according to the virtual machine creation request; determining the target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster; controlling the target host to create the virtual machine according to the type of the virtual machine, the type of the target host and the node memory amount of the virtual machine; if the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host is a host with NUMA configuration, binding the processor corresponding to the created virtual machine to the node of the target host. The use of this method can avoid the problem that the memory and processor of the virtual machine are different NUMA nodes when the virtual machine is running, and the memory access performance is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine technology, and in particular to a virtual machine creation method, device, computer equipment and storage medium. Background Art

[0002] NUMA (Non Uniform Memory Access Architecture) is a design for multiple processors. The memory access efficiency depends on the relative position of the processor and the memory. Usually, virtual machines running on NUMA-based physical machines will switch virtual machines on NUMA nodes with higher loads to NUMA nodes with lower loads due to business needs. When migration occurs, the processor and memory access will cross NUMA nodes, causing the virtual machine's memory and processor to be on different NUMA nodes, and the memory access performance will be greatly reduced. Summary of the invention

[0003] Based on this, it is necessary to provide a virtual machine creation method, apparatus, computer equipment and storage medium that can improve the memory access performance of virtual machines running on a physical machine based on NUMA architecture in order to solve the above technical problems.

[0004] A method for creating a virtual machine, the method comprising:

[0005] According to the virtual machine creation request, obtain the node topology information and type of the virtual machine to be created;

[0006] Determine a target host machine according to the node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster;

[0007] Controlling the target host machine to create the virtual machine according to the type of the virtual machine, the type of the target host machine, and the node memory amount of the virtual machine;

[0008] If the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host machine with NUMA configuration, a processor corresponding to the created virtual machine is bound to a node of the target host machine.

[0009] In one embodiment, controlling the target host machine to create the virtual machine according to the type of the virtual machine, the type of the target host machine, and the node memory amount of the virtual machine includes:

[0010] If the type of the virtual machine is a virtual machine with NUMA configuration, controlling the target host machine to create the virtual machine according to the type of the target host machine;

[0011] A node memory is allocated to the virtual machine according to the node memory amount of the virtual machine.

[0012] In one embodiment, controlling the target host machine to create the virtual machine according to the type of the target host machine includes:

[0013] If the type of the target host machine is a host machine with NUMA configuration, control the target host machine to create a first virtual machine; the first virtual machine has a node binding relationship with the target host machine and has NUMA configuration;

[0014] If the type of the target host machine is a host machine without NUMA configuration, the target host machine is controlled to create a second virtual machine; the second virtual machine has no node binding relationship with the target host machine and has NUMA configuration.

[0015] In one embodiment, the method further comprises:

[0016] If the type of the virtual machine is a virtual machine without NUMA configuration, controlling the target host machine to create a virtual machine with non-NUMA configuration;

[0017] Node memory is allocated to the created non-NUMA configured virtual machine according to the node memory amount of the virtual machine.

[0018] In one embodiment, binding the processor corresponding to the created virtual machine to the node of the target host machine includes:

[0019] If it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is exclusively occupied by the target node of the target host machine, the processor corresponding to the virtual machine is bound to the target node; the target node is the node in the target host machine where the virtual machine is created;

[0020] If it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is not exclusively occupied by the target node, the processor corresponding to the virtual machine is bound to multiple nodes of the target host machine.

[0021] In one embodiment, the method further comprises:

[0022] The node memory amount of the virtual machine is determined according to the node memory amount of the processor of the target host machine; wherein the node memory amount of the processor of the target host machine is greater than or equal to the node memory amount of the virtual machine.

[0023] In one embodiment, the method further comprises:

[0024] Obtain the node memory allocation of the target host machine, and record the node memory allocation of the target host machine.

[0025] In one of the embodiments, determining the target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster includes:

[0026] The target host machine is determined based on the host machines whose number of nodes of the host machines meets the number of nodes of the virtual machines and whose node availability meets the node availability of the virtual machines.

[0027] In one embodiment, determining the target host machine according to the host machines whose number of nodes of each host machine meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine includes:

[0028] Determine at least two candidate host machines according to the host machines whose number of nodes of each host machine meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine;

[0029] Determining a weight of each of the candidate hosts;

[0030] The candidate host machine with the largest weight is determined as the target host machine.

[0031] A virtual machine creation device, the device comprising:

[0032] An acquisition module, used to acquire node topology information and type of the virtual machine to be created according to a virtual machine creation request;

[0033] A first determination module, configured to determine a target host machine according to the node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster;

[0034] A first creation module, used for controlling the target host machine to create the virtual machine according to the type of the virtual machine, the type of the target host machine and the node memory amount of the virtual machine;

[0035] The binding module is used to bind the processor corresponding to the created virtual machine to the node of the target host machine if the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host with NUMA configuration.

[0036] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0037] According to the virtual machine creation request, obtain the node topology information and type of the virtual machine to be created;

[0038] Determine a target host machine according to the node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster;

[0039] Controlling the target host machine to create the virtual machine according to the type of the virtual machine, the type of the target host machine, and the node memory amount of the virtual machine;

[0040] If the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host machine with NUMA configuration, a processor corresponding to the created virtual machine is bound to a node of the target host machine.

[0041] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0042] According to the virtual machine creation request, obtain the node topology information and type of the virtual machine to be created;

[0043] Determine a target host machine according to the node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster;

[0044] Controlling the target host machine to create the virtual machine according to the type of the virtual machine, the type of the target host machine, and the node memory amount of the virtual machine;

[0045] If the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host machine with NUMA configuration, a processor corresponding to the created virtual machine is bound to a node of the target host machine.

[0046] The above-mentioned virtual machine creation method, device, computer equipment and storage medium obtain the node topology information and type of the virtual machine to be created according to the virtual machine creation request, determine the target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster, control the target host according to the type of the virtual machine, the type of the target host and the node memory amount of the virtual machine, create the virtual machine, if the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host is a host with NUMA configuration, then bind the processor corresponding to the created virtual machine to the node of the target host. Since the type of the virtual machine to be created can be accurately obtained according to the virtual machine creation request, the target host can be controlled to create the virtual machine according to the type of the virtual machine, the determined type of the target host and the node memory amount of the virtual machine, and when the type of the created virtual machine is a virtual machine with NUMA configuration and the type of the target host is a host with NUMA configuration, bind the processor corresponding to the created virtual machine to the node of the target host, thereby avoiding the problem of memory access performance degradation when the virtual machine's memory and processor are different NUMA nodes when the virtual machine is running. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 An application environment diagram of a virtual machine creation method in one embodiment;

[0048] Figure 2 A schematic diagram of a flow chart of a method for creating a virtual machine in one embodiment;

[0049] Figure 3 A schematic diagram of a flow chart of a method for creating a virtual machine in one embodiment;

[0050] Figure 4 A schematic diagram of a flow chart of a method for creating a virtual machine in one embodiment;

[0051] Figure 5 A structural block diagram of a virtual machine creation device in one embodiment;

[0052] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] The virtual machine creation method provided in this application can be applied to Figure 1In the application environment shown. The virtual machine management server 102 communicates with the host machine 104 through the network. The virtual machine management server 102 can also be called a control machine, which can be implemented by an independent server or a server cluster composed of multiple servers. The host machine 104 can be a single host machine or a cluster composed of multiple host machines. The host machine 104 can be, but not limited to, various personal computers, laptops, and tablet computers. The virtual machine management server 102 can control the host machine 104 through the network to create virtual machines and manage the created virtual machines.

[0055] In one embodiment, Figure 2 As shown, a virtual machine creation method is provided, and the method is applied to Figure 1 The virtual machine management server in the example is used as an example to illustrate the process, including the following steps:

[0056] S201, obtaining node topology information and type of a virtual machine to be created according to a virtual machine creation request.

[0057] Specifically, the virtual machine management server obtains the node topology information and type of the virtual machine to be created according to the virtual machine creation request. Optionally, the user can pre-store the virtual machine creation request in a preset database, and the virtual machine management server can obtain the virtual machine creation request from the database, parse the obtained virtual machine creation request, and obtain the node topology information and type of the virtual machine to be created. Optionally, the node topology information of the virtual machine to be created may include information such as the number of nodes of the virtual machine to be created, the node availability of the virtual machine to be created, etc. Optionally, the type of the virtual machine to be created can be a virtual machine with NUMA configuration or a virtual machine with non-NUMA configuration.

[0058] S202: Determine a target host machine according to the node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster.

[0059] Specifically, the virtual machine management server determines the target host machine for creating the above-mentioned virtual machine from the host machine cluster based on the node topology information of the virtual machine obtained above and the node topology information of each host machine in the host machine cluster. Optionally, the virtual machine management server can determine the host machine whose node topology information of each host machine in the host machine cluster satisfies the node topology information of the virtual machine as the target host machine for creating the above-mentioned virtual machine. It should be noted here that each host machine in the host machine cluster will report its own node topology information to the virtual machine management server in real time, so that the virtual machine management server can obtain the node topology information of each host machine in the host machine cluster.

[0060] S203, controlling the target host machine to create a virtual machine according to the type of the virtual machine, the type of the target host machine, and the node memory amount of the virtual machine.

[0061] Specifically, the virtual machine management server controls the determined target host to create the above virtual machine according to the type of the virtual machine, the type of the target host, and the node memory amount of the virtual machine. Optionally, if the type of the virtual machine is a non-NUMA configured virtual machine, the virtual machine management server can control the target host to create a non-NUMA configured virtual machine according to the node memory amount of the virtual machine; if the type of the virtual machine is a virtual machine with NUMA configuration, the virtual machine management server can create a virtual machine with NUMA configuration according to the type of the target host and the node memory amount of the virtual machine.

[0062] S204: If the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host machine with NUMA configuration, bind a processor corresponding to the created virtual machine to a node of the target host machine.

[0063] Specifically, if the type of the created virtual machine is a virtual machine with NUMA configuration and the type of the target host is a host with NUMA configuration, the virtual machine management server binds the processor corresponding to the created virtual machine to the node of the target host. Optionally, the virtual machine management server may bind the processor corresponding to the created virtual machine to one node of the target host, or may bind the processor corresponding to the created virtual machine to multiple nodes of the target host, which is not limited in this embodiment.

[0064] In the above-mentioned virtual machine creation method, since the virtual machine management server can accurately obtain the type of the virtual machine to be created according to the virtual machine creation request, it can control the target host machine to create the virtual machine to be created according to the type of the virtual machine, the determined type of the target host machine and the node memory amount of the virtual machine, and when the type of the created virtual machine is a virtual machine with a NUMA configuration and the type of the target host machine is a host machine with a NUMA configuration, the processor corresponding to the created virtual machine is bound to the node of the target host machine, thereby avoiding the problem that the memory and processor of the virtual machine are on different NUMA nodes and the memory access performance is reduced when the virtual machine is running.

[0065] In the scenario where the virtual machine management server controls the target host to create a virtual machine according to the type of the virtual machine, the type of the target host and the node memory amount of the virtual machine, in one embodiment, Figure 3 As shown, the above S203 includes:

[0066] S301: If the type of the virtual machine is a virtual machine with NUMA configuration, control the target host machine to create a virtual machine according to the type of the target host machine.

[0067] Specifically, if the type of the virtual machine to be created is a virtual machine with a NUMA configuration, the virtual machine management server controls the target host to create the virtual machine according to the type of the target host. Optionally, if the type of the target host is a host with a NUMA configuration, the virtual machine management server controls the target host to create a first virtual machine, wherein the first virtual machine has a node binding relationship with the target host and has a NUMA configuration. Optionally, if the type of the target host is a host without a NUMA configuration, the virtual machine management server controls the target host to create a second virtual machine, wherein the second virtual machine has no node binding relationship with the target host and has a NUMA configuration.

[0068] S302: Allocate node memory to the virtual machine according to the node memory amount of the virtual machine.

[0069] Specifically, after the virtual machine management server controls the target host to create a virtual machine, it allocates node memory to the created virtual machine according to the node memory of the virtual machine. It is understandable that the node memory allocated to the virtual machine by the virtual machine management server is the node memory of the target host, and the node memory allocated to the virtual machine is less than or equal to the node memory of the target host. Optionally, the node memory of the virtual machine can be determined according to the above-mentioned virtual machine creation request, or it can be determined according to the node memory of the target host.

[0070] In this embodiment, if the type of the virtual machine is a virtual machine with NUMA configuration, the virtual machine management server can control the target host to create a virtual machine to be created according to the type of the target host. The virtual machine created in this way is a virtual machine that takes the type of the target host into consideration, and can accurately create the virtual machine in combination with the type of the target host. Furthermore, after the virtual machine is created, the virtual machine management server allocates node memory to the virtual machine according to the node memory amount of the virtual machine, which can ensure the high availability of the node memory allocated to the virtual machine, minimize the occurrence of cross-node memory access of the virtual machine, and thereby ensure the virtual memory access performance.

[0071] In the scenario where the virtual machine management server controls the target host to create a virtual machine according to the type of the virtual machine, the type of the target host, and the node memory amount of the virtual machine, the type of the virtual machine may also be a virtual machine without NUMA configuration. In one embodiment, Figure 4 As shown, the above method also includes:

[0072] S401: If the type of the virtual machine is a virtual machine without NUMA configuration, control the target host machine to create a virtual machine without NUMA configuration.

[0073] Specifically, if the type of the virtual machine is a virtual machine without NUMA configuration, the virtual machine management server controls the target host to create a non-NUMA configured virtual machine, that is, the virtual machine created by the target host cannot be used for multi-processor memory design. Optionally, the virtual machine management server can send a control instruction to the target host to control the target host to create a non-NUMA configured virtual machine.

[0074] S402: Allocate node memory for the created non-NUMA-configured virtual machine according to the node memory amount of the virtual machine.

[0075] Specifically, after the virtual machine management server controls the target host to create a non-NUMA-configured virtual machine, the node memory is allocated to the non-NUMA-configured virtual machine created above according to the node memory amount of the virtual machine. It can be understood that the node memory allocated by the virtual machine management server to the created non-NUMA-configured virtual machine is the node memory of the target host, and the node memory allocated to the created non-NUMA-configured virtual machine is less than or equal to the node memory of the target host. Optionally, the node memory amount of the virtual machine can be determined according to the above-mentioned virtual machine creation request, or it can be determined according to the node memory amount of the target host.

[0076] In this embodiment, if the type of the virtual machine is a virtual machine without NUMA configuration, the virtual machine management server can control the target host machine to create a non-NUMA configured virtual machine according to the type of the virtual machine. The virtual machine created in this way is a virtual machine that meets the creation request, and then node memory can be allocated to the created non-NUMA configured virtual machine according to the node memory amount of the virtual machine, thereby ensuring the high availability of the node memory allocated to the virtual machine, minimizing the occurrence of cross-node memory access of the virtual machine, and thus ensuring the virtual memory access performance.

[0077] In the above scenario where if the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host is a host with NUMA configuration, the virtual machine management server binds the processor corresponding to the created virtual machine to the node of the target host, in one embodiment, the above S204 includes:

[0078] Step A: If it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is exclusively occupied by the target node of the target host machine, the processor corresponding to the virtual machine is bound to the target node; the target node is the node for creating the virtual machine in the target host machine.

[0079] Specifically, the node topology information of the virtual machine includes information on whether the processor of the virtual machine is exclusively occupied by the target node of the target host machine, wherein the target node is the node in the target host machine where the virtual machine is created. If the virtual machine management server determines, based on the node topology information of the virtual machine, that the processor of the virtual machine is exclusively occupied by the target node of the target host machine, the virtual machine management server binds the processor corresponding to the virtual machine to the above-mentioned target node, i.e., the above-mentioned target node is only bound to the processor corresponding to the virtual machine for scheduling.

[0080] Step B: if it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is not exclusively occupied by the target node, the processor corresponding to the virtual machine is bound to multiple nodes of the target host machine.

[0081] Specifically, if the virtual machine management server determines that the processor of the virtual machine is not exclusively occupied by the above target node based on the node topology information of the virtual machine, the processor corresponding to the virtual machine is bound to multiple nodes of the target host machine, that is, the processor corresponding to the virtual machine can schedule multiple nodes of the bound target host machine.

[0082] In this embodiment, the virtual machine management server can determine whether the processor of the virtual machine is exclusively occupied by the target node for creating the virtual machine in the target host machine based on the node topology information of the virtual machine. In this way, the virtual machine management server can bind the processor corresponding to the virtual machine to the node for creating the virtual machine in the target host machine when it is determined that the processor of the virtual machine is exclusively occupied by the target node. When it is determined that the processor of the virtual machine is not exclusively occupied by the target node, the virtual machine management server can bind the processor corresponding to the virtual machine to multiple nodes of the target host machine, thereby ensuring the accuracy of the processor corresponding to the virtual machine scheduling the node of the target host machine, thereby minimizing the occurrence of cross-node memory access of the virtual machine, and further ensuring the virtual memory access performance.

[0083] In the scenario where the above-mentioned virtual machine management server controls the target host machine to create a virtual machine according to the type of the virtual machine, the type of the target host machine and the node memory amount of the virtual machine, it is necessary to first determine the node memory amount of the virtual machine. In one embodiment, the above-mentioned method also includes: determining the node memory amount of the virtual machine according to the node memory amount of the processor of the target host machine; wherein the node memory amount of the processor of the target host machine is greater than or equal to the node memory amount of the virtual machine.

[0084] Specifically, the virtual machine management server determines the node memory amount of the virtual machine according to the node memory amount of the processor of the target host machine; wherein the node memory amount of the processor of the target host machine is greater than or equal to the node memory amount of the virtual machine. Exemplarily, if the node memory amount of the processor of the target host machine can be 64G, the node memory amount of the determined virtual machine can be 40G, or other memory amount, as long as it is less than 64G, and this embodiment does not limit it here.

[0085] In this embodiment, the virtual machine management server can determine the node memory amount of the virtual machine based on the node memory amount of the processor of the target host machine, wherein the node memory amount of the processor of the target host machine is greater than or equal to the node memory amount of the virtual machine. This can minimize the occurrence of cross-node memory access by the virtual machine and ensure the high availability of the node memory allocated to the virtual machine.

[0086] In some scenarios, the virtual machine management server also needs to record the node memory allocation of the target host machine. When there is a new virtual machine to be created, the memory allocation of the new virtual machine to be created is directly determined based on the recorded node memory allocation of the target host machine. In one embodiment, the above method also includes: obtaining the node memory allocation of the target host machine and recording the node memory allocation of the target host machine.

[0087] Specifically, the virtual machine management server obtains the node memory allocation of the target host machine and records the node memory allocation of the target host machine. Optionally, the target host machine can report its own node memory allocation to the virtual machine management server in real time, and the virtual machine management server records the node memory allocation reported by the target host machine. Optionally, the virtual machine management server can also send an acquisition instruction to the target host machine to obtain the node memory allocation of the target host machine and record the node memory allocation reported by the target host machine.

[0088] In this embodiment, the virtual machine management server obtains the node memory allocation of the target host machine and records the node memory allocation of the target host machine, so that the virtual machine management server can obtain the node memory allocation of the target host machine in a timely manner, so that the virtual machine management server can determine the node memory amount of the virtual machine in a timely manner according to the node memory allocation of the target host machine when creating a new virtual machine.

[0089] In the scenario where the virtual machine management server determines the target host machine based on the node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster, in one embodiment, the above S202 includes: determining the target host machine based on the host machine whose number of nodes of each host machine meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine.

[0090] Specifically, the virtual machine management server determines the target host according to the host whose number of nodes of each host in the host cluster meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine. Optionally, if there is only one host whose number of nodes of each host in the host cluster meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine, the virtual machine management server determines the host as the above-mentioned target host. Optionally, if there are multiple hosts whose number of nodes of each host in the host cluster meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine, the virtual machine management server can determine the above-mentioned target host through the following method steps: S1, determine at least two candidate hosts according to the host whose number of nodes of each host meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine; S2, determine the weight of each candidate host; S3, determine the candidate host with the largest weight as the above-mentioned target host. That is to say, when there are multiple host machines in the host cluster whose node number of each host machine meets the node number of the virtual machine and whose node availability meets the node availability of the virtual machine, the weights of these multiple host machines can be determined, and the host machine with the largest weight can be determined as the above-mentioned target host machine.

[0091] In this embodiment, the virtual machine management server can accurately determine the target host machine based on the host machines whose node number meets the node number of the virtual machine and whose node availability meets the node availability of the virtual machine, thereby avoiding the situation where processors corresponding to multiple virtual machines are repeatedly bound to the same node of the host machine, and ensuring that the determined target host machine is a host machine that meets the node topology information of the virtual machine.

[0092] It should be understood that although Figure 2-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0093] In one embodiment, Figure 5 As shown, a virtual machine creation device is provided, comprising: an acquisition module, a first determination module, a first creation module and a binding module, wherein:

[0094] The acquisition module is used to obtain the node topology information and type of the virtual machine to be created according to the virtual machine creation request.

[0095] The first determination module is used to determine the target host machine according to the node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster.

[0096] The first creation module is used to control the target host machine to create a virtual machine according to the type of the virtual machine, the type of the target host machine and the node memory amount of the virtual machine.

[0097] The binding module is used to bind the processor corresponding to the created virtual machine to the node of the target host machine if the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host with NUMA configuration.

[0098] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0099] Based on the above embodiment, optionally, the above first creation module includes: a creation unit and an allocation unit, wherein:

[0100] The creation unit is used for controlling the target host machine to create a virtual machine according to the type of the target host machine if the type of the virtual machine is a virtual machine with NUMA configuration.

[0101] The allocation unit is used to allocate node memory to the virtual machine according to the node memory amount of the virtual machine.

[0102] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0103] On the basis of the above embodiment, optionally, the above creation unit is specifically used to control the target host machine to create a first virtual machine if the type of the target host machine is a host machine with NUMA configuration; the first virtual machine has a node binding relationship with the target host machine and has a NUMA configuration; if the type of the target host machine is a host machine without NUMA configuration, control the target host machine to create a second virtual machine; the second virtual machine has no node binding relationship with the target host machine and has a NUMA configuration.

[0104] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0105] Based on the above embodiment, optionally, the above device further includes: a second creation module and an allocation module, wherein:

[0106] The second creation module is used to control the target host machine to create a non-NUMA configured virtual machine if the type of the virtual machine is a virtual machine without NUMA configuration.

[0107] The allocation module is used to allocate node memory for the created non-NUMA configured virtual machine according to the node memory amount of the virtual machine.

[0108] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0109] On the basis of the above embodiment, optionally, the above binding module includes: a first binding unit and a second binding unit, wherein:

[0110] The first binding unit is used to bind the processor corresponding to the virtual machine to the target node if it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is exclusively occupied by the target node of the target host machine; the target node is the node for creating the virtual machine in the target host machine.

[0111] The second binding unit is used to bind the processor corresponding to the virtual machine to multiple nodes of the target host machine if it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is not exclusively occupied by the target node.

[0112] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0113] Based on the above embodiment, optionally, the above device further includes: a second determining module, wherein:

[0114] The second determination module is used to determine the node memory amount of the virtual machine according to the node memory amount of the processor of the target host machine; wherein the node memory amount of the processor of the target host machine is greater than or equal to the node memory amount of the virtual machine.

[0115] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0116] Based on the above embodiment, optionally, the above device further includes: a recording module, wherein:

[0117] The recording module is used to obtain the node memory allocation of the target host machine and record the node memory allocation of the target host machine.

[0118] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0119] Based on the above embodiment, optionally, the above first determination module includes: a determination unit, wherein:

[0120] The determination unit is used to determine the target host machine according to the host machines whose node numbers satisfy the node numbers of the virtual machines and whose node availability satisfies the node availability of the virtual machines.

[0121] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0122] Based on the above embodiment, optionally, the above determination unit is specifically used to determine at least two candidate host machines based on the host machines whose node numbers meet the node numbers of the virtual machines and whose node availability meets the node availability of the virtual machines; determine the weight of each candidate host machine; and determine the candidate host machine with the largest weight as the target host machine.

[0123] The virtual machine creation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0124] For the specific definition of the virtual machine creation device, please refer to the definition of the virtual machine creation method above, which will not be repeated here. Each module in the above virtual machine creation device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0125] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for creating a virtual machine is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0126] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0127] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0128] According to the virtual machine creation request, obtain the node topology information and type of the virtual machine to be created;

[0129] Determine the target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster;

[0130] Control the target host to create a virtual machine according to the type of the virtual machine, the type of the target host and the node memory amount of the virtual machine;

[0131] If the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host machine with NUMA configuration, the processor corresponding to the created virtual machine is bound to the node of the target host machine.

[0132] The implementation principle and technical effect of the computer device provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.

[0133] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0134] According to the virtual machine creation request, obtain the node topology information and type of the virtual machine to be created;

[0135] Determine the target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster;

[0136] Control the target host to create a virtual machine according to the type of the virtual machine, the type of the target host and the node memory amount of the virtual machine;

[0137] If the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host machine with NUMA configuration, the processor corresponding to the created virtual machine is bound to the node of the target host machine.

[0138] The computer-readable storage medium provided in the above embodiment has similar implementation principles and technical effects as those of the above method embodiment, and will not be described in detail here.

[0139] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0140] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0141] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for creating a virtual machine, It is characterized in that The method comprises: According to the virtual machine creation request, obtain the node topology information and type of the virtual machine to be created; Determine the target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster; the types of the virtual machines to be created include virtual machines with NUMA configuration and virtual machines with non-NUMA configuration; If the type of the virtual machine is the non-NUMA-configured virtual machine, control the target host machine to create the non-NUMA-configured virtual machine according to the node memory amount of the virtual machine; if the type of the virtual machine is the NUMA-configured virtual machine, create the NUMA-configured virtual machine according to the type of the target host machine and the node memory amount of the virtual machine; If the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host machine with NUMA configuration, binding a processor corresponding to the created virtual machine to a node of the target host machine; Binding the processor corresponding to the created virtual machine to the node of the target host machine includes: If it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is exclusively occupied by the target node of the target host machine, the processor corresponding to the virtual machine is bound to the target node; the target node is the node in the target host machine where the virtual machine is created; If it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is not exclusively occupied by the target node, the processor corresponding to the virtual machine is bound to multiple nodes of the target host machine.

2. The method according to claim 1, It is characterized in that The method further comprises: If the type of the virtual machine is a virtual machine with NUMA configuration, controlling the target host machine to create the virtual machine according to the type of the target host machine; A node memory is allocated to the virtual machine according to the node memory amount of the virtual machine.

3. The method according to claim 2, It is characterized in that The controlling the target host machine to create the virtual machine according to the type of the target host machine includes: If the type of the target host machine is a host machine with NUMA configuration, control the target host machine to create a first virtual machine; the first virtual machine has a node binding relationship with the target host machine and has NUMA configuration; If the type of the target host machine is a host machine without NUMA configuration, the target host machine is controlled to create a second virtual machine; the second virtual machine has no node binding relationship with the target host machine and has NUMA configuration.

4. The method according to claim 1, It is characterized in that The method further comprises: If the type of the virtual machine is a virtual machine without NUMA configuration, controlling the target host machine to create a virtual machine with non-NUMA configuration; Node memory is allocated to the created non-NUMA configured virtual machine according to the node memory amount of the virtual machine.

5. The method according to claim 1, It is characterized in that The method further comprises: The node memory amount of the virtual machine is determined according to the node memory amount of the processor of the target host machine; wherein the node memory amount of the processor of the target host machine is greater than or equal to the node memory amount of the virtual machine.

6. The method according to claim 1, It is characterized in that The method further comprises: Obtain the node memory allocation of the target host machine, and record the node memory allocation of the target host machine.

7. The method according to claim 1, It is characterized in that The determining the target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster includes: The target host machine is determined based on the host machines whose number of nodes of the host machines meets the number of nodes of the virtual machines and whose node availability meets the node availability of the virtual machines.

8. The method according to claim 7, It is characterized in that The determining the target host machine according to the host machines whose number of nodes of each host machine meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine includes: Determine at least two candidate host machines according to the host machines whose number of nodes of each host machine meets the number of nodes of the virtual machine and whose node availability meets the node availability of the virtual machine; Determining a weight of each of the candidate hosts; The candidate host machine with the largest weight is determined as the target host machine.

9. A virtual machine creation device, It is characterized in that The device comprises: An acquisition module, used to acquire node topology information and type of the virtual machine to be created according to a virtual machine creation request; A first determination module is used to determine a target host machine according to the node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster; the types of the virtual machines to be created include virtual machines with NUMA configuration and virtual machines with non-NUMA configuration; A first creation module is used to control the target host machine to create the non-NUMA-configured virtual machine according to the node memory amount of the virtual machine if the type of the virtual machine is the non-NUMA-configured virtual machine; if the type of the virtual machine is the virtual machine with NUMA configuration, create the virtual machine with NUMA configuration according to the type of the target host machine and the node memory amount of the virtual machine; A binding module, for binding a processor corresponding to the created virtual machine to a node of the target host machine if the type of the virtual machine is a virtual machine with NUMA configuration and the type of the target host machine is a host with NUMA configuration; The binding module includes: a first binding unit and a second binding unit, wherein: The first binding unit is specifically configured to bind the processor corresponding to the virtual machine to the target node when it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is exclusively occupied by the target node of the target host machine; the target node is the node in the target host machine where the virtual machine is created; The second binding unit is specifically configured to bind the processor corresponding to the virtual machine to multiple nodes of the target host machine when it is determined according to the node topology information of the virtual machine that the processor of the virtual machine is not exclusively occupied by the target node.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Method, device and system for creating virtual machine

    CN106020937A

  • NUMA node binding method and device of virtual machine, equipment and storage medium

    CN112181595A