Virtual machine processing method, device, electronic device, program product and medium

By calculating the overhead value of the virtual machine on multiple nodes, selecting the appropriate node for virtual machine creation or migration, it solves the problems of low virtual machine performance and low processor core usage efficiency, and realizes more efficient virtual machine operation and processing core utilization.

CN113835826BActive Publication Date: 2024-11-01QI AN XIN TECHNOLOGY GROUP INC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110931483.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-13
Publication Date
2024-11-01
Estimated Expiration
2041-08-13

AI Technical Summary

Technical Problem

The existing technology lacks references to NUMA Node and I/O attributes when creating or migrating virtual machines on virtualization platforms with non-unified memory access architectures, resulting in virtual machines running on unreasonable Nodes, low performance and processor core usage efficiency. Not high.

Method used

By obtaining the attribute information of the virtual machine and physical device nodes, calculate the overhead value of the virtual machine on each node, including CPU and memory utilization, I/O interface distance, processor core number and load information, and select the most suitable node for Virtual machine creation or migration.

Benefits of technology

Improves the performance of virtual machines and the efficiency of processor core usage, ensures that the virtual machines run on the right nodes, and improves the utilization of processor cores.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113835826B_ABST
    Figure CN113835826B_ABST
Patent Text Reader

Abstract

The present invention provides a virtual machine processing method, device, electronic device, program product and medium, the method comprising: obtaining attribute information of a first virtual machine; the first virtual machine is a virtual machine to be created or migrated; the attribute information includes the working mode information of the first virtual machine and the input / output attribute information of the running business; obtaining attribute information of multiple nodes on a physical device; the attribute information of the node includes the input / output attribute information of the node, the distance information between the node and another node with an input / output interface, the number of available processor cores of the node and the load information of the node; according to the attribute information of the first virtual machine and the attribute information of multiple nodes, calculating the overhead value of the first virtual machine running on multiple nodes respectively; determining the node used to process the first virtual machine according to the overhead value. The method provided by the present invention improves the performance of the virtual machine and improves the efficiency of using the processor core.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of virtualized infrastructure, and in particular to a virtual machine processing method, device, electronic device, program product and medium. Background Art

[0002] A virtual machine (VM) is a complete computer system that is simulated by software and has complete hardware system functions and runs in a completely isolated environment. Currently, VMs created based on kvm-qemu technology run a qemu process for each VM instance, and each qemu process occupies the CPU and memory on the host machine.

[0003] When creating a virtual machine on a virtualization platform with a non-uniform memory access architecture, or migrating an existing virtual machine, a physical processor of corresponding specifications needs to be allocated to the virtual machine.

[0004] When creating a virtual machine on a host machine, it is often run using physical processors and memory from multiple nodes. When a newly created virtual machine or an already running virtual machine switches from shared mode to exclusive mode, the host problem of the NUMA Node to which the virtual machine belongs is involved, and a certain strategy is required to allow the virtual machine to run on a suitable NUMA Node. Some existing technologies may simply schedule VMs based on the overall physical core perspective of the physical device, while others may be a little better and schedule VMs based on the perspective of the physical core at the NUMA granularity. The first type is obviously only applicable to non-NUMA architecture hosts; although the second type also schedules VMs at the NUMA granularity, it still lacks the I / O attributes of the NUMA Node and the application attributes of the VM. The lack of these two attribute references may cause the VM to run on an unreasonable Node, resulting in unexpected VM performance. At the same time, when the VM is in shared mode, in order to further improve performance, it may be necessary to allow the VM to exclusively use the physical core. This also involves the ability of the VM to migrate across NUMA nodes. The migration decision also relies on the NUMA-based scheduling mechanism to ensure that the VM mode switches to the exclusive core process and migrates to the appropriate node, resulting in inefficient use of the processor core. Summary of the invention

[0005] The present invention provides a virtual machine processing method, device, electronic device, program product and medium, which are used to solve the technical problems of low virtual machine performance and low processor core utilization efficiency in the prior art, and achieve the purpose of improving virtual machine performance and improving processor core utilization efficiency.

[0006] In a first aspect, the present invention provides a virtual machine processing method, comprising:

[0007] Acquire attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of a service running on the first virtual machine;

[0008] Acquire attribute information of multiple nodes on a physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node having an input / output interface, number information of available processor cores of the node, and load information of the node;

[0009] Calculating, according to the attribute information of the first virtual machine and the attribute information of the multiple nodes, overhead values ​​of the first virtual machine running on the multiple nodes respectively;

[0010] A node for processing the first virtual machine is determined according to the cost value.

[0011] Furthermore, a virtual machine processing method provided according to the present invention includes:

[0012] The node load information includes the time utilization of the node's processor and the actual memory utilization of the node;

[0013] Correspondingly, calculating the overhead values ​​of the first virtual machine running on the multiple nodes respectively according to the attribute information of the first virtual machine and the attribute information of the multiple nodes includes:

[0014] Calculate a first overhead parameter value of the first node according to distance information between the first node and a second node having an input / output interface; wherein the first node is any one of the multiple nodes;

[0015] Calculating a second overhead parameter value of the first node according to a degree of matching between input / output attribute information of the service running on the first virtual machine and input / output attribute information of the first node;

