CN113849260A - Instance processing core allocation method and device - Google Patents

Instance processing core allocation method and device Download PDF

Info

Publication number
CN113849260A
CN113849260A CN202010599059.2A CN202010599059A CN113849260A CN 113849260 A CN113849260 A CN 113849260A CN 202010599059 A CN202010599059 A CN 202010599059A CN 113849260 A CN113849260 A CN 113849260A
Authority
CN
China
Prior art keywords
instance
processing cores
virtual machine
container
creation request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010599059.2A
Other languages
Chinese (zh)
Inventor
朱磊
周文礼
苏利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010599059.2A priority Critical patent/CN113849260A/en
Publication of CN113849260A publication Critical patent/CN113849260A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

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

In the application, after receiving a virtual machine creation request, a resource allocation device allocates a first part of processing cores in NUMA nodes of a physical machine to a virtual machine instance according to the virtual machine creation request, wherein the processing cores required by the specification of the virtual machine instance are matched with the first part of processing cores, and the virtual machine instance is a NUMA perception type instance; the resource allocation apparatus may then receive a container creation request, and allocate a second portion of the processing cores in the NUMA node to the container instance according to the container creation request, where the first portion of the processing cores is different from the second portion of the processing cores. The processing cores required by the container instance specification match the second portion of processing cores, and the container instance is a NUMA unaware instance. The resource allocation device can allocate processing cores in the same NUMA node for the container and the virtual machine, so that co-deployment of the container and the virtual machine is realized, and the utilization rate of resources in the physical machine can be improved.

Description

