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

By filtering and adjusting the resource topology, the problem of virtual machine activation failure caused by insufficient NUMA cell resources is solved, and the utilization of physical machine resources is improved.

CN118606004APending Publication Date: 2024-09-06BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410851620.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

When enterprise-level models have sufficient physical machine resources, virtual machine activation fails due to insufficient NUMA cell resources, resulting in low utilization of physical machine resources.

Method used

By obtaining the resource demand information in the boot request, the available computing nodes that meet the filtering conditions of the resource topology are filtered out. If the filtering fails, the resource allocation of the resource topology is adjusted until the available computing nodes are successfully matched to ensure that the virtual machine can Activated successfully.

Benefits of technology

It avoids virtual machine activation failure caused by insufficient NUMA cell resources and improves the physical machine resource utilization of computing nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606004A
    Figure CN118606004A
Patent Text Reader

Abstract

The invention relates to a virtual machine opening method and device, computer equipment and a storage medium. The method comprises the following steps: modifying a resource topological structure required for opening a target virtual machine, and then matching the resource topological structure with an available memory topological structure of a computing node, so that the situation that the target virtual machine fails to be opened due to the fact that resource distribution corresponding to the available memory topological structure of the computing node cannot cover the resource topological structure is avoided; and adjusting the resource topological structure to the corresponding memory unit resource of each distribution resource less than or equal to the available memory topological structure of the computing node, so as to solve the problem of virtual machine opening failure caused by sufficient physical machine resource and insufficient numa cell resource, and improve the physical machine resource utilization rate of the computing node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In order to achieve higher performance, enterprise-class models need to use core binding to bind CPU resources to avoid poor performance caused by competition for CPU resources. Enterprise-class hosts allocate CPU, memory and other resources according to the computing node NUMA (Non-Uniform Memory Access) structure.

[0003] However, due to issues such as hardware resource selection and underlying service resource reservation, even if the physical machine resources are sufficient, if the memory unit (numa cell) resources that make up the physical machine resources are insufficient to activate a virtual machine, the virtual machine activation will still fail, resulting in low utilization of physical machine resources. Summary of the invention

[0004] The present application provides a virtual machine provisioning method, apparatus, computer equipment and storage medium to solve the problem that the virtual machine provisioning fails due to sufficient physical machine resources but insufficient NUMA cell resources.

[0005] In a first aspect, the present application provides a method for provisioning a virtual machine, comprising:

[0006] Obtaining a power-on request, wherein the power-on request is used to request to activate a target virtual machine, and the power-on request includes resource requirement information;

[0007] Filter out available computing nodes that match the resource demand information: filter out computing nodes that meet the corresponding filtering conditions of the resource topology structure as available computing nodes, and when the screening of available computing nodes fails, adjust the resource ratio of the resource topology structure that participated in the previous node screening according to a preset adjustment plan, until the available computing nodes that match the resource demand information are screened out using the adjusted resource topology structure, wherein the filtering condition is a condition for screening computing nodes by the resource topology structure that matches the resource demand information, and the filtering condition includes that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources;

[0008] When the available computing nodes are successfully screened, the available memory resources of the available computing nodes are allocated according to the resource ratio corresponding to the target resource topology structure to enable the target virtual machine, wherein the target resource topology structure is a resource topology structure that successfully matches the available computing nodes.

[0009] In a second aspect, the present application provides a virtual machine provisioning device, the device comprising:

[0010] An acquisition module, used to acquire a power-on request, wherein the power-on request is used to request to activate a target virtual machine, and the power-on request includes resource demand information;

[0011] A screening module, used to screen out available computing nodes that match the resource demand information: screen out computing nodes that meet the filtering conditions corresponding to the resource topology structure as available computing nodes, and when the screening of available computing nodes fails, adjust the resource ratio of the resource topology structure that participated in the previous node screening according to a preset adjustment plan, until the available computing nodes that match the resource demand information are screened out using the adjusted resource topology structure, wherein the filtering conditions are conditions for screening computing nodes by the resource topology structure that matches the resource demand information, and the filtering conditions include that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources;

[0012] A creation module is used to activate the target virtual machine according to the resource ratio corresponding to the target resource topology structure of the available memory resources of the available computing node when the available computing node is successfully screened, wherein the target resource topology structure is a resource topology structure that successfully matches the available computing node.