[0016] Calculating a third overhead parameter value of the first node according to the quantity information of the available processor cores of the first node and the working mode information of the first virtual machine;

[0017] Calculating a fourth overhead parameter value of the first node according to the planned memory usage of the first node;

[0018] Calculating a fifth overhead parameter value of the first node according to the time utilization rate of the processor of the first node;

[0019] Calculating a sixth overhead parameter value of the first node according to an actual memory usage rate of the first node;

[0020] An overhead value of the first virtual machine running on the first node is calculated based on the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value of the first node.

[0021] Furthermore, a virtual machine processing method provided according to the present invention includes:

[0022] The calculating, according to the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value, and the sixth overhead parameter value of the first node, an overhead value of the first virtual machine running on the first node includes:

[0023] cost=x1×ω1+x2×ω2+x3×ω3+x4×ω4+x5×ω5+x6×ω6

[0024] Wherein, x1 is the first overhead parameter value, x2 is the second overhead parameter value, x3 is the third overhead parameter value, x4 is the fourth overhead parameter value, x5 is the fifth overhead parameter value, and x6 is the sixth overhead parameter value;

[0025] ω1 is the weight value of the first overhead parameter value; ω2 is the weight value of the second overhead parameter value; ω3 is the weight value of the third overhead parameter value; ω4 is the weight value of the fourth overhead parameter value; ω5 is the weight value of the fifth overhead parameter value; ω6 is the weight value of the sixth overhead parameter value.

[0026] Furthermore, a virtual machine processing method provided according to the present invention includes:

[0027] The determining, according to the overhead value, a node for processing the first virtual machine includes:

[0028] Sorting the cost values ​​to obtain a sorting result;

[0029] Selecting a third node corresponding to a minimum cost value from the sorting results;

[0030] Determining whether the third node can meet the needs of the first virtual machine;

[0031] In a case where the third node can meet the requirements of the first virtual machine, determining the third node as a node for processing the first virtual machine;

[0032] or,

[0033] When the third node cannot meet the needs of the first virtual machine, a fourth node is selected to determine the third node and the fourth node as nodes for processing the first virtual machine; wherein the fourth node is a node corresponding to one or more cost values ​​that are close to the minimum cost value.

[0034] Furthermore, a virtual machine processing method provided according to the present invention includes:

[0035] The method for calculating the number of available processor cores of the first node is:

[0036] The number of available processor cores of the first node is obtained by subtracting the maximum number of processor cores occupied by virtual machines in shared mode from the total number of processor cores on the first node, and then subtracting the sum of the number of processor cores occupied by virtual machines in exclusive mode.

[0037] Furthermore, according to a virtual machine processing method provided by the present invention, before acquiring the attribute information of multiple nodes on the physical device, the method includes:

[0038] The attribute information of multiple nodes on the physical device is read and registered.

[0039] In a second aspect, the present invention further provides a virtual machine processing device, comprising:

[0040] A first acquisition module, configured to acquire attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of a service running on the first virtual machine;

[0041] A second acquisition module is used to acquire attribute information of multiple nodes on the physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node having an input / output interface, number information of available processor cores of the node, and load information of the node;

[0042] A calculation module, configured to calculate, according to the attribute information of the first virtual machine and the attribute information of the multiple nodes, the cost values ​​of the first virtual machine running on the multiple nodes respectively;

[0043] A determination module is used to determine a node for processing the first virtual machine according to the overhead value.

[0044] In a third aspect, the present invention further provides an electronic device, comprising:

[0045] processor, memory and bus, wherein,

[0046] The processor and the memory communicate with each other via the bus;

[0047] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the steps of any of the resource management methods described above.

[0048] In a fourth aspect, the present invention further provides a computer program product, comprising computer executable instructions, which, when executed, are used to implement the steps of the resource management method as described in any one of the above items.

[0049] In a fifth aspect, the present invention further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the steps of the resource management method as described above.

[0050] The present invention provides a virtual machine processing method, device, electronic device, program product and medium, wherein the method obtains attribute information of the virtual machine and attribute information of multiple nodes on a physical device, calculates the cost values ​​of the virtual machine running on multiple nodes respectively, and selects a node suitable for the virtual machine according to the size of the cost value. The method provided by the present invention can improve the performance of the virtual machine and improve the utilization efficiency of the processor core. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 It is a flowchart of a virtual machine processing method provided by the present invention;

[0053] Figure 2 It is a structural schematic diagram of a physical device node provided by the present invention;

[0054] Figure 3 It is a structural schematic diagram of a virtual machine processing device provided by the present invention;

[0055] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

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

[0057] Figure 1 The virtual machine processing method provided by the present invention is as follows: Figure 1 As shown, the virtual machine processing method provided by the present invention includes the following steps:

[0058] Step 101: Acquire attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of a service running on the first virtual machine;

[0059] Step 102: Acquire attribute information of multiple nodes on the physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node having an input / output interface, number information of available processor cores of the node, and load information of the node;

[0060] Step 103: Calculating overhead values ​​of the first virtual machine running on the multiple nodes respectively according to the attribute information of the first virtual machine and the attribute information of the multiple nodes;

[0061] Step 104: Determine a node for processing the first virtual machine according to the cost value.