Instance processing core allocation method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for allocating processing cores of an instance.
Background
Currently, the virtual machine instance and the container instance are deployed independently, that is, only the virtual machine instance or only the container instance can be deployed on one physical machine. The way that the virtual machine instance and the container instance are deployed independently can cause resource waste of the physical machine.
In summary, a hybrid deployment manner of virtual machines and containers is needed to reduce the resource waste of physical machines so as to fully utilize the resources in the physical machines.
Disclosure of Invention
The application provides an example processing core allocation method and device, which are used for realizing allocation of processing cores when a virtual machine and a container are deployed in a mixed mode.
In a first aspect, an embodiment of the present application provides an example processing core allocation method, where the method is executed by a resource allocation apparatus, and in the method: the resource allocation device receives the virtual machine creation request first, and after receiving the virtual machine creation request, the resource allocation device can allocate resources to the virtual machine instance. Specifically, the resource allocation device may allocate a first part of processing cores in a NUMA node of the physical machine to the virtual machine instance according to the virtual machine creation request, where the processing cores required by the specification of the virtual machine instance are matched with the first part of processing cores, and the virtual machine instance is a NUMA aware instance; the resource allocation apparatus may further receive a container creation request, and the resource allocation apparatus may allocate the resource to the container instance after receiving the container creation request. Specifically, the resource allocation means may allocate a second portion of the processing cores in the NUMA node to the container instance according to the container creation request, where the first portion of the processing cores is different from the second portion of the processing cores. The second partial processing core may be a remaining processing core of the NUMA node other than the first partial processing core, or may be a partial processing core of the remaining processing cores. The processing cores required by the container instance specification match the second portion of processing cores, and the container instance is a NUMA unaware instance.
By the method, the resource allocation device can allocate the processing cores in the same NUMA node to the container and the virtual machine, so that the co-deployment of the container and the virtual machine is realized, and the utilization rate of resources in the physical machine can be improved.
In one possible implementation, the virtual machine creation request includes a virtual machine instance specification, and the resource allocation apparatus may first acquire a first resource view when allocating a first part of processing cores in a NUMA node of the physical machine to the virtual machine instance according to the virtual machine creation request, where the first resource view may indicate idle resources of the physical machine and that a first reference instance occupies the first part of processing cores, where the first reference instance is a predicted virtual machine instance or container instance that needs to be created. The scheduling allocating device may determine, based on the first resource view, that the processing cores required by the specification of the virtual machine instance match with the first part of processing cores occupied by the first reference instance, and then allocate the first part of processing cores to the virtual machine instance.
By the method, when the resource allocation device allocates the processing cores to the virtual machine instances, the processing cores occupied by the first reference instance can be used as reference, so that the process of allocating the processing cores to the virtual machine instances can be effectively simplified, and the resource allocation efficiency is improved.
In one possible implementation, the container creation request includes a container instance specification, and the resource allocation apparatus may first acquire a first resource view when allocating a second part of processing cores in a NUMA node of the physical machine to the container instance according to the container creation request, where the first resource view may indicate idle resources of the physical machine and a second reference instance occupies the second part of processing cores, where the second reference instance is a predicted virtual machine instance or container instance that needs to be created. The resource allocation means may determine, based on the first resource view, that the processing cores required by the container instance specification match a second portion of processing cores occupied by the second reference instance, and then allocate the second portion of processing cores to the container instance.
By the method, when the resource allocation device allocates the processing cores for the container instances, the processing cores occupied by the second reference instances can be used as references, so that the process of allocating the processing cores for the container instances can be effectively simplified, and the resource allocation efficiency is improved.
In one possible implementation manner, the scheduling allocating device may receive a first simulation instance creation request, where the first simulation instance creation request is used to request that resources are allocated to the first reference instance; then, allocating a first part of processing cores for the first reference example based on a second resource view, wherein the second resource view is used for indicating idle resources of the physical machine; and marking the first part of the processing cores as the first reference instance occupation in the second resource view, and generating the first resource view.
By the method, the scheduling allocation device can allocate the first part of the processing cores to the first reference instance in advance to generate the first resource view, so that resources can be allocated to the virtual machine instance in the following process.
In a possible implementation manner, the scheduling allocating apparatus may further receive a second simulation instance creation request, where the second simulation instance creation request is used to request to allocate resources for the second reference instance; then, allocating a second part of processing cores for the two reference examples based on a second resource view, wherein the second resource view is used for indicating idle resources of the physical machine; and marking the second part of the processing cores as second reference instance occupation in the second resource view, and generating the first resource view.
By the method, the scheduling allocation device may allocate the second part of the processing cores to the second reference instance in advance, generate the first resource view, and facilitate subsequent allocation of resources to the container instance.
In a possible implementation manner, after allocating a first part of processing cores to a virtual machine instance, the resource scheduling apparatus may send first notification information to the physical machine, where the first notification information is used to notify the physical machine to create the virtual machine instance; after the resource scheduling device allocates the second part of processing cores to the container instance, the resource scheduling device may send second notification information to the physical machine, where the second notification information is used to notify the physical machine to create the container instance.
By the above method, the resource scheduling device can send notification information to the physical machine after allocating resources for the virtual machine instance and the container instance, so that the virtual machine instance and the container instance can be deployed on the NUMA node on the physical machine.
In a second aspect, an embodiment of the present application provides a physical machine, where the physical machine includes a NUMA node, and a container and a virtual machine instance are deployed on the physical machine, a first part of processing cores in the NUMA node of the physical machine is allocated to the virtual machine instance, a second part of processing cores in the NUMA node is allocated to the container instance, the second part of processing cores is different from the first part of processing cores, the second part of processing cores may be remaining processing cores of the NUMA node except the first part of processing cores or partial processing cores in the remaining processing cores, a processor core required by a specification of the virtual machine instance is matched with the first part of processing cores, the virtual machine instance is a NUMA-aware instance, a processor core required by a specification of the virtual machine instance is matched with the second part of processing cores, and the container instance is a NUMA non-aware instance.
Through the physical machine, the virtual machine and the container can be co-deployed in the physical machine, and resources of NUMA nodes in the physical machine can be fully utilized.
In a third aspect, an embodiment of the present application provides an example processing core allocation method, where the method is executed by a resource allocation apparatus, and in the method: the resource allocation means may allocate a portion of the processing cores in the NUMA node of the physical machine to at least one virtual machine instance, wherein the processor cores required by the at least one virtual machine instance specification match the portion of the processing cores, and the virtual machine instance is a NUMA aware instance; allocating the remaining processing cores in the NUMA node except the partial processing cores to at least one container instance, the at least one container instance specification requiring processor cores to match the remaining processing cores except the partial processing cores, and the container instance being a NUMA unaware instance.
Through the method, all the processing cores of the NUMA node of the physical machine can be occupied, and the resource utilization rate is effectively improved.
In a fourth aspect, an embodiment of the present application further provides a resource allocation apparatus, where the apparatus has a function of implementing the behavior in the method example of the first aspect, and for beneficial effects, reference may be made to the description of the first aspect and details are not repeated here. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions. In a possible design, the structure of the apparatus includes a receiving module, an allocating module, and may further include a sending module, where these units may perform corresponding functions in the method example of the first aspect, for specific reference, detailed description in the method example is given, and details are not repeated here.
In a fifth aspect, an embodiment of the present application further provides an apparatus, where the apparatus has a function of implementing the behavior in the method example of the first aspect, and for beneficial effects, reference may be made to the description of the first aspect and details are not repeated here. The communication device has a structure comprising a processor and a memory, wherein the processor is configured to support the base station to perform the corresponding functions of the method of the first aspect. The memory is coupled to the processor and retains program instructions and data necessary for the communication device. The structure of the communication device also comprises a communication interface used for communicating with other equipment.
In a sixth aspect, the present application also provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of the above aspects.
In a seventh aspect, the present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the above aspects.
In an eighth aspect, the present application further provides a computer chip, where the chip is connected to a memory, and the chip is used to read and execute a software program stored in the memory, and execute the method in the above aspects.
Drawings
Fig. 1A is a schematic structural diagram of a physical machine provided in the present application;
FIG. 1B is a block diagram of a system according to the present application;
FIG. 2 is a schematic diagram of an exemplary processing core allocation method provided herein;
fig. 3 is a schematic structural diagram of a resource allocation apparatus provided in the present application;
fig. 4 is a schematic structural diagram of an apparatus provided in the present application.
Detailed Description
After a description is given to an example processing core allocation method and apparatus provided in an embodiment of the present application, concepts related to the embodiment of the present application are described first:
(1) non-uniform memory access (NUMA), NUMA nodes.
NUMA is a multiprocessor computer architecture. Each processor in NUMA has a different latency in accessing memory in a different location.
In a Physical Machine (PM) having a NUMA structure, the physical machine may be divided into one or more NUMA nodes, and a NUMA node includes some or all of resources of the physical machine, including but not limited to: processing cores, memory, or network bandwidth, etc. The resources that a NUMA node includes can be referred to as the NUMA node's structure. A processor in a physical machine may include one or more processing cores.
(2) Example, example specification.
Examples of types in embodiments of the present application include, but are not limited to: virtual Machine (VM), container (container). That is, the instance in the present application may be a virtual machine instance, and may also be a container instance.
The virtual machine instance has NUMA sensing characteristics and is a NUMA sensing type instance; the NUMA perceptual characteristic of the virtual machine instance means that the virtual machine instance specifies a structure of a NUMA node that the virtual machine instance can occupy in a scheduling process, and when allocating resources to the virtual machine instance, the NUMA node conforming to the structure and the resources occupied by the NUMA node need to be allocated to the virtual machine instance.
The container example has the NUMA non-sensing characteristic and is a NUMA non-sensing type example; the NUMA-unaware nature of the container instance refers to structures that do not specify NUMA nodes, and the container instance can be deployed on NUMA nodes of any structure.
The instance specification may indicate the resources required by the instance (which may also be understood as the resources occupied by the instance) in relation to the type of the instance.
For a virtual machine instance, because the virtual machine instance has NUMA-aware properties, the virtual machine specification includes the required structure of the NUMA nodes, and the amount of resources such as processing cores, memory, disks, network bandwidth, etc. required by the virtual machine instance.
For a container instance, since the container instance has NUMA imperceptible properties, the container specification includes the number of resources such as processing cores, memory, disks, network bandwidth, etc. required by the container.
Referring to fig. 1A, a schematic structural diagram of a physical machine provided in this embodiment of the present application, where the physical machine 100 includes one or more NUMA nodes 110. The NUMA node 110 occupies some or all of the resources of the physical machine, such as processing cores, memory, and the like. One or more virtual machine instances can be deployed on each NUMA node 110, and one or more container instances can also be deployed. The virtual machine instance and the container instance can be co-deployed, that is, the virtual machine instance and the container instance can be deployed on the same physical machine, and even on the same NUMA node.
In this embodiment, taking four NUMA nodes 110 included in the physical machine 100 as an example, several possible deployment manners of the virtual machine instance and the container instance on the physical machine 100 are described, and for convenience of distinguishing the four NUMA nodes 110, the four NUMA nodes are respectively represented by NUMA node 1101, NUMA node 1102, NUMA node 1103, and NUMA node 1104.
For NUMA node 1101, only container instances are deployed on NUMA node 1101. The number of container instances deployed on NUMA node 1101 is not limited herein. The container instance can occupy some or all of the resources on the NUMA node 1101. Such as occupying some or all of the processing cores, memory, etc. on the NUMA node 1101. Processing cores on NUMA node 1101 are indicated in FIG. 1A with black boxes.
For NUMA node 1102, only the virtual machine instance is deployed on NUMA node 1102. The number of virtual machine instances deployed on NUMA node 1102 is not limited herein. The virtual machine instance can occupy some or all of the resources on NUMA node 1102. Such as occupying some or all of the processing cores, memory, etc. on the NUMA node 1102.
For NUMA node 1103, a virtual machine instance and a container instance are deployed on NUMA node 1103. The number of virtual machine instances and container instances deployed on NUMA node 1103 is not limited herein. The virtual machine instance and container instance occupy a portion of the resources on NUMA node 1103, e.g., a virtual machine instance occupies a portion of the processing cores on NUMA node 1103, a container instance occupies another portion of the processing cores on NUMA node 1103, and the total number of processing cores on NUMA node 1103 occupied by a virtual machine instance and container instance is less than the total number of processing cores on NUMA node 1103.
For NUMA node 1104, a virtual machine instance and a container instance are deployed on NUMA node 1104. The number of virtual machine instances and container instances deployed on NUMA node 1104 is not limited herein. The virtual machine instance and container instance occupy all resources on NUMA node 1104, e.g., the virtual machine instance occupies a portion of the processing cores on NUMA node 1104, the container instance occupies the remaining processing cores on NUMA node 1104, and the total number of processing cores on NUMA node 1104 that are occupied by the virtual machine instance and container instance is equal to the total number of processing cores on NUMA node 1104.
Referring to fig. 1B, a system architecture diagram applicable to the embodiment of the present application includes a resource allocation apparatus 200 and one or more physical machines 100, and optionally, may further include a prediction apparatus 300, where one physical machine 100 includes one or more NUMA nodes 110. Wherein one NUMA node 110 includes some or all of the resources on the physical machine 100.
In this embodiment of the present application, the resource allocation apparatus 200 may allocate resources (such as processing cores, memories, and the like) for predicted instances (such as the first reference instance and the second reference instance) that need to be created, for example, determining NUMA nodes 110 that need to be occupied and resources occupied in the NUMA nodes 110. Resource allocation apparatus 200 can also allocate resources for a virtual machine instance or container instance that needs to be created when a virtual machine instance or container instance needs to be created, such as when a virtual machine creation request or container creation request is received, e.g., to determine NUMA node 110 that needs to be committed and the resources in that NUMA node 110 that need to be committed.
The resource allocation apparatus 200 may determine the resources required to be occupied by the virtual machine instance or container instance to be created, with reference to the resources allocated to the predicted reference instance to be created when allocating resources to the virtual machine instance or container instance to be created.
In the embodiment of the present application, the resource allocation apparatus 200 may further maintain two different resource views, which are referred to as a first resource view and a second resource view for convenience of description, where the first resource view and the second resource view can both indicate free resources and occupied resources on one or more physical machines 100. The difference is that the first resource view may indicate the resources occupied by the predicted reference instance that needs to be created. And these resources are marked as occupied by predicted, need-to-create reference instances. That is, the first resource view is a resource view generated taking into account the resources occupied by the predicted reference instance that needs to be created. And the second resource view indicates one or more physical idle resources and occupied resources, and does not consider the resources occupied by the reference instance which is predicted and needs to be created, that is, the second resource view is a real resource view and can truly reflect the distribution conditions of the one or more physical idle resources and the occupied resources.
The first resource view can be updated in time when the resource allocation apparatus 200 allocates resources for the predicted reference instance that needs to be created. When the resource allocation apparatus 200 allocates resources for an instance that actually needs to be created, the first resource view and the second resource view can be updated simultaneously.
It should be noted that, the present application does not limit the manner in which the resource allocation apparatus 200 receives the virtual machine creation request or the container creation request, for example, the virtual machine creation request or the container creation request may be sent to the resource allocation apparatus 200 by another apparatus, for example, the other apparatus may be a client, and the client generates the virtual machine creation request or the container creation request under the trigger of the user (the user determines the number of virtual machines or containers to be created, the specification of the virtual machines or containers, and the like on the creation interface), and sends the virtual machine creation request or the container creation request to the resource allocation apparatus 200. For another example, the virtual machine creation request or the container creation request may be generated by the resource allocation apparatus 200 itself under the trigger of the user. The above two ways are only examples, and all the ways that the resource allocation apparatus 200 can receive the virtual machine creation request or the container creation request are applicable to the embodiment of the present application.
The predicting apparatus 300 may predict an instance to be created and send a simulation instance creation request (e.g., a first simulation instance creation request or a first simulation instance creation request) to the resource allocating apparatus 200 for requesting allocation of resources for the predicted reference instance to be created.
The embodiment of the present application does not limit the way in which the prediction apparatus 300 predicts that the reference instance needs to be created, for example, the prediction apparatus 300 may perform data analysis on the simulation instance creation request received by the resource allocation apparatus 200, so as to predict the reference instance that needs to be created in a future period of time.
With reference to fig. 2, a description is given below of an example processing core allocation method provided in this embodiment, where in the method shown in fig. 2, steps 201 to 202 allocate resources to the resource allocation apparatus 200 for a virtual machine instance that needs to be created, and steps 203 to 204 allocate resources to the resource allocation apparatus 200 for a container instance that needs to be created.
Step 201: the resource allocation apparatus 200 receives a virtual machine creation request for requesting allocation of a resource for a virtual machine instance, which may include a virtual machine instance specification.
Step 202: resource allocation apparatus 200 allocates a first portion of the processing cores in NUMA node 110 to the virtual machine instance in accordance with the virtual machine creation request. The processing cores required by the virtual machine instance specification are matched with the first part of processing cores.
Step 203: the resource allocation apparatus 200 receives a container creation request for requesting allocation of a resource for a container instance, the container creation request including a container instance specification.
Step 204: resource allocation apparatus 200 allocates a second portion of the processing cores in NUMA node 110 to the container instance in accordance with the container creation request. The processing cores required by the container instance specification match the second portion of processing cores.
Wherein the first part of processing cores is different from the second part of processing cores. The second partial processing core may be the remaining processing cores of NUMA node 110 in addition to the first partial processing core or may be a partial processing core of the remaining processing cores.
(1) And allocating resources for the virtual machine instance.
After receiving the virtual machine creation request, the resource allocation apparatus 200 may allocate resources (such as a processing core and a memory) to the virtual machine, and the embodiment of the present application does not limit the manner in which the resource allocation apparatus 200 allocates resources to the virtual machine instance, for example, the resource allocation apparatus 200 may allocate resources to the virtual machine instance according to the virtual machine specification based on the idle resources (i.e., the second resource view) on the current physical machine 100, or may adopt other manners.
The embodiment of the present application provides a method for allocating resources to a virtual machine instance, in the embodiment of the present application, a resource allocation apparatus 200 may first allocate occupied resources to a predicted first reference instance that needs to be created, and then, when determining that resources need to be allocated to the virtual machine instance after receiving a virtual machine creation request, may determine whether resources occupied by the first reference instance may be allocated to the virtual machine instance with reference to the resources occupied by the first reference instance; if yes, allocating the resources occupied by the first reference instance to the virtual machine instance; otherwise, resources may be allocated for the virtual machine instance according to the virtual machine specification based on the free resources (i.e., the second resource view) on the current physical machine 100.
1) And allocating resources for the predicted first reference instance to be created.
The predicting apparatus 300 may generate a first simulation instance creation request after predicting the first reference instance to be created, and send the first simulation instance creation request to the resource allocating apparatus 200.
The first simulation instance creation request includes a first reference instance specification that indicates the structure of NUMA node 110 that the first reference instance needs to occupy and the amount of resources needed by the first reference instance if the type of the first reference instance is a virtual machine. The type of the first reference instance is a container, and the first reference instance specification needs to indicate the amount of resources required by the first reference instance.
Since the first reference instance is not an instance actually and really required to be created, that is, the first simulation instance creation request is a simulation instance creation request, the first simulation instance creation request may also indicate that the first reference instance is an instance predicted to be created or indicate that the first simulation instance creation request is a simulation instance creation request, and the embodiment of the application does not limit the manner in which the first simulation instance creation request indicates that the first reference instance is an instance predicted to be created or indicates that the first simulation instance creation request is a simulation instance creation request. For example, the first simulation instance creation request may carry indication information for indicating that the first reference instance is an instance predicted to need to be created, or indicating that the first reference instance does not need to be created, and for example, the first simulation instance creation request may carry a simulation request identifier for identifying that the first simulation instance creation request is a simulation instance creation request. Any manner of indicating that the first reference instance is an instance predicted to need to be created or indicating that the first simulation instance creation request is a simulation instance creation request is applicable to the embodiments of the present application.
The resource allocation apparatus 200, after receiving the first simulation instance creation request, may allocate resources for the first reference instance according to the first simulation instance creation request.
When the resource allocation apparatus 200 allocates resources for the first reference instance, a second resource view may be obtained first, determine idle resources on one or more current physical machines 100 according to the second resource view, allocate resources for the first reference instance, and determine a NUMA node 110 that the first reference instance needs to occupy and resources of the NUMA node 110 that the first reference instance occupies, for example, the resources of the NUMA node 110 that the first reference instance occupies include but are not limited to: a first portion of the processing cores of the NUMA node 110 occupied by the first reference instance, memory of the NUMA node 110 occupied by the first reference instance, and so on.
If the type of the first reference instance is a virtual machine, resource allocation apparatus 200 needs to determine, from the free resources on one or more physical machines 100, a NUMA node 110 that meets the specification of the first reference instance, and may also determine the resources occupied by the first reference instance at the NUMA node 110. Because a virtual machine instance can be deployed across NUMA nodes 110, that is, a virtual machine instance can be deployed in a distributed manner on a plurality of NUMA nodes 110, the embodiments of the present application do not limit the number of NUMA nodes 110 determined by resource allocation apparatus 200, and the number of NUMA nodes 110 that can deploy the first reference instance determined by resource allocation apparatus 200 may be one or more.
It should be noted that, in this embodiment of the application, the resource occupied by the first reference instance in the NUMA node 110 refers to the number of idle resources that the first reference instance needs to occupy in the NUMA node 110 (for example, the number of the first part of processing cores of the NUMA node 110 occupied by the first reference instance or the size of the memory of the NUMA node 110 occupied by the first reference instance).
If the type of the first reference instance is a container, the resource allocation apparatus 200 needs to determine, from the idle resources on the one or more physical machines 100, a NUMA node 110 capable of deploying the first reference instance, and may also determine the resources of the NUMA node 110 occupied by the first reference instance. For a description of the resources of NUMA node 110 occupied by the first reference instance, refer to the foregoing, and are not described here again. Since container instances can be deployed across NUMA nodes 110, i.e., one container instance can be deployed in a distributed manner over multiple NUMA nodes 110, the number of NUMA nodes 110 that the resource allocation apparatus 200 determines can deploy the first reference instance may be one or multiple.
After determining the NUMA node 110 occupied by the first reference instance and the resources of the NUMA node 110 occupied by the first reference instance, the resource allocation apparatus 200 may label the resources occupied by the first reference instance in the second resource view, that is, label the NUMA node 110 occupied by the first reference instance and the resources (such as the first part of processing cores or memory) occupied by the first reference instance at the NUMA node 110, where the second resource view labeled with the resources occupied by the first reference instance is the first resource view.
Since the first reference instance is a predicted instance that needs to be created, the resource allocation apparatus 200 does not need to instruct the creation of the first reference instance. That is, the resources occupied by the first reference instance are still idle resources.
To this end, the resource allocation apparatus 200 allocates resources for the first reference example.
2) And allocating resources for the virtual machine instance by taking the resources occupied by the first reference instance as reference.
After the resource allocation apparatus 200 allocates the resource to the first reference instance, if a virtual machine creation request is received, the resource may be allocated to the virtual machine instance according to the virtual machine creation request, where the virtual machine creation request includes a virtual machine instance specification. When the resource allocation apparatus 200 allocates resources for a virtual machine instance, a first resource view may be obtained first, and it is determined whether resources occupied by a first reference instance are matched with the specification of the virtual machine instance according to the first resource view.
Resource allocation apparatus 200 can determine the structure of NUMA node 110 occupied by the first reference instance and the resources of NUMA node 110 occupied by the first reference instance from the first resource view, and if the structure of NUMA node 110 required by the virtual machine instance specification is consistent with the structure of NUMA node 110 occupied by the first reference instance, the resources required by the virtual machine instance specification match the resources occupied by the first reference instance, for example, the processing cores required by the virtual machine instance specification match the first portion of processing cores of NUMA node 110 occupied by the first reference instance (i.e., the number of processing cores required by the virtual machine instance specification is the same as the number of processing cores of the first portion of NUMA node 110 occupied by the first reference instance), and the memory required by the virtual machine instance specification matches the memory of NUMA node 110 occupied by the first reference instance (i.e., the size of the memory required by the virtual machine instance specification is the same as the size of the memory of NUMA node 110 occupied by the first reference instance). The resource allocation apparatus 200 is illustrated determining that a virtual machine instance can be created using the resources occupied by the first reference instance.
It should be noted that if a NUMA node 110 is occupied by a first reference instance, matching the resources required by the virtual machine instance specification with the resources of NUMA node 110 occupied by the first reference instance means that for any type of resource, the number of resources required by the virtual machine instance specification is equal to the number of resources of NUMA node 110 occupied by the second reference instance. If a first reference instance occupies multiple NUMA nodes 110, the matching of the resources required by the virtual machine instance specification to the resources of NUMA nodes 110 occupied by the first reference instance means that for any type of resource, the number of resources required by the virtual machine instance specification is the same as the total number of the resources of the multiple NUMA nodes 110 occupied by the second reference instance.
Resource allocation apparatus 200 can allocate resources occupied by the first reference instance to the virtual machine instance, e.g., can allocate a first portion of the processing cores of NUMA node 110 to the virtual machine instance, allocate memory of NUMA node 110 occupied by the first reference instance to the virtual machine instance, and instruct creation of the virtual machine instance using the resources occupied by the first reference instance.
For example, the resource allocation apparatus 200 may send first notification information to the physical machine 100 where the NUMA node 110 is located, and notify the physical machine 100 to create the virtual machine instance, where the first notification information indicates the NUMA node 110 that the virtual machine instance needs to occupy and the resources occupied on the NUMA node 110, such as that the virtual machine instance occupies a first part of processing cores on the NUMA node 110, or that the virtual machine instance occupies memory on the NUMA node 110, and the physical machine 100 (or a virtual machine creation module deployed on the physical machine 100) completes the creation operation of the virtual machine instance.
Physical machine 100, upon receiving the first notification message, can create a virtual machine instance based on the first notification message, assign a first portion of the processing cores on NUMA node 110 to the virtual machine instance, and create the virtual machine instance using the first portion of the processing cores on NUMA node 110.
After determining that the virtual machine instance can be created by using the resource occupied by the first reference instance, the resource allocation apparatus 200 may further update the first resource view and the second resource view, label, for the first resource view, the resource occupied by the first reference instance (such as the NUMA node 110 occupied by the first reference instance and the first part of the processing cores and/or the memory of the occupied NUMA node 110) as the resource occupied by the virtual machine instance, and label, for the second resource view, the resource occupied by the virtual machine instance as occupied.
If the structure of NUMA node 110 required by the virtual machine instance specification does not match the structure of NUMA node 110 occupied by the first reference instance, or the resources of NUMA node 110 required by the virtual machine instance specification do not match the resources of NUMA node 110 occupied by the first reference instance, such as the processing cores required by the virtual machine instance specification do not match the first portion of processing cores of NUMA node 110 occupied by the first reference instance (i.e., the number of processing cores required by the virtual machine instance specification is different from the number of processing cores of NUMA node 110 occupied by the first reference instance), the memory required by the virtual machine instance specification does not match the memory of NUMA node 110 occupied by the first reference instance (i.e., the size of the memory required by the virtual machine instance specification is different from the size of the memory of NUMA node 110 occupied by the first reference instance), indicating that the resources occupied by the first reference instance cannot be allocated to the virtual machine instance, the virtual machine instance cannot be created using the resources occupied by the first reference instance.
In order to allocate resources to the virtual machine instance, the resource allocation apparatus 200 may obtain a second resource view, and allocate resources to the virtual machine instance according to the second resource view, where a manner of allocating resources to the virtual machine instance by the resource allocation apparatus 200 according to the second resource view is similar to a manner of allocating resources to the first reference instance by the resource allocation apparatus 200 according to the second resource view, which may be referred to in detail in the foregoing, and details are not repeated here.
After determining the NUMA node 110 that needs to be occupied by the virtual machine instance and the resources of the NUMA node 110 that need to be occupied by the virtual machine instance, the resource allocation apparatus 200 may instruct to create the virtual machine instance, and a manner in which the resource allocation apparatus 200 instructs to create the virtual machine instance is similar to that in the foregoing, a manner in which the resource allocation apparatus 200 instructs the physical machine 100 to create the virtual machine instance is described, which may specifically refer to the foregoing, and details are not described here.
After the resource allocation apparatus 200 allocates resources to the virtual machine instance, the first resource view and the second resource view may also be updated, and the resources occupied by the virtual machine instance are marked as occupied.
(2) Allocating resources for the container instance.
After the resource allocation apparatus 200 allocates resources to the virtual machine instance, if a container creation request is received, the resource allocation apparatus 200 may allocate resources to the container instance according to the container creation request, and the embodiment of the present application does not limit the manner in which the resource allocation apparatus 200 allocates resources to the container instance.
Taking the example that the virtual machine instance has occupied the first part of processing cores in the NUMA node 110 of the physical machine 100, the resource allocation apparatus 200 may directly allocate the second part of processing cores in the NUMA node 110 of the physical machine 100 to the container instance when it is determined that the second part of processing cores in the NUMA node 110 of the physical machine 100 are idle resources and the second part of processing cores match with the processing cores required by the container instance specification. The resource allocation apparatus 200 may also allocate resources for container instances in a manner similar to the manner in which resources are allocated for virtual machine instances.
1. Resources are allocated for the predicted second reference instance that needs to be created.
The predicting apparatus 300 may generate a second simulation instance creation request after predicting the second reference instance to be created, and send the second simulation instance creation request to the resource allocating apparatus 200.
The second simulation instance creation request includes a second reference instance specification, the type of the second reference instance being a virtual machine, the second reference instance specification indicating a structure of NUMA node 110 that the second reference instance needs to occupy and an amount of resources that the second reference instance needs to occupy. The type of the second reference instance is a container, and the specification of the second reference instance needs to indicate the amount of resources occupied by the second reference instance.
Since the second reference instance is not an instance actually required to be created, that is, the second simulation instance creation request is a simulation instance creation request, the second simulation instance creation request may further indicate that the second reference instance is an instance predicted to be created or indicate that the second simulation instance creation request is a simulation instance creation request, and the manner in which the second simulation instance creation request indicates that the second reference instance is an instance predicted to be created or indicates that the second simulation instance creation request is a simulation instance creation request is similar to the manner in which the first simulation instance creation request indicates that the first reference instance is an instance predicted to be created or indicates that the first simulation instance creation request is a simulation instance creation request, which may be specifically referred to in the foregoing description.
The resource allocation apparatus 200, after receiving the second simulation instance creation request, may allocate resources for the second reference instance according to the second simulation instance creation request.
The manner of allocating resources for the second reference example by the resource allocation apparatus 200 is similar to the manner of allocating resources for the first reference example, and reference may be specifically made to the foregoing description, which is not repeated herein. In this embodiment of the application, the occupied resources allocated by the resource allocation apparatus 200 for the second reference example include a second part of processing cores and a memory of the NUMA node 110 in the physical machine 100.
After determining the NUMA node 110 occupied by the second reference instance and the resource (such as the second part of the processing core) of the NUMA node 110 occupied by the second reference instance, the resource allocation apparatus 200 may label the resource occupied by the second reference instance in the second resource view, that is, label the NUMA node 110 occupied by the second reference instance and the resource occupied by the second reference instance in the NUMA node 110, and label the second resource view of the resource occupied by the second reference instance to generate the first resource view.
Since the second reference instance is a predicted instance that needs to be created, the resource allocation apparatus 200 does not need to instruct to create the second reference instance, that is, the resources occupied by the second reference instance are still idle resources.
To this end, the resource allocation apparatus 200 allocates occupied resources for the second reference example.
2. And taking the resources occupied by the second reference example as reference to allocate the resources for the container example.
When the resource allocation apparatus 200 allocates resources for the container instance, a first resource view may be obtained first, and it is determined whether the resources occupied by the second reference instance are matched with the resources required by the container instance specification according to the first resource view.
Resource allocation apparatus 200 may determine NUMA node 110 occupied by the second reference instance and resources of NUMA node 110 occupied by the second reference instance according to the first resource view, and if the resources required by the container instance specification match the resources of NUMA node 110 occupied by the second reference instance, if the processing cores required by the container instance specification match the second portion of processing cores of NUMA node 110 occupied by the second reference instance (i.e., the number of processing cores required by the container instance specification is the same as the number of processing cores of the second portion of NUMA node 110 occupied by the second reference instance), and the memory required by the container instance specification matches the memory of NUMA node 110 occupied by the second reference instance (i.e., the size of the memory required by the container instance specification is the same as the size of the memory of NUMA node 110 occupied by the second reference instance), it is possible to create a virtual machine instance using the resources occupied by the second reference instance.
Resource allocation apparatus 200 may allocate resources occupied by the second reference instance to the container instance, allocate a second portion of the processing cores and memory of NUMA node 110 to the container instance, and instruct creation of the container instance using the resources occupied by the second reference instance.
It should be noted that if a NUMA node 110 is occupied by a second reference instance, matching the resources required by the container instance specification with the resources of NUMA node 110 occupied by the second reference instance means that, for any type of resource, the number of resources required by the container instance specification matches the number of resources of NUMA node 110 occupied by the second reference instance. If the second reference instance occupies a plurality of NUMA nodes 110, the container instance specification required resources matching the resources of the NUMA nodes 110 occupied by the second reference instance means that for any type of resource, the number of container instance specification required resources matches the total number of the resources of the plurality of NUMA nodes 110 occupied by the second reference instance.
The resource allocation apparatus 200 may instruct the creation of the container instance using the resources occupied by the second reference instance.
For example, the resource allocation apparatus 200 may send second notification information to the physical machine 100 where the NUMA node 110 is located, and notify the physical machine 100 to create the container instance, where the second notification information indicates the NUMA node 110 occupied by the container instance and the resource on the NUMA node 110 occupied by the container instance, such as a second part of processing cores, memory, and the like on the NUMA node 110, and the physical machine 100 (or a container creation module deployed on the physical machine 100) completes the creation operation of the container instance.
Physical machine 100, upon receiving the second notification, can create a virtual machine instance based on the second notification, assign a second portion of the processing cores on NUMA node 110 to a container instance, and create the container instance using the second portion of the processing cores on NUMA node 110.
After the resource allocation apparatus 200 determines that the container instance can be created by using the resource occupied by the second reference instance, the first resource view and the second resource view may also be updated, and the manner for the resource allocation apparatus 200 to update the first resource view and the second resource view may refer to the foregoing description, which is not described herein again.
If the resources required by the container instance specification do not match the resources of NUMA node 110 occupied by the second reference instance, if the processing cores required by the container instance specification do not match the second portion of processing cores of NUMA node 110 occupied by the second reference instance (i.e., the number of processing cores required by the container instance specification is different from the number of processing cores of NUMA node 110 occupied by the second reference instance), the memory required by the container instance specification does not match the memory of NUMA node 110 occupied by the second reference instance (i.e., the size of the memory required by the container instance specification is different from the size of the memory of NUMA node 110 occupied by the second reference instance). The resource allocation apparatus 200 may obtain the second resource view, allocate resources for the container instance according to the second resource view, and a manner of allocating resources for the container instance by the resource allocation apparatus 200 according to the second resource view is similar to a manner of allocating resources for the virtual machine instance by the resource allocation apparatus 200 according to the second resource view, which may be referred to in detail in the foregoing, and is not described herein again.
After determining the NUMA node 110 occupied by the container instance and the resources of the NUMA node 110 occupied by the container instance, the resource allocation apparatus 200 may instruct to create the container instance, where a manner in which the resource allocation apparatus 200 instructs to create the container instance is similar to that in the foregoing, and a manner in which the resource allocation apparatus 200 instructs the physical machine 100 to create the container instance is specifically referred to the foregoing, and details are not described here.
After the resource allocation apparatus 200 allocates resources to the container instance, the first resource view and the second resource view may also be updated, and the resources occupied by the container instance are marked as occupied.
Based on the same inventive concept as the method embodiment, an embodiment of the present application further provides a resource allocation apparatus, configured to execute the method executed by the resource allocation apparatus in the method embodiment shown in fig. 2, and related features may refer to the method embodiment described above and are not described herein again, and as shown in fig. 3, the resource allocation apparatus 300 includes a receiving module 301 and an allocating module 302.
A receiving module 301, configured to receive a virtual machine creation request.
An allocating module 302, configured to allocate, according to a virtual machine creation request, a first part of processing cores in a NUMA node of a physical machine to a virtual machine instance, where the processing cores required by the specification of the virtual machine instance are matched with the first part of processing cores, and the virtual machine instance is a NUMA-aware instance.
The receiving module 301 is further configured to receive a container creation request.
An allocating module 302, configured to allocate a second part of processing cores in the NUMA node to a container instance according to the container creation request, where the first part of processing cores is different from the second part of processing cores, the second part of processing cores may be remaining processing cores of the NUMA node except the first part of processing cores, or may be part of processing cores in the remaining processing cores, the processing cores required by the specification of the container instance are matched with the second part of processing cores, and the container instance is a NUMA unaware instance.
In one possible implementation, the virtual machine creation request includes a virtual machine instance specification, and when the first part of processing cores in the NUMA node of the physical machine is allocated to the virtual machine instance according to the virtual machine creation request, the allocating module 302 may determine, based on a first resource view, that the processing cores required by the virtual machine instance specification match with a first part of processing cores occupied by a first reference instance, where the first reference instance is a predicted virtual machine instance or container instance that needs to be created, and the first resource view is used to indicate idle resources of the physical machine and that the first reference instance occupies the first part of processing cores; thereafter, a first portion of the processing cores are allocated to the virtual machine instance.
In one possible embodiment, the container creation request includes a container instance specification, and when the second part of processing cores in the NUMA node of the physical machine is allocated to the container instance according to the container creation request, the allocating module 302 may determine, based on the first resource view, that the processing cores required by the container instance specification match with a second part of processing cores occupied by a second reference instance, where the second reference instance is a predicted container instance or container instance that needs to be created, and the first resource view is used to indicate idle resources of the physical machine and that the second reference instance occupies the second part of processing cores; thereafter, a second portion of the processing cores is assigned to the container instance.
In a possible implementation manner, the receiving module 301 may receive a first simulation instance creation request, where the first simulation instance creation request is used to request that resources are allocated to a first reference instance; thereafter, the allocation module 302 may allocate the first portion of the processing cores to the first reference instance based on a second resource view, the second resource view indicating free resources of the physical machine; and marking the first reference instance occupying the first part of processing cores in the second resource view, and generating the first resource view.
In a possible implementation manner, the receiving module 301 may receive a second simulation instance creation request, where the second simulation instance creation request is used to request that resources are allocated to a second reference instance; thereafter, the allocation module 302 may allocate a second portion of the processing cores for the two reference instances based on a second resource view, the second resource view being used to indicate free resources of the physical machine; and marking the second reference instance to occupy a second part of processing cores in the second resource view, and generating the first resource view.
In a possible implementation manner, the apparatus further includes a sending module 303, where the sending module 303 may send first notification information to the physical machine, where the first notification information is used to notify the physical machine to create the virtual machine instance; the sending module 303 may also send a second notification message to the physical machine, where the second notification message is used to notify the physical machine to create the container instance.
In a simple embodiment, the resource allocation means in the embodiment shown in fig. 2 takes the form shown in fig. 4, as will be appreciated by those skilled in the art.
The apparatus 400 shown in fig. 4 comprises at least one processor 401, a memory 402, and optionally a communication interface 403.
Memory 402 may be a volatile memory, such as a random access memory; the memory may also be a non-volatile memory such as, but not limited to, a read-only memory, a flash memory, a Hard Disk Drive (HDD) or solid-state drive (SSD), or the memory 402 may be any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 402 may be a combination of the above.
Memory 402 may be a volatile memory, such as a random access memory; the memory may also be a non-volatile memory such as, but not limited to, a read-only memory, a flash memory, a Hard Disk Drive (HDD) or a solid-state drive (SSD), or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 402 may be a combination of the above.
The specific connection medium between the processor 401 and the memory 402 is not limited in the embodiments of the present application.
The processor 401 may be a Central Processing Unit (CPU), and the processor 401 may also be other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, artificial intelligence chip, chip on chip, etc. A general purpose processor may be a microprocessor or any conventional processor or the like. The device has a data transceiving function, can communicate with other devices, and in the device as shown in fig. 3, a separate data transceiving module, such as a communication interface 403, can be provided for transceiving data; the processor 301 may perform data transmission through the communication interface 403 when communicating with other devices, such as receiving a virtual machine creation request, a container creation request, a first simulation instance creation request, a second simulation instance creation request, and sending first notification information and second notification information.
When the resource allocation apparatus takes the form shown in fig. 4, the processor 401 in fig. 4 may make the resource allocation apparatus execute the method performed by the detection apparatus in any of the above method embodiments by calling a computer stored in the memory 402 to execute the instructions.
In particular, the functions/implementation processes of the receiving module, the allocating module, and the sending module of fig. 3 may be implemented by the processor 401 in fig. 4 calling a computer executing instructions stored in the memory 402. Alternatively, the functions/implementation procedures of the allocation module in fig. 3 may be implemented by the processor 401 in fig. 4 calling a computer executing instruction stored in the memory 402, and the functions/implementation procedures of the receiving module and the sending module in fig. 3 may be implemented by the communication interface 403 in fig. 4.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications can be made in the present application without departing from the scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (16)