[0013] In a third aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned virtual machine provisioning method when executing the computer program.

[0014] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the above-mentioned virtual machine provisioning method.

[0015] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, obtains a power-on request, wherein the power-on request is used to request to activate a target virtual machine, and the power-on request includes resource demand information; selects available computing nodes that match the resource demand information: selects computing nodes that meet the filtering conditions corresponding to the resource topology structure as available computing nodes, and when the available computing node screening fails, adjusts the resource ratio of the resource topology structure that participated in the previous node screening according to a preset adjustment scheme, until the available computing nodes that match the resource demand information are screened out using the adjusted resource topology structure, wherein the filtering conditions are conditions for screening computing nodes by the resource topology structure that matches the resource demand information, and the filtering conditions include that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources; when the available computing nodes are successfully screened, the available memory resources of the available computing nodes are used to activate the target virtual machine according to the resource ratio corresponding to the target resource topology structure, wherein the target resource topology structure is a resource topology structure that successfully matches the available computing nodes.

[0016] If the available computing nodes cannot be screened out based on the above method, it means that the computing nodes with available memory topology structures that can cover the resource topology structures cannot be screened out, which means that the NUMA cell resources of the computing nodes are insufficient to provision the target virtual machine. By modifying the resource topology structure required for provisioning the target virtual machine and then matching it with the available memory topology structure of the computing node, it is avoided that the resource distribution corresponding to the available memory topology structure of the computing node cannot cover the resource topology structure, resulting in the failure of provisioning the target virtual machine. The resource topology structure is adjusted to a point where each distributed resource is less than or equal to the corresponding memory unit resource in the available memory topology structure of the computing node, so as to solve the problem of virtual machine provisioning failure caused by sufficient physical machine resources but insufficient NUMA cell resources, and improve the utilization rate of physical machine resources of the computing node. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0020] Figure 1 A flowchart of a method for provisioning a virtual machine provided in an embodiment of the present application;

[0021] Figure 2 A flowchart of a method for provisioning a virtual machine provided in an embodiment of the present application;

[0022] Figure 3 A flowchart of a method for provisioning a virtual machine provided in an embodiment of the present application;

[0023] Figure 4 A flowchart of a method for provisioning a virtual machine provided in an embodiment of the present application;

[0024] Figure 5 A flowchart of a method for provisioning a virtual machine provided in an embodiment of the present application;

[0025] Figure 6 A flowchart of a method for provisioning a virtual machine provided in an embodiment of the present application;

[0026] Figure 7 A flowchart of a method for provisioning a virtual machine provided in an embodiment of the present application;

[0027] Figure 8 A flowchart of a method for provisioning a virtual machine provided in an embodiment of the present application;

[0028] Fig. 9 A structural block diagram of a virtual machine provisioning device provided in an embodiment of the present application;

[0029] Fig.10 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0031] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0032] In one embodiment, Figure 1 A flowchart of a method for provisioning a virtual machine in an embodiment is shown in FIG. Figure 1 , a virtual machine provisioning method is provided. This embodiment mainly uses the method applied to a server as an example to illustrate, and the virtual machine provisioning method specifically includes the following steps:

[0033] Step S2, obtaining a power-on request, wherein the power-on request is used to request to activate a target virtual machine, and the power-on request includes resource requirement information.

[0034] Specifically, the power-on request is a request initiated by a user for requesting to activate a target virtual machine. The power-on request includes resource requirement information required for activating the target virtual machine and filtering conditions for the target virtual machine for computing nodes. The resource requirement information includes at least the model of the target virtual machine, the total resource requirement required for activating the target virtual machine, and the number of memory unit requests required for activating the target virtual machine. The number of memory unit requests is used to indicate the number of memory units that the target virtual machine needs to occupy. For example, when the number of memory unit requests is 1, it indicates that the target virtual machine needs to occupy one memory unit, that is, one numa cell; and when the number of memory unit requests is 2, it indicates that the target virtual machine needs to occupy two memory units.

[0035] Step S4, filter out available computing nodes that match the resource demand information: filter out computing nodes that meet the corresponding filtering conditions of the resource topology structure as available computing nodes, and when the screening of available computing nodes fails, adjust the resource ratio of the resource topology structure that participated in the previous node screening according to the preset adjustment plan, until the available computing nodes that match the resource demand information are filtered out using the adjusted resource topology structure, wherein the filtering condition is the condition for filtering computing nodes with the resource topology structure that matches the resource demand information, and the filtering condition includes that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources.