[0062] Specifically, the overhead value refers to the total amount of overhead required when the virtual machine to be migrated or the virtual machine to be created runs on the node. The overhead value can be calculated based on indicators such as actual memory usage and CPU usage.

[0063] Among them, a virtual machine (VM) refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment.

[0064] When creating a new virtual machine or migrating an existing virtual machine, it is necessary to select a suitable node from the physical device so that the newly created virtual machine or the migrated virtual machine has good operating efficiency.

[0065] For example, a virtual machine VM-a runs in exclusive mode on node-k. As other VM services are continuously deployed on node-k, there are no longer enough physical cores on node-k to meet the needs of VM-a to exclusively use the physical cores on node-k. VM-a needs to be migrated from the current node to another node that meets its operating requirements. Or when creating a VM, it is necessary to select a node that meets the VM specification requirements and maximizes the utilization of the processor cores to create a new VM.

[0066] In step 101, the attribute information of the first virtual machine is obtained, and the attribute information includes the working mode of the first virtual machine and the input / output attribute information of the business running on the first virtual machine, wherein there are two working modes, one is a sharing mode, in which several virtual machines share one or more physical processor cores, and the other is an exclusive mode, that is, a virtual machine excludes other virtual machines and uses all physical processor cores on the node alone; the input / output attribute of the running business belongs to one of the VM business types, and the VM business type is divided into computing intensive and I / O intensive, wherein computing intensive means that most of the resources of the computer system are used to complete operations such as calculations and logical judgments, which makes the CPU occupancy rate very high, and I / O intensive means that most of the resources of the computer system are used to perform network transmission, read hard disks and other I / O devices, etc. For example, encryption and decryption engines and AI engines are computing intensive, and log engines are I / O intensive.

[0067] In step 102, the attribute information of multiple nodes on the physical device includes the input / output attribute information of the node, the distance information between the node and another node with an input / output interface, the number of available processor cores of the node, and the load information of the node, wherein, in an embodiment of the present invention, the input / output attribute of the node indicates whether the current node has an I / O interface, the distance information between the node and another node with an input / output interface is represented as the distance between the currently selected node and the node with the I / O interface, the number of available processor cores of the node indicates how many processor cores are available for the current node, and the load information includes the time utilization rate of the node's processor and the actual memory utilization rate. According to the above information, it can be obtained that the access overhead of different nodes is related to the I / O interface on the node in addition to the overhead of adjacent and alternate nodes. Some nodes on the physical device have I / O interfaces, while some nodes do not. For example, Figure 2As shown, there are IOU0 and IOU1 on Panal0 and Panal6 respectively, which means that there are I / O interfaces on nodes P0 and P6, and there are no I / O interfaces on other nodes. Among them, when calculating the overhead value of the virtual machine running on node P2, it can be obtained through the above analysis that node P2 does not have an I / O interface, and at the same time it can be confirmed that node P2 is closest to node P6 with an I / O interface, and the distance from node P2 to node P6 is obtained by table lookup or calculation. It should be noted that whether a node has an I / O interface can be set according to actual needs, and is not specifically limited here. In addition, the number of available processor cores of the node can be calculated and obtained according to the specific calculation method of the following embodiment, which is not specifically introduced here.

[0068] In step 103, the cost value of the first virtual machine on multiple nodes is calculated based on the attribute information of the first virtual machine and the attribute information of multiple nodes on the physical device, wherein the cost value may be the cost required to migrate the first virtual machine from the current node to another node, or the cost required to create a new virtual machine on a node.

[0069] In step 104, the cost values ​​obtained in step 103 are sorted in ascending order, and the node running the first virtual machine is determined according to the sorting result. It should be noted that the cost value sorting method can be set according to actual needs and is not specifically limited here.

[0070] In an embodiment of the present invention, the overhead value of the first virtual machine on multiple nodes is calculated by obtaining the attribute information of the first virtual machine and the attribute information of multiple nodes on the physical device, and the node running the first virtual machine is determined according to the size of the overhead value. The method provided by the present invention can improve the performance of the virtual machine and improve the utilization efficiency of the physical processor core of the host machine.

[0071] In another embodiment of the present invention, the load information of the node includes the time utilization of the processor of the node and the actual utilization of the memory of the node;

[0072] Correspondingly, calculating the overhead values ​​of the first virtual machine running on the multiple nodes respectively according to the attribute information of the first virtual machine and the attribute information of the multiple nodes includes:

[0073] Calculate a first overhead parameter value of the first node according to distance information between the first node and a second node having an input / output interface; wherein the first node is any one of the multiple nodes;

[0074] Calculating a second overhead parameter value of the first node according to a degree of matching between input / output attribute information of the service running on the first virtual machine and input / output attribute information of the first node;

[0075] Calculating a third overhead parameter value of the first node according to the quantity information of the available processor cores of the first node and the working mode information of the first virtual machine;

[0076] Calculating a fourth overhead parameter value of the first node according to the planned memory usage of the first node;

[0077] Calculating a fifth overhead parameter value of the first node according to the time utilization rate of the processor of the first node;

[0078] Calculating a sixth overhead parameter value of the first node according to an actual memory usage rate of the first node;

[0079] An overhead value of the first virtual machine running on the first node is calculated based on the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value of the first node.

[0080] Specifically, the time utilization rate of the processor and the actual memory utilization rate of the first node are obtained by real-time collection by the monitoring information collection module.

[0081] In an embodiment of the present invention, the overhead value of the first virtual machine running on the first node is calculated by obtaining the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value of the first node. It should be noted that the first overhead parameter value is obtained by converting the distance information between the first node and the second node having the input / output interface, wherein the distance information is represented as node_to_IO_node_distance. In an embodiment of the present invention, if any node among nodes P0-P7 is selected to calculate the overhead value of the virtual machine, the calculation can be performed according to the first overhead parameter value information shown in Table 1 below.

[0082] Table 1 First Overhead Parameter Values

[0083]

[0084] According to Table 1 above, device identification 1 and device identification 2 correspond to two different physical devices. The physical device in device identification 1 has 8 nodes (P0-P7), where P0=0 means that node P0 has an I / O interface. Since the value information of P1-P7 is not 0, it means that nodes P1-P7 are nodes without I / O interfaces, and nodes P1 and P4 are closest to node P0. In addition, there are also 8 nodes on the physical device of device identification 2, where P0=P6=0, which means that nodes P0 and P6 have I / O interfaces, and nodes P2 and P7 are closest to node P6 with an I / O interface, and nodes P1 and P4 are closest to node P0 with an I / O interface.

[0085] The second overhead parameter value is calculated based on the matching degree between the input / output attribute information of the service running on the first virtual machine and the input / output attribute information of the first node. If the I / O attribute of the first virtual machine matches the I / O attribute of the first node, a predetermined high value is obtained. If not, a predetermined low value is obtained, as shown in the following Table 2. It should be noted that the parameter value can be set according to actual needs and is not specifically limited here.

[0086] Table 2 Second overhead parameter values

[0087]

[0088] According to Table 2 above, if the business type of the first virtual machine is I / O intensive and the first node is also I / O intensive, the second overhead parameter value is 1; if the business type of the first virtual machine is I / O intensive and the business type of the first node is compute intensive, the second overhead parameter value is 0.5.

[0089] Among them, the third overhead parameter value is calculated and converted based on the number information of available processor cores of the first node and the working mode information of the first virtual machine, wherein the number information of available processor cores is represented as node_cpu_available, and the more available processor cores, the lower the cost calculation value is obtained, and the node processor availability (Rate) is obtained based on the calculated number of available processor cores and the total number of processor cores of the first node; the working mode of the first virtual machine is represented as vm_mode, and the working mode of the first virtual machine can be shared mode 0 or exclusive mode 1. The obtained third overhead parameter value is shown in Table 3 below.

[0090] Table 3 Third Overhead Parameter Values

[0091]

[0092] According to the content of Table 3 above, the third overhead parameter value can be obtained, which is used to calculate the overhead value of the first virtual machine running on the first node. Among them, when the availability is 0, it means that the current node has no available processor core to run the virtual machine to be migrated, that is, the virtual machine to be migrated cannot be migrated to the current node, no matter whether the working mode of the virtual machine to be migrated is exclusive mode or shared mode at this time, it cannot be migrated to the current node, so the overhead value of the current node is set to the maximum value of 1. As the availability increases, the value of the third overhead parameter becomes smaller and smaller, indicating that the higher the availability of the current node, the easier it is to migrate the virtual machine to be migrated to the current node or to create a new virtual machine on the current node, and the third overhead parameter value in the exclusive mode is less than the overhead value in the shared mode, which is more conducive to migration to a single node, realizing the operation of the virtual machine on a single node, and ensuring the performance of the virtual machine.

[0093] The fourth overhead parameter value is calculated based on the memory of the first node according to the specification plan of the virtual machine, that is, the total memory of the first node is allocated according to the specification data of the virtual machine. For example, the total memory of node A is 32G, the specification requirement of VM1 is 4G, the specification requirement of VM2 is 4G, and the specification requirement of VM3 is 8G. The memory of node A is allocated and processed according to the specification requirements of the virtual machines, and the memory planning utilization rate of node A is 50%, which is the fourth overhead parameter value of the first node.

[0094] The fifth overhead parameter value refers to the time utilization rate of the processor of the first node, and the sixth overhead parameter value refers to the actual memory usage efficiency of the first node, wherein the sixth overhead parameter value is the actual memory usage efficiency. For example, VM1 is allocated 4G memory according to the specification requirements, but the business is idle, and the actual memory usage is 1G. Similarly, the actual memory usage of VM2 and VM3 is also 1G respectively, that is, the three virtual machines actually use 3G memory in total, and the actual memory usage efficiency is 3G / 32G=0.9375, which is the sixth overhead parameter value. It should be noted that the fifth overhead parameter value and the sixth overhead parameter value can be obtained by real-time monitoring according to the monitoring information collection module.

[0095] In an embodiment of the present invention, the overhead value of the first virtual machine running on the first node is calculated based on the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value of the first node, so that the node suitable for migrating the first virtual machine or creating the first virtual machine can be accurately calculated, the performance of the virtual machine is improved, and the accuracy of scheduling is improved.

[0096] On the basis of the above embodiment, the calculating the overhead value of the first virtual machine running on the first node according to the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value, and the sixth overhead parameter value of the first node includes:

[0097] cost=x1×ω1+x2×ω2+x3×ω3+x4×ω4+x5×ω5+x6×ω6