1. An example processing core allocation method, comprising:
receiving a virtual machine creation request, and allocating a first part of processing cores in a non-matching memory access architecture (NUMA) node of a physical machine to a virtual machine instance according to the virtual machine creation request, wherein the processing cores required by the specification of the virtual machine instance are matched with the first part of processing cores, and the virtual machine instance is a NUMA perception instance;
receiving a container creation request, and allocating a second part of processing cores in the NUMA node to a container instance according to the container creation request, wherein the first part of processing cores is different from the second part of processing cores, the processing cores required by the container instance specification are matched with the second part of processing cores, and the container instance is a NUMA unaware instance.
2. The method of claim 1, wherein the virtual machine creation request includes the virtual machine instance specification, the allocating a first portion of processing cores in a NUMA node of a physical machine to a virtual machine instance according to the virtual machine creation request comprising:
determining that processing cores required by the specification of the virtual machine instance are matched with the first part of processing cores occupied by a first reference instance, wherein the first reference instance is a predicted virtual machine instance or container instance required to be created, and the first resource view is used for indicating idle resources of the physical machine and the first part of processing cores occupied by the first reference instance;
allocating the first portion of processing cores to the virtual machine instance.
3. The method of claim 1 or 2, wherein the container creation request includes the container instance specification, the allocating a second portion of processing cores in a NUMA node of a physical machine to a container instance according to the container creation request, comprising:
determining that the processing cores required by the container instance specification are matched with the second part of processing cores occupied by a second reference instance, wherein the second reference instance is a predicted container instance or container instance required to be created, and the first resource view is used for indicating idle resources of the physical machine and the second reference instance occupies the second part of processing cores;
assigning the second portion of processing cores to the container instance.
4. The method of claim 1 or 2, wherein the method further comprises:
receiving a first simulation instance creating request, wherein the first simulation instance creating request is used for requesting to allocate resources for a first reference instance;
allocating the first portion of processing cores to the first reference instance based on a second resource view, the second resource view indicating free resources of the physical machine;
and marking the first reference instance occupying the first part of processing cores in the second resource view, and generating the first resource view.
5. The method of claim 1 or 3, wherein the method further comprises:
receiving a second simulation instance creation request, wherein the second simulation instance creation request is used for requesting to allocate resources for a second reference instance;
allocating the second portion of processing cores to the two reference instances based on a second resource view, the second resource view indicating free resources of the physical machine;
and marking the second reference instance to occupy the second part of processing cores in the second resource view, and generating the first resource view.
6. The method of any of claims 1 to 5, further comprising:
sending first notification information to the physical machine, wherein the first notification information is used for notifying the physical machine to create the virtual machine instance;
and sending second notification information to the physical machine, wherein the second notification information is used for notifying the physical machine to create the container instance.
7. A resource allocation apparatus, comprising:
the receiving module is used for receiving a virtual machine creating request; and receiving a container creation request;
an allocation module to allocate a first portion of processing cores in a NUMA node of a physical machine to a virtual machine instance according to the virtual machine creation request; and allocating a second part of processing cores in the NUMA node to a container instance according to the container creation request, wherein the first part of processing cores is different from the second part of processing cores, the processing cores required by the virtual machine instance specification are matched with the first part of processing cores, the processing cores required by the container instance specification are matched with the second part of processing cores, the virtual machine instance is a NUMA aware instance, and the container instance is a NUMA unaware instance.
8. The apparatus of claim 7, wherein the virtual machine creation request includes the virtual machine instance specification, and wherein the assignment module, when assigning the first portion of processing cores in the NUMA node of the physical machine to the virtual machine instance in accordance with the virtual machine creation request, is to:
determining that processing cores required by the specification of the virtual machine instance are matched with the first part of processing cores occupied by a first reference instance, wherein the first reference instance is a predicted virtual machine instance or container instance required to be created, and the first resource view is used for indicating idle resources of the physical machine and the first part of processing cores occupied by the first reference instance;
allocating the first portion of processing cores to the virtual machine instance.
9. The apparatus of claim 7 or 8, wherein the container creation request includes the container instance specification, and wherein the assignment module, when assigning the second portion of processing cores in the NUMA node of the physical machine to the container instance according to the container creation request, is to:
determining that the processing cores required by the container instance specification are matched with the second part of processing cores occupied by a second reference instance, wherein the second reference instance is a predicted container instance or container instance required to be created, and the first resource view is used for indicating idle resources of the physical machine and the second reference instance occupies the second part of processing cores;
assigning the second portion of processing cores to container instances.
10. The apparatus of claim 7 or 8,
the receiving module is further configured to receive a first simulation instance creation request, where the first simulation instance creation request is used to request resource allocation for a first reference instance;
the allocation module is further configured to allocate the first part of the processing cores to the first reference instance based on a second resource view, where the second resource view is used to indicate idle resources of the physical machine; and marking the first reference instance occupying the first part of processing cores in the second resource view, and generating the first resource view.
11. The apparatus of claim 7 or 9,
the receiving module is further configured to receive a second simulation instance creation request, where the second simulation instance creation request is used to request resource allocation for a second reference instance;
the allocation module is further configured to allocate the second part of the processing cores to the two reference instances based on a second resource view, where the second resource view is used to indicate idle resources of the physical machine; and marking the second reference instance to occupy the second part of processing cores in the second resource view, and generating the first resource view.
12. The apparatus according to any of claims 7 to 11, characterized in that the apparatus further comprises a sending module,
the sending module is configured to send first notification information to the physical machine, where the first notification information is used to notify the physical machine to create the virtual machine instance; and sending second notification information to the physical machine, wherein the second notification information is used for notifying the physical machine to create the container instance.
13. A physical machine comprising a NUMA node, and wherein a container and a virtual machine instance are deployed on the physical machine, wherein a first portion of processing cores in the NUMA node of the physical machine are allocated to the virtual machine instance, wherein a second portion of processing cores in the NUMA node are allocated to the container instance, wherein the second portion of processing cores are different from the first portion of processing cores, wherein a processor core required by the virtual machine instance specification matches the first portion of processing cores, wherein the virtual machine instance is a NUMA-aware instance, wherein the processor core required by the virtual machine instance specification matches the second portion of processing cores, and wherein the container instance is a NUMA-unaware instance.
14. An example processing core allocation method, comprising:
allocating a portion of processing cores in a NUMA node of a physical machine to at least one virtual machine instance, wherein processor cores required by the at least one virtual machine instance specification match the portion of processing cores, and the virtual machine instance is a NUMA aware instance;
allocating remaining processing cores in the NUMA node other than the partial processing cores to at least one container instance, the at least one container instance specification requiring processor cores that match the remaining processing cores other than the partial processing cores, and the container instance being a NUMA unaware instance.
15. An apparatus comprising a memory and a processor; the memory stores program instructions that are executed by the processor to perform the method of any of claims 1-6.
16. A computer-readable storage medium having stored thereon instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 6.
CN202010599059.2A 2020-06-28 2020-06-28 Instance processing core allocation method and device Pending CN113849260A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010599059.2A CN113849260A (en) 2020-06-28 2020-06-28 Instance processing core allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010599059.2A CN113849260A (en) 2020-06-28 2020-06-28 Instance processing core allocation method and device