[0036] Specifically, screening computing nodes that meet the corresponding filtering conditions of the resource topology structure is to determine whether the available memory topology structure in the computing node can cover the resource topology structure. The available memory topology structure contains at least one available memory unit resource, and the available memory unit resource is the idle resource of the computing node, that is, to determine whether each memory unit resource in the available memory topology structure is greater than or equal to each distributed resource in the resource topology structure. Only when each distributed resource is matched to a memory unit resource that is greater than or equal to the distributed resource, it is determined that the memory unit resources of the computing node are sufficient to activate the target virtual machine. On the contrary, when at least one distributed resource is not matched to a memory unit resource that is greater than or equal to the distributed resource, it is determined that the memory unit resources of the computing node are insufficient and the target virtual machine cannot be successfully activated.

[0037] By matching the resource topology structure with the available memory topology structure in each computing node, computing nodes whose memory unit resources are sufficient to provision the target virtual machine are selected as available computing nodes.

[0038] The available computing node screening failed, indicating that the available memory topology structure in no computing node matches the resource topology structure, that is, although there may be computing nodes with sufficient physical machine resources, that is, the sum of the memory unit resources in the computing node is greater than or equal to the total resource demand, the single memory unit resource in the computing node is less than the distributed resource in the resource topology structure, that is, the memory unit resource is insufficient. In order to successfully open the target virtual machine, the resource ratio of the resource topology structure is adjusted according to the preset adjustment plan, that is, the distributed resources in the resource topology structure are adjusted, but the sum of the distributed resources is still the total resource demand, so that the memory unit resources greater than or equal to the distributed resources can be matched later.

[0039] The updated resource topology structure is looped to execute the above step S4, that is, each distributed resource in the updated resource topology structure is matched with the memory unit resources in the available memory topology structure in each computing node. Once the match fails, the resource ratio of the resource topology structure is adjusted in a loop, and the node screening process is performed again to re-judge whether there is an available memory topology structure that can cover the target resource topology structure. That is, the updated resource topology structure obtained in each round will be re-matched with the available memory topology structure until an available computing node matching the adjusted resource topology structure is screened out.

[0040] Step S6, when the available computing nodes are successfully screened, the available memory resources of the available computing nodes are allocated according to the resource ratio corresponding to the target resource topology structure to enable the target virtual machine.

[0041] Specifically, if the available computing nodes are successfully screened, indicating that computing nodes with available memory resources sufficient to activate the target virtual machine are screened out, the available memory resources of the available computing nodes are allocated according to the resource ratio corresponding to the target resource topology structure for activating the target virtual machine.

[0042] Based on the above method, when the NUMA cell resources of the computing node are insufficient to activate the target virtual machine, the resource topology structure required for activating the target virtual machine is modified and then matched with the available memory topology structure of the computing node, thereby avoiding the failure of the target virtual machine to be activated due to the resource distribution corresponding to the available memory topology structure of the computing node being unable to cover the resource topology structure, and adjusting the resource topology structure to a point where each distributed resource is less than or equal to the corresponding memory unit resource in the available memory topology structure of the computing node, so as to solve the problem of virtual machine activation failure caused by sufficient physical machine resources but insufficient NUMA cell resources, and improve the utilization rate of physical machine resources of the computing node.

[0043] For example, the resource topology is {cell0:32}, and the physical machine resource distribution (NUMA resource distribution) of the computing node is {numa0:30, numa1:34}, but the memory cell resources of the memory area (NUMA area) where 34 is located are insufficient, that is, the available memory cell resources of the memory area where 34 is located are less than 32. Assuming that the available memory topology is {numa0:30, numa1:30}, 30 is the available memory cell resource. Even if the available physical machine resources are 60, the available memory cell resources in the NUMA area where 34 is located are not enough to open the resource topology. The target virtual machine should be opened, so the resource topology needs to be adjusted. Assume that the adjusted target resource topology is {cell0: 30, cell1: 2}. The total resource demand does not change, but only the resource ratio is changed. That is, when the target virtual machine cannot be opened through one memory area, resources are borrowed from other memory areas of the same computing node, that is, numa0 is used to provide the distributed resources 30 required by cell0, and numa1 is used to provide the distributed resources 2 required by cell1. In this way, the memory unit resources are sufficient to provide the distributed resources required to open the target virtual machine, and the target virtual machine can be successfully opened.

[0044] In one embodiment, Figure 2 As shown, the filtering out computing nodes that meet the filtering conditions corresponding to the resource topology structure as available computing nodes includes:

[0045] Step S411, filtering out computing nodes that meet the node filtering conditions corresponding to the resource topology structure as candidate computing nodes, wherein the node filtering conditions at least include that the available memory resources of the computing nodes are greater than or equal to the total resource demand in the resource demand information;

[0046] Step S412, when the candidate computing nodes are successfully screened, the candidate computing nodes that meet the resource filtering conditions corresponding to the resource topology structure are screened as the available computing nodes, wherein the filtering conditions include the node filtering conditions and the resource filtering conditions, and the resource filtering conditions include that the available memory topology structure in the available computing nodes contains memory unit resources that match each distributed resource in the resource topology structure respectively, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources.

[0047] Specifically, the filtering conditions include node filtering conditions and resource filtering conditions. The node filtering conditions are mainly used to filter out candidate computing nodes whose available memory resources are greater than or equal to the total resource demand. The node filtering conditions can also include node cluster properties, memory, computing node status, hard disk status (iops), graphics processor status (gpu), central processing unit status (cpu), number of node virtual machines, number of tenant restrictions, number of node network card restrictions, node network restriction bandwidth, etc., to filter out suitable candidate computing nodes through multiple dimensions.

[0048] The candidate computing node screening is successful, indicating that at least one candidate computing node is screened out, and among multiple candidate computing nodes, a candidate computing node whose available memory topology can cover the resource topology is selected as an available computing node, that is, the available memory topology in each candidate computing node is matched with the resource topology to screen the candidate computing nodes whose memory unit resources are sufficient to provision the target virtual machine.

[0049] In one embodiment, Figure 3 As shown, when the available computing node screening fails, the resource ratio of the resource topology structure participating in the previous node screening is adjusted according to the preset adjustment scheme until the available computing nodes matching the resource demand information are screened out using the adjusted resource topology structure, including:

[0050] Step S421, when the available computing node screening fails, determining whether the total resource demand is lower than a resource adjustment threshold;

[0051] Step S422, when the total resource demand is greater than or equal to the resource adjustment threshold, adjust the resource ratio of the resource topology structure participating in the previous node screening according to the preset resource adjustment quantity in the preset adjustment plan, until the available computing nodes matching the resource demand information are screened out using the adjusted resource topology structure.

[0052] Specifically, when the available computing node screening fails, it means that a computing node with an available memory topology that can cover the resource topology cannot be matched, and the memory unit resources in the available memory topology of each computing node are insufficient. At this time, it is determined whether the total resource demand is lower than the resource adjustment threshold. The resource adjustment threshold is used to indicate the minimum resource threshold for allowing borrowed resources. If the total resource demand is less than the resource adjustment threshold, it means that opening the target virtual machine through borrowed core scheduling will have a significant impact on the operating performance, and the resource topology structure is rejected. Figure 8 The resource topology structure can only be adjusted when the total resource demand is greater than or equal to the resource adjustment threshold. The resource adjustment threshold is usually related to the model of the target virtual machine and does not exceed half of the total resource demand.

[0053] Specifically, the resource topology structure can be adjusted according to the preset resource adjustment quantity in the preset adjustment plan. The preset resource adjustment quantity can be customized according to the actual application scenario. The preset resource adjustment quantity is a positive even number, such as 2, 4, 6, 8, etc. Assuming that the preset resource adjustment quantity is 2, the resource topology structure is {cell0: 32, cell1: 32}, the resource ratio of the resource topology structure is adjusted according to 2, and the adjusted target resource topology structure is {cell0: 30, cell1: 34} or {cell0: 34, cell1: 30}, but it is necessary to ensure that the total amount of resource demand after adjustment remains unchanged. That is, each round adjusts the resource topology structure of the previous node screening according to a fixed preset resource adjustment quantity.

[0054] In one embodiment, Figure 4 As shown, when the available computing nodes fail to be screened, after determining whether the total resource demand is lower than the resource adjustment threshold, the method further includes:

[0055] Step S423, when the total resource demand is greater than or equal to the resource adjustment threshold, determining the cumulative number of adjustments corresponding to the resource topology structure;

[0056] Step S424, when the cumulative number of adjustments is less than the preset number of adjustments, the resource ratio of the resource topology structure participating in the previous node screening is adjusted in sequence in different node screening cycles according to the resource adjustment quantity of each class in the borrowed core string, until the available computing nodes matching the resource demand information are screened out using the adjusted resource topology structure, wherein the preset adjustment plan also includes the borrowed core string.

[0057] Specifically, the core borrowing string includes multiple positive even characters connected together by separators, each positive even character represents a resource adjustment quantity, and the positive even characters in the core borrowing string are, from left to right, the first-order resource adjustment quantity, the second-order resource adjustment quantity, the third-order resource adjustment quantity, ..., the N-node resource adjustment quantity. For example, the core borrowing string is "2,4,6", where 2 is the first-order resource adjustment quantity, 4 is the second-order resource adjustment quantity, and 6 is the third-order resource adjustment quantity. According to the resource adjustment quantities of different levels in the core borrowing string, in each node screening cycle, adjust the resource topology structure that participated in the previous node screening in the current node screening cycle. If the core borrowing string is an empty string or the format is incorrect, the core borrowing scheduling will not be triggered.

[0058] That is, the resource distribution of the resource topology structure is adjusted according to the first-order resource adjustment quantity in the borrowed core string to obtain the adjusted resource topology structure, and then the adjusted resource topology structure is matched with the available memory topology structure in the computing node. If the match fails, the next adjustment round is entered, and the resource distribution of the resource topology structure that participated in the last node screening is adjusted using the second-order resource adjustment quantity in the borrowed core string, and the cycle is repeated until the available computing nodes that match the resource demand information are screened out using the adjusted resource topology structure.

[0059] The difference between the current embodiment and the previous embodiment is that in each node screening cycle, the resource topology structure participating in the previous node screening is adjusted with different resource adjustment quantities, and the adjustment granularity is gradually increased to speed up the adjustment efficiency.

[0060] In one embodiment, referring to Figure 5 As shown, the step of constructing a resource topology structure according to the resource requirement information in the power-on request includes:

[0061] Step S3, constructing a resource topology structure that initially matches the resource demand information based on the resource distribution after equally dividing the total resource demand according to the number of memory unit requests in the resource demand information, wherein the resource topology structure that initially matches the resource demand information is used to participate in the first node screening.

[0062] Specifically, a resource topology structure is constructed according to the resource demand information. The resource topology structure is recorded as VM NumaTopology. The resource topology structure contains at least one distributed resource. The sum of each distributed resource in the resource topology structure is equal to the total resource demand. The distribution of each distributed resource in the resource topology structure can indicate the resource ratio corresponding to the resource topology structure. For example, the resource topology structure is {cell0: 32}, which means that the target virtual machine needs to occupy a numa cell, where 32 indicates a distributed resource, that is, the total resource required is 32. Each distributed resource in the resource topology structure is equal. For example, the number of memory unit requests is 1 and the total resource demand is 32. At this time, the resource topology structure is {cell0: 32}; if the number of memory unit requests is 2 and the total resource demand is 34, at this time, the resource topology structure is {cell0: 32, cell1: 32}, and so on. The distributed resources are determined by the ratio between the total resource demand and the number of memory unit requests.

[0063] In one embodiment, Figure 6 As shown, when the available computing nodes are successfully screened, the available memory resources of the available computing nodes are allocated according to the resource ratio corresponding to the target resource topology structure, and the target virtual machine is opened, including:

[0064] Step S61, when one of the available computing nodes is successfully screened out, the available memory resources of the available computing node are allocated according to the resource ratio corresponding to the target resource topology structure to enable the target virtual machine; or,

[0065] Step S62, when multiple available computing nodes are successfully screened out, the weight value of each available computing node is determined according to the resource occupancy information of each available computing node, and the available memory resources of the available computing node with the largest weight value are allocated according to the resource ratio corresponding to the target resource topology structure to activate the target virtual machine.

[0066] Specifically, if an available computing node is selected, resource allocation processing is performed on the available memory resources of the available computing node; combined with Figure 8 If multiple available computing nodes with available memory resources sufficient to activate the target virtual machine are screened out, the weight value of each available computing node is determined according to the resource occupancy information of each available computing node. The resource occupancy information includes the remaining resource amount and the remaining memory amount. The remaining resource amount refers to the remaining CPU resource amount. The remaining resource amount and the remaining memory amount of each available computing node are weighted and summed to obtain the weight value of each available computing node. The higher the weight value, the more available resources the available computing node has, and the higher the probability of using the available memory resources of the available computing node to activate the target virtual machine. Therefore, the available computing node with the largest weight value is selected as the available computing node for final resource allocation.

[0067] In one embodiment, Figure 7 As shown, the available memory resources of the available computing nodes are allocated according to the resource ratio corresponding to the target resource topology structure, and the target virtual machine is enabled, including:

[0068] Step S631, allocating the available memory resources of the available computing nodes according to the resource ratio corresponding to the target resource topology structure to obtain startup resources;

[0069] Step S632, generating a resource configuration file based on the resource topology structure that initially matches the resource demand information;

[0070] Step S633: Activate the target virtual machine according to the resource configuration file and the startup resources.

[0071] Specific, combined Figure 8 When the available computing nodes are successfully screened, the available memory resources in the available computing nodes are allocated according to the resource ratio corresponding to the target resource topology structure to obtain the startup resources. Before the target virtual machine is activated, an XML resource configuration file needs to be generated. The resource configuration file is generated based on the resource topology structure and is used to indicate the initial resource topology structure required for activating the target virtual machine. Then, the target virtual machine is activated based on the resource configuration file and the startup resources.

[0072] Figure 1-Figure 8 FIG. 1 is a flow chart of a method for provisioning a virtual machine in an embodiment. It should be understood that although Figure 1-Figure 8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 8 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0073] In one embodiment, Fig. 9 As shown, a virtual machine provisioning device is provided, comprising:

[0074] The acquisition module 310 is used to acquire a power-on request, wherein the power-on request is used to request to activate a target virtual machine, and the power-on request includes resource requirement information;

[0075] A screening module 320 is used to screen out available computing nodes that match the resource demand information: screen out computing nodes that meet the filtering conditions corresponding to the resource topology structure as available computing nodes, and when the screening of available computing nodes fails, adjust the resource ratio of the resource topology structure that participated in the previous node screening according to a preset adjustment plan, until the available computing nodes that match the resource demand information are screened out using the adjusted resource topology structure, wherein the filtering conditions are conditions for screening computing nodes by the resource topology structure that matches the resource demand information, and the filtering conditions include that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources;

[0076] A creation module 330 is used to activate the target virtual machine by allocating the available memory resources of the available computing nodes according to the resource ratio corresponding to the target resource topology structure when the available computing nodes are successfully screened, wherein the target resource topology structure is a resource topology structure that successfully matches the available computing nodes.

[0077] In one embodiment, the screening module 320 is further configured to:

[0078] Filter out computing nodes that meet the node filtering conditions corresponding to the resource topology structure as candidate computing nodes, wherein the node filtering conditions at least include that the available memory resources of the computing nodes are greater than or equal to the total resource demand in the resource demand information;

[0079] When the candidate computing nodes are successfully screened, the candidate computing nodes that meet the resource filtering conditions corresponding to the resource topology structure are screened as the available computing nodes, wherein the filtering conditions include the node filtering conditions and the resource filtering conditions, and the resource filtering conditions include that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure respectively, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources.

[0080] In one embodiment, the screening module 320 is further configured to:

[0081] When the available computing node screening fails, determining whether the total resource demand is lower than a resource adjustment threshold;

[0082] When the total resource demand is greater than or equal to the resource adjustment threshold, the resource ratio of the resource topology structure participating in the previous node screening is adjusted according to the preset resource adjustment quantity in the preset adjustment plan until the available computing nodes matching the resource demand information are screened out using the adjusted resource topology structure.

[0083] In one embodiment, the screening module 320 is further configured to:

[0084] When the total resource demand is greater than or equal to the resource adjustment threshold, determining the cumulative number of adjustments corresponding to the resource topology structure;

[0085] When the cumulative number of adjustments is less than the preset number of adjustments, the resource ratio of the resource topology structure participating in the previous node screening is adjusted in turn in different node screening cycles according to the resource adjustment quantity of each class in the borrowed core string, until the available computing nodes matching the resource demand information are screened out using the adjusted resource topology structure, wherein the preset adjustment plan also includes the borrowed core string.

[0086] In one embodiment, the apparatus further comprises a building block for:

[0087] According to the resource distribution after equally dividing the total resource demand according to the number of memory unit requests in the resource demand information, a resource topology structure initially matching the resource demand information is constructed, wherein the resource topology structure initially matching the resource demand information is used to participate in the first node screening.

[0088] In one embodiment, the creation module 330 is further used to:

[0089] When one of the available computing nodes is successfully screened out, the available memory resources of the available computing node are allocated according to the resource ratio corresponding to the target resource topology structure to enable the target virtual machine; or,

[0090] When multiple available computing nodes are successfully screened out, the weight value of each available computing node is determined according to the resource occupancy information of each available computing node, and the available memory resources of the available computing node with the largest weight value are allocated according to the resource ratio corresponding to the target resource topology structure to activate the target virtual machine.

[0091] In one embodiment, the creation module 330 is further used to:

[0092] Allocating the available memory resources of the available computing nodes according to the resource ratio corresponding to the target resource topology structure to obtain startup resources;

[0093] Generate a resource configuration file based on a resource topology structure that initially matches the resource demand information;

[0094] The target virtual machine is activated according to the resource configuration file and the startup resources.

[0095] like Fig.10As shown, an embodiment of the present application provides a computer device, including a processor 711, a communication interface 712, a memory 713 and a communication bus 714, wherein the processor 711, the communication interface 712, and the memory 713 communicate with each other through the communication bus 714;

[0096] Memory 713, used for storing computer programs;

[0097] The processor 711 is configured to implement the virtual machine provisioning method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 713 .

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

[0099] In one embodiment, the virtual machine provisioning device provided in the present application can be implemented in the form of a computer program. The computer program can be Fig.10 The memory of the computer device may store various program modules constituting the virtual machine provisioning device, for example, Fig. 9 The acquisition module 310, the screening module 320 and the creation module 330 are shown. The computer program composed of various program modules enables the processor to execute the virtual machine provisioning method of each embodiment of the present application described in this specification.

[0100] Fig.10 The computer device shown can be Fig. 9The acquisition module 310 in the virtual machine activation device shown executes to acquire a power-on request, wherein the power-on request is used to request to activate the target virtual machine, and the power-on request includes resource demand information. The computer device can perform filtering out available computing nodes matching the resource demand information through the screening module 320: filtering out computing nodes that meet the corresponding filtering conditions of the resource topology structure as available computing nodes, and when the available computing node screening fails, adjusting the resource ratio of the resource topology structure that participated in the previous node screening according to the preset adjustment scheme, until the available computing nodes matching the resource demand information are filtered out using the adjusted resource topology structure, wherein the filtering condition is the condition for filtering computing nodes by the resource topology structure matching the resource demand information, and the filtering condition includes that the available memory topology structure in the available computing node has memory unit resources that match each distributed resource in the resource topology structure, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources. The computer device can create module 330 to execute, when the available computing nodes are successfully screened, to allocate the available memory resources of the available computing nodes according to the resource ratio corresponding to the target resource topology structure, and activate the target virtual machine, wherein the target resource topology structure is a resource topology structure that successfully matches the available computing nodes.

[0101] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the virtual machine provisioning method provided by any of the aforementioned method embodiments is implemented.

[0102] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0103] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0104] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative can be used.

[0105] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for provisioning a virtual machine, It is characterized in that The method comprises: Obtaining a power-on request, wherein the power-on request is used to request to activate a target virtual machine, and the power-on request includes resource requirement information; Filter out available computing nodes that match the resource demand information: filter out computing nodes that meet the corresponding filtering conditions of the resource topology structure as available computing nodes, and when the screening of available computing nodes fails, adjust the resource ratio of the resource topology structure that participated in the previous node screening according to a preset adjustment plan, until the available computing nodes that match the resource demand information are screened out using the adjusted resource topology structure, wherein the filtering condition is a condition for screening computing nodes by the resource topology structure that matches the resource demand information, and the filtering condition includes that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources; When the available computing nodes are successfully screened, the available memory resources of the available computing nodes are allocated according to the resource ratio corresponding to the target resource topology structure to enable the target virtual machine, wherein the target resource topology structure is a resource topology structure that successfully matches the available computing nodes.

2. The method according to claim 1, It is characterized in that The step of selecting computing nodes that meet the filtering conditions corresponding to the resource topology structure as available computing nodes includes: Filter out computing nodes that meet the node filtering conditions corresponding to the resource topology structure as candidate computing nodes, wherein the node filtering conditions at least include that the available memory resources of the computing nodes are greater than or equal to the total resource demand in the resource demand information; When the candidate computing nodes are successfully screened, the candidate computing nodes that meet the resource filtering conditions corresponding to the resource topology structure are screened as the available computing nodes, wherein the filtering conditions include the node filtering conditions and the resource filtering conditions, and the resource filtering conditions include that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure respectively, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources.

3. The method according to claim 2, It is characterized in that When the available computing node screening fails, the resource ratio of the resource topology structure participating in the previous node screening is adjusted according to a preset adjustment scheme until an available computing node matching the resource demand information is screened out using the adjusted resource topology structure, including: When the available computing node screening fails, determining whether the total resource demand is lower than a resource adjustment threshold; When the total resource demand is greater than or equal to the resource adjustment threshold, the resource ratio of the resource topology structure participating in the previous node screening is adjusted according to the preset resource adjustment quantity in the preset adjustment plan until the available computing nodes matching the resource demand information are screened out using the adjusted resource topology structure.

4. The method according to claim 3, It is characterized in that When the available computing nodes fail to be screened, after determining whether the total resource demand is lower than a resource adjustment threshold, the method further includes: When the total resource demand is greater than or equal to the resource adjustment threshold, determining the cumulative number of adjustments corresponding to the resource topology structure; When the cumulative number of adjustments is less than the preset number of adjustments, the resource ratio of the resource topology structure participating in the previous node screening is adjusted in turn in different node screening cycles according to the resource adjustment quantity of each class in the borrowed core string, until the available computing nodes matching the resource demand information are screened out using the adjusted resource topology structure, wherein the preset adjustment plan also includes the borrowed core string.

5. The method according to claim 1, It is characterized in that After obtaining the power-on request, the method further includes: According to the resource distribution after equally dividing the total resource demand according to the number of memory unit requests in the resource demand information, a resource topology structure initially matching the resource demand information is constructed, wherein the resource topology structure initially matching the resource demand information is used to participate in the first node screening.

6. The method according to claim 1, It is characterized in that When the available computing nodes are successfully screened, the available memory resources of the available computing nodes are allocated according to the resource ratio corresponding to the target resource topology structure to enable the target virtual machine, including: When one of the available computing nodes is successfully screened out, the available memory resources of the available computing node are allocated according to the resource ratio corresponding to the target resource topology structure to enable the target virtual machine; or, When multiple available computing nodes are successfully screened out, the weight value of each available computing node is determined according to the resource occupancy information of each available computing node, and the available memory resources of the available computing node with the largest weight value are allocated according to the resource ratio corresponding to the target resource topology structure to activate the target virtual machine.

7. The method according to claim 6, It is characterized in that Allocating the available memory resources of the available computing nodes according to the resource ratio corresponding to the target resource topology structure to enable the target virtual machine includes: Allocating the available memory resources of the available computing nodes according to the resource ratio corresponding to the target resource topology structure to obtain startup resources; Generate a resource configuration file based on a resource topology structure that initially matches the resource demand information; The target virtual machine is activated according to the resource configuration file and the startup resources.

8. A virtual machine provisioning device, It is characterized in that The device comprises: An acquisition module, used to acquire a power-on request, wherein the power-on request is used to request to activate a target virtual machine, and the power-on request includes resource demand information; A screening module, used to screen out available computing nodes that match the resource demand information: screen out computing nodes that meet the filtering conditions corresponding to the resource topology structure as available computing nodes, and when the screening of available computing nodes fails, adjust the resource ratio of the resource topology structure that participated in the previous node screening according to a preset adjustment plan, until the available computing nodes that match the resource demand information are screened out using the adjusted resource topology structure, wherein the filtering conditions are conditions for screening computing nodes by the resource topology structure that matches the resource demand information, and the filtering conditions include that there are memory unit resources in the available memory topology structure in the available computing nodes that match each distributed resource in the resource topology structure, and the memory unit resources that match the distributed resources are greater than or equal to the distributed resources; A creation module is used to activate the target virtual machine according to the resource ratio corresponding to the target resource topology structure of the available memory resources of the available computing node when the available computing node is successfully screened, wherein the target resource topology structure is a resource topology structure that successfully matches the available computing node.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

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