[0098] Wherein, x1 is the first overhead parameter value, x2 is the second overhead parameter value, x3 is the third overhead parameter value, x4 is the fourth overhead parameter value, x5 is the fifth overhead parameter value, and x6 is the sixth overhead parameter value;

[0099] ω1 is the weight value of the first overhead parameter value; ω2 is the weight value of the second overhead parameter value; ω3 is the weight value of the third overhead parameter value; ω4 is the weight value of the fourth overhead parameter value; ω5 is the weight value of the fifth overhead parameter value; ω6 is the weight value of the sixth overhead parameter value.

[0100] Specifically, the weight value can be set according to the experience value and can be dynamically adjusted during the application process.

[0101] In an embodiment of the present invention, the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value, as well as the weight values ​​occupied by each, can be obtained according to the above embodiment, and the overhead value of the first virtual machine running on the first node can be obtained by the above calculation formula. If the first overhead parameter value is 1, the second overhead parameter value is 0.5, the third overhead parameter value is 0.8, the fourth overhead parameter value is 0.5, the fifth overhead parameter value is 0.3 and the sixth overhead parameter value is 0.6, and the corresponding weight values ​​are 0.1, 0.2, 0.3, 0.1, 0.1, 0.2, respectively, then the above formula can be used to obtain cost = 1 * 0.1 + 0.5 * 0.2 + 0.8 * 0.3 + 0.5 * 0.1 + 0.3 * 0.1 + 0.6 * 0.2 = 0.64. It should be noted that the setting of the weight value can be set according to actual needs and is not specifically limited here.

[0102] In the embodiment of the present invention, the overhead value of the first virtual machine running on the first node can be accurately calculated through a specific calculation formula and corresponding parameter values, providing a theoretical basis for migrating or creating the first virtual machine.

[0103] In another embodiment of the present invention, determining the node for processing the first virtual machine according to the cost value includes:

[0104] Sorting the cost values ​​to obtain a sorting result;

[0105] Selecting a third node corresponding to a minimum cost value from the sorting results;

[0106] Determining whether the third node can meet the needs of the first virtual machine;

[0107] In a case where the third node can meet the requirements of the first virtual machine, determining the third node as a node for processing the first virtual machine;

[0108] or,

[0109] When the third node cannot meet the needs of the first virtual machine, a fourth node is selected to determine the third node and the fourth node as nodes for processing the first virtual machine; wherein the fourth node is a node corresponding to one or more cost values ​​that are close to the minimum cost value.

[0110] Specifically, the minimum cost value indicates that the cost required to migrate the first virtual machine from the current node to another node is the minimum, or that it is most advantageous to create a new virtual machine on the node corresponding to the minimum cost value.

[0111] In the embodiment of the present invention, the principle of minimum overhead priority scheduling is adopted. The overhead values ​​calculated according to the above embodiment are sorted in ascending order. The third node corresponding to the minimum overhead value is selected according to the sorting result, and it is judged whether the third node meets the specification requirements of the first virtual machine. For example, the specification requirements of the first virtual machine require 3 processor cores. The third node obtained by analysis has 3 processor cores, which just meets the operation requirements of the first virtual machine. It can be seen that the third node just meets the requirements of the first virtual machine to run in exclusive mode. If the third node does not meet the specification requirements of the first virtual machine, such as the third node corresponding to the minimum overhead value has 2 processor cores, the third node corresponding to the minimum overhead value and the fourth node corresponding to an overhead value close to the minimum overhead value are selected to jointly run the first virtual machine. It should be noted that the fourth node can be a node close to the minimum overhead value, or it can be a node corresponding to multiple overhead values ​​close to the minimum overhead value. It can be selected according to actual needs and is not specifically limited here.

[0112] When the first virtual machine is a virtual machine to be migrated and the working mode is switched from the shared mode to the exclusive mode, the following priority strategy may be adopted:

[0113] When the first virtual machine is running on a single source node, it is preferred to migrate it to the single node;

[0114] When the first virtual machine is running on multiple source nodes, it is preferred to migrate it to a single node.

[0115] In an embodiment of the present invention, based on the sorting results from small to large, the node corresponding to the minimum cost value is preferentially selected for judgment and analysis to determine whether it meets the specification requirements of the first virtual machine. If so, the node corresponding to the minimum cost value is determined as the node running the first virtual machine. If not, the node corresponding to one or more cost values ​​that are close to the minimum cost value in sorting is selected as the fourth node, and the third node and the fourth node are determined as nodes for processing the first virtual machine. The method provided by the present invention can accurately and flexibly identify the node running the first virtual machine, improve the performance of the virtual machine, improve the rationality and accuracy of scheduling, and make the entire technical solution more flexible.

[0116] In another embodiment of the present invention, the method for calculating the quantity information of available processor cores of the first node is:

[0117] The number of available processor cores of the first node is obtained by subtracting the maximum number of processor cores occupied by virtual machines in shared mode from the total number of processor cores on the first node, and then subtracting the sum of the number of processor cores occupied by virtual machines in exclusive mode.

[0118] Specifically, the total number of processor cores on the first node is obtained by registering the attribute information of the physical device in advance.

[0119] In an embodiment of the present invention, the number of available processor cores of the first node is obtained by subtracting the maximum number of processor cores occupied by virtual machines in shared mode from the total number of processor cores of the node, and then subtracting the sum of the number of processor cores occupied by virtual machines in exclusive mode. The specific calculation formula is: the total number of processor cores of the current node - MAX (the number of processor cores occupied by VMs in shared mode) - SUM (the number of processor cores occupied by VMs in exclusive mode). For example, if the first node is node-k, the total number of processor cores on node-k is 16, and the virtual machines running in shared mode are VM-a, VM-b and VM-c, wherein VM-a occupies 4 processor cores, VM-b occupies 4 processor cores, and VM-c occupies 2 processor cores. It can be seen that the maximum value of processor cores occupied by virtual machines in shared mode is 4, and the virtual machines running in exclusive mode are VM-d and VM-e, which occupy 2 and 3 processor cores respectively. According to the above information, the number of available processor cores on node-k is 16-4-2-3=7. It should be noted that the number of available processor cores of the first node can be set according to actual needs, and is not specifically limited here.

[0120] In an embodiment of the present invention, the number of available processor cores of the first node is calculated based on the total number of processor cores of the first node, the maximum value of the processor cores occupied by shared mode virtual machines, and the sum of the processor cores occupied by exclusive mode virtual machines. The calculated value is used to solve the overhead value of the first virtual machine running on the first node, which can achieve accurate judgment on whether the first node is suitable for migration or creation of the first virtual machine, thereby improving the utilization efficiency of the processor cores.

[0121] In another embodiment of the present invention, before acquiring the attribute information of the plurality of nodes on the physical device, the method includes:

[0122] The attribute information of multiple nodes on the physical device is read and registered.

[0123] Specifically, the physical device needs to implement the initialization of topological physical resources based on the Non Uniform Memory Access (NUMA) technology.

[0124] In an embodiment of the present invention, before obtaining the attribute information of multiple nodes on a physical device, it is also necessary to read the attribute information of multiple nodes on the physical device for registration processing. It should be noted that in addition to the attribute information of multiple nodes, the NUMA attributes, available memory, and number of NUMA nodes of the physical device, as well as the number of processors on each NUMA node and the access overhead measurement information of the node are also read, and these resource topology information are registered in the resource management module, so as to facilitate the subsequent direct acquisition of data for calculation when migrating or creating a virtual machine.

[0125] Among them, the resource management module includes a resource registration module, a monitoring information collection module and a scheduling module. The resource registration module is responsible for managing the initialized resource topology information. In this embodiment, a registration mechanism is also introduced to realize the unified management of distributed cluster resource nodes; the monitoring information collection module is used for real-time statistics of CPU utilization, memory utilization and other information collected by the resource collection module; the scheduling module is used to select a suitable node to complete the creation or migration of the VM.

[0126] In the embodiment of the present invention, before acquiring the attribute information of multiple nodes on the physical device, it is also necessary to read the attribute information of multiple nodes on the physical device and register them to provide data support for the migration or creation of the virtual machine.

[0127] Figure 3 A virtual machine processing device provided by the present invention, such as Figure 3 As shown, the virtual machine processing device provided by the present invention includes:

[0128] A first acquisition module 301 is used to acquire attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of a service running on the first virtual machine;

[0129] The second acquisition module 302 is used to acquire attribute information of multiple nodes on the physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node having an input / output interface, number information of available processors of the node, and load information of the node;

[0130] A calculation module 303, configured to calculate, according to the attribute information of the first virtual machine and the attribute information of the multiple nodes, the cost values ​​of the first virtual machine running on the multiple nodes respectively;

[0131] The determination module 304 is configured to determine a node for processing the first virtual machine according to the cost value.

[0132] Specifically, the load information includes the time utilization of the processor of the node and the actual utilization of the memory of the node.

[0133] In an embodiment of the present invention, a first acquisition module is used to acquire attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes the working mode information of the first virtual machine and the input / output attribute information of the business running on the first virtual machine; a second acquisition module is used to acquire attribute information of multiple nodes on a physical device; wherein the attribute information of a node includes the input / output attribute information of the node, the distance information between the node and another node having an input / output interface, the number of available processors of the node, and the load information of the node; a calculation module is used to calculate the overhead value of the first virtual machine running on multiple nodes respectively according to the attribute information of the first virtual machine and the attribute information of the multiple nodes; a determination module is used to determine the node used to process the first virtual machine according to the size of the overhead value. The device provided by the present invention can improve the performance of virtual machines and improve the efficiency of using physical processors.

[0134] Furthermore, in the virtual machine processing device provided by the present invention, the computing module is further used for: the load information of the node includes the time utilization rate of the processor of the node and the actual utilization rate of the memory of the node;

[0135] Correspondingly, calculating the overhead values ​​of the first virtual machine running on the multiple nodes respectively according to the attribute information of the first virtual machine and the attribute information of the multiple nodes includes:

[0136] Calculate a first overhead parameter value of the first node according to distance information between the first node and a second node having an input / output interface; wherein the first node is any one of the multiple nodes;

[0137] Calculating a second overhead parameter value of the first node according to a degree of matching between input / output attribute information of the service running on the first virtual machine and input / output attribute information of the first node;

