CN113608833A - Virtual machine creation method and device, computer equipment and storage medium - Google Patents
Virtual machine creation method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113608833A CN113608833A CN202110812653.XA CN202110812653A CN113608833A CN 113608833 A CN113608833 A CN 113608833A CN 202110812653 A CN202110812653 A CN 202110812653A CN 113608833 A CN113608833 A CN 113608833A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- node
- host
- target host
- machine
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 230000015654 memory Effects 0.000 claims abstract description 141
- 238000004590 computer program Methods 0.000 claims description 13
- 230000000694 effects Effects 0.000 description 11
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45583—Memory management, e.g. access or allocation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application relates to a virtual machine creating method, a virtual machine creating device, computer equipment and a storage medium. The method comprises the following steps: 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. By adopting the method, 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 can be solved.
Description
Technical Field
The present application relates to the field of virtual machine technologies, and in particular, to a virtual machine creation method, an apparatus, a computer device, and a storage medium.
Background
NUMA (Non Uniform Memory Access Architecture) is a design for a multiprocessor, the Memory Access efficiency depends on the relative position of the processor and the Memory, and generally, a virtual machine running on a physical machine based on the NUMA Architecture switches a virtual machine on a NUMA node with a higher load to a NUMA node with a lower load due to traffic demands. When migration occurs, the access of the processor and the memory crosses NUMA nodes, so that the memory and the processor of the virtual machine are different NUMA nodes, and the access performance is greatly reduced.
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.
Drawings
FIG. 1 is a diagram of an application environment of a virtual machine creation method in one embodiment;
FIG. 2 is a flowchart illustrating a method for creating a virtual machine according to an embodiment;
FIG. 3 is a flowchart illustrating a method for creating a virtual machine according to an embodiment;
FIG. 4 is a flowchart illustrating a method for creating a virtual machine according to an embodiment;
FIG. 5 is a block diagram showing the configuration of a virtual machine creation apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
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.
Claims (12)
1. 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.
2. The method according to claim 1, wherein 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 amount of node memory 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.
3. The method of claim 2, wherein the controlling the target host to create the virtual machine according to the type of the target host comprises:
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.
4. The method of claim 1, further comprising:
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.
5. The method of claim 1, wherein binding the processor corresponding to the created virtual machine with the node of the target host comprises:
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.
6. The method of claim 1, further comprising:
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.
7. The method of claim 1, further comprising:
and acquiring the node memory allocation amount of the target host machine, and recording the node memory allocation amount of the target host machine.
8. The method according to claim 1, wherein 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 comprises:
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.
9. The method according to claim 8, wherein 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 availability satisfies the node availability of the virtual machine comprises:
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.
10. An apparatus for creating a virtual machine, 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.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110812653.XA CN113608833A (en) | 2021-07-19 | 2021-07-19 | Virtual machine creation method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110812653.XA CN113608833A (en) | 2021-07-19 | 2021-07-19 | Virtual machine creation method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113608833A true CN113608833A (en) | 2021-11-05 |
Family
ID=78337879
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110812653.XA Pending CN113608833A (en) | 2021-07-19 | 2021-07-19 | Virtual machine creation method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113608833A (en) |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060277180A1 (en) * | 2005-05-09 | 2006-12-07 | Russell Okamoto | Distributed data management system |
US20080209279A1 (en) * | 2007-02-28 | 2008-08-28 | Henrl Han Van Riel | Method and system for automatic resolution and dispatching subscription service |
US20140373006A1 (en) * | 2013-06-12 | 2014-12-18 | Krishnaprasad K | System And Method For Virtual Machine Management |
US9116803B1 (en) * | 2011-09-30 | 2015-08-25 | Symantec Corporation | Placement of virtual machines based on page commonality |
CN106020937A (en) * | 2016-07-07 | 2016-10-12 | 腾讯科技(深圳)有限公司 | Method, device and system for creating virtual machine |
CN106919435A (en) * | 2015-12-25 | 2017-07-04 | 华为技术有限公司 | The creation method of virtual machine, the management method of resource and device |
CN108196958A (en) * | 2017-12-29 | 2018-06-22 | 北京泽塔云科技股份有限公司 | Scheduling of resource distribution method, computer system and super fusion architecture system |
WO2018141242A1 (en) * | 2017-02-06 | 2018-08-09 | 腾讯科技(深圳)有限公司 | Resource scheduling method, system, server and storage medium |
CN109426544A (en) * | 2017-08-23 | 2019-03-05 | 龙芯中科技术有限公司 | Virtual machine deployment method and device |
CN109885377A (en) * | 2018-11-23 | 2019-06-14 | 中国银联股份有限公司 | The method of unified resource scheduling coordinator and its creation virtual machine and/or container, unified resource dispatch system |
WO2019179453A1 (en) * | 2018-03-22 | 2019-09-26 | 华为技术有限公司 | Virtual machine creation method and apparatus |
CN110750336A (en) * | 2019-10-29 | 2020-02-04 | 北京浪潮数据技术有限公司 | OpenStack virtual machine memory hot-expanding method |
CN112181595A (en) * | 2020-10-10 | 2021-01-05 | 济南浪潮数据技术有限公司 | NUMA node binding method, device, equipment and storage medium of virtual machine |
CN112732401A (en) * | 2020-12-29 | 2021-04-30 | 深圳前海微众银行股份有限公司 | Virtual machine resource allocation method, system, device and medium |
CN113127142A (en) * | 2019-12-30 | 2021-07-16 | 奇安信科技集团股份有限公司 | Method and device for creating virtual machine in physical system |
-
2021
- 2021-07-19 CN CN202110812653.XA patent/CN113608833A/en active Pending
Patent Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060277180A1 (en) * | 2005-05-09 | 2006-12-07 | Russell Okamoto | Distributed data management system |
US20080209279A1 (en) * | 2007-02-28 | 2008-08-28 | Henrl Han Van Riel | Method and system for automatic resolution and dispatching subscription service |
US9116803B1 (en) * | 2011-09-30 | 2015-08-25 | Symantec Corporation | Placement of virtual machines based on page commonality |
US20140373006A1 (en) * | 2013-06-12 | 2014-12-18 | Krishnaprasad K | System And Method For Virtual Machine Management |
CN106919435A (en) * | 2015-12-25 | 2017-07-04 | 华为技术有限公司 | The creation method of virtual machine, the management method of resource and device |
CN106020937A (en) * | 2016-07-07 | 2016-10-12 | 腾讯科技(深圳)有限公司 | Method, device and system for creating virtual machine |
WO2018141242A1 (en) * | 2017-02-06 | 2018-08-09 | 腾讯科技(深圳)有限公司 | Resource scheduling method, system, server and storage medium |
CN109426544A (en) * | 2017-08-23 | 2019-03-05 | 龙芯中科技术有限公司 | Virtual machine deployment method and device |
CN108196958A (en) * | 2017-12-29 | 2018-06-22 | 北京泽塔云科技股份有限公司 | Scheduling of resource distribution method, computer system and super fusion architecture system |
WO2019179453A1 (en) * | 2018-03-22 | 2019-09-26 | 华为技术有限公司 | Virtual machine creation method and apparatus |
CN109885377A (en) * | 2018-11-23 | 2019-06-14 | 中国银联股份有限公司 | The method of unified resource scheduling coordinator and its creation virtual machine and/or container, unified resource dispatch system |
WO2020103465A1 (en) * | 2018-11-23 | 2020-05-28 | 中国银联股份有限公司 | Unified resource scheduling coordinator and method thereof for creating a virtual machine and/or container, and unified resource scheduling system |
CN110750336A (en) * | 2019-10-29 | 2020-02-04 | 北京浪潮数据技术有限公司 | OpenStack virtual machine memory hot-expanding method |
CN113127142A (en) * | 2019-12-30 | 2021-07-16 | 奇安信科技集团股份有限公司 | Method and device for creating virtual machine in physical system |
CN112181595A (en) * | 2020-10-10 | 2021-01-05 | 济南浪潮数据技术有限公司 | NUMA node binding method, device, equipment and storage medium of virtual machine |
CN112732401A (en) * | 2020-12-29 | 2021-04-30 | 深圳前海微众银行股份有限公司 | Virtual machine resource allocation method, system, device and medium |
Non-Patent Citations (1)
Title |
---|
左起同: "面向负载均衡的VNUMA虚拟机创建方法与调度策略研究", 信息科技, no. 2 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10789083B2 (en) | Providing a virtual desktop service based on physical distance on network from the user terminal and improving network I/O performance based on power consumption | |
JP5400482B2 (en) | Management computer, resource management method, resource management program, recording medium, and information processing system | |
US8650296B1 (en) | Workload reallocation involving inter-server transfer of software license rights and intra-server transfer of hardware resources | |
JP5510556B2 (en) | Method and system for managing virtual machine storage space and physical hosts | |
JP5332065B2 (en) | Cluster configuration management method, management apparatus, and program | |
CN111104208B (en) | Process scheduling management method, device, computer equipment and storage medium | |
EP2418578A1 (en) | A computer system, resource management server of a computer system, and resource management method of a computer system | |
CN103577345A (en) | Methods and structure for improved flexibility in shared storage caching by multiple systems | |
CN111338779B (en) | Resource allocation method, device, computer equipment and storage medium | |
CN113377545B (en) | Method and device for distributing GPU physical memory | |
CN112241320A (en) | Resource allocation method, storage device and storage system | |
CN113867644A (en) | Disk array optimization method and device, computer equipment and storage medium | |
US7793051B1 (en) | Global shared memory subsystem | |
JP4649341B2 (en) | Computer control method, information processing system, and computer control program | |
CN112162818B (en) | Virtual memory allocation method and device, electronic equipment and storage medium | |
US9317306B2 (en) | Computer device and memory management method thereof | |
CN105677481A (en) | Method and system for processing data and electronic equipment | |
JP2011210134A (en) | Management server, virtual machine management method and virtual machine management program | |
CN107329798B (en) | Data replication method and device and virtualization system | |
KR101695238B1 (en) | System and method for job scheduling using multi computing resource | |
CN114281516A (en) | Resource allocation method and device based on NUMA attribute | |
US10956084B2 (en) | Drive utilization in multi-tiered systems with read-intensive flash | |
CN113608833A (en) | Virtual machine creation method and device, computer equipment and storage medium | |
CN110162483B (en) | Static memory defragmentation method, device, computer equipment and storage medium | |
CN111813564B (en) | Cluster resource management method and device and container cluster management system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |