Disclosure of Invention
In view of the foregoing, it is desirable to provide a virtual machine creation method, an apparatus, a computer device, and a storage medium, which can improve the access performance of a virtual machine running on a NUMA-based physical machine.
A virtual machine creation method, the method comprising:
acquiring node topology information and types of virtual machines to be created according to the virtual machine creation request;
determining a 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;
and 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 with a node of the target host machine.
In one embodiment, the 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 includes:
if the type of the virtual machine is a virtual machine with NUMA configuration, controlling the target host to create the virtual machine according to the type of the target host;
and allocating the node memory for the virtual machine according to the node memory amount of the virtual machine.
In one embodiment, the controlling the target host to create the virtual machine according to the type of the target host includes:
if the type of the target host is a host with NUMA configuration, controlling the target host to create a first virtual machine; the first virtual machine and the target host have a node binding relationship and have NUMA configuration;
if the type of the target host is a host without NUMA configuration, controlling the target host to create a second virtual machine; the second virtual machine has no node binding relationship with the target host machine and has NUMA configuration.
In one embodiment, the method further comprises:
if the type of the virtual machine is a virtual machine without NUMA configuration, controlling the target host to create a virtual machine with non-NUMA configuration;
and allocating the node memory for the created virtual machine configured by the non-NUMA according to the node memory amount of the virtual machine.
In one embodiment, the binding the processor corresponding to the created virtual machine with the node of the target host includes:
if the processor of the virtual machine is determined to be exclusively occupied by the target node of the target host machine according to the node topology information of the virtual machine, the processor corresponding to the virtual machine is bound with the target node; the target node is a node for creating the virtual machine in the target host machine;
and if the processor of the virtual machine is determined not to be exclusively occupied by the target node according to the node topology information of the virtual machine, binding the processor corresponding to the virtual machine with a plurality of nodes of the target host machine.
In one embodiment, the method further comprises:
determining the node memory amount of the virtual machine according to the node memory amount of the processor of the target host machine; and the node memory amount of the processor of the target host is greater than or equal to the node memory amount of the virtual machine.
In one embodiment, the method further comprises:
and acquiring the node memory allocation amount of the target host machine, and recording the node memory allocation amount of the target host machine.
In one embodiment, the determining a 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:
and determining the target host machine according to the host machines of which the node number of each host machine meets the node number of the virtual machine and the node available quantity meets the node available quantity of the virtual machine.
In one embodiment, the determining the target host according to the host whose node number of each host satisfies the node number of the virtual machine and whose node available amount satisfies the node available amount of the virtual machine includes:
determining at least two candidate host machines according to the host machines of which the node number of each host machine meets the node number of the virtual machine and the node available quantity meets the node available quantity of the virtual machine;
determining the weight of each candidate host;
and determining the candidate host with the maximum weight as the target host.
An apparatus for virtual machine creation, the apparatus comprising:
the acquisition module is used for acquiring the node topology information and the type of the virtual machine to be created according to the virtual machine creation request;
the first determining module is used for determining a target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster;
a first creating module, configured to control the target host to create the virtual machine according to a type of the virtual machine, the type of the target host, and a node memory amount of the virtual machine;
and the binding module is used for binding the processor corresponding to the created virtual machine with 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 machine with NUMA configuration.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring node topology information and types of virtual machines to be created according to the virtual machine creation request;
determining a 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;
and 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 with a node of the target host machine.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring node topology information and types of virtual machines to be created according to the virtual machine creation request;
determining a 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;
and 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 with a node of the target host machine.
According to the virtual machine creation method, the virtual machine creation device, the computer device and the storage medium, node topology information and types of a virtual machine to be created are obtained according to a virtual machine creation request, a target host is determined according to the node topology information of the virtual machine and the node topology information of each host in a host cluster, the target host is controlled 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, and 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, a processor corresponding to the created virtual machine is bound with nodes of the target host. The type of the virtual machine to be created can be accurately acquired according to the creation request of the virtual machine, so that the target host can be controlled to create the virtual machine to be created 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 the processor corresponding to the created virtual machine is bound with the node of the target host under the condition that the type of the created virtual machine is the virtual machine with NUMA configuration and the type of the target host is the host with NUMA configuration, so that the problem that the memory and the processor of the virtual machine are different NUMA nodes when the virtual machine runs and the memory access performance is reduced is avoided.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The virtual machine creation method provided by the application can be applied to the application environment shown in fig. 1. The virtual machine management server 102 communicates with the host 104 through a network. The virtual machine management server 102 may also be referred to as a control machine, and may be implemented by an independent server or a server cluster formed by a plurality of servers, the host 104 may be a single host or a cluster formed by a plurality of hosts, the host 104 may be, but is not limited to, various personal computers, notebook computers, and tablet computers, and the virtual machine management server 102 may control the host 104 to create a virtual machine through a network and manage the created virtual machine.
In one embodiment, as shown in fig. 2, a virtual machine creation method is provided, which is described by taking the application of the method to the virtual machine management server in fig. 1 as an example, and includes the following steps:
s201, according to the virtual machine creation request, obtaining node topology information and types of the virtual machine to be created.
Specifically, the virtual machine management server obtains node topology information and types of the virtual machines to be created according to the virtual machine creation request. Optionally, the user may store the virtual machine creation request in a preset database in advance, and the virtual machine management server may obtain the virtual machine creation request from the database, and analyze the obtained virtual machine creation request to obtain node topology information and a 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, and the available amount of nodes of the virtual machine to be created. Optionally, the type of virtual machine to be created may be a virtual machine with a NUMA configuration or a virtual machine with a non-NUMA configuration.
S202, determining a target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster.
Specifically, the virtual machine management server determines a target host machine for creating the virtual machine from the host machine cluster according to the obtained node topology information of the virtual machine and the node topology information of each host machine in the host machine cluster. Optionally, the virtual machine management server may determine a 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 a target host machine for creating the virtual machine. It should be noted that each host in the host cluster reports its own node topology information to the virtual machine management server in real time, so that the virtual machine management server obtains the node topology information of each host in the host cluster.
S203, 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.
Specifically, the virtual machine management server controls the determined 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. Optionally, if the type of the virtual machine is a non-NUMA configured virtual machine, the virtual machine management server may control the target host 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 a virtual machine with a NUMA configuration, the virtual machine management server may create a virtual machine with a NUMA configuration according to the type of the target host and the node memory amount of the virtual machine.
And 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, binding the processor corresponding to the created virtual machine with the node of the target host machine.
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 with 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 herein.
In the virtual machine creating method, the virtual machine management server can accurately acquire the type of the virtual machine to be created according to the creating request of the virtual machine, so that the target host can be controlled to create the virtual machine to be created 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 under the condition that the type of the created virtual machine is the virtual machine with NUMA configuration and the type of the target host is the host with NUMA configuration, the processor corresponding to the created virtual machine is bound with the node of the target host, thereby avoiding the problem that the memory and the processor of the virtual machine are different NUMA nodes and the memory access performance is reduced when the virtual machine runs.
In a scenario where the virtual machine management server controls 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, as shown in fig. 3, in an embodiment, the step S203 includes:
s301, if the type of the virtual machine is a virtual machine with NUMA configuration, controlling the target host to create the virtual machine according to the type of the target host.
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 NUMA configuration, the virtual machine management server controls the target host to create a first virtual machine, where the first virtual machine and the target host have a node binding relationship and have NUMA configuration. Optionally, if the type of the target host is a host without NUMA configuration, the virtual machine management server controls the target host to create a second virtual machine, where the second virtual machine and the target host have no node binding relationship and have NUMA configuration.
S302, allocating node memories for the virtual machines according to the node memory amount of the virtual machines.
Specifically, after the virtual machine management server controls the target host to create the virtual machine, the virtual machine management server allocates the node memory to the created virtual machine according to the node memory amount of the virtual machine. It can be understood 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 amount of the virtual machine may be determined according to the virtual machine creation request, or may be determined according to the node memory amount of the target host.
In this embodiment, if the type of the virtual machine is a virtual machine with NUMA configuration, the virtual machine management server may control the target host to create a virtual machine to be created according to the type of the target host, and the virtual machine created in this way is a virtual machine that takes into account the type of the target host, and can accurately create the virtual machine in combination with the type of the target host.
In a scenario where the virtual machine management server controls 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, the type of the virtual machine may also be a virtual machine without NUMA configuration, in an embodiment, as shown in fig. 4, the method further includes:
s401, if the type of the virtual machine is the virtual machine without NUMA configuration, controlling the target host machine to create the virtual machine with non-NUMA configuration.
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 virtual machine with non-NUMA configuration, that is, the virtual machine created by the target host cannot be used for memory design of the multiprocessor. Optionally, the virtual machine management server may issue a control instruction to the target host to control the target host to create a virtual machine with non-NUMA configuration.
S402, distributing node memory for the created non-NUMA configured virtual machine according to the node memory amount of the virtual machine.
Specifically, after the virtual machine management server controls the target host to create the virtual machine of the non-NUMA configuration, the virtual machine management server allocates the node memory to the created virtual machine of the non-NUMA configuration according to the node memory amount of the virtual machine. It is to be understood that the node memory allocated to the virtual machine of the created non-NUMA configuration by the virtual machine management server is the node memory of the target host, and the node memory allocated to the virtual machine of the created non-NUMA configuration is less than or equal to the node memory of the target host. Optionally, the node memory amount of the virtual machine may be determined according to the virtual machine creation request, or may be determined according to the node memory amount of the target host.
In this embodiment, if the type of the virtual machine is a virtual machine without NUMA configuration, the virtual machine management server may control the target host to create a virtual machine with non-NUMA configuration according to the type of the virtual machine, where the created virtual machine is a virtual machine satisfying the creation request, and further may allocate a node memory to the created virtual machine with non-NUMA configuration according to the node memory amount of the virtual machine, so as to ensure that the node memory allocated to the virtual machine is highly available, maximally reduce the occurrence of cross-node memory access of the virtual machine, and further ensure virtual memory access performance.
In a scenario that the virtual machine management server binds the processor corresponding to the created virtual machine to a node of the target host 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, in an embodiment, the step S204 includes:
step A, if the processor of the virtual machine is determined to be exclusively occupied by the target node of the target host machine according to the node topology information of the virtual machine, the processor corresponding to the virtual machine is bound with the target node; the target node is a node for creating a virtual machine in the target host machine.
Specifically, the node topology information of the virtual machine includes information whether a processor of the virtual machine is exclusive to a target node of a target host, where the target node is a node in the target host that creates the virtual machine, and if the virtual machine management server determines that the processor of the virtual machine is exclusive to the target node of the target host according to the node topology information of the virtual machine, the virtual machine management server binds the processor corresponding to the virtual machine to the target node, that is, the target node is bound only to the processor corresponding to the virtual machine for scheduling.
And step B, if the processor of the virtual machine is determined not to be exclusively occupied by the target node according to the node topology information of the virtual machine, the processor corresponding to the virtual machine is bound with a plurality of nodes of the target host machine.
Specifically, if the virtual machine management server determines that the processor of the virtual machine is not exclusively owned by the target node according to 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 the bound multiple nodes of the target host machine.
In this embodiment, the virtual machine management server can determine whether the processor of the virtual machine is monopolized by the target node creating the virtual machine in the target host according to the node topology information of the virtual machine, so that the virtual machine management server can bind the processor corresponding to the virtual machine with the node creating the virtual machine in the target host under the condition that the processor of the virtual machine is monopolized by the target node, and bind the processor corresponding to the virtual machine with the plurality of nodes of the target host under the condition that the processor of the virtual machine is not monopolized by the target node, thereby ensuring the accuracy of the processor corresponding to the virtual machine for scheduling the node of the target host, maximally reducing the occurrence of cross-node access of the virtual machine, and further ensuring the virtual access performance.
In a scenario where the virtual machine management server controls 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, it is necessary to first determine the node memory amount of the virtual machine, and in one embodiment, the method further includes: determining the node memory amount of the virtual machine according to the node memory amount of the processor of the target host machine; and 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.
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; and 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. For example, if the node memory amount of the processor of the target host may be 64G, the determined node memory amount of the virtual machine may be 40G, or other memory amounts as long as it is smaller than 64G, which is not limited herein.
In this embodiment, the virtual machine management server can determine the node memory amount of the virtual machine according to the node memory amount of the processor of the target host, where the node memory amount of the processor of the target host is greater than or equal to the node memory amount of the virtual machine, so that the occurrence of cross-node memory access of the virtual machine can be reduced to the maximum extent, and the high availability of the node memory allocated to the virtual machine is ensured.
In some scenarios, the virtual machine management server further needs to record a node memory allocation amount of the target host, and in a case that there is a new virtual machine to be created, directly determine a memory allocation amount of the new virtual machine to be created according to the recorded node memory allocation amount of the target host, in an embodiment, the method further includes: and acquiring the node memory allocation amount of the target host machine, and recording the node memory allocation amount of the target host machine.
Specifically, the virtual machine management server obtains the node memory allocation amount of the target host machine, and records the node memory allocation amount of the target host machine. Optionally, the target host may report the node memory allocation amount of the target host to the virtual machine management server in real time, and the virtual machine management server records the node memory allocation amount reported by the target host. Optionally, the virtual machine management server may also issue an acquisition instruction to the target host, acquire the node memory allocation amount of the target host, and record the node memory allocation amount reported by the target host.
In this embodiment, the virtual machine management server can obtain the node memory allocation amount of the target host in time by obtaining the node memory allocation amount of the target host and recording the node memory allocation amount of the target host, so that the virtual machine management server can determine the node memory amount of the virtual machine in time according to the node memory allocation amount of the target host when creating a new virtual machine.
In a scenario where the virtual machine management server determines a target host according to the node topology information of the virtual machine and the node topology information of each host in the host cluster, in an embodiment, the step S202 includes: and determining the target host machine according to the host machines of which the node number of each host machine meets the node number of the virtual machine and the node available quantity meets the node available quantity of the virtual machine.
Specifically, the virtual machine management server determines the target host according to the host with the node number of each host in the host cluster meeting the node number of the virtual machine and the node available amount meeting the node available amount of the virtual machine. Optionally, if the number of nodes of each host in the host cluster satisfies the number of nodes of the virtual machine, and there is only one host whose node availability satisfies the node availability of the virtual machine, the virtual machine management server determines the host as the target host. Optionally, if the number of nodes of each host in the host cluster satisfies the number of nodes of the virtual machine, and there are a plurality of hosts whose node availability satisfies the node availability of the virtual machine, the virtual machine management server may determine the target host by the following method steps: s1, determining at least two candidate host machines according to the host machines of which the node number of each host machine meets the node number of the virtual machine and the node available quantity meets the node available quantity of the virtual machine; s2, determining the weight of each candidate host machine; and S3, determining the candidate host with the largest weight as the target host. That is, when there are a plurality of hosts whose node numbers of the hosts in the host cluster satisfy the node numbers of the virtual machines and whose node availability amounts satisfy the node availability amounts of the virtual machines, the weights of the hosts may be determined, and the host with the largest weight may be determined as the target host.
In this embodiment, the virtual machine management server can accurately determine the target host machine according to the host machines whose node number satisfies the node number of the virtual machine and whose node available amount satisfies the node available amount of the virtual machine, thereby avoiding the situation that processors corresponding to a plurality of virtual machines are repeatedly bound to the same node of the host machine, and ensuring that the determined target host machine is the host machine satisfying the node topology information of the virtual machine.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 5, there is provided a virtual machine creation apparatus including: the device comprises an acquisition module, a first determination module, a first creation module and a binding module, wherein:
and the acquisition module is used for acquiring the node topology information and the type of the virtual machine to be created according to the virtual machine creation request.
The first determining module is used for 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.
The first creating module is used for 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.
And the binding module is used for binding the processor corresponding to the created virtual machine with the node of the target host machine if the type of the virtual machine is the virtual machine with NUMA configuration and the type of the target host machine is the host machine with NUMA configuration.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
On the basis of the foregoing embodiment, optionally, the first creating module includes: a creation unit and an allocation unit, wherein:
and the creating unit is used for controlling the target host to create the virtual machine according to the type of the target host if the type of the virtual machine is the virtual machine with NUMA configuration.
And the allocation unit is used for allocating the node memory for the virtual machine according to the node memory amount of the virtual machine.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
On the basis of the foregoing embodiment, optionally, the creating unit is specifically configured to control the target host to create the first virtual machine if the type of the target host is a host with NUMA configuration; the first virtual machine and the target host have a node binding relationship and have NUMA configuration; if the type of the target host is the host without NUMA configuration, controlling the target host to create a second virtual machine; the second virtual machine has no node binding relationship with the target host machine and has NUMA configuration.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
On the basis of the foregoing embodiment, optionally, the apparatus further includes: a second creation module and an assignment module, wherein:
and the second creating module is used for controlling the target host to create the virtual machine with non-NUMA configuration if the type of the virtual machine is the virtual machine without NUMA configuration.
And the allocation module is used for allocating the node memory for the created non-NUMA configured virtual machine according to the node memory amount of the virtual machine.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
On the basis of the foregoing embodiment, optionally, the binding module includes: a first binding unit and a second binding unit, wherein:
the first binding unit is used for binding the processor corresponding to the virtual machine with the target node if the processor of the virtual machine is determined to be exclusively occupied by the target node of the target host machine according to the node topology information of the virtual machine; the target node is a node for creating a virtual machine in the target host machine.
And the second binding unit is used for binding the processor corresponding to the virtual machine with a plurality of nodes of the target host machine if the processor of the virtual machine is determined not to be exclusive to the target node according to the node topology information of the virtual machine.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
On the basis of the foregoing embodiment, optionally, the apparatus further includes: a second determination module, wherein:
a second determining module, configured to determine a node memory amount of the virtual machine according to the node memory amount of the processor of the target host; and 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.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
On the basis of the foregoing embodiment, optionally, the apparatus further includes: a recording module, wherein:
and the recording module is used for acquiring the node memory allocation amount of the target host machine and recording the node memory allocation amount of the target host machine.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
On the basis of the foregoing embodiment, optionally, the first determining module includes: a determination unit, wherein:
and the determining unit is used for determining the target host machine according to the host machines of which the node number of each host machine meets the node number of the virtual machine and the node available quantity meets the node available quantity of the virtual machine.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
On the basis of the foregoing embodiment, optionally, the determining unit is specifically configured to determine at least two candidate host machines according to the host machines whose node numbers of the host machines meet the node number of the virtual machine and whose node available amounts meet the node available amounts of the virtual machine; determining the weight of each candidate host machine; and determining the candidate host with the maximum weight as the target host.
The virtual machine creating apparatus provided in this embodiment may execute the method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
For specific limitations of the virtual machine creation apparatus, reference may be made to the above limitations of the virtual machine creation method, which is not described herein again. The modules in the virtual machine creation apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a virtual machine creation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring node topology information and types of virtual machines to be created according to the virtual machine creation request;
determining a 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 a 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;
and if the type of the virtual machine is the virtual machine with NUMA configuration and the type of the target host machine is the host machine with NUMA configuration, binding the processor corresponding to the created virtual machine with the node of the target host machine.
The implementation principle and technical effect of the computer device provided by the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring node topology information and types of virtual machines to be created according to the virtual machine creation request;
determining a 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 a 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;
and if the type of the virtual machine is the virtual machine with NUMA configuration and the type of the target host machine is the host machine with NUMA configuration, binding the processor corresponding to the created virtual machine with the node of the target host machine.
The implementation principle and technical effect of the computer-readable storage medium provided by the above embodiments are similar to those of the above method embodiments, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.