[0138] Calculating a third overhead parameter value of the first node according to the quantity information of the available processor cores of the first node and the working mode information of the first virtual machine;

[0139] Calculating a fourth overhead parameter value of the first node according to the planned memory usage of the first node;

[0140] Calculating a fifth overhead parameter value of the first node according to the time utilization rate of the processor of the first node;

[0141] Calculating a sixth overhead parameter value of the first node according to an actual memory usage rate of the first node;

[0142] An overhead value of the first virtual machine running on the first node is calculated based on the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value of the first node.

[0143] Further, according to the virtual machine processing device provided by the present invention, the calculation module is further used to: calculate the overhead value of the first virtual machine running on the first node according to the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value of the first node, including:

[0144] cost=x1×ω1+x2×ω2+x3×ω3+x4×ω4+x5×ω5+x6×ω6

[0145] Wherein, x1 is the first overhead parameter value, x2 is the second overhead parameter value, x3 is the third overhead parameter value, x4 is the fourth overhead parameter value, x5 is the fifth overhead parameter value, and x6 is the sixth overhead parameter value;

[0146] ω1 is the weight value of the first overhead parameter value; ω2 is the weight value of the second overhead parameter value; ω3 is the weight value of the third overhead parameter value; ω4 is the weight value of the fourth overhead parameter value; ω5 is the weight value of the fifth overhead parameter value; ω6 is the weight value of the sixth overhead parameter value.

[0147] Further, according to the virtual machine processing device provided by the present invention, the determination module is further used to: determine the node for processing the first virtual machine according to the cost value, including:

[0148] Sorting the cost values ​​to obtain a sorting result;

[0149] Selecting a third node corresponding to a minimum cost value from the sorting results;

[0150] Determining whether the third node can meet the needs of the first virtual machine;

[0151] In a case where the third node can meet the requirements of the first virtual machine, determining the third node as a node for processing the first virtual machine;

[0152] or,

[0153] When the third node cannot meet the needs of the first virtual machine, a fourth node is selected to determine the third node and the fourth node as nodes for processing the first virtual machine; wherein the fourth node is a node corresponding to one or more cost values ​​that are close to the minimum cost value.

[0154] Further, according to the virtual machine processing device provided by the present invention, the calculation module is also used for: the calculation method of the number of available processor cores of the first node is:

[0155] The number of available processor cores of the first node is obtained by subtracting the maximum number of processor cores occupied by virtual machines in shared mode from the total number of processor cores on the first node, and then subtracting the sum of the number of processor cores occupied by virtual machines in exclusive mode.

[0156] Furthermore, according to the virtual machine processing device provided by the present invention, the device, before acquiring the attribute information of the plurality of nodes on the physical device, comprises:

[0157] The attribute information of multiple nodes on the physical device is read and registered.

[0158] Since the principle of the device described in the embodiment of the present invention is the same as that of the method described in the above embodiment, a more detailed explanation will not be repeated here.

[0159] Figure 4 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 4 As shown, the present invention provides an electronic device, including: a processor (processor) 401, a memory (memory) 402 and a bus 403;

[0160] The processor 401 and the memory 402 communicate with each other via the bus 403;

[0161] The processor 401 is used to call the program instructions in the memory 402 to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of the business running on the first virtual machine; obtaining attribute information of multiple nodes on a physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node with an input / output interface, number information of available processors of the node, and load information of the node; according to the attribute information of the first virtual machine and the attribute information of the multiple nodes, calculating the overhead value of the first virtual machine running on multiple nodes respectively; determining the node used to process the first virtual machine according to the overhead value.

[0162] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above methods, and the method includes: obtaining attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of the business running on the first virtual machine; obtaining attribute information of multiple nodes on a physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node with an input / output interface, number information of available processors of the node, and load information of the node; according to the attribute information of the first virtual machine and the attribute information of the multiple nodes, calculating the overhead value of the first virtual machine running on multiple nodes respectively; determining the node used to process the first virtual machine according to the overhead value.

[0163] An embodiment of the present invention provides a non-transitory computer-readable storage medium, which stores computer instructions. The computer instructions enable the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of the business running on the first virtual machine; obtaining attribute information of multiple nodes on a physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node with an input / output interface, number information of available processors of the node, and load information of the node; according to the attribute information of the first virtual machine and the attribute information of the multiple nodes, calculating the overhead values ​​of the first virtual machine running on multiple nodes respectively; determining the node used to process the first virtual machine according to the overhead value.

[0164] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A virtual machine processing method, It is characterized in that include: Acquire attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of a service running on the first virtual machine; Acquire attribute information of multiple nodes on a physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node having an input / output interface, number information of available processor cores of the node, and load information of the node; The overhead values ​​of the first virtual machine running on the multiple nodes are calculated according to the attribute information of the first virtual machine and the attribute information of the multiple nodes; the load information of the node includes the time utilization of the processor of the node and the actual memory utilization of the node; accordingly, the overhead values ​​of the first virtual machine running on the multiple nodes are calculated according to the attribute information of the first virtual machine and the attribute information of the multiple nodes, including: calculating the first overhead parameter value of the first node according to the distance information between the first node and the second node with an input / output interface; wherein the first node is any one of the multiple nodes; calculating the first overhead parameter value of the first node according to the distance information between the input / output attribute information of the service running on the first virtual machine and the input / output attribute information of the first node According to the matching degree between the two, calculate the second overhead parameter value of the first node; according to the number of available processor cores of the first node and the working mode information of the first virtual machine, calculate the third overhead parameter value of the first node; according to the memory planning utilization rate of the first node, calculate the fourth overhead parameter value of the first node; according to the time utilization rate of the processor of the first node, calculate the fifth overhead parameter value of the first node; according to the actual memory utilization rate of the first node, calculate the sixth overhead parameter value of the first node; according to the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value of the first node, calculate the overhead value of the first virtual machine running on the first node; A node for processing the first virtual machine is determined according to the cost value.

2. The virtual machine processing method according to claim 1, It is characterized in that The calculating, according to the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value, and the sixth overhead parameter value of the first node, an overhead value of the first virtual machine running on the first node includes: cost=x 1 ×ω 1 +x 2 ×ω 2 +x 3 ×ω 3 +x 4 ×ω 4 +x 5 ×ω 5 +x 6 ×ω 6 Among them, x 1 is the first overhead parameter value, x 2 is the value of the second overhead parameter, x 3 is the third overhead parameter value, x 4 is the fourth overhead parameter value, x 5 is the fifth overhead parameter value, x 6 is the sixth overhead parameter value; ω 1 is the weight value of the first overhead parameter value; ω 2 is the weight value of the second overhead parameter value; ω 3 is the weight value of the third overhead parameter value; ω 4 is the weight value of the fourth overhead parameter value; ω 5 is the weight value of the fifth overhead parameter value; ω 6 is the weight value of the sixth overhead parameter value.

3. The virtual machine processing method according to claim 1, It is characterized in that The determining, according to the overhead value, a node for processing the first virtual machine includes: Sorting the cost values ​​to obtain a sorting result; Selecting a third node corresponding to a minimum cost value from the sorting results; Determining whether the third node can meet the needs of the first virtual machine; In a case where the third node can meet the requirements of the first virtual machine, determining the third node as a node for processing the first virtual machine; or, When the third node cannot meet the needs of the first virtual machine, a fourth node is selected to determine the third node and the fourth node as nodes for processing the first virtual machine; wherein the fourth node is a node corresponding to one or more cost values ​​that are close to the minimum cost value.

4. The virtual machine processing method according to claim 1, It is characterized in that The method for calculating the number of available processor cores of the first node is: The number of available processor cores of the first node is obtained by subtracting the maximum number of processor cores occupied by virtual machines in shared mode from the total number of processor cores on the first node, and then subtracting the sum of the number of processor cores occupied by virtual machines in exclusive mode.

5. The virtual machine processing method according to claim 1, It is characterized in that Before obtaining the attribute information of the plurality of nodes on the physical device, the method includes: The attribute information of multiple nodes on the physical device is read and registered.

6. A virtual machine processing device, It is characterized in that include: A first acquisition module, configured to acquire attribute information of a first virtual machine; wherein the first virtual machine is a virtual machine to be created or a virtual machine to be migrated; the attribute information includes working mode information of the first virtual machine and input / output attribute information of a service running on the first virtual machine; A second acquisition module is used to acquire attribute information of multiple nodes on the physical device; wherein the attribute information of the node includes input / output attribute information of the node, distance information between the node and another node having an input / output interface, number information of available processor cores of the node, and load information of the node; A calculation module, used to calculate the cost values ​​of the first virtual machine running on multiple nodes respectively according to the attribute information of the first virtual machine and the attribute information of the multiple nodes; the calculation module is also used: the load information of the node includes the time utilization rate of the processor of the node and the actual utilization rate of the memory of the node; accordingly, the cost values ​​of the first virtual machine running on multiple nodes respectively according to the attribute information of the first virtual machine and the attribute information of the multiple nodes include: calculating the first cost parameter value of the first node according to the distance information between the first node and the second node with an input / output interface; wherein the first node is any one of the multiple nodes; calculating the first cost parameter value of the first node according to the input / output attribute information of the business running on the first virtual machine and the input of the first node / output attribute information, calculate the second overhead parameter value of the first node; calculate the third overhead parameter value of the first node according to the number of available processor cores of the first node and the working mode information of the first virtual machine; calculate the fourth overhead parameter value of the first node according to the planned memory usage of the first node; calculate the fifth overhead parameter value of the first node according to the time utilization of the processor of the first node; calculate the sixth overhead parameter value of the first node according to the actual memory usage of the first node; calculate the overhead value of the first virtual machine running on the first node according to the first overhead parameter value, the second overhead parameter value, the third overhead parameter value, the fourth overhead parameter value, the fifth overhead parameter value and the sixth overhead parameter value of the first node; A determination module is used to determine a node for processing the first virtual machine according to the overhead value.

7. An electronic device, It is characterized in that include: processor, memory and bus, wherein, The processor and the memory communicate with each other via the bus; The memory stores program instructions that can be executed by the processor, and the processor can execute any one of the methods according to claims 1 to 5 by calling the program instructions.

8. A computer program product comprising computer executable instructions, It is characterized in that When the instructions are executed, they are used to implement the method according to any one of claims 1 to 5.

9. A non-transitory computer-readable storage medium, It is characterized in that The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the method according to any one of claims 1 to 5.