Publications (1)

Publication Number Publication Date
CN113849260A true CN113849260A (en) 2021-12-28

Family

ID=78972478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010599059.2A Pending CN113849260A (en) 2020-06-28 2020-06-28 Instance processing core allocation method and device

Country Status (1)

Country Link
CN (1) CN113849260A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023179170A1 (en) * 2022-03-24 2023-09-28 华为云计算技术有限公司 Instance configuration method and apparatus, and device
WO2023226437A1 (en) * 2022-05-23 2023-11-30 华为云计算技术有限公司 Resource scheduling method, apparatus and device
CN117234742A (en) * 2023-11-14 2023-12-15 苏州元脑智能科技有限公司 Processor core allocation method, device, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023179170A1 (en) * 2022-03-24 2023-09-28 华为云计算技术有限公司 Instance configuration method and apparatus, and device
WO2023226437A1 (en) * 2022-05-23 2023-11-30 华为云计算技术有限公司 Resource scheduling method, apparatus and device
CN117234742A (en) * 2023-11-14 2023-12-15 苏州元脑智能科技有限公司 Processor core allocation method, device, equipment and storage medium
CN117234742B (en) * 2023-11-14 2024-02-09 苏州元脑智能科技有限公司 Processor core allocation method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US20220318064A1 (en) Technologies for batching requests in an edge infrastructure
CN110647394B (en) Resource allocation method, device and equipment
CN106325998B (en) Application deployment method and device based on cloud computing
CN113849260A (en) Instance processing core allocation method and device
US11231955B1 (en) Dynamically reallocating memory in an on-demand code execution system
CN107301093B (en) Method and device for managing resources
CN108572845B (en) Upgrading method of distributed micro-service cluster and related system
CN112905342B (en) Resource scheduling method, device, equipment and computer readable storage medium
CN109213567B (en) Method and equipment for managing VNF instantiation
CN113886069A (en) Resource allocation method and device, electronic equipment and storage medium
CN113285843B (en) Container network configuration method and device, computer readable medium and electronic equipment
CN110795202B (en) Resource allocation method and device of virtualized cluster resource management system
WO2021013185A1 (en) Virtual machine migration processing and strategy generation method, apparatus and device, and storage medium
CN110489356B (en) Information processing method, information processing device, electronic equipment and storage medium
CN116501487A (en) Task execution method and device on virtual machine, storage medium and electronic equipment
CN111400032A (en) Resource allocation method and device
CN116010093A (en) Data processing method, apparatus, computer device and readable storage medium
CN105512091A (en) Memory allocation method and device
CN113157611B (en) Data transmission control method, device, equipment and readable storage medium
CN114675954A (en) Task scheduling method and device
CN114237902A (en) Service deployment method and device, electronic equipment and computer readable medium
CN114490083A (en) CPU resource binding method and device, storage medium and electronic device
CN113515376A (en) Memory management method and device, electronic equipment and storage medium
WO2008044865A1 (en) Device and method for allocating memory of terminal device
CN114253704A (en) Method and device for allocating resources

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220214

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Applicant after: Huawei Cloud Computing